Class FMRegressionModel

All Implemented Interfaces:
Serializable, org.apache.spark.internal.Logging, Params, HasFeaturesCol, HasFitIntercept, HasLabelCol, HasMaxIter, HasPredictionCol, HasRegParam, HasSeed, HasSolver, HasStepSize, HasTol, HasWeightCol, org.apache.spark.ml.PredictorParams, org.apache.spark.ml.regression.FactorizationMachinesParams, org.apache.spark.ml.regression.FMRegressorParams, Identifiable, MLWritable

public class FMRegressionModel extends RegressionModel<Vector,FMRegressionModel> implements org.apache.spark.ml.regression.FMRegressorParams, MLWritable
Model produced by FMRegressor.
See Also:
  • Method Details

    • read

      public static MLReader<FMRegressionModel> read()
    • load

      public static FMRegressionModel 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()
    • 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,FMRegressionModel>
    • predict

      public double predict(Vector features)
      Description copied from class: PredictionModel
      Predict label for the given features. This method is used to implement transform() and output PredictionModel.predictionCol().
      Specified by:
      predict in class PredictionModel<Vector,FMRegressionModel>
      Parameters:
      features - (undocumented)
      Returns:
      (undocumented)
    • copy

      public FMRegressionModel 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<FMRegressionModel>
      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