public class LassoModel extends GeneralizedLinearModel implements RegressionModel, scala.Serializable, Saveable, PMMLExportable
param: weights Weights computed for every feature. param: intercept Intercept computed for this model.
Constructor and Description |
---|
LassoModel(Vector weights,
double intercept) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
formatVersion()
Current version of model save/load format.
|
double |
intercept() |
static LassoModel |
load(SparkContext sc,
java.lang.String path) |
static JavaRDD<java.lang.Double> |
predict(JavaRDD<Vector> testData) |
static RDD<java.lang.Object> |
predict(RDD<Vector> testData) |
static double |
predict(Vector testData) |
protected double |
predictPoint(Vector dataMatrix,
Vector weightMatrix,
double intercept)
Predict the result given a data point and the weights learned.
|
void |
save(SparkContext sc,
java.lang.String path)
Save this model to the given path.
|
static java.lang.String |
toPMML() |
static void |
toPMML(java.io.OutputStream outputStream) |
static void |
toPMML(SparkContext sc,
java.lang.String path) |
static void |
toPMML(java.lang.String localPath) |
static java.lang.String |
toString() |
Vector |
weights() |
predict, predict, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
predict, predict, predict
public LassoModel(Vector weights, double intercept)
public static LassoModel load(SparkContext sc, java.lang.String path)
public static double predict(Vector testData)
public static java.lang.String toString()
public static void toPMML(java.lang.String localPath)
public static void toPMML(SparkContext sc, java.lang.String path)
public static void toPMML(java.io.OutputStream outputStream)
public static java.lang.String toPMML()
public Vector weights()
weights
in class GeneralizedLinearModel
public double intercept()
intercept
in class GeneralizedLinearModel
protected double predictPoint(Vector dataMatrix, Vector weightMatrix, double intercept)
GeneralizedLinearModel
predictPoint
in class GeneralizedLinearModel
dataMatrix
- Row vector containing the features for this data pointweightMatrix
- Column vector containing the weights of the modelintercept
- Intercept of the model.public void save(SparkContext sc, java.lang.String path)
Saveable
This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using Loader.load
.
protected java.lang.String formatVersion()
Saveable
formatVersion
in interface Saveable