# Function Configuration

A function configuration object is used to create or load a function.

It is a JSON object that looks like this:

{
"id": <id>,
"type": <type>,
"params": {
<params>
}
}

• id is a string that defines the URL at which the function will be available via the REST API
• type is a string that specified the function's type (see below)
• params is an object that configures the function, and whose contents will vary according to the type

Not all three of these fields are required in all contexts:

• one or both of id and type must be specified
• if only id is specified, MLDB will assume this is a pre-existing function and will try to load it (an error will ensue if it doesn't already exist)
• if type is specified, MLDB will assume that the function doesn't exist yet and will try to create it (an error will ensue if it already exists)
• if type is specified without id, an id will be auto-generated
• if type is specified with id, the function will be created with the specified id unless a function already exists with that id
• if type is specified, then a corresponding params function must be specified if the type requires it

The following types of functions are available:

TypeDescriptionDoc
classifierApply a trained classifier to new data[doc]
classifier.explainExplain the output of a classifier[doc]
embedding.neighborsReturn the nearest neighbors of a known row in an embedding dataset[doc]
feature_hasherFeature hashing feature generator[doc]
fetcherFetches the contents of a URL each time it's invoked[doc]
http.useragentParse user agent strings into their components[doc]
image.proximatevoxelsFind values in a cubic volume inside a 3d embedding[doc]
image.readpixelsWraps access to a 2d embedding[doc]
kmeansApply a k-means clustering to new data[doc]
mongodb.queryTakes a MongoDB query, forwards it to MongDB, parses the result and returns it as an MLDB result.[doc]
poolingApply a pooling function[doc]
probabilizerApply a probability calibration model[doc]
sql.expressionRun an SQL expression as a function[doc]
sql.queryRun a single row SQL query against a dataset[doc]
statsTable.bagOfWords.posnegGet the pos/neg p(outcome)[doc]
statsTable.getCountsGet stats table counts for a row of keys[doc]
stemmerApply a stemming algorithm column names[doc]
stemmerdocApply a stemming algorithm on a single document[doc]
svd.embedRowApply a trained SVD to embed a row into a coordinate space[doc]
tensorflow.graphGraph parameters for a trained TensorFlow model[doc]
tfidfApply a TF-IDF scoring to a bag of words[doc]
tokensplitInsert spaces after tokens from a dictionary[doc]