Class LassoModel

Object
org.apache.spark.mllib.regression.GeneralizedLinearModel
org.apache.spark.mllib.regression.LassoModel
All Implemented Interfaces:
Serializable, PMMLExportable, RegressionModel, Saveable

public class LassoModel extends GeneralizedLinearModel implements RegressionModel, Serializable, Saveable, PMMLExportable
Regression model trained using Lasso.

param: weights Weights computed for every feature. param: intercept Intercept computed for this model.

See Also:
  • Constructor Details

    • LassoModel

      public LassoModel(Vector weights, double intercept)
  • Method Details

    • load

      public static LassoModel load(SparkContext sc, String path)
    • weights

      public Vector weights()
      Overrides:
      weights in class GeneralizedLinearModel
    • intercept

      public double intercept()
      Overrides:
      intercept in class GeneralizedLinearModel
    • save

      public void save(SparkContext sc, String path)
      Description copied from interface: Saveable
      Save this model to the given path.

      This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/

      The model may be loaded using Loader.load.

      Specified by:
      save in interface Saveable
      Parameters:
      sc - Spark context used to save model data.
      path - Path specifying the directory in which to save this model. If the directory already exists, this method throws an exception.