public class GeneralizedLinearRegressionModel extends RegressionModel<Vector,GeneralizedLinearRegressionModel> implements GeneralizedLinearRegressionBase, MLWritable
GeneralizedLinearRegression
.Modifier and Type | Method and Description |
---|---|
Vector |
coefficients() |
GeneralizedLinearRegressionModel |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
GeneralizedLinearRegressionSummary |
evaluate(Dataset<?> dataset)
Evaluate the model on the given dataset, returning a summary of the results.
|
boolean |
hasSummary()
Indicates if
summary is available. |
double |
intercept() |
static GeneralizedLinearRegressionModel |
load(String path) |
int |
numFeatures()
Returns the number of features the model was trained on.
|
double |
predict(Vector features)
Predict label for the given features.
|
static MLReader<GeneralizedLinearRegressionModel> |
read() |
GeneralizedLinearRegressionModel |
setLinkPredictionCol(String value)
Sets the link prediction (linear predictor) column name.
|
GeneralizedLinearRegressionTrainingSummary |
summary()
Gets R-like summary of model on training set.
|
Dataset<Row> |
transform(Dataset<?> dataset)
Transforms dataset by reading from
featuresCol , calling predict , and storing
the predictions as a new column predictionCol . |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
MLWriter |
write()
Returns a
MLWriter instance for this ML instance. |
setFeaturesCol, setPredictionCol, transformSchema
transform, transform, transform
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
family, getFamily, getLink, getLinkPower, getLinkPredictionCol, getOffsetCol, getVariancePower, hasLinkPredictionCol, hasOffsetCol, hasWeightCol, link, linkPower, linkPredictionCol, offsetCol, solver, validateAndTransformSchema, variancePower
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
toString
fitIntercept, getFitIntercept
getMaxIter, maxIter
getRegParam, regParam
getWeightCol, weightCol
initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
save
public static MLReader<GeneralizedLinearRegressionModel> read()
public static GeneralizedLinearRegressionModel load(String path)
public String uid()
Identifiable
uid
in interface Identifiable
public Vector coefficients()
public double intercept()
public GeneralizedLinearRegressionModel setLinkPredictionCol(String value)
value
- (undocumented)public double predict(Vector features)
PredictionModel
transform()
and output predictionCol
.predict
in class PredictionModel<Vector,GeneralizedLinearRegressionModel>
features
- (undocumented)public Dataset<Row> transform(Dataset<?> dataset)
PredictionModel
featuresCol
, calling predict
, and storing
the predictions as a new column predictionCol
.
transform
in class PredictionModel<Vector,GeneralizedLinearRegressionModel>
dataset
- input datasetpredictionCol
of type Double
public GeneralizedLinearRegressionTrainingSummary summary()
public boolean hasSummary()
summary
is available.public GeneralizedLinearRegressionSummary evaluate(Dataset<?> dataset)
dataset
- (undocumented)public GeneralizedLinearRegressionModel copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Model<GeneralizedLinearRegressionModel>
extra
- (undocumented)public MLWriter write()
MLWriter
instance for this ML instance.
For GeneralizedLinearRegressionModel
, this does NOT currently save the
training summary
. An option to save summary
may be added in the future.
write
in interface MLWritable
public int numFeatures()
PredictionModel
numFeatures
in class PredictionModel<Vector,GeneralizedLinearRegressionModel>