Prediction API
Dynamic Imputing of Missing Value for Predictions
Real world data often times contains missing values. While these missing values are handled gracefully by some machine learning algorithms, others, require all values to be present in order to generate a prediction. For the latter SymetryML can impute the missing values in one of the following ways:
Replace the missing value by the average of its column. This is the default behaviour.
Impute the missing attribute by building a separate model which will attempt to predict the missing attribute based on the the attributes that are available.
The second option is what we refer to as the Dynamic Imputer. The online nature of SymetryML enables these imputation models to be build on the fly as the prediction file is being processed. Enabling this functionality is as simple as specifying impute=true in the query parameter of the Predict APIs.
Sample Request/Response DS Predict
Sample Request/Response Predict
Prediction REST API Canonical URL
HTTP Responses
200
OK
Success.
400
BAD REQUEST
Invalid RTM ID. {"statusCode":"BAD_REQUEST","statusString":"Cannot Find SYMETRYML id[r2] for Customer id [c1]","values":{}}
500
INTERNAL SERVER ERROR
Invalid model ID. {"statusCode":"INTERNAL_SERVER_ERROR","statusString":"Generic Exception \u003cError no such model \u003cm3\u003e\u003e","values":{}}
HTTP Response Entity
Contain information about the prediction.
Sample Request Response
Model Prediction Map Keys
ECOD
res:1 or 0 (1 if ecodscore > chosen threshold score)
ecodscore: the anomaly score of the ECOD model
EVT
evt_is_anomaly: 1 or 0 (1 if score > threshold)
evt_threshold: value of threshold if EVT is one sided
evt_threshold_upper: value of the upper threshold if EVT is double sided
evt_threshold_lower: value of the lower threshold if EVT is double sided
Partial Least Square Regression
If OneQ is true q Else 1 … q predictions
Principal Component Regression
If pcr_type == full
return res. Otherwise, If OneQ is true return q Else 1 … q
LDA & MLDA
- res, 1 or 0 - resZ - z0 - z1GTz0 Examples: res :1 resZ :-1.66850 z0 :0.240482 z1GTz0 :true
LDA also return resU, which is similar to res but use a different threshold for when the positive and negative examples are unbalanced in the training data.
LSVM
- res, 1 or 0
LSVR
- res, the regression result
MLR
- res, the regression result
QDA
For each target in the model, a key,value pair is returned. The format of the key is ‘<attribute name>’. The value is the number computed by the model for that target. Example: Corn :12.0509 * *Sugarbeets :11.4417 * *Clover :11.7757 * *Soybeans :12.0040 Cotton :12.0634 The best scoring target is also returned in the ‘res’ key.
Bayes
res = 0 or 1. Prob = contains the likelihood of the result.
Markov Chains
next = contains the next state next.p = contains probability of the next state seq.like = contains the likelihood of the input sequence
Hidden Markov Model
seq = sequence of hidden states
Random Forest Classifier
-res, the class id with the highest probability. The probability for each classes is also returned. For a model with 3 classes their ids would be [0, 1, 2].
Kaplan Meier
Prediction is not defined for Kaplan Meier model. Predict should not be called on models of type KM.
Last updated