org.apache.spark.ml.classification

LogisticRegressionModel

class LogisticRegressionModel extends ProbabilisticClassificationModel[Vector, LogisticRegressionModel] with LogisticRegressionParams

:: AlphaComponent ::

Model produced by LogisticRegression.

Annotations
@AlphaComponent()
Linear Supertypes
LogisticRegressionParams, HasThreshold, HasMaxIter, HasRegParam, ProbabilisticClassificationModel[Vector, LogisticRegressionModel], ProbabilisticClassifierParams, HasProbabilityCol, ClassificationModel[Vector, LogisticRegressionModel], ClassifierParams, HasRawPredictionCol, PredictionModel[Vector, LogisticRegressionModel], PredictorParams, HasPredictionCol, HasFeaturesCol, HasLabelCol, Model[LogisticRegressionModel], Transformer, Params, Identifiable, PipelineStage, Logging, Serializable, Serializable, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By inheritance
Inherited
  1. LogisticRegressionModel
  2. LogisticRegressionParams
  3. HasThreshold
  4. HasMaxIter
  5. HasRegParam
  6. ProbabilisticClassificationModel
  7. ProbabilisticClassifierParams
  8. HasProbabilityCol
  9. ClassificationModel
  10. ClassifierParams
  11. HasRawPredictionCol
  12. PredictionModel
  13. PredictorParams
  14. HasPredictionCol
  15. HasFeaturesCol
  16. HasLabelCol
  17. Model
  18. Transformer
  19. Params
  20. Identifiable
  21. PipelineStage
  22. Logging
  23. Serializable
  24. Serializable
  25. AnyRef
  26. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def addOutputColumn(schema: StructType, colName: String, dataType: DataType): StructType

    Attributes
    protected
    Definition Classes
    Params
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def checkInputColumn(schema: StructType, colName: String, dataType: DataType): Unit

    Check whether the given schema contains an input column.

    Check whether the given schema contains an input column.

    colName

    Parameter name for the input column.

    dataType

    SQL DataType of the input column.

    Attributes
    protected
    Definition Classes
    Params
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def copy(): LogisticRegressionModel

    Create a copy of the model.

    Create a copy of the model. The copy is shallow, except for the embedded paramMap, which gets a deep copy.

    Attributes
    protected
    Definition Classes
    LogisticRegressionModel → PredictionModel
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def explainParams(): String

    Returns the documentation of all params.

    Returns the documentation of all params.

    Definition Classes
    Params
  14. val featuresCol: Param[String]

    param for features column name

    param for features column name

    Definition Classes
    HasFeaturesCol
  15. def featuresDataType: DataType

    :: DeveloperApi ::

    :: DeveloperApi ::

    Returns the SQL DataType corresponding to the FeaturesType type parameter.

    This is used by validateAndTransformSchema(). This workaround is needed since SQL has different APIs for Scala and Java.

    The default value is VectorUDT, but it may be overridden if FeaturesType is not Vector.

    Attributes
    protected
    Definition Classes
    PredictionModel
    Annotations
    @DeveloperApi()
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. val fittingParamMap: ParamMap

    Fitting parameters, such that parent.

    Fitting parameters, such that parent.fit(..., fittingParamMap) could reproduce the model.

    Definition Classes
    LogisticRegressionModelModel
  18. def get[T](param: Param[T]): T

    Gets the value of a parameter in the embedded param map.

    Gets the value of a parameter in the embedded param map.

    Attributes
    protected
    Definition Classes
    Params
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def getFeaturesCol: String

    Definition Classes
    HasFeaturesCol
  21. def getLabelCol: String

    Definition Classes
    HasLabelCol
  22. def getMaxIter: Int

    Definition Classes
    HasMaxIter
  23. def getPredictionCol: String

    Definition Classes
    HasPredictionCol
  24. def getProbabilityCol: String

    Definition Classes
    HasProbabilityCol
  25. def getRawPredictionCol: String

    Definition Classes
    HasRawPredictionCol
  26. def getRegParam: Double

    Definition Classes
    HasRegParam
  27. def getThreshold: Double

    Definition Classes
    HasThreshold
  28. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  29. val intercept: Double

  30. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  31. def isSet(param: Param[_]): Boolean

    Checks whether a param is explicitly set.

    Checks whether a param is explicitly set.

    Definition Classes
    Params
  32. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  33. val labelCol: Param[String]

    param for label column name

    param for label column name

    Definition Classes
    HasLabelCol
  34. def log: Logger

    Attributes
    protected
    Definition Classes
    Logging
  35. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  36. def logDebug(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  37. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  38. def logError(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  39. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  40. def logInfo(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  41. def logName: String

    Attributes
    protected
    Definition Classes
    Logging
  42. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  43. def logTrace(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  44. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  45. def logWarning(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  46. val maxIter: IntParam

    param for max number of iterations

    param for max number of iterations

    Definition Classes
    HasMaxIter
  47. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  48. final def notify(): Unit

    Definition Classes
    AnyRef
  49. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  50. val numClasses: Int

    Number of classes (values which the label can take).

    Number of classes (values which the label can take).

    Definition Classes
    LogisticRegressionModel → ClassificationModel
  51. val paramMap: ParamMap

    Internal param map.

    Internal param map.

    Attributes
    protected
    Definition Classes
    Params
  52. def params: Array[Param[_]]

    Returns all params.

    Returns all params.

    Definition Classes
    Params
  53. val parent: LogisticRegression

    The parent estimator that produced this model.

    The parent estimator that produced this model.

    Definition Classes
    LogisticRegressionModelModel
  54. def predict(features: Vector): Double

    Predict label for the given feature vector.

    Predict label for the given feature vector. The behavior of this can be adjusted using threshold.

    Attributes
    protected
    Definition Classes
    LogisticRegressionModel → ClassificationModel → PredictionModel
  55. def predictProbabilities(features: Vector): Vector

    :: DeveloperApi ::

    :: DeveloperApi ::

    Predict the probability of each class given the features. These predictions are also called class conditional probabilities.

    WARNING: Not all models output well-calibrated probability estimates! These probabilities should be treated as confidences, not precise probabilities.

    This internal method is used to implement transform() and output probabilityCol.

    Attributes
    protected
    Definition Classes
    LogisticRegressionModel → ProbabilisticClassificationModel
  56. def predictRaw(features: Vector): Vector

    :: DeveloperApi ::

    :: DeveloperApi ::

    Raw prediction for each possible label. The meaning of a "raw" prediction may vary between algorithms, but it intuitively gives a measure of confidence in each possible label (where larger = more confident). This internal method is used to implement transform() and output rawPredictionCol.

    returns

    vector where element i is the raw prediction for label i. This raw prediction may be any real number, where a larger value indicates greater confidence for that label.

    Attributes
    protected
    Definition Classes
    LogisticRegressionModel → ClassificationModel
  57. val predictionCol: Param[String]

    param for prediction column name

    param for prediction column name

    Definition Classes
    HasPredictionCol
  58. val probabilityCol: Param[String]

    param for predicted class conditional probabilities column name

    param for predicted class conditional probabilities column name

    Definition Classes
    HasProbabilityCol
  59. val rawPredictionCol: Param[String]

    param for raw prediction column name

    param for raw prediction column name

    Definition Classes
    HasRawPredictionCol
  60. val regParam: DoubleParam

    param for regularization parameter

    param for regularization parameter

    Definition Classes
    HasRegParam
  61. def set[T](param: Param[T], value: T): LogisticRegressionModel.this.type

    Sets a parameter in the embedded param map.

    Sets a parameter in the embedded param map.

    Attributes
    protected
    Definition Classes
    Params
  62. def setFeaturesCol(value: String): LogisticRegressionModel

    Definition Classes
    PredictionModel
  63. def setPredictionCol(value: String): LogisticRegressionModel

    Definition Classes
    PredictionModel
  64. def setProbabilityCol(value: String): LogisticRegressionModel

    Definition Classes
    ProbabilisticClassificationModel
  65. def setRawPredictionCol(value: String): LogisticRegressionModel

    Definition Classes
    ClassificationModel
  66. def setThreshold(value: Double): LogisticRegressionModel.this.type

  67. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  68. val threshold: DoubleParam

    param for threshold in (binary) prediction

    param for threshold in (binary) prediction

    Definition Classes
    HasThreshold
  69. def toString(): String

    Definition Classes
    AnyRef → Any
  70. def transform(dataset: DataFrame, paramMap: ParamMap): DataFrame

    Transforms dataset by reading from featuresCol, and appending new columns as specified by parameters:

    Transforms dataset by reading from featuresCol, and appending new columns as specified by parameters:

    dataset

    input dataset

    paramMap

    additional parameters, overwrite embedded params

    returns

    transformed dataset

    Definition Classes
    LogisticRegressionModel → ProbabilisticClassificationModel → ClassificationModel → PredictionModel → Transformer
  71. def transform(dataset: DataFrame, paramPairs: ParamPair[_]*): DataFrame

    Transforms the dataset with optional parameters

    Transforms the dataset with optional parameters

    dataset

    input dataset

    paramPairs

    optional list of param pairs, overwrite embedded params

    returns

    transformed dataset

    Definition Classes
    Transformer
    Annotations
    @varargs()
  72. def transformSchema(schema: StructType, paramMap: ParamMap): StructType

    :: DeveloperAPI ::

    :: DeveloperAPI ::

    Derives the output schema from the input schema and parameters. The schema describes the columns and types of the data.

    schema

    Input schema to this stage

    paramMap

    Parameters passed to this stage

    returns

    Output schema from this stage

    Definition Classes
    PredictionModel → PipelineStage
  73. def transformSchema(schema: StructType, paramMap: ParamMap, logging: Boolean): StructType

    Derives the output schema from the input schema and parameters, optionally with logging.

    Derives the output schema from the input schema and parameters, optionally with logging.

    Attributes
    protected
    Definition Classes
    PipelineStage
  74. def validate(): Unit

    Validates parameter values stored internally.

    Validates parameter values stored internally. Raise an exception if any parameter value is invalid.

    Definition Classes
    Params
  75. def validate(paramMap: ParamMap): Unit

    Validates parameter values stored internally plus the input parameter map.

    Validates parameter values stored internally plus the input parameter map. Raises an exception if any parameter is invalid.

    Definition Classes
    Params
  76. def validateAndTransformSchema(schema: StructType, paramMap: ParamMap, fitting: Boolean, featuresDataType: DataType): StructType

    Validates and transforms the input schema with the provided param map.

    Validates and transforms the input schema with the provided param map.

    schema

    input schema

    paramMap

    additional parameters

    fitting

    whether this is in fitting

    featuresDataType

    SQL DataType for FeaturesType. E.g., org.apache.spark.mllib.linalg.VectorUDT for vector features.

    returns

    output schema

    Attributes
    protected
    Definition Classes
    ProbabilisticClassifierParams → ClassifierParams → PredictorParams
  77. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. val weights: Vector

Inherited from LogisticRegressionParams

Inherited from HasThreshold

Inherited from HasMaxIter

Inherited from HasRegParam

Inherited from ProbabilisticClassificationModel[Vector, LogisticRegressionModel]

Inherited from ProbabilisticClassifierParams

Inherited from HasProbabilityCol

Inherited from ClassificationModel[Vector, LogisticRegressionModel]

Inherited from ClassifierParams

Inherited from HasRawPredictionCol

Inherited from PredictionModel[Vector, LogisticRegressionModel]

Inherited from PredictorParams

Inherited from HasPredictionCol

Inherited from HasFeaturesCol

Inherited from HasLabelCol

Inherited from Model[LogisticRegressionModel]

Inherited from Transformer

Inherited from Params

Inherited from Identifiable

Inherited from PipelineStage

Inherited from Logging

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Parameters

A list of (hyper-)parameter keys this algorithm can take. Users can set and get the parameter values through setters and getters, respectively.

Members

Parameter setters

Parameter getters