Interface LogisticRegressionParams
- All Superinterfaces:
- ClassifierParams,- HasAggregationDepth,- HasElasticNetParam,- HasFeaturesCol,- HasFitIntercept,- HasLabelCol,- HasMaxBlockSizeInMB,- HasMaxIter,- HasPredictionCol,- HasProbabilityCol,- HasRawPredictionCol,- HasRegParam,- HasStandardization,- HasThreshold,- HasThresholds,- HasTol,- HasWeightCol,- Identifiable,- Params,- PredictorParams,- ProbabilisticClassifierParams,- Serializable
- All Known Implementing Classes:
- LogisticRegression,- LogisticRegressionModel
- 
Method SummaryModifier and TypeMethodDescriptionvoidIfthresholdandthresholdsare both set, ensures they are consistent.family()Param for the name of family which is a description of the label distribution to be used in the model.doubleGet threshold for binary classification.double[]Get thresholds for binary or multiclass classification.The lower bounds on coefficients if fitting under bound constrained optimization.The lower bounds on intercepts if fitting under bound constrained optimization.setThreshold(double value) Set threshold in binary classification, in range [0, 1].setThresholds(double[] value) Set thresholds in multiclass (or binary) classification to adjust the probability of predicting each class.The upper bounds on coefficients if fitting under bound constrained optimization.The upper bounds on intercepts if fitting under bound constrained optimization.booleanvalidateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType) Validates and transforms the input schema with the provided param map.Methods inherited from interface org.apache.spark.ml.param.shared.HasAggregationDepthaggregationDepth, getAggregationDepthMethods inherited from interface org.apache.spark.ml.param.shared.HasElasticNetParamelasticNetParam, getElasticNetParamMethods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesColfeaturesCol, getFeaturesColMethods inherited from interface org.apache.spark.ml.param.shared.HasFitInterceptfitIntercept, getFitInterceptMethods inherited from interface org.apache.spark.ml.param.shared.HasLabelColgetLabelCol, labelColMethods inherited from interface org.apache.spark.ml.param.shared.HasMaxBlockSizeInMBgetMaxBlockSizeInMB, maxBlockSizeInMBMethods inherited from interface org.apache.spark.ml.param.shared.HasMaxItergetMaxIter, maxIterMethods inherited from interface org.apache.spark.ml.param.shared.HasPredictionColgetPredictionCol, predictionColMethods inherited from interface org.apache.spark.ml.param.shared.HasProbabilityColgetProbabilityCol, probabilityColMethods inherited from interface org.apache.spark.ml.param.shared.HasRawPredictionColgetRawPredictionCol, rawPredictionColMethods inherited from interface org.apache.spark.ml.param.shared.HasRegParamgetRegParam, regParamMethods inherited from interface org.apache.spark.ml.param.shared.HasStandardizationgetStandardization, standardizationMethods inherited from interface org.apache.spark.ml.param.shared.HasThresholdthresholdMethods inherited from interface org.apache.spark.ml.param.shared.HasThresholdsthresholdsMethods inherited from interface org.apache.spark.ml.param.shared.HasWeightColgetWeightCol, weightColMethods inherited from interface org.apache.spark.ml.util.IdentifiabletoString, uidMethods inherited from interface org.apache.spark.ml.param.Paramsclear, copy, copyValues, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
- 
Method Details- 
checkThresholdConsistencyvoid checkThresholdConsistency()Ifthresholdandthresholdsare both set, ensures they are consistent.- Throws:
- IllegalArgumentException- if- thresholdand- thresholdsare not equivalent
 
- 
familyParam for the name of family which is a description of the label distribution to be used in the model. Supported options: - "auto": Automatically select the family based on the number of classes: If numClasses == 1 || numClasses == 2, set to "binomial". Else, set to "multinomial" - "binomial": Binary logistic regression with pivoting. - "multinomial": Multinomial logistic (softmax) regression without pivoting. Default is "auto".- Returns:
- (undocumented)
 
- 
getFamilyString getFamily()
- 
getLowerBoundsOnCoefficientsMatrix getLowerBoundsOnCoefficients()
- 
getLowerBoundsOnInterceptsVector getLowerBoundsOnIntercepts()
- 
getThresholddouble getThreshold()Get threshold for binary classification.If thresholdsis set with length 2 (i.e., binary classification), this returns the equivalent threshold:
 . 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.1 / (1 + thresholds(0) / thresholds(1))- Specified by:
- getThresholdin interface- HasThreshold
- Returns:
- (undocumented)
 
- 
getThresholdsdouble[] getThresholds()Get thresholds for binary or multiclass classification.If thresholdsis set, return its value. Otherwise, ifthresholdis set, return the equivalent thresholds for binary classification: (1-threshold, threshold). If neither are set, throw an exception.- Specified by:
- getThresholdsin interface- HasThresholds
- Returns:
- (undocumented)
 
- 
getUpperBoundsOnCoefficientsMatrix getUpperBoundsOnCoefficients()
- 
getUpperBoundsOnInterceptsVector getUpperBoundsOnIntercepts()
- 
lowerBoundsOnCoefficientsThe lower bounds on coefficients if fitting under bound constrained optimization. The bound matrix must be compatible with the shape (1, number of features) for binomial regression, or (number of classes, number of features) for multinomial regression. Otherwise, it throws exception. Default is none.- Returns:
- (undocumented)
 
- 
lowerBoundsOnInterceptsThe lower bounds on intercepts if fitting under bound constrained optimization. The bounds vector size must be equal to 1 for binomial regression, or the number of classes for multinomial regression. Otherwise, it throws exception. Default is none.- Returns:
- (undocumented)
 
- 
setThresholdSet threshold in binary classification, in range [0, 1].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)). WhensetThreshold()is called, any user-set value forthresholdswill be cleared. If boththresholdandthresholdsare set in a ParamMap, then they must be equivalent.Default is 0.5. - Parameters:
- value- (undocumented)
- Returns:
- (undocumented)
 
- 
setThresholdsSet thresholds in multiclass (or binary) classification to adjust the probability of predicting each class. Array must have length equal to the number of classes, with values greater than 0, excepting that at most one value may be 0. The class with largest value p/t is predicted, where p is the original probability of that class and t is the class's threshold.Note: When setThresholds()is called, any user-set value forthresholdwill be cleared. If boththresholdandthresholdsare set in a ParamMap, then they must be equivalent.- Parameters:
- value- (undocumented)
- Returns:
- (undocumented)
 
- 
upperBoundsOnCoefficientsThe upper bounds on coefficients if fitting under bound constrained optimization. The bound matrix must be compatible with the shape (1, number of features) for binomial regression, or (number of classes, number of features) for multinomial regression. Otherwise, it throws exception. Default is none.- Returns:
- (undocumented)
 
- 
upperBoundsOnInterceptsThe upper bounds on intercepts if fitting under bound constrained optimization. The bound vector size must be equal to 1 for binomial regression, or the number of classes for multinomial regression. Otherwise, it throws exception. Default is none.- Returns:
- (undocumented)
 
- 
usingBoundConstrainedOptimizationboolean usingBoundConstrainedOptimization()
- 
validateAndTransformSchemaStructType validateAndTransformSchema(StructType schema, boolean fitting, DataType featuresDataType) Description copied from interface:PredictorParamsValidates and transforms the input schema with the provided param map.- Specified by:
- validateAndTransformSchemain interface- ClassifierParams
- Specified by:
- validateAndTransformSchemain interface- PredictorParams
- Specified by:
- validateAndTransformSchemain interface- ProbabilisticClassifierParams
- Parameters:
- schema- input schema
- fitting- whether this is in fitting
- featuresDataType- SQL DataType for FeaturesType. E.g.,- VectorUDTfor vector features.
- Returns:
- output schema
 
 
-