Class FMClassificationModel
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.classification.ClassificationModel<FeaturesType,M>
 
org.apache.spark.ml.classification.ProbabilisticClassificationModel<Vector,FMClassificationModel>
 
org.apache.spark.ml.classification.FMClassificationModel
- All Implemented Interfaces:
- Serializable,- org.apache.spark.internal.Logging,- ClassifierParams,- FMClassifierParams,- ProbabilisticClassifierParams,- Params,- HasFeaturesCol,- HasFitIntercept,- HasLabelCol,- HasMaxIter,- HasPredictionCol,- HasProbabilityCol,- HasRawPredictionCol,- HasRegParam,- HasSeed,- HasSolver,- HasStepSize,- HasThresholds,- HasTol,- HasWeightCol,- PredictorParams,- FactorizationMachinesParams,- HasTrainingSummary<FMClassificationTrainingSummary>,- Identifiable,- MLWritable
public class FMClassificationModel
extends ProbabilisticClassificationModel<Vector,FMClassificationModel>
implements FMClassifierParams, MLWritable, HasTrainingSummary<FMClassificationTrainingSummary> 
Model produced by 
FMClassifier- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface org.apache.spark.internal.Loggingorg.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
- 
Method SummaryModifier and TypeMethodDescriptionCreates a copy of this instance with the same UID and some extra params.longEvaluates the model on a test dataset.factors()final IntParamParam for dimensionality of the factors (>= 0)final BooleanParamParam for whether to fit an intercept term.final BooleanParamParam for whether to fit linear term (aka 1-way term)final DoubleParaminitStd()Param for standard deviation of initial coefficientsdoublelinear()static FMClassificationModelfinal IntParammaxIter()Param for maximum number of iterations (>= 0).final DoubleParamParam for mini-batch fraction, must be in range (0, 1]intNumber of classes (values which the label can take).intReturns the number of features the model was trained on.predictRaw(Vector features) Raw prediction for each possible label.static MLReader<FMClassificationModel>read()final DoubleParamregParam()Param for regularization parameter (>= 0).final LongParamseed()Param for random seed.solver()The solver algorithm for optimization.stepSize()Param for Step size to be used for each iteration of optimization (> 0).summary()Gets summary of model on training set.final DoubleParamtol()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 anMLWriterinstance for this ML instance.Methods inherited from class org.apache.spark.ml.classification.ProbabilisticClassificationModelnormalizeToProbabilitiesInPlace, predictProbability, probabilityCol, setProbabilityCol, setThresholds, thresholds, transform, transformSchemaMethods inherited from class org.apache.spark.ml.classification.ClassificationModelpredict, rawPredictionCol, setRawPredictionCol, transformImplMethods inherited from class org.apache.spark.ml.PredictionModelfeaturesCol, labelCol, predictionCol, setFeaturesCol, setPredictionColMethods inherited from class org.apache.spark.ml.Transformertransform, transform, transformMethods inherited from class org.apache.spark.ml.PipelineStageparamsMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.spark.ml.regression.FactorizationMachinesParamsgetFactorSize, getFitLinear, getInitStd, getMiniBatchFractionMethods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesColfeaturesCol, getFeaturesColMethods inherited from interface org.apache.spark.ml.param.shared.HasFitInterceptgetFitInterceptMethods inherited from interface org.apache.spark.ml.param.shared.HasLabelColgetLabelCol, labelColMethods inherited from interface org.apache.spark.ml.param.shared.HasMaxItergetMaxIterMethods inherited from interface org.apache.spark.ml.param.shared.HasPredictionColgetPredictionCol, predictionColMethods inherited from interface org.apache.spark.ml.param.shared.HasProbabilityColgetProbabilityCol, probabilityColMethods inherited from interface org.apache.spark.ml.param.shared.HasRawPredictionColgetRawPredictionCol, rawPredictionColMethods inherited from interface org.apache.spark.ml.param.shared.HasRegParamgetRegParamMethods inherited from interface org.apache.spark.ml.param.shared.HasStepSizegetStepSizeMethods inherited from interface org.apache.spark.ml.param.shared.HasThresholdsgetThresholds, thresholdsMethods inherited from interface org.apache.spark.ml.util.HasTrainingSummaryhasSummary, setSummaryMethods inherited from interface org.apache.spark.ml.param.shared.HasWeightColgetWeightColMethods inherited from interface org.apache.spark.internal.LogginginitializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logBasedOnLevel, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, MDC, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContextMethods inherited from interface org.apache.spark.ml.util.MLWritablesaveMethods inherited from interface org.apache.spark.ml.param.Paramsclear, copyValues, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwnMethods inherited from interface org.apache.spark.ml.classification.ProbabilisticClassifierParamsvalidateAndTransformSchema
- 
Method Details- 
read
- 
load
- 
factorSizeDescription copied from interface:FactorizationMachinesParamsParam for dimensionality of the factors (>= 0)- Specified by:
- factorSizein interface- FactorizationMachinesParams
- Returns:
- (undocumented)
 
- 
fitLinearDescription copied from interface:FactorizationMachinesParamsParam for whether to fit linear term (aka 1-way term)- Specified by:
- fitLinearin interface- FactorizationMachinesParams
- Returns:
- (undocumented)
 
- 
miniBatchFractionDescription copied from interface:FactorizationMachinesParamsParam for mini-batch fraction, must be in range (0, 1]- Specified by:
- miniBatchFractionin interface- FactorizationMachinesParams
- Returns:
- (undocumented)
 
- 
initStdDescription copied from interface:FactorizationMachinesParamsParam for standard deviation of initial coefficients- Specified by:
- initStdin interface- FactorizationMachinesParams
- Returns:
- (undocumented)
 
- 
solverDescription copied from interface:FactorizationMachinesParamsThe solver algorithm for optimization. Supported options: "gd", "adamW". Default: "adamW"- Specified by:
- solverin interface- FactorizationMachinesParams
- Specified by:
- solverin interface- HasSolver
- Returns:
- (undocumented)
 
- 
weightColDescription copied from interface:HasWeightColParam for weight column name. If this is not set or empty, we treat all instance weights as 1.0.- Specified by:
- weightColin interface- HasWeightCol
- Returns:
- (undocumented)
 
- 
regParamDescription copied from interface:HasRegParamParam for regularization parameter (>= 0).- Specified by:
- regParamin interface- HasRegParam
- Returns:
- (undocumented)
 
- 
fitInterceptDescription copied from interface:HasFitInterceptParam for whether to fit an intercept term.- Specified by:
- fitInterceptin interface- HasFitIntercept
- Returns:
- (undocumented)
 
- 
seedDescription copied from interface:HasSeedParam for random seed.
- 
tolDescription copied from interface:HasTolParam for the convergence tolerance for iterative algorithms (>= 0).
- 
stepSizeDescription copied from interface:HasStepSizeParam for Step size to be used for each iteration of optimization (> 0).- Specified by:
- stepSizein interface- HasStepSize
- Returns:
- (undocumented)
 
- 
maxIterDescription copied from interface:HasMaxIterParam for maximum number of iterations (>= 0).- Specified by:
- maxIterin interface- HasMaxIter
- Returns:
- (undocumented)
 
- 
uidDescription copied from interface:IdentifiableAn immutable unique ID for the object and its derivatives.- Specified by:
- uidin interface- Identifiable
- Returns:
- (undocumented)
 
- 
interceptpublic double intercept()
- 
linear
- 
factors
- 
numClassespublic int numClasses()Description copied from class:ClassificationModelNumber of classes (values which the label can take).- Specified by:
- numClassesin class- ClassificationModel<Vector,- FMClassificationModel> 
 
- 
numFeaturespublic int numFeatures()Description copied from class:PredictionModelReturns the number of features the model was trained on. If unknown, returns -1- Overrides:
- numFeaturesin class- PredictionModel<Vector,- FMClassificationModel> 
 
- 
summaryGets summary of model on training set. An exception is thrown ifhasSummaryis false.- Specified by:
- summaryin interface- HasTrainingSummary<FMClassificationTrainingSummary>
- Returns:
- (undocumented)
 
- 
evaluateEvaluates the model on a test dataset.- Parameters:
- dataset- Test dataset to evaluate model on.
- Returns:
- (undocumented)
 
- 
predictRawDescription copied from class:ClassificationModelRaw prediction for each possible label. The meaning of a "raw" prediction may vary between algorithms, but it intuitively gives a measure of confidence in each possible label (where larger = more confident). This internal method is used to implementtransform()and outputClassificationModel.rawPredictionCol().- Specified by:
- predictRawin class- ClassificationModel<Vector,- FMClassificationModel> 
- Parameters:
- features- (undocumented)
- Returns:
- vector where element i is the raw prediction for label i. This raw prediction may be any real number, where a larger value indicates greater confidence for that label.
 
- 
copyDescription copied from interface:ParamsCreates 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:
- copyin interface- Params
- Specified by:
- copyin class- Model<FMClassificationModel>
- Parameters:
- extra- (undocumented)
- Returns:
- (undocumented)
 
- 
estimatedSizepublic long estimatedSize()
- 
writeDescription copied from interface:MLWritableReturns anMLWriterinstance for this ML instance.- Specified by:
- writein interface- MLWritable
- Returns:
- (undocumented)
 
- 
toString- Specified by:
- toStringin interface- Identifiable
- Overrides:
- toStringin class- Object
 
 
-