Class LinearRegressionModel

All Implemented Interfaces:
Serializable, PMMLExportable, RegressionModel, Saveable, scala.Serializable

public class LinearRegressionModel extends GeneralizedLinearModel implements RegressionModel, scala.Serializable, Saveable, PMMLExportable
Regression model trained using LinearRegression.

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

See Also:
  • Constructor Details

    • LinearRegressionModel

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

    • load

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

      public Vector weights()
      weights in class GeneralizedLinearModel
    • intercept

      public double intercept()
      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
      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.