User-defined Functions are named, reusable programs used to implement streaming computations which can accept input values and return output values. Functions are used to:
Functions can be created directly via a REST API call or by passing a functionName
argument to most training Procedures.
Functions have a fixed set of input values and output values. Input and output values can be either scalar or variable-length row-like values. The input and output values are named so that it is easy to identify them. Also, this permits function's output values to be passed as another function's input values. This composition of functions can be done using the serial
function type.
All MLDB Functions are automatically accessible as REST Endpoints, which can be used to apply machine learning models in a streaming/real-time process. Functions can be applied via a REST API call like GET /v1/functions/<id>/application?input={<values>}
.
Functions support input values passed in as query string parameters or as a JSON payload. In both cases, the REST call must be a GET.
In MLDB SQL, Functions can be applied much like built-in functions: they accept a row as input and return a row as output.
Functions are created via a REST API call with one of the following types:
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] |