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 SummaryNested classes/interfaces inherited from interface org.apache.spark.internal.Loggingorg.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintThe dimension of training features.booleanGet if the algorithm uses addInterceptabstract OptimizerThe 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.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.internal.LogginginitializeForcefully, 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- 
GeneralizedLinearAlgorithmpublic GeneralizedLinearAlgorithm()
 
- 
- 
Method Details- 
getNumFeaturespublic int getNumFeatures()The dimension of training features.- Returns:
- (undocumented)
 
- 
isAddInterceptpublic boolean isAddIntercept()Get if the algorithm uses addIntercept- Returns:
- (undocumented)
 
- 
optimizerThe optimizer to solve the problem.- Returns:
- (undocumented)
 
- 
runRun the algorithm with the configured parameters on an input RDD of LabeledPoint entries.- Parameters:
- input- (undocumented)
- Returns:
- (undocumented)
 
- 
runRun 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)
 
- 
setInterceptSet 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)
 
- 
setValidateDataSet if the algorithm should validate data before training. Default true.- Parameters:
- validateData- (undocumented)
- Returns:
- (undocumented)
 
 
-