Classifier Apply Function

This function applies a classifier model previously trained by a classifier.train procedure type to a feature vector, producing a classification score.


A new function of type classifier named <id> can be created as follows:

mldb.put("/v1/functions/"+<id>, {
    "type": "classifier",
    "params": {
        "modelFileUrl": <Url>

with the following key-value definitions for params:

Field, Type, DefaultDescription


URL of the model file (with extension '.cls') to load. This file is created by the classifier.train procedure type.

Input and Output Values

Functions of this type have a single input value called features which is a row. The columns that are expected in this row depend on the features that were trained into the classifier. For example, if in the training the input was "select": "x,y", then the function will expect two columns called x and y.

These functions output a single value where the name depends on the classifier mode:


To allow introspection into a trained model, the following routes of a Classifier function will return status information:


See also