Package org.apache.spark.ml.regression
Class FMRegressionModel
Object
org.apache.spark.ml.PipelineStage
org.apache.spark.ml.Transformer
org.apache.spark.ml.Model<M>
org.apache.spark.ml.PredictionModel<FeaturesType,M>
org.apache.spark.ml.regression.RegressionModel<Vector,FMRegressionModel>
org.apache.spark.ml.regression.FMRegressionModel
- All Implemented Interfaces:
Serializable
,org.apache.spark.internal.Logging
,Params
,HasFeaturesCol
,HasFitIntercept
,HasLabelCol
,HasMaxIter
,HasPredictionCol
,HasRegParam
,HasSeed
,HasSolver
,HasStepSize
,HasTol
,HasWeightCol
,PredictorParams
,FactorizationMachinesParams
,FMRegressorParams
,Identifiable
,MLWritable
public class FMRegressionModel
extends RegressionModel<Vector,FMRegressionModel>
implements FMRegressorParams, MLWritable
Model produced by
FMRegressor
.- 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 TypeMethodDescriptionCreates a copy of this instance with the same UID and some extra params.factors()
final IntParam
Param for dimensionality of the factors (>= 0)final BooleanParam
Param for whether to fit an intercept term.final BooleanParam
Param for whether to fit linear term (aka 1-way term)final DoubleParam
initStd()
Param for standard deviation of initial coefficientsdouble
linear()
static FMRegressionModel
final IntParam
maxIter()
Param for maximum number of iterations (>= 0).final DoubleParam
Param for mini-batch fraction, must be in range (0, 1]int
Returns the number of features the model was trained on.double
Predict label for the given features.static MLReader<FMRegressionModel>
read()
final DoubleParam
regParam()
Param for regularization parameter (>= 0).final LongParam
seed()
Param for random seed.solver()
The solver algorithm for optimization.stepSize()
Param for Step size to be used for each iteration of optimization (> 0).final DoubleParam
tol()
Param for the convergence tolerance for iterative algorithms (>= 0).toString()
uid()
An immutable unique ID for the object and its derivatives.Param for weight column name.write()
Returns anMLWriter
instance for this ML instance.Methods inherited from class org.apache.spark.ml.PredictionModel
featuresCol, labelCol, predictionCol, setFeaturesCol, setPredictionCol, transform, transformSchema
Methods inherited from class org.apache.spark.ml.Transformer
transform, transform, transform
Methods inherited from class org.apache.spark.ml.PipelineStage
params
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.spark.ml.regression.FactorizationMachinesParams
getFactorSize, getFitLinear, getInitStd, getMiniBatchFraction
Methods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesCol
featuresCol, getFeaturesCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasFitIntercept
getFitIntercept
Methods inherited from interface org.apache.spark.ml.param.shared.HasLabelCol
getLabelCol, labelCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasMaxIter
getMaxIter
Methods inherited from interface org.apache.spark.ml.param.shared.HasPredictionCol
getPredictionCol, predictionCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasRegParam
getRegParam
Methods inherited from interface org.apache.spark.ml.param.shared.HasStepSize
getStepSize
Methods inherited from interface org.apache.spark.ml.param.shared.HasWeightCol
getWeightCol
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
Methods inherited from interface org.apache.spark.ml.util.MLWritable
save
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
Methods inherited from interface org.apache.spark.ml.PredictorParams
validateAndTransformSchema
-
Method Details
-
read
-
load
-
factorSize
Description copied from interface:FactorizationMachinesParams
Param for dimensionality of the factors (>= 0)- Specified by:
factorSize
in interfaceFactorizationMachinesParams
- Returns:
- (undocumented)
-
fitLinear
Description copied from interface:FactorizationMachinesParams
Param for whether to fit linear term (aka 1-way term)- Specified by:
fitLinear
in interfaceFactorizationMachinesParams
- Returns:
- (undocumented)
-
miniBatchFraction
Description copied from interface:FactorizationMachinesParams
Param for mini-batch fraction, must be in range (0, 1]- Specified by:
miniBatchFraction
in interfaceFactorizationMachinesParams
- Returns:
- (undocumented)
-
initStd
Description copied from interface:FactorizationMachinesParams
Param for standard deviation of initial coefficients- Specified by:
initStd
in interfaceFactorizationMachinesParams
- Returns:
- (undocumented)
-
solver
Description copied from interface:FactorizationMachinesParams
The solver algorithm for optimization. Supported options: "gd", "adamW". Default: "adamW"- Specified by:
solver
in interfaceFactorizationMachinesParams
- Specified by:
solver
in interfaceHasSolver
- Returns:
- (undocumented)
-
weightCol
Description copied from interface:HasWeightCol
Param for weight column name. If this is not set or empty, we treat all instance weights as 1.0.- Specified by:
weightCol
in interfaceHasWeightCol
- Returns:
- (undocumented)
-
regParam
Description copied from interface:HasRegParam
Param for regularization parameter (>= 0).- Specified by:
regParam
in interfaceHasRegParam
- Returns:
- (undocumented)
-
fitIntercept
Description copied from interface:HasFitIntercept
Param for whether to fit an intercept term.- Specified by:
fitIntercept
in interfaceHasFitIntercept
- Returns:
- (undocumented)
-
seed
Description copied from interface:HasSeed
Param for random seed. -
tol
Description copied from interface:HasTol
Param for the convergence tolerance for iterative algorithms (>= 0). -
stepSize
Description copied from interface:HasStepSize
Param for Step size to be used for each iteration of optimization (> 0).- Specified by:
stepSize
in interfaceHasStepSize
- Returns:
- (undocumented)
-
maxIter
Description copied from interface:HasMaxIter
Param for maximum number of iterations (>= 0).- Specified by:
maxIter
in interfaceHasMaxIter
- Returns:
- (undocumented)
-
uid
Description copied from interface:Identifiable
An immutable unique ID for the object and its derivatives.- Specified by:
uid
in interfaceIdentifiable
- Returns:
- (undocumented)
-
intercept
public double intercept() -
linear
-
factors
-
numFeatures
public int numFeatures()Description copied from class:PredictionModel
Returns the number of features the model was trained on. If unknown, returns -1- Overrides:
numFeatures
in classPredictionModel<Vector,
FMRegressionModel>
-
predict
Description copied from class:PredictionModel
Predict label for the given features. This method is used to implementtransform()
and outputPredictionModel.predictionCol()
.- Specified by:
predict
in classPredictionModel<Vector,
FMRegressionModel> - Parameters:
features
- (undocumented)- Returns:
- (undocumented)
-
copy
Description copied from interface:Params
Creates a copy of this instance with the same UID and some extra params. Subclasses should implement this method and set the return type properly. SeedefaultCopy()
.- Specified by:
copy
in interfaceParams
- Specified by:
copy
in classModel<FMRegressionModel>
- Parameters:
extra
- (undocumented)- Returns:
- (undocumented)
-
write
Description copied from interface:MLWritable
Returns anMLWriter
instance for this ML instance.- Specified by:
write
in interfaceMLWritable
- Returns:
- (undocumented)
-
toString
- Specified by:
toString
in interfaceIdentifiable
- Overrides:
toString
in classObject
-