Machine Learning Models
OcientML™ functionality enables you to create a machine learning model, rename the model, export the syntax for the model creation, retrain the model, execute a query against the model, and drop the model.
CREATE MLMODEL
Train a new machine learning model of type <model type> on the result set returned by the SQL SELECT statement. After the database creates the model, <model name> becomes a callable function in SQL SELECT statements.
Syntax
model_name
model_type
These models are supported. You can find full descriptions of each model in Regression Models, Classification Models, Clustering and Dimension Reduction Models, or Other Models.
SIMPLE LINEAR REGRESSIONMULTIPLE LINEAR REGRESSIONPOLYNOMIAL REGRESSIONLINEAR COMBINATION REGRESSIONVECTOR AUTOREGRESSIONKMEANSKNN (K Nearest Neighbors)LOGISTIC REGRESSIONNAIVE BAYESNONLINEAR REGRESSIONFEEDFORWARD NETWORKPRINCIPAL COMPONENT ANALYSISLINEAR DISCRIMINANT ANALYSISSUPPORT VECTOR MACHINEDECISION TREEGAUSSIAN MIXTURE MODELASSOCIATION RULESGRADIENT BOOSTED TREESREGRESSION TREE
option_list
The SQL SELECT statement that serves as the basis for the model must return rows that fit the specified requirements of the model. For example, in multiple linear regression, the first N columns are the independent variables, and the last column is the dependent variable.
You cannot create a machine learning model with an existing schema and name combination.
Example
Assume you created the mldata table that contains the data for the model. Then, you can create the my_model machine learning model based on that data.
ALTER MLMODEL RENAME
Rename a machine learning model. Use the IF EXISTS clause to ignore any models that do not exist.
Required Privileges
To rename a view, you must have the ALTER MLMODEL privilege for the model.
The Ocient System requires these privileges if this statement includes a change to the schema:
VIEWprivilege on the current schema of the modelVIEW MLMODELandCREATE MLMODELprivileges on the target schema (if the schema already exists)CREATE MLMODELprivilege on the database (if the schema does not exist)
Syntax
Example
DROP MLMODEL
Drop a machine learning model. Use the IF EXISTS clause to ignore any models that do not exist.
Syntax
Example
Drop the machine learning model my_model.
Drop multiple machine learning models.
EXPORT MLMODEL
Return the SQL statement that can recreate the machine learning model.
Syntax
Example
Output
The output SQL statement includes the schema explicitly.
REFRESH MLMODEL
Retrain a machine learning model without changing any model options.
Syntax
Example
Related Links
Machine Learning Model Functions

