The scope of a machine learning model is the schema.
Supported Machine Learning Models
Supported machine learning models and reference material are divided into these categories.For functions to help organize data before training a model, see Data Preparation.
Regression Models
- Simple Linear Regression
- Multiple Linear Regression
- Vector Autoregression
- Polynomial Regression
- Linear Combination Regression
- Nonlinear Regression
- Gradient Boosted Trees
- Regression Tree
Classification Models
- K Nearest Neighbor Classification
- Naive Bayes Classification
- Decision Tree
- Random Forest
- Logistic Regression
- Support Vector Machine
- Gradient Boosted Trees
Clustering and Dimension Reduction Models
Ensemble Models
Other Models
For a view of the full list of model options, see Machine Learning Model Options.Execute a Query Using a Machine Learning Model
To create a machine learning model and manage the model, see Machine Learning Models for the corresponding syntax. After you create the model, you can execute a query using the model with this syntax. SyntaxSQL
Example
Create a table with data for the model.
SQL
SQL
SELECT query against the multiple linear regression to see the actual and predicted values. Limit the result set to 10 rows.
SQL
Text
Machine Learning Meta Functions
Machine Learning meta functions provide additional ways to invoke a trained model. Unlike calling a model directly by name, meta functions wrap the model invocation and control how the model produces its output.predict
Thepredict meta function behaves the same as invoking the model directly as a function. The function returns the value predicted by the specified model for the input features.
Syntax
SQL
Example
SQL
SQL
predict_probabilities
Thepredict_probabilities meta function returns a tuple of label-score pairs for each possible class the model can predict. The model assigns each label a score determined by the input features. Then, the model sorts the pairs in decreasing order of score, with ties broken by decreasing label value.
This function is supported only for these model types:
- Decision Tree
- Random Forest
- Logistic Regression
- Support Vector Machine
- Gaussian Discriminant Analysis
- Gaussian Mixture Model
- MLP (only when trained with softmax output for classification)
predict_probabilities function, including all regression variants, Naive Bayes, Linear Discriminant Analysis, Principal Component Analysis, ensemble models (Bagging, Stacking), K-Means, Power Iteration Clustering, K Nearest Neighbors, and anomaly detection models. Undersampling models do not support either meta function because they produce output tables rather than row-level predictions.
Syntax
SQL
Example
SQL

