class staticanalytics. ThresholdModel
Source: analyticsdoc.
The Threshold model. Uses the methods from the module:analytics.metrics.
Methods
new ThresholdModel([arg])
Threshold Model
Example
// TODO
Parameters
Name | Type | Optional | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg |
Object |
Yes |
The constructor parameters. Values in
|
Methods
decisionFunction(x) → (number or module:la.Vector)
Apply all models to the given vector and returns the distance to the class boundary.
Example
// TODO
Parameter
Name | Type | Optional | Description |
---|---|---|---|
x |
(number or module:la.Vector) |
|
The prediction score for each class. |
- Returns
-
(number or module:la.Vector)
1. value of the translated prediction based on the threshold, ifx
isnumber
,
2. module:la.Vector of translated prediction based on the threshold, ifx
is module:la.Vector.
fit(X, y)
Fits the model.
Example
// TODO
Parameters
Name | Type | Optional | Description |
---|---|---|---|
X |
|
Prediction for each instance (output of descisionFunction). |
|
y |
number |
|
The target labels (1 or -1). |
predict(x) → (number or module:la.Vector)
Returns the most likely category.
Example
// TODO
Parameter
Name | Type | Optional | Description |
---|---|---|---|
x |
(number or module:la.Vector) |
|
The prediction score for each class. |
- Returns
-
(number or module:la.Vector)
1. value of the positive label IDs, ifx
isnumber
,
2. module:la.Vector of the positive label IDs, ifx
is module:la.Vector.