Class FMClassificationModel

All Implemented Interfaces:
Serializable, org.apache.spark.internal.Logging, org.apache.spark.ml.classification.ClassifierParams, org.apache.spark.ml.classification.FMClassifierParams, org.apache.spark.ml.classification.ProbabilisticClassifierParams, Params, HasFeaturesCol, HasFitIntercept, HasLabelCol, HasMaxIter, HasPredictionCol, HasProbabilityCol, HasRawPredictionCol, HasRegParam, HasSeed, HasSolver, HasStepSize, HasThresholds, HasTol, HasWeightCol, org.apache.spark.ml.PredictorParams, org.apache.spark.ml.regression.FactorizationMachinesParams, org.apache.spark.ml.util.HasTrainingSummary<FMClassificationTrainingSummary>, Identifiable, MLWritable

public class FMClassificationModel extends ProbabilisticClassificationModel<Vector,FMClassificationModel> implements org.apache.spark.ml.classification.FMClassifierParams, MLWritable, org.apache.spark.ml.util.HasTrainingSummary<FMClassificationTrainingSummary>
Model produced by FMClassifier
See Also:
  • Method Details

    • read

      public static MLReader<FMClassificationModel> read()
    • load

      public static FMClassificationModel load(String path)
    • factorSize

      public final IntParam factorSize()
      Specified by:
      factorSize in interface org.apache.spark.ml.regression.FactorizationMachinesParams
    • fitLinear

      public final BooleanParam fitLinear()
      Specified by:
      fitLinear in interface org.apache.spark.ml.regression.FactorizationMachinesParams
    • miniBatchFraction

      public final DoubleParam miniBatchFraction()
      Specified by:
      miniBatchFraction in interface org.apache.spark.ml.regression.FactorizationMachinesParams
    • initStd

      public final DoubleParam initStd()
      Specified by:
      initStd in interface org.apache.spark.ml.regression.FactorizationMachinesParams
    • solver

      public final Param<String> solver()
      Description copied from interface: HasSolver
      Param for the solver algorithm for optimization.
      Specified by:
      solver in interface org.apache.spark.ml.regression.FactorizationMachinesParams
      Specified by:
      solver in interface HasSolver
      Returns:
      (undocumented)
    • weightCol

      public final Param<String> 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 interface HasWeightCol
      Returns:
      (undocumented)
    • regParam

      public final DoubleParam regParam()
      Description copied from interface: HasRegParam
      Param for regularization parameter (&gt;= 0).
      Specified by:
      regParam in interface HasRegParam
      Returns:
      (undocumented)
    • fitIntercept

      public final BooleanParam fitIntercept()
      Description copied from interface: HasFitIntercept
      Param for whether to fit an intercept term.
      Specified by:
      fitIntercept in interface HasFitIntercept
      Returns:
      (undocumented)
    • seed

      public final LongParam seed()
      Description copied from interface: HasSeed
      Param for random seed.
      Specified by:
      seed in interface HasSeed
      Returns:
      (undocumented)
    • tol

      public final DoubleParam tol()
      Description copied from interface: HasTol
      Param for the convergence tolerance for iterative algorithms (&gt;= 0).
      Specified by:
      tol in interface HasTol
      Returns:
      (undocumented)
    • stepSize

      public DoubleParam stepSize()
      Description copied from interface: HasStepSize
      Param for Step size to be used for each iteration of optimization (&gt; 0).
      Specified by:
      stepSize in interface HasStepSize
      Returns:
      (undocumented)
    • maxIter

      public final IntParam maxIter()
      Description copied from interface: HasMaxIter
      Param for maximum number of iterations (&gt;= 0).
      Specified by:
      maxIter in interface HasMaxIter
      Returns:
      (undocumented)
    • uid

      public String uid()
      Description copied from interface: Identifiable
      An immutable unique ID for the object and its derivatives.
      Specified by:
      uid in interface Identifiable
      Returns:
      (undocumented)
    • intercept

      public double intercept()
    • linear

      public Vector linear()
    • factors

      public Matrix factors()
    • numClasses

      public int numClasses()
      Description copied from class: ClassificationModel
      Number of classes (values which the label can take).
      Specified by:
      numClasses in class ClassificationModel<Vector,FMClassificationModel>
    • 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 class PredictionModel<Vector,FMClassificationModel>
    • summary

      Gets summary of model on training set. An exception is thrown if hasSummary is false.
      Specified by:
      summary in interface org.apache.spark.ml.util.HasTrainingSummary<FMClassificationTrainingSummary>
      Returns:
      (undocumented)
    • evaluate

      public FMClassificationSummary evaluate(Dataset<?> dataset)
      Evaluates the model on a test dataset.

      Parameters:
      dataset - Test dataset to evaluate model on.
      Returns:
      (undocumented)
    • predictRaw

      public Vector predictRaw(Vector features)
      Description copied from class: ClassificationModel
      Raw 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 implement transform() and output ClassificationModel.rawPredictionCol().

      Specified by:
      predictRaw in 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.
    • copy

      public FMClassificationModel copy(ParamMap extra)
      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. See defaultCopy().
      Specified by:
      copy in interface Params
      Specified by:
      copy in class Model<FMClassificationModel>
      Parameters:
      extra - (undocumented)
      Returns:
      (undocumented)
    • write

      public MLWriter write()
      Description copied from interface: MLWritable
      Returns an MLWriter instance for this ML instance.
      Specified by:
      write in interface MLWritable
      Returns:
      (undocumented)
    • toString

      public String toString()
      Specified by:
      toString in interface Identifiable
      Overrides:
      toString in class Object