evalMLMethod
Prediction using fitted regression models usesevalMLMethod function. See link in linearRegression.
stochasticLinearRegression
The stochasticLinearRegression aggregate function implements stochastic gradient descent method using linear model and MSE loss function. UsesevalMLMethod to predict on new data.
stochasticLogisticRegression
The stochasticLogisticRegression aggregate function implements stochastic gradient descent method for binary classification problem. UsesevalMLMethod to predict on new data.
assignCentroid
Introduced in: v26.8.0 Returns the id of the nearest (L2) centroid to a vector. The centroids are given as a constant array of float arrays, where the id is the 0-based position in that array, or as the name of aDictionary holding the attributes cid and vec, where the id is cid.
This function is non-deterministic: it can return different results for the same arguments.
vec— Vector to assign. Its dimension must match the dimension of the centroids. Widths other thanFloat32are converted toFloat32, which is what the scoring kernel uses.Array(Float32)orArray(Float64)orArray(BFloat16)centroids— The centroids to score against, which must be constant. Given as an array of equally sized, non-empty float arrays, the id then being the 0-based position in that array; or as the name of aDictionarywith an attributecidof an unsigned integer type that fitsUInt32and an attributevecof typeArray(Float32), the id then beingcid. The dictionary is read once and cached until it reloads.Array(Array(Float32))orArray(Array(Float64))orArray(Array(BFloat16))orString
UInt32
Examples
Inline centroids
Query
Response
evalMLMethod
Introduced in: v20.1.0 Applies a trained machine learning model to input features to generate predictions. Syntaxmodel— The trained machine learning model.AggregateFunctionStatex1, x2, ...— Feature values for prediction.Float*or(U)Int*
Float64
Examples
Example usage
Query
Response
naiveBayesClassifier
Introduced in: v25.11.0 Classifies input text using aNAIVE_BAYES dictionary. Returns the same predicted class value as dictGet(dictionary_name, class_attribute, input_text), where class_attribute is the name of the class label attribute configured in the dictionary’s layout. Unlike dictGet, the result type is always UInt32 rather than the declared type of the class attribute, and input_text must be a String (no key type conversion is applied).
This function is non-deterministic: it can return different results for the same arguments.
dictionary_name— Name of a dictionary with the NAIVE_BAYES layout.Stringinput_text— Text to classify.String
UInt32
Examples
Classify text
Query
Response
naiveBayesClassifierWithAllProbs
Introduced in: v26.7.0 Classifies input text using aNAIVE_BAYES dictionary and returns all classes with their probabilities, ordered from most to least probable.
This function is non-deterministic: it can return different results for the same arguments.
dictionary_name— Name of a dictionary with the NAIVE_BAYES layout.Stringinput_text— Text to classify.String
Array(Tuple(UInt32, Float64))
Examples
All class probabilities
Query
Response
naiveBayesClassifierWithProb
Introduced in: v26.7.0 Classifies input text using aNAIVE_BAYES dictionary and returns the predicted class with its probability.
This function is non-deterministic: it can return different results for the same arguments.
dictionary_name— Name of a dictionary with the NAIVE_BAYES layout.Stringinput_text— Text to classify.String
Tuple(UInt32, Float64)
Examples
Classify with probability
Query
Response
predictXGBoost
Introduced in: v26.10.0 Predicts a numeric target for a feature vector using anXGBOOST dictionary. Features are passed positionally, in the order the dictionary’s key columns were declared. This is the only way to query an XGBOOST dictionary: it holds a trained model rather than rows, so the generic dictionary interface (dictGet, dictHas, SELECT * FROM dict) is not supported. The XGBoost integration is experimental, so the enable_xgboost setting must be enabled.
Syntax
dictionary_name— Name of a dictionary with the XGBOOST layout. See the XGBOOST dictionary layout for how to create it and the training parameters it accepts.StringfeatureN— Numeric feature values, positionally in the dictionary’s key order. A NULL feature is passed to the model as a missing value, which XGBoost handles the way it was trained to, so the prediction is never NULL.(U)Int*orFloat*orNullable((U)Int*)orNullable(Float*)params— Optional constant Map of XGBoost prediction parameters, from parameter name to an integer value, e.g.map('type', 0, 'iteration_end', 0). Every accepted parameter is an integer or a boolean, so fractional values are rejected. See prediction parameters for the accepted keys.Map(String, (U)Int8/16/32/64)
Float64
Examples
Predict
Query
Response
Query
Response