public class LogisticAggregator
extends java.lang.Object
implements scala.Serializable
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 and Description |
---|
LogisticAggregator(Vector weights,
int numClasses,
boolean fitIntercept,
double[] featuresStd,
double[] featuresMean) |
Modifier and Type | Method and Description |
---|---|
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.
|
public LogisticAggregator(Vector weights, int numClasses, boolean fitIntercept, double[] featuresStd, double[] featuresMean)
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()