|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.apache.spark.ml.classification.LogisticAggregator
public class LogisticAggregator
LogisticAggregator computes the gradient and loss for binary logistic loss function, as used in binary classification for samples in sparse or dense vector in a online fashion.
Note that multinomial logistic loss is not supported yet!
Two LogisticAggregator can be merged together to have a summary of loss and gradient of the corresponding joint dataset.
param: weights The weights/coefficients corresponding to the features. param: numClasses the number of possible outcomes for k classes classification problem in Multinomial Logistic Regression. param: fitIntercept Whether to fit an intercept term. param: featuresStd The standard deviation values of the features. param: featuresMean The mean values of the features.
Constructor Summary | |
---|---|
LogisticAggregator(Vector weights,
int numClasses,
boolean fitIntercept,
double[] featuresStd,
double[] featuresMean)
|
Method Summary | |
---|---|
LogisticAggregator |
add(double label,
Vector data)
Add a new training data to this LogisticAggregator, and update the loss and gradient of the objective function. |
long |
count()
|
Vector |
gradient()
|
double |
loss()
|
LogisticAggregator |
merge(LogisticAggregator other)
Merge another LogisticAggregator, and update the loss and gradient of the objective function. |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogisticAggregator(Vector weights, int numClasses, boolean fitIntercept, double[] featuresStd, double[] featuresMean)
Method Detail |
---|
public LogisticAggregator add(double label, Vector data)
label
- The label for this data point.data
- The features for one data point in dense/sparse vector format to be added
into this aggregator.
public LogisticAggregator merge(LogisticAggregator other)
this
object will be modified.)
other
- The other LogisticAggregator to be merged.
public long count()
public double loss()
public Vector gradient()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |