# 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.

## Configuration

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

modelFileUrl
Url

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:

• For a classifier in regression mode, the name is score and it gives the output of the regression.
• For a classifier in boolean mode, the name is score and it gives the classifier's score. Depending on the classifier type, this could have any range, but normally the higher the score, the more likely the "true" response. A probabilizer.train procedure type can be used to transform the output into a probability.
• For a classifier in categorical mode, the name is scores and it outputs a row of values with one column for each category, the value of which is the score the classifier has assigned to that category. Again, the higher the score, the more likely that the category is true, and a probabilizer.train procedure type can be used.

## Status

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

• /status: overview of the trained model
• /details: parameters of the trained model, such as weights