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: coefficients The 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 coefficients,
int numClasses,
boolean fitIntercept,
double[] featuresStd,
double[] featuresMean) |
Modifier and Type | Method and Description |
---|---|
LogisticAggregator |
add(org.apache.spark.ml.feature.Instance instance)
Add a new training instance to this LogisticAggregator, and update the loss and gradient
of the objective function.
|
Vector |
gradient() |
double |
loss() |
LogisticAggregator |
merge(LogisticAggregator other)
Merge another LogisticAggregator, and update the loss and gradient
of the objective function.
|
public LogisticAggregator(Vector coefficients, int numClasses, boolean fitIntercept, double[] featuresStd, double[] featuresMean)
public LogisticAggregator add(org.apache.spark.ml.feature.Instance instance)
instance
- The instance of data point to be added.public LogisticAggregator merge(LogisticAggregator other)
this
object will be modified.)
other
- The other LogisticAggregator to be merged.public double loss()
public Vector gradient()