public class IsotonicRegressionModel extends java.lang.Object implements java.io.Serializable, Saveable
param: boundaries Array of boundaries for which predictions are known. Boundaries must be sorted in increasing order. param: predictions Array of predictions associated to the boundaries at the same index. Results of isotonic regression and therefore monotone. param: isotonic indicates whether this is isotonic or antitonic.
Constructor and Description |
---|
IsotonicRegressionModel(double[] boundaries,
double[] predictions,
boolean isotonic) |
IsotonicRegressionModel(java.lang.Iterable<java.lang.Object> boundaries,
java.lang.Iterable<java.lang.Object> predictions,
java.lang.Boolean isotonic)
A Java-friendly constructor that takes two Iterable parameters and one Boolean parameter.
|
Modifier and Type | Method and Description |
---|---|
double[] |
boundaries() |
protected java.lang.String |
formatVersion()
Current version of model save/load format.
|
boolean |
isotonic() |
static IsotonicRegressionModel |
load(SparkContext sc,
java.lang.String path) |
double |
predict(double testData)
Predict a single label.
|
JavaDoubleRDD |
predict(JavaDoubleRDD testData)
Predict labels for provided features.
|
RDD<java.lang.Object> |
predict(RDD<java.lang.Object> testData)
Predict labels for provided features.
|
double[] |
predictions() |
void |
save(SparkContext sc,
java.lang.String path)
Save this model to the given path.
|
public IsotonicRegressionModel(double[] boundaries, double[] predictions, boolean isotonic)
public IsotonicRegressionModel(java.lang.Iterable<java.lang.Object> boundaries, java.lang.Iterable<java.lang.Object> predictions, java.lang.Boolean isotonic)
boundaries
- (undocumented)predictions
- (undocumented)isotonic
- (undocumented)public static IsotonicRegressionModel load(SparkContext sc, java.lang.String path)
public double[] boundaries()
public double[] predictions()
public boolean isotonic()
public RDD<java.lang.Object> predict(RDD<java.lang.Object> testData)
testData
- Features to be labeled.public JavaDoubleRDD predict(JavaDoubleRDD testData)
testData
- Features to be labeled.public double predict(double testData)
testData
- Feature to be labeled.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