Class LinearRegressionWithSGD
Object
org.apache.spark.mllib.regression.GeneralizedLinearAlgorithm<LinearRegressionModel>
org.apache.spark.mllib.regression.LinearRegressionWithSGD
- All Implemented Interfaces:
Serializable
,org.apache.spark.internal.Logging
public class LinearRegressionWithSGD
extends GeneralizedLinearAlgorithm<LinearRegressionModel>
implements Serializable
Train a linear regression model with no regularization using Stochastic Gradient Descent.
This solves the least squares regression formulation
f(weights) = 1/n ||A weights-y||^2^
(which is the mean squared error).
Here the data matrix has n rows, and the input RDD holds the set of rows of A, each with
its corresponding right hand side label y.
See also the documentation for the precise formulation.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.spark.internal.Logging
org.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
-
Method Summary
Modifier and TypeMethodDescriptionThe optimizer to solve the problem.Methods inherited from class org.apache.spark.mllib.regression.GeneralizedLinearAlgorithm
getNumFeatures, isAddIntercept, run, run, setIntercept, setValidateData
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.spark.internal.Logging
initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContext
-
Method Details
-
optimizer
Description copied from class:GeneralizedLinearAlgorithm
The optimizer to solve the problem.- Specified by:
optimizer
in classGeneralizedLinearAlgorithm<LinearRegressionModel>
- Returns:
- (undocumented)
-