Skip to main content

evalMLMethod

Prediction using fitted regression models uses evalMLMethod function. See link in linearRegression.

stochasticLinearRegression

The stochasticLinearRegression aggregate function implements stochastic gradient descent method using linear model and MSE loss function. Uses evalMLMethod to predict on new data.

stochasticLogisticRegression

The stochasticLogisticRegression aggregate function implements stochastic gradient descent method for binary classification problem. Uses evalMLMethod 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 a Dictionary 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.
Syntax
Arguments
  • vec — Vector to assign. Its dimension must match the dimension of the centroids. Widths other than Float32 are converted to Float32, which is what the scoring kernel uses. Array(Float32) or Array(Float64) or Array(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 a Dictionary with an attribute cid of an unsigned integer type that fits UInt32 and an attribute vec of type Array(Float32), the id then being cid. The dictionary is read once and cached until it reloads. Array(Array(Float32)) or Array(Array(Float64)) or Array(Array(BFloat16)) or String
Returned value The nearest centroid id. UInt32 Examples Inline centroids
Query
Response

evalMLMethod

Introduced in: v20.1.0 Applies a trained machine learning model to input features to generate predictions. Syntax
Arguments Returned value Returns the predicted value based on the trained model. Float64 Examples Example usage
Query
Response

naiveBayesClassifier

Introduced in: v25.11.0 Classifies input text using a NAIVE_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.
Syntax
Arguments
  • dictionary_name — Name of a dictionary with the NAIVE_BAYES layout. String
  • input_text — Text to classify. String
Returned value Predicted class ID. UInt32 Examples Classify text
Query
Response

naiveBayesClassifierWithAllProbs

Introduced in: v26.7.0 Classifies input text using a NAIVE_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.
Syntax
Arguments
  • dictionary_name — Name of a dictionary with the NAIVE_BAYES layout. String
  • input_text — Text to classify. String
Returned value Array of (class_id, probability) tuples ordered from most to least probable. Array(Tuple(UInt32, Float64)) Examples All class probabilities
Query
Response

naiveBayesClassifierWithProb

Introduced in: v26.7.0 Classifies input text using a NAIVE_BAYES dictionary and returns the predicted class with its probability.
This function is non-deterministic: it can return different results for the same arguments.
Syntax
Arguments
  • dictionary_name — Name of a dictionary with the NAIVE_BAYES layout. String
  • input_text — Text to classify. String
Returned value Tuple of (class_id, probability). Tuple(UInt32, Float64) Examples Classify with probability
Query
Response

predictXGBoost

Introduced in: v26.10.0 Predicts a numeric target for a feature vector using an XGBOOST 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
Arguments
  • 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. String
  • featureN — 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* or Float* or Nullable((U)Int*) or Nullable(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)
Returned value The model prediction as Float64, one per row. Float64 Examples Predict
Query
Response
Predict with parameters
Query
Response