LassoModel (Spark 3.5.5 JavaDoc) (original) (raw)
Object
- org.apache.spark.mllib.regression.GeneralizedLinearModel
- org.apache.spark.mllib.regression.LassoModel
All Implemented Interfaces:
java.io.Serializable, PMMLExportable, RegressionModel, Saveable
public class LassoModel
extends GeneralizedLinearModel
implements RegressionModel, scala.Serializable, Saveable, PMMLExportable
Regression model trained using Lasso.
param: weights Weights computed for every feature. param: intercept Intercept computed for this model.
See Also:
Serialized Form
Constructor Summary
Constructors
Constructor and Description LassoModel(Vector weights, double intercept) Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Modifier and Type Method and Description double intercept() static LassoModel load(SparkContext sc, String path) void save(SparkContext sc, String path) Save this model to the given path. Vector weights() * ### Methods inherited from class org.apache.spark.mllib.regression.[GeneralizedLinearModel](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html "class in org.apache.spark.mllib.regression") `[predict](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html#predict-org.apache.spark.rdd.RDD-), [predict](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html#predict-org.apache.spark.mllib.linalg.Vector-), [toString](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html#toString--)` * ### Methods inherited from class Object `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait` * ### Methods inherited from interface org.apache.spark.mllib.regression.[RegressionModel](../../../../../org/apache/spark/mllib/regression/RegressionModel.html "interface in org.apache.spark.mllib.regression") `[predict](../../../../../org/apache/spark/mllib/regression/RegressionModel.html#predict-org.apache.spark.api.java.JavaRDD-), [predict](../../../../../org/apache/spark/mllib/regression/RegressionModel.html#predict-org.apache.spark.rdd.RDD-), [predict](../../../../../org/apache/spark/mllib/regression/RegressionModel.html#predict-org.apache.spark.mllib.linalg.Vector-)` * ### Methods inherited from interface org.apache.spark.mllib.pmml.[PMMLExportable](../../../../../org/apache/spark/mllib/pmml/PMMLExportable.html "interface in org.apache.spark.mllib.pmml") `[toPMML](../../../../../org/apache/spark/mllib/pmml/PMMLExportable.html#toPMML--), [toPMML](../../../../../org/apache/spark/mllib/pmml/PMMLExportable.html#toPMML-java.io.OutputStream-), [toPMML](../../../../../org/apache/spark/mllib/pmml/PMMLExportable.html#toPMML-org.apache.spark.SparkContext-java.lang.String-), [toPMML](../../../../../org/apache/spark/mllib/pmml/PMMLExportable.html#toPMML-javax.xml.transform.stream.StreamResult-), [toPMML](../../../../../org/apache/spark/mllib/pmml/PMMLExportable.html#toPMML-java.lang.String-)`
Constructor Detail
* #### LassoModel public LassoModel([Vector](../../../../../org/apache/spark/mllib/linalg/Vector.html "interface in org.apache.spark.mllib.linalg") weights, double intercept)
Method Detail
* #### load public static [LassoModel](../../../../../org/apache/spark/mllib/regression/LassoModel.html "class in org.apache.spark.mllib.regression") load([SparkContext](../../../../../org/apache/spark/SparkContext.html "class in org.apache.spark") sc, String path) * #### weights public [Vector](../../../../../org/apache/spark/mllib/linalg/Vector.html "interface in org.apache.spark.mllib.linalg") weights() Overrides: `[weights](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html#weights--)` in class `[GeneralizedLinearModel](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html "class in org.apache.spark.mllib.regression")` * #### intercept public double intercept() Overrides: `[intercept](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html#intercept--)` in class `[GeneralizedLinearModel](../../../../../org/apache/spark/mllib/regression/GeneralizedLinearModel.html "class in org.apache.spark.mllib.regression")` * #### save public void save([SparkContext](../../../../../org/apache/spark/SparkContext.html "class in org.apache.spark") sc, String path) Description copied from interface: `[Saveable](../../../../../org/apache/spark/mllib/util/Saveable.html#save-org.apache.spark.SparkContext-java.lang.String-)` 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](../../../../../org/apache/spark/mllib/util/Saveable.html#save-org.apache.spark.SparkContext-java.lang.String-)` in interface `[Saveable](../../../../../org/apache/spark/mllib/util/Saveable.html "interface in org.apache.spark.mllib.util")` 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.