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. |
Extends
Methods
(static) load(sc, path) → {module:eclairjs/mllib/classification.LogisticRegressionModel}
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | |
path |
string |
Returns:
clearThreshold() → {module:eclairjs/mllib/classification.LogisticRegressionModel}
Clears the threshold so that `predict` will output raw prediction scores.
It is only used for binary classification.
Returns:
getThreshold() → {number}
Returns the threshold (if any) used for converting raw prediction scores into 0/1 predictions.
It is only used for binary classification.
Returns:
- Type
- number
predict(testData) → {float}
Predict values for a single data point using the model trained.
Parameters:
Name | Type | Description |
---|---|---|
testData |
module:eclairjs/mllib/linalg.Vector |
- Inherited From:
- Source:
Returns:
- Type
- float
save(sc, path)
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | |
path |
string |
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 |