org.apache.spark.mllib.classification
Constructs a LogisticRegressionModel with weights and intercept for binary classification.
Constructs a LogisticRegressionModel with weights and intercept for binary classification.
Weights computed for every feature.
Intercept computed for this model. (Only used in Binary Logistic Regression. In Multinomial Logistic Regression, the intercepts will not be a single value, so the intercepts will be part of the weights.)
the dimension of the features.
the number of possible outcomes for k classes classification problem in Multinomial Logistic Regression. By default, it is binary logistic regression so numClasses will be set to 2.
Clears the threshold so that predict
will output raw prediction scores.
Clears the threshold so that predict
will output raw prediction scores.
It is only used for binary classification.
Current version of model save/load format.
Current version of model save/load format.
Returns the threshold (if any) used for converting raw prediction scores into 0/1 predictions.
Returns the threshold (if any) used for converting raw prediction scores into 0/1 predictions. It is only used for binary classification.
Intercept computed for this model.
Intercept computed for this model. (Only used in Binary Logistic Regression. In Multinomial Logistic Regression, the intercepts will not be a single value, so the intercepts will be part of the weights.)
the number of possible outcomes for k classes classification problem in Multinomial Logistic Regression.
the number of possible outcomes for k classes classification problem in Multinomial Logistic Regression. By default, it is binary logistic regression so numClasses will be set to 2.
the dimension of the features.
the dimension of the features.
Predict values for examples stored in a JavaRDD.
Predict values for examples stored in a JavaRDD.
JavaRDD representing data points to be predicted
a JavaRDD[java.lang.Double] where each entry contains the corresponding prediction
Predict values for a single data point using the model trained.
Predict values for a single data point using the model trained.
array representing a single data point
Double prediction from the trained model
Predict values for the given data set using the model trained.
Predict values for the given data set using the model trained.
RDD representing data points to be predicted
RDD[Double] where each entry contains the corresponding prediction
Predict the result given a data point and the weights learned.
Predict the result given a data point and the weights learned.
Row vector containing the features for this data point
Column vector containing the weights of the model
Intercept of the model.
Save this model to the given path.
Save this model to the given path.
This saves:
The model may be loaded using Loader.load
.
Spark context used to save model data.
Path specifying the directory in which to save this model. If the directory already exists, this method throws an exception.
Sets the threshold that separates positive predictions from negative predictions in Binary Logistic Regression.
Sets the threshold that separates positive predictions from negative predictions in Binary Logistic Regression. An example with prediction score greater than or equal to this threshold is identified as a positive, and negative otherwise. The default value is 0.5. It is only used for binary classification.
Export the model to a String in PMML format
Export the model to a String in PMML format
Export the model to the OutputStream in PMML format
Export the model to the OutputStream in PMML format
Export the model to a directory on a distributed file system in PMML format
Export the model to a directory on a distributed file system in PMML format
Export the model to a local file in PMML format
Export the model to a local file in PMML format
Print a summary of the model.
Print a summary of the model.
Weights computed for every feature.
Weights computed for every feature.
Classification model trained using Multinomial/Binary Logistic Regression.