Constructor
new LinearRegressionWithSGD()
Construct a LinearRegression object with default parameters: {stepSize: 1.0, numIterations: 100, miniBatchFraction: 1.0}.
Methods
(static) train(rdd, numIterations, stepSizeopt, miniBatchFractionopt, initialWeightsopt) → {module:eclairjs/mllib/regression.LinearRegressionModel}
Train a Linear 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 a stochastic gradient.
The weights used in gradient descent are initialized using the initial weights provided.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
rdd |
module:eclairjs.RDD | of LabeledPoints | |
numIterations |
integer | ||
stepSize |
float |
<optional> |
step size to be used for each iteration of gradient descent, defaults to 1.0 |
miniBatchFraction |
floar |
<optional> |
fraction of data to be used per iteration, defaults to 1.0 |
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. |