public class GeneralizedLinearRegressionModel extends RegressionModel<Vector,GeneralizedLinearRegressionModel> implements GeneralizedLinearRegressionBase, MLWritable, HasTrainingSummary<GeneralizedLinearRegressionTrainingSummary>
GeneralizedLinearRegression.| Modifier and Type | Method and Description |
|---|---|
IntParam |
aggregationDepth()
Param for suggested depth for treeAggregate (>= 2).
|
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.
|
Param<String> |
family()
Param for the name of family which is a description of the error distribution
to be used in the model.
|
BooleanParam |
fitIntercept()
Param for whether to fit an intercept term.
|
double |
intercept() |
Param<String> |
link()
Param for the name of link function which provides the relationship
between the linear predictor and the mean of the distribution function.
|
DoubleParam |
linkPower()
Param for the index in the power link function.
|
Param<String> |
linkPredictionCol()
Param for link prediction (linear predictor) column name.
|
static GeneralizedLinearRegressionModel |
load(String path) |
IntParam |
maxIter()
Param for maximum number of iterations (>= 0).
|
int |
numFeatures()
Returns the number of features the model was trained on.
|
Param<String> |
offsetCol()
Param for offset column name.
|
double |
predict(Vector features)
Predict label for the given features.
|
static MLReader<GeneralizedLinearRegressionModel> |
read() |
DoubleParam |
regParam()
Param for regularization parameter (>= 0).
|
GeneralizedLinearRegressionModel |
setLinkPredictionCol(String value)
Sets the link prediction (linear predictor) column name.
|
Param<String> |
solver()
The solver algorithm for optimization.
|
GeneralizedLinearRegressionTrainingSummary |
summary()
Gets R-like summary of model on training set.
|
DoubleParam |
tol()
Param for the convergence tolerance for iterative algorithms (>= 0).
|
String |
toString() |
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.
|
DoubleParam |
variancePower()
Param for the power in the variance function of the Tweedie distribution which provides
the relationship between the variance and mean of the distribution.
|
Param<String> |
weightCol()
Param for weight column name.
|
MLWriter |
write()
Returns a
MLWriter instance for this ML instance. |
featuresCol, labelCol, predictionCol, setFeaturesCol, setPredictionCol, transformSchematransform, transform, transformparamsgetFamily, getLink, getLinkPower, getLinkPredictionCol, getOffsetCol, getVariancePower, hasLinkPredictionCol, hasOffsetCol, hasWeightCol, validateAndTransformSchemagetLabelCol, labelColfeaturesCol, getFeaturesColgetPredictionCol, predictionColclear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwngetFitInterceptgetMaxItergetRegParamgetWeightColgetAggregationDepth$init$, initializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, initLock, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning, org$apache$spark$internal$Logging$$log__$eq, org$apache$spark$internal$Logging$$log_, uninitializesavehasSummary, setSummarypublic static MLReader<GeneralizedLinearRegressionModel> read()
public static GeneralizedLinearRegressionModel load(String path)
public final Param<String> family()
GeneralizedLinearRegressionBasefamily in interface GeneralizedLinearRegressionBasepublic final DoubleParam variancePower()
GeneralizedLinearRegressionBasevariancePower in interface GeneralizedLinearRegressionBasepublic final Param<String> link()
GeneralizedLinearRegressionBaselinkPower.
link in interface GeneralizedLinearRegressionBasepublic final DoubleParam linkPower()
GeneralizedLinearRegressionBasevariancePower, which matches the R "statmod"
package.
linkPower in interface GeneralizedLinearRegressionBasepublic final Param<String> linkPredictionCol()
GeneralizedLinearRegressionBaselinkPredictionCol in interface GeneralizedLinearRegressionBasepublic final Param<String> offsetCol()
GeneralizedLinearRegressionBaseoffsetCol in interface GeneralizedLinearRegressionBasepublic final Param<String> solver()
GeneralizedLinearRegressionBasesolver in interface HasSolversolver in interface GeneralizedLinearRegressionBasepublic final IntParam aggregationDepth()
HasAggregationDepthaggregationDepth in interface HasAggregationDepthpublic final Param<String> weightCol()
HasWeightColweightCol in interface HasWeightColpublic final DoubleParam regParam()
HasRegParamregParam in interface HasRegParampublic final DoubleParam tol()
HasTolpublic final IntParam maxIter()
HasMaxItermaxIter in interface HasMaxIterpublic final BooleanParam fitIntercept()
HasFitInterceptfitIntercept in interface HasFitInterceptpublic String uid()
Identifiableuid in interface Identifiablepublic Vector coefficients()
public double intercept()
public GeneralizedLinearRegressionModel setLinkPredictionCol(String value)
value - (undocumented)public double predict(Vector features)
PredictionModeltransform() and output predictionCol.predict in class PredictionModel<Vector,GeneralizedLinearRegressionModel>features - (undocumented)public Dataset<Row> transform(Dataset<?> dataset)
PredictionModelfeaturesCol, calling predict, and storing
the predictions as a new column predictionCol.
transform in class PredictionModel<Vector,GeneralizedLinearRegressionModel>dataset - input datasetpredictionCol of type Doublepublic GeneralizedLinearRegressionTrainingSummary summary()
summary in interface HasTrainingSummary<GeneralizedLinearRegressionTrainingSummary>public GeneralizedLinearRegressionSummary evaluate(Dataset<?> dataset)
dataset - (undocumented)public GeneralizedLinearRegressionModel copy(ParamMap extra)
ParamsdefaultCopy().copy in interface Paramscopy 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 MLWritablepublic int numFeatures()
PredictionModelnumFeatures in class PredictionModel<Vector,GeneralizedLinearRegressionModel>public String toString()
toString in interface IdentifiabletoString in class Object