new SVMWithSGD()
Construct a SVM object with default parameters: {stepSize: 1.0, numIterations: 100,
regParm: 0.01, miniBatchFraction: 1.0}.
Methods
(static) train(input, numIterations, stepSizeopt, regParamopt, miniBatchFractionopt, initialWeightsopt) → {module:eclairjs/mllib/classification.SVMModel}
Train a SVM 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 SVM should be {0, 1}.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
input |
module:eclairjs.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. |
regParam |
number |
<optional> |
Regularization parameter. |
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. |