Class: LogisticRegressionModel

eclairjs/mllib/classification.LogisticRegressionModel

new LogisticRegressionModel(weights, intercept, numFeaturesopt, numClassesopt)

Classification model trained using Multinomial/Binary Logistic Regression.
Parameters:
Name Type Attributes Description
weights module:eclairjs/mllib/linalg.Vector Weights computed for every feature.
intercept float 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.)
numFeatures int <optional>
the dimension of the features.
numClasses int <optional>
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.
Source:

Extends

  • GeneralizedLinearModel

Methods

(static) load(sc, path) → {module:eclairjs/mllib/classification.LogisticRegressionModel}

Parameters:
Name Type Description
sc module:eclairjs.SparkContext
path string
Source:
Returns:
Type
module:eclairjs/mllib/classification.LogisticRegressionModel

clearThreshold() → {module:eclairjs/mllib/classification.LogisticRegressionModel}

Clears the threshold so that `predict` will output raw prediction scores. It is only used for binary classification.
Source:
Returns:
Type
module:eclairjs/mllib/classification.LogisticRegressionModel

getThreshold() → {number}

Returns the threshold (if any) used for converting raw prediction scores into 0/1 predictions. It is only used for binary classification.
Source:
Returns:
Type
number

save(sc, path) → {Promise.<Void>}

Parameters:
Name Type Description
sc module:eclairjs.SparkContext
path string
Source:
Returns:
A Promise that resolves to nothing.
Type
Promise.<Void>

setThreshold(threshold)

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 an positive, and negative otherwise. The default value is 0.5. It is only used for binary classification.
Parameters:
Name Type Description
threshold number
Source:
Returns:

weights() → {Promise.<Vector>}

Source:
Returns:
Type
Promise.<Vector>