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, transformSchema
transform, transform, transform
params
getFamily, getLink, getLinkPower, getLinkPredictionCol, getOffsetCol, getVariancePower, hasLinkPredictionCol, hasOffsetCol, hasWeightCol, validateAndTransformSchema
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
clear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
getFitIntercept
getMaxIter
getRegParam
getWeightCol
getAggregationDepth
$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_, uninitialize
save
hasSummary, setSummary
public static MLReader<GeneralizedLinearRegressionModel> read()
public static GeneralizedLinearRegressionModel load(String path)
public final Param<String> family()
GeneralizedLinearRegressionBase
family
in interface GeneralizedLinearRegressionBase
public final DoubleParam variancePower()
GeneralizedLinearRegressionBase
variancePower
in interface GeneralizedLinearRegressionBase
public final Param<String> link()
GeneralizedLinearRegressionBase
linkPower
.
link
in interface GeneralizedLinearRegressionBase
public final DoubleParam linkPower()
GeneralizedLinearRegressionBase
variancePower
, which matches the R "statmod"
package.
linkPower
in interface GeneralizedLinearRegressionBase
public final Param<String> linkPredictionCol()
GeneralizedLinearRegressionBase
linkPredictionCol
in interface GeneralizedLinearRegressionBase
public final Param<String> offsetCol()
GeneralizedLinearRegressionBase
offsetCol
in interface GeneralizedLinearRegressionBase
public final Param<String> solver()
GeneralizedLinearRegressionBase
solver
in interface HasSolver
solver
in interface GeneralizedLinearRegressionBase
public final IntParam aggregationDepth()
HasAggregationDepth
aggregationDepth
in interface HasAggregationDepth
public final Param<String> weightCol()
HasWeightCol
weightCol
in interface HasWeightCol
public final DoubleParam regParam()
HasRegParam
regParam
in interface HasRegParam
public final DoubleParam tol()
HasTol
public final IntParam maxIter()
HasMaxIter
maxIter
in interface HasMaxIter
public final BooleanParam fitIntercept()
HasFitIntercept
fitIntercept
in interface HasFitIntercept
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()
summary
in interface HasTrainingSummary<GeneralizedLinearRegressionTrainingSummary>
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>
public String toString()
toString
in interface Identifiable
toString
in class Object