public class GeneralizedLinearRegression extends Regressor<Vector,GeneralizedLinearRegression,GeneralizedLinearRegressionModel> implements GeneralizedLinearRegressionBase, DefaultParamsWritable, org.apache.spark.internal.Logging
Modifier and Type | Class and Description |
---|---|
static class |
GeneralizedLinearRegression.Binomial$
Binomial exponential family distribution.
|
static class |
GeneralizedLinearRegression.CLogLog$ |
static class |
GeneralizedLinearRegression.Family$ |
static class |
GeneralizedLinearRegression.FamilyAndLink$ |
static class |
GeneralizedLinearRegression.Gamma$
Gamma exponential family distribution.
|
static class |
GeneralizedLinearRegression.Gaussian$
Gaussian exponential family distribution.
|
static class |
GeneralizedLinearRegression.Identity$ |
static class |
GeneralizedLinearRegression.Inverse$ |
static class |
GeneralizedLinearRegression.Link$ |
static class |
GeneralizedLinearRegression.Log$ |
static class |
GeneralizedLinearRegression.Logit$ |
static class |
GeneralizedLinearRegression.Poisson$
Poisson exponential family distribution.
|
static class |
GeneralizedLinearRegression.Probit$ |
static class |
GeneralizedLinearRegression.Sqrt$ |
static class |
GeneralizedLinearRegression.Tweedie$ |
Constructor and Description |
---|
GeneralizedLinearRegression() |
GeneralizedLinearRegression(String uid) |
Modifier and Type | Method and Description |
---|---|
IntParam |
aggregationDepth()
Param for suggested depth for treeAggregate (>= 2).
|
GeneralizedLinearRegression |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
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.
|
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 GeneralizedLinearRegression |
load(String path) |
IntParam |
maxIter()
Param for maximum number of iterations (>= 0).
|
Param<String> |
offsetCol()
Param for offset column name.
|
static MLReader<T> |
read() |
DoubleParam |
regParam()
Param for regularization parameter (>= 0).
|
GeneralizedLinearRegression |
setAggregationDepth(int value) |
GeneralizedLinearRegression |
setFamily(String value)
Sets the value of param
family . |
GeneralizedLinearRegression |
setFitIntercept(boolean value)
Sets if we should fit the intercept.
|
GeneralizedLinearRegression |
setLink(String value)
Sets the value of param
link . |
GeneralizedLinearRegression |
setLinkPower(double value)
Sets the value of param
linkPower . |
GeneralizedLinearRegression |
setLinkPredictionCol(String value)
Sets the link prediction (linear predictor) column name.
|
GeneralizedLinearRegression |
setMaxIter(int value)
Sets the maximum number of iterations (applicable for solver "irls").
|
GeneralizedLinearRegression |
setOffsetCol(String value)
Sets the value of param
offsetCol . |
GeneralizedLinearRegression |
setRegParam(double value)
Sets the regularization parameter for L2 regularization.
|
GeneralizedLinearRegression |
setSolver(String value)
Sets the solver algorithm used for optimization.
|
GeneralizedLinearRegression |
setTol(double value)
Sets the convergence tolerance of iterations.
|
GeneralizedLinearRegression |
setVariancePower(double value)
Sets the value of param
variancePower . |
GeneralizedLinearRegression |
setWeightCol(String value)
Sets the value of param
weightCol . |
Param<String> |
solver()
The solver algorithm for optimization.
|
DoubleParam |
tol()
Param for the convergence tolerance for iterative algorithms (>= 0).
|
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.
|
featuresCol, fit, labelCol, predictionCol, setFeaturesCol, setLabelCol, setPredictionCol, transformSchema
params
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
toString
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
write
save
public GeneralizedLinearRegression(String uid)
public GeneralizedLinearRegression()
public static GeneralizedLinearRegression load(String path)
public static MLReader<T> read()
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 GeneralizedLinearRegression setFamily(String value)
family
.
Default is "gaussian".
value
- (undocumented)public GeneralizedLinearRegression setVariancePower(double value)
variancePower
.
Used only when family is "tweedie".
Default is 0.0, which corresponds to the "gaussian" family.
value
- (undocumented)public GeneralizedLinearRegression setLinkPower(double value)
linkPower
.
Used only when family is "tweedie".
value
- (undocumented)public GeneralizedLinearRegression setLink(String value)
link
.
Used only when family is not "tweedie".
value
- (undocumented)public GeneralizedLinearRegression setFitIntercept(boolean value)
value
- (undocumented)public GeneralizedLinearRegression setMaxIter(int value)
value
- (undocumented)public GeneralizedLinearRegression setTol(double value)
value
- (undocumented)public GeneralizedLinearRegression setRegParam(double value)
$$ 0.5 * regParam * L2norm(coefficients)^2 $$Default is 0.0.
value
- (undocumented)public GeneralizedLinearRegression setWeightCol(String value)
weightCol
.
If this is not set or empty, we treat all instance weights as 1.0.
Default is not set, so all instances have weight one.
In the Binomial family, weights correspond to number of trials and should be integer.
Non-integer weights are rounded to integer in AIC calculation.
value
- (undocumented)public GeneralizedLinearRegression setOffsetCol(String value)
offsetCol
.
If this is not set or empty, we treat all instance offsets as 0.0.
Default is not set, so all instances have offset 0.0.
value
- (undocumented)public GeneralizedLinearRegression setSolver(String value)
value
- (undocumented)public GeneralizedLinearRegression setLinkPredictionCol(String value)
value
- (undocumented)public GeneralizedLinearRegression setAggregationDepth(int value)
public GeneralizedLinearRegression copy(ParamMap extra)
Params
defaultCopy()
.copy
in interface Params
copy
in class Predictor<Vector,GeneralizedLinearRegression,GeneralizedLinearRegressionModel>
extra
- (undocumented)