public interface LogisticRegressionParams extends ProbabilisticClassifierParams, HasRegParam, HasElasticNetParam, HasMaxIter, HasFitIntercept, HasTol, HasStandardization, HasWeightCol, HasThreshold, HasAggregationDepth, HasMaxBlockSizeInMB
Modifier and Type | Method and Description |
---|---|
void |
checkThresholdConsistency()
If
threshold and thresholds are both set, ensures they are consistent. |
Param<String> |
family()
Param for the name of family which is a description of the label distribution
to be used in the model.
|
String |
getFamily() |
Matrix |
getLowerBoundsOnCoefficients() |
Vector |
getLowerBoundsOnIntercepts() |
double |
getThreshold()
Get threshold for binary classification.
|
double[] |
getThresholds()
Get thresholds for binary or multiclass classification.
|
Matrix |
getUpperBoundsOnCoefficients() |
Vector |
getUpperBoundsOnIntercepts() |
Param<Matrix> |
lowerBoundsOnCoefficients()
The lower bounds on coefficients if fitting under bound constrained optimization.
|
Param<Vector> |
lowerBoundsOnIntercepts()
The lower bounds on intercepts if fitting under bound constrained optimization.
|
LogisticRegressionParams |
setThreshold(double value)
Set threshold in binary classification, in range [0, 1].
|
LogisticRegressionParams |
setThresholds(double[] value)
Set thresholds in multiclass (or binary) classification to adjust the probability of
predicting each class.
|
Param<Matrix> |
upperBoundsOnCoefficients()
The upper bounds on coefficients if fitting under bound constrained optimization.
|
Param<Vector> |
upperBoundsOnIntercepts()
The upper bounds on intercepts if fitting under bound constrained optimization.
|
boolean |
usingBoundConstrainedOptimization() |
StructType |
validateAndTransformSchema(StructType schema,
boolean fitting,
DataType featuresDataType)
Validates and transforms the input schema with the provided param map.
|
extractInstances
extractInstances, extractInstances
getLabelCol, labelCol
featuresCol, getFeaturesCol
getPredictionCol, predictionCol
clear, copy, 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, uid
getRawPredictionCol, rawPredictionCol
getProbabilityCol, probabilityCol
thresholds
getRegParam, regParam
elasticNetParam, getElasticNetParam
getMaxIter, maxIter
fitIntercept, getFitIntercept
getStandardization, standardization
getWeightCol, weightCol
threshold
aggregationDepth, getAggregationDepth
getMaxBlockSizeInMB, maxBlockSizeInMB
void checkThresholdConsistency()
threshold
and thresholds
are both set, ensures they are consistent.
IllegalArgumentException
- if threshold
and thresholds
are not equivalentParam<String> family()
String getFamily()
Matrix getLowerBoundsOnCoefficients()
Vector getLowerBoundsOnIntercepts()
double getThreshold()
If thresholds
is set with length 2 (i.e., binary classification),
this returns the equivalent threshold:
1 / (1 + thresholds(0) / thresholds(1))
.
Otherwise, returns `threshold` if set, or its default value if unset.
@group getParam
@throws IllegalArgumentException if `thresholds` is set to an array of length other than 2.getThreshold
in interface HasThreshold
double[] getThresholds()
If thresholds
is set, return its value.
Otherwise, if threshold
is set, return the equivalent thresholds for binary
classification: (1-threshold, threshold).
If neither are set, throw an exception.
getThresholds
in interface HasThresholds
Matrix getUpperBoundsOnCoefficients()
Vector getUpperBoundsOnIntercepts()
Param<Matrix> lowerBoundsOnCoefficients()
Param<Vector> lowerBoundsOnIntercepts()
LogisticRegressionParams setThreshold(double value)
If the estimated probability of class label 1 is greater than threshold, then predict 1, else 0. A high threshold encourages the model to predict 0 more often; a low threshold encourages the model to predict 1 more often.
Note: Calling this with threshold p is equivalent to calling setThresholds(Array(1-p, p))
.
When setThreshold()
is called, any user-set value for thresholds
will be cleared.
If both threshold
and thresholds
are set in a ParamMap, then they must be
equivalent.
Default is 0.5.
value
- (undocumented)LogisticRegressionParams setThresholds(double[] value)
Note: When setThresholds()
is called, any user-set value for threshold
will be cleared.
If both threshold
and thresholds
are set in a ParamMap, then they must be
equivalent.
value
- (undocumented)Param<Matrix> upperBoundsOnCoefficients()
Param<Vector> upperBoundsOnIntercepts()
boolean usingBoundConstrainedOptimization()
StructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType)
PredictorParams
validateAndTransformSchema
in interface ClassifierParams
validateAndTransformSchema
in interface PredictorParams
validateAndTransformSchema
in interface ProbabilisticClassifierParams
schema
- input schemafitting
- whether this is in fittingfeaturesDataType
- SQL DataType for FeaturesType.
E.g., VectorUDT
for vector features.