org.apache.spark.ml.regression
Class LeastSquaresCostFun

Object
  extended by org.apache.spark.ml.regression.LeastSquaresCostFun
All Implemented Interfaces:
breeze.optimize.DiffFunction<breeze.linalg.DenseVector<Object>>, breeze.optimize.StochasticDiffFunction<breeze.linalg.DenseVector<Object>>, scala.Function1<breeze.linalg.DenseVector<Object>,Object>

public class LeastSquaresCostFun
extends Object
implements breeze.optimize.DiffFunction<breeze.linalg.DenseVector<Object>>

LeastSquaresCostFun implements Breeze's DiffFunction[T] for Least Squares cost. It returns the loss and gradient with L2 regularization at a particular point (weights). It's used in Breeze's convex optimization routines.


Constructor Summary
LeastSquaresCostFun(RDD<scala.Tuple2<Object,Vector>> data, double labelStd, double labelMean, double[] featuresStd, double[] featuresMean, double effectiveL2regParam)
           
 
Method Summary
 scala.Tuple2<Object,breeze.linalg.DenseVector<Object>> calculate(breeze.linalg.DenseVector<Object> weights)
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface breeze.optimize.DiffFunction
cached, throughLens
 
Methods inherited from interface breeze.optimize.StochasticDiffFunction
apply, gradientAt, valueAt
 
Methods inherited from interface scala.Function1
andThen, andThen$mcDD$sp, andThen$mcDF$sp, andThen$mcDI$sp, andThen$mcDJ$sp, andThen$mcFD$sp, andThen$mcFF$sp, andThen$mcFI$sp, andThen$mcFJ$sp, andThen$mcID$sp, andThen$mcIF$sp, andThen$mcII$sp, andThen$mcIJ$sp, andThen$mcJD$sp, andThen$mcJF$sp, andThen$mcJI$sp, andThen$mcJJ$sp, andThen$mcVD$sp, andThen$mcVF$sp, andThen$mcVI$sp, andThen$mcVJ$sp, andThen$mcZD$sp, andThen$mcZF$sp, andThen$mcZI$sp, andThen$mcZJ$sp, apply$mcDD$sp, apply$mcDF$sp, apply$mcDI$sp, apply$mcDJ$sp, apply$mcFD$sp, apply$mcFF$sp, apply$mcFI$sp, apply$mcFJ$sp, apply$mcID$sp, apply$mcIF$sp, apply$mcII$sp, apply$mcIJ$sp, apply$mcJD$sp, apply$mcJF$sp, apply$mcJI$sp, apply$mcJJ$sp, apply$mcVD$sp, apply$mcVF$sp, apply$mcVI$sp, apply$mcVJ$sp, apply$mcZD$sp, apply$mcZF$sp, apply$mcZI$sp, apply$mcZJ$sp, compose, compose$mcDD$sp, compose$mcDF$sp, compose$mcDI$sp, compose$mcDJ$sp, compose$mcFD$sp, compose$mcFF$sp, compose$mcFI$sp, compose$mcFJ$sp, compose$mcID$sp, compose$mcIF$sp, compose$mcII$sp, compose$mcIJ$sp, compose$mcJD$sp, compose$mcJF$sp, compose$mcJI$sp, compose$mcJJ$sp, compose$mcVD$sp, compose$mcVF$sp, compose$mcVI$sp, compose$mcVJ$sp, compose$mcZD$sp, compose$mcZF$sp, compose$mcZI$sp, compose$mcZJ$sp, toString
 

Constructor Detail

LeastSquaresCostFun

public LeastSquaresCostFun(RDD<scala.Tuple2<Object,Vector>> data,
                           double labelStd,
                           double labelMean,
                           double[] featuresStd,
                           double[] featuresMean,
                           double effectiveL2regParam)
Method Detail

calculate

public scala.Tuple2<Object,breeze.linalg.DenseVector<Object>> calculate(breeze.linalg.DenseVector<Object> weights)
Specified by:
calculate in interface breeze.optimize.StochasticDiffFunction<breeze.linalg.DenseVector<Object>>