Class: LogisticRegressionWithSGD

eclairjs/mllib/classification.LogisticRegressionWithSGD

new LogisticRegressionWithSGD()

Construct a LogisticRegression object with default parameters: {stepSize: 1.0, numIterations: 100, regParm: 0.01, miniBatchFraction: 1.0}.
Source:

Methods

(static) train(input, numIterations, stepSizeopt, miniBatchFractionopt, initialWeightsopt) → {module:eclairjs/mllib/classification.LogisticRegressionModel}

Train a logistic regression model given an RDD of (label, features) pairs. We run a fixed number of iterations of gradient descent using the specified step size. Each iteration uses `miniBatchFraction` fraction of the data to calculate the gradient. The weights used in gradient descent are initialized using the initial weights provided. NOTE: Labels used in Logistic Regression should be {0, 1}
Parameters:
Name Type Attributes Description
input module:eclairjs/rdd.RDD RDD of (label, array of features) pairs.
numIterations number Number of iterations of gradient descent to run.
stepSize number <optional>
step size to be used for each iteration of gradient descent, defaults to 1.0.
miniBatchFraction number <optional>
fraction of data to be used per iteration.
initialWeights module:eclairjs/mllib/linalg.Vector <optional>
initial set of weights to be used. Array should be equal in size to the number of features in the data.
Source:
Returns:
Type
module:eclairjs/mllib/classification.LogisticRegressionModel