public class LogisticAggregator
extends 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: numClasses the number of possible outcomes for k classes classification problem in Multinomial Logistic Regression. param: fitIntercept Whether to fit an intercept term.
| Constructor and Description |
|---|
LogisticAggregator(int numFeatures,
int numClasses,
boolean fitIntercept) |
| Modifier and Type | Method and Description |
|---|---|
LogisticAggregator |
add(org.apache.spark.ml.feature.Instance instance,
Vector coefficients,
double[] featuresStd)
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(int numFeatures,
int numClasses,
boolean fitIntercept)
public LogisticAggregator add(org.apache.spark.ml.feature.Instance instance, Vector coefficients, double[] featuresStd)
instance - The instance of data point to be added.coefficients - The coefficients corresponding to the features.featuresStd - The standard deviation values of the features.public LogisticAggregator merge(LogisticAggregator other)
this object will be modified.)
other - The other LogisticAggregator to be merged.public double loss()
public Vector gradient()