class Spark::Mllib::RidgeRegressionWithSGD
Constants
- DEFAULT_OPTIONS
Public Class Methods
train(rdd, options={})
click to toggle source
Train a ridge regression model on the given data.
Parameters:¶ ↑
- rdd
-
The training data (
RDD
instance). - iterations
-
The number of iterations (default: 100).
- step
-
The step parameter used in SGD (default: 1.0).
- reg_param
-
The regularizer parameter (default: 0.0).
- mini_batch_fraction
-
Fraction of data to be used for each SGD iteration (default: 1.0).
- initial_weights
-
The initial weights (default: nil).
- intercept
-
Boolean parameter which indicates the use or not of the augmented representation for training data (i.e. whether bias features are activated or not). (default: false)
- validate
-
Boolean parameter which indicates if the algorithm should validate data before training. (default: true)
Calls superclass method
Spark::Mllib::RegressionMethodBase::train
# File lib/spark/mllib/regression/ridge.rb, line 96 def self.train(rdd, options={}) super weights, intercept = Spark.jb.call(RubyMLLibAPI.new, 'trainRidgeModelWithSGD', rdd, options[:iterations].to_i, options[:step].to_f, options[:reg_param].to_f, options[:mini_batch_fraction].to_f, options[:initial_weights], options[:intercept], options[:validate]) RidgeRegressionModel.new(weights, intercept) end