public abstract class GeneralizedLinearModel
extends java.lang.Object
implements scala.Serializable
param: weights Weights computed for every feature. param: intercept Intercept computed for this model.
Constructor and Description |
---|
GeneralizedLinearModel(Vector weights,
double intercept) |
Modifier and Type | Method and Description |
---|---|
double |
intercept() |
RDD<java.lang.Object> |
predict(RDD<Vector> testData)
Predict values for the given data set using the model trained.
|
double |
predict(Vector testData)
Predict values for a single data point using the model trained.
|
protected abstract double |
predictPoint(Vector dataMatrix,
Vector weightMatrix,
double intercept)
Predict the result given a data point and the weights learned.
|
java.lang.String |
toString()
Print a summary of the model.
|
Vector |
weights() |
public GeneralizedLinearModel(Vector weights, double intercept)
public Vector weights()
public double intercept()
protected abstract double predictPoint(Vector dataMatrix, Vector weightMatrix, double intercept)
dataMatrix
- Row vector containing the features for this data pointweightMatrix
- Column vector containing the weights of the modelintercept
- Intercept of the model.public RDD<java.lang.Object> predict(RDD<Vector> testData)
testData
- RDD representing data points to be predictedpublic double predict(Vector testData)
testData
- array representing a single data pointpublic java.lang.String toString()
toString
in class java.lang.Object