Class GeneralizedLinearAlgorithm<M extends GeneralizedLinearModel>
Object
org.apache.spark.mllib.regression.GeneralizedLinearAlgorithm<M>
- All Implemented Interfaces:
Serializable
,org.apache.spark.internal.Logging
- Direct Known Subclasses:
LassoWithSGD
,LinearRegressionWithSGD
,LogisticRegressionWithLBFGS
,LogisticRegressionWithSGD
,RidgeRegressionWithSGD
,SVMWithSGD
public abstract class GeneralizedLinearAlgorithm<M extends GeneralizedLinearModel>
extends Object
implements org.apache.spark.internal.Logging, Serializable
GeneralizedLinearAlgorithm implements methods to train a Generalized Linear Model (GLM).
This class should be extended with an Optimizer to create a new GLM.
- 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
The dimension of training features.boolean
Get if the algorithm uses addInterceptabstract Optimizer
The optimizer to solve the problem.run
(RDD<LabeledPoint> input) Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries.run
(RDD<LabeledPoint> input, Vector initialWeights) Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries starting from the initial weights provided.setIntercept
(boolean addIntercept) Set if the algorithm should add an intercept.setValidateData
(boolean validateData) Set if the algorithm should validate data before training.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
-
Constructor Details
-
GeneralizedLinearAlgorithm
public GeneralizedLinearAlgorithm()
-
-
Method Details
-
getNumFeatures
public int getNumFeatures()The dimension of training features.- Returns:
- (undocumented)
-
isAddIntercept
public boolean isAddIntercept()Get if the algorithm uses addIntercept- Returns:
- (undocumented)
-
optimizer
The optimizer to solve the problem.- Returns:
- (undocumented)
-
run
Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries.- Parameters:
input
- (undocumented)- Returns:
- (undocumented)
-
run
Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries starting from the initial weights provided.- Parameters:
input
- (undocumented)initialWeights
- (undocumented)- Returns:
- (undocumented)
-
setIntercept
Set if the algorithm should add an intercept. Default false. We set the default to false because adding the intercept will cause memory allocation.- Parameters:
addIntercept
- (undocumented)- Returns:
- (undocumented)
-
setValidateData
Set if the algorithm should validate data before training. Default true.- Parameters:
validateData
- (undocumented)- Returns:
- (undocumented)
-