LassoModel train¶
-
train
(self, frame, value_column, observation_columns, initial_weights=None, num_iterations=500, step_size=1.0, reg_param=0.01, mini_batch_fraction=1.0)¶ Train Lasso Model
Parameters: frame : Frame
A frame to train the model on
value_column : unicode
Column name containing the value for each observation.
observation_columns : list
List of column(s) containing the observations.
initial_weights : list (default=None)
Initial set of weights to be used. List should be equal in size to the number of features in the data.
num_iterations : int32 (default=500)
Number of iterations of gradient descent to run
step_size : float64 (default=1.0)
Step size scaling to be used for the iterations of gradient descent.
reg_param : float64 (default=0.01)
regParam Regularization parameter.
mini_batch_fraction : float64 (default=1.0)
Fraction of data to be used per iteration.
Returns: : dict
- Train a Lasso 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.
Examples
See here for examples.