---
title: Machine Learning Model Functions
slug: nSSovgblboDy6aqau7LBY
description: Implement machine learning model functions in Ocient with OcientML for advanced predictive and analytical capabilities.
docTags: 
createdAt: Thu Jul 21 2022 17:05:13 GMT+0000 (Coordinated Universal Time)
updatedAt: Fri Apr 10 2026 19:58:37 GMT+0000 (Coordinated Universal Time)
---

OcientML™ functionality supports these SQL functions for machine learning models.

:::hint{type="info"}
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.&#x20;

:::hint{type="info"}
For functions to help organize data before training a model, see [Data Preparation](<./Machine Learning Model Functions/Data Preparation.md>).
:::

### Regression Models

- [Simple Linear Regression](<./Machine Learning Model Functions/Regression Models.md>)&#x20;
- [Multiple Linear Regression](<./Machine Learning Model Functions/Regression Models.md>)&#x20;
- [Vector Autoregression](<./Machine Learning Model Functions/Regression Models.md>)
- [Polynomial Regression](<./Machine Learning Model Functions/Regression Models.md>)
- [Linear Combination Regression](<./Machine Learning Model Functions/Regression Models.md>)&#x20;
- [Nonlinear Regression](<./Machine Learning Model Functions/Regression Models.md>)
- [Gradient Boosted Trees](<./Machine Learning Model Functions/Regression Models.md>)
- [Regression Tree](<./Machine Learning Model Functions/Regression Models.md>)

### Classification Models

- [K Nearest Neighbor Classification](<./Machine Learning Model Functions/Classification Models.md>)&#x20;
- [Naive Bayes Classification](<./Machine Learning Model Functions/Classification Models.md>)&#x20;
- [Decision Tree](<./Machine Learning Model Functions/Classification Models.md>)
- [Random Forest](<./Machine Learning Model Functions/Classification Models.md>)&#x20;
- [Logistic Regression](<./Machine Learning Model Functions/Classification Models.md>)&#x20;
- [Support Vector Machine](<./Machine Learning Model Functions/Classification Models.md>)
- [Gradient Boosted Trees](<./Machine Learning Model Functions/Classification Models.md>)&#x20;

### Clustering and Dimension Reduction Models

- [Principal Component Analysis](<./Machine Learning Model Functions/Clustering and Dimension Reduction Models.md>)
- [K-Means Clustering](<./Machine Learning Model Functions/Clustering and Dimension Reduction Models.md>)
- [Gaussian Mixture](<./Machine Learning Model Functions/Clustering and Dimension Reduction Models.md>)
- [Linear Discriminant Analysis](<./Machine Learning Model Functions/Clustering and Dimension Reduction Models.md>)

### Ensemble Models

- [Bagging](<./Machine Learning Model Functions/Ensemble Models.md>)&#x20;
- [Boosting](<./Machine Learning Model Functions/Ensemble Models.md>)&#x20;
- [Stacking](<./Machine Learning Model Functions/Ensemble Models.md>)&#x20;

### Other Models

- [Association Rules](<./Machine Learning Model Functions/Other Models.md>)
- [Feedforward Neural Network](<./Machine Learning Model Functions/Other Models.md>)&#x20;

For a view of the full list of model options, see [Machine Learning Model Options](<./Machine Learning Model Functions/Machine Learning Model Options.md>).

# Execute a Query Using a Machine Learning Model

To create a machine learning model and manage the model, see [Machine Learning Models](<./Data Definition Language _DDL_ Statement Reference/Machine Learning Models.md>) for the corresponding syntax. After you create the model, you can execute a query using the model with this syntax.

**Syntax**

```sql
SELECT model_name ( expression [, ... ] ) FROM table_reference
```

| **Parameter**     | **Data Type**                             | **Description**                                                                                                                                                                                                                                                                                                                                   |
| ----------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model_name`      | identifier                                | The name of a machine learning model created using a `CREATE MODEL` SQL statement. The model name must be a valid identifier and reference an existing trained model.                                                                                                                                                                             |
| `expression`      | identifier<br />string<br />numeric<br /> | One or more expressions that serve as input features for the machine learning model evaluation. These expressions must match the expected input schema the model was trained on. <br /><br />Expressions can be any combination of literal values, column names, arithmetic expressions, and function invocations, with parentheses for grouping. |
| `table_reference` | identifier                                | The name of a table, view, or subquery that provides the data for model evaluation. The table must contain columns or computed expressions that match the expected input features of the model.                                                                                                                                                   |

**Example**

Create a table with data for the model.

```sql
CREATE TABLE mldemo.mlr AS (SELECT a.c1 AS x1, b.c1 AS x2, 1 + 2*a.c1 + 3*b.c1 AS y 
    FROM sys.dummy10 a, sys.dummy10 b);
Modified 100 rows
```

Create a multiple linear regression model based on the data.

```sql
CREATE MLMODEL mlr_model TYPE MULTIPLE LINEAR REGRESSION ON (SELECT * FROM mldemo.mlr) 
options('metrics' -> 'true');
Modified 0 rows
```

Execute a `SELECT` query against the multiple linear regression to see the actual and predicted values. Limit the result set to 10 rows.

```sql
SELECT x1, x2, y AS actual, mlr_model(x1, x2) AS predicted 
    FROM mldemo.mlr 
    LIMIT 10;
```

*Output*

```none
x1         x2         actual              predicted
----------------------------------------------------------------
6          1          16                  15.999999999999975
6          2          19                  18.999999999999975
6          3          22                  21.999999999999975
6          4          25                  24.999999999999975
6          5          28                  27.999999999999975
6          6          31                  30.999999999999975
6          7          34                  33.99999999999997
6          8          37                  36.99999999999997
6          9          40                  39.99999999999997
6          10         43                  42.99999999999997

Fetched 10 rows
```

# Related Links

[Machine Learning in Ocient](<././Analysis in Ocient/Machine Learning in Ocient.md>)&#x20;

[Machine Learning Models](<./Data Definition Language _DDL_ Statement Reference/Machine Learning Models.md>)&#x20;

