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 APItype
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 typeNot all three of these fields are required in all contexts:
id
and type
must be specified
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)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)
type
is specified without id
, an id will be auto-generatedtype
is specified with id
, the function will be created with the specified id
unless a function already exists with that idtype
is specified, then a corresponding params
function must be specified if the type requires itThe following types of functions are available:
Type | Description | Doc |
---|---|---|
classifier | Apply a trained classifier to new data | [doc] |
classifier.explain | Explain the output of a classifier | [doc] |
embedding.neighbors | Return the nearest neighbors of a known row in an embedding dataset | [doc] |
feature_hasher | Feature hashing feature generator | [doc] |
fetcher | Fetches the contents of a URL each time it's invoked | [doc] |
http.useragent | Parse user agent strings into their components | [doc] |
image.proximatevoxels | Find values in a cubic volume inside a 3d embedding | [doc] |
image.readpixels | Wraps access to a 2d embedding | [doc] |
kmeans | Apply a k-means clustering to new data | [doc] |
mongodb.query | Takes a MongoDB query, forwards it to MongDB, parses the result and returns it as an MLDB result. | [doc] |
pooling | Apply a pooling function | [doc] |
probabilizer | Apply a probability calibration model | [doc] |
sql.expression | Run an SQL expression as a function | [doc] |
sql.query | Run a single row SQL query against a dataset | [doc] |
statsTable.bagOfWords.posneg | Get the pos/neg p(outcome) | [doc] |
statsTable.getCounts | Get stats table counts for a row of keys | [doc] |
stemmer | Apply a stemming algorithm column names | [doc] |
stemmerdoc | Apply a stemming algorithm on a single document | [doc] |
svd.embedRow | Apply a trained SVD to embed a row into a coordinate space | [doc] |
tensorflow.graph | Graph parameters for a trained TensorFlow model | [doc] |
tfidf | Apply a TF-IDF scoring to a bag of words | [doc] |
tokensplit | Insert spaces after tokens from a dictionary | [doc] |