SynapCores AutoML Guide
Build powerful machine learning models directly in SQL without writing any Python code.
Overview
SynapCores AutoML provides comprehensive options for creating machine learning experiments through SQL syntax. Train, tune, and deploy production-ready models using familiar database commands.
Task Types
| Task Type |
Description |
Default Metric |
regression |
Continuous value prediction |
R-squared (r2) |
binary_classification |
Two-class classification |
Accuracy (accuracy) |
classification/multiclass |
Two-class or multi-class classification, from the target |
Accuracy (accuracy) |
clustering |
Unsupervised grouping |
Silhouette score (silhouette) |
anomaly/anomaly_detection |
Anomaly detection |
Tail separation (tail_separation) |
time_series/forecasting |
Time series forecasting |
MAE (mae) |
Creating AutoML Experiments
Basic Syntax
CREATE EXPERIMENT <experiment_name> AS
<SELECT_query>
WITH (<options>)
The SELECT supplies the training rows (with the target column for supervised tasks), and WITH sets the options below.
Configuration Options
General Options
| Option |
Type |
Default |
Description |
task_type |
string |
Inferred from the target |
Type of ML task |
target_column |
string |
'target' |
Column to predict (omit for clustering and anomaly) |
algorithms |
array |
Default set for the task |
Candidate algorithms |
max_trials |
integer |
10 |
Maximum training trials |
validation_strategy |
string |
'holdout' |
'holdout', 'k_fold', or 'walk_forward' for forecasting |
validation_split |
float |
0.2 |
Validation data proportion |
n_folds |
integer |
5 |
Folds for 'k_fold' and 'walk_forward' |
optimization_metric |
string |
Task-dependent |
Metric to optimize, such as 'f1' or 'auc' for classification |
hyperparameter_strategy |
string |
'fixed_grid' |
'fixed_grid', 'random', or 'bayesian' |
random_seed |
integer |
— |
Random seed for reproducibility |
Forecasting Options
| Option |
Type |
Description |
time_column |
string |
Numeric, evenly spaced time column with one row per time step |
seasonal_period |
integer |
Length of the repeating cycle, such as 7 for a weekly cycle in daily data |
forecast_horizon |
integer |
Steps ahead that validation scores the models on; PREDICT forecasts the future time steps you select |
Available Algorithms
For classification and regression:
'linear_regression' - Linear Regression
'logistic_regression' - Logistic Regression
'decision_tree' - Decision Tree
'random_forest' - Random Forest
'gradient_boosting' - Gradient Boosting
'xgboost' - XGBoost
'neural_network' - Neural Network
'knn' - K-Nearest Neighbors
'naive_bayes' - Naive Bayes
'svm' - Support Vector Machine
For the other task types:
- Clustering:
'kmeans'
- Anomaly detection:
'isolation_forest'
- Forecasting:
'seasonal_naive', 'ets', 'sarima', 'prophet'
Choosing Algorithms
- Omit
algorithms and AutoML searches its default set of algorithms for the task type.
- Pass a list, such as
algorithms=['logistic_regression', 'decision_tree'], to search only those algorithms.
Algorithm-Specific Options
Random Forest
| Hyperparameter |
Type |
Description |
n_estimators |
integer |
Number of trees |
max_depth |
integer |
Maximum tree depth |
min_samples_split |
integer |
Minimum samples to split |
WITH (
task_type='classification',
target_column='churned',
algorithms=['random_forest'],
n_estimators=200,
max_depth=10
)
Neural Network
| Hyperparameter |
Type |
Description |
learning_rate |
float |
Learning rate |
activation |
string |
'relu', 'tanh', 'sigmoid', 'swish', or 'leaky_relu' |
WITH (
task_type='classification',
target_column='churned',
algorithms=['neural_network'],
activation='tanh',
learning_rate=0.01,
max_trials=2
)
Gradient Boosting / XGBoost
| Hyperparameter |
Type |
Description |
n_estimators |
integer |
Number of boosting stages |
learning_rate |
float |
Learning rate |
Feature Preprocessing
AutoML prepares the columns of your SELECT for training:
- Text feature columns, such as a merchant category, are encoded automatically.
- Classification targets are numeric class codes, such as 0/1 or 0/1/2.
- The fitted preprocessing is saved with the model, and
PREDICT applies it to new rows.
Complete Examples
Customer Churn Prediction
CREATE EXPERIMENT churn_prediction AS
SELECT customer_id, age, tenure, monthly_charges, total_charges, churned
FROM customers
WITH (
task_type='binary_classification',
target_column='churned',
max_trials=50,
validation_split=0.2
);
House Price Regression
CREATE EXPERIMENT house_price_model AS
SELECT * FROM housing_data
WITH (
task_type='regression',
target_column='price',
algorithms=['random_forest', 'xgboost', 'gradient_boosting'],
max_trials=100,
n_estimators=200
);
Fraud Detection with Cross-Validation
CREATE EXPERIMENT fraud_detection AS
SELECT * FROM transactions
WITH (
task_type='binary_classification',
target_column='is_fraud',
algorithms=['xgboost', 'random_forest'],
optimization_metric='f1',
validation_strategy='k_fold',
n_folds=5,
max_trials=150
);
Time Series Forecasting
Forecasting trains on a single series with one row per time step, so this query sums one product's sales per day and uses the day number as the time column.
CREATE EXPERIMENT sales_forecast AS
SELECT day_index, SUM(sales) AS sales
FROM sales_data
WHERE product_id = 1
GROUP BY day_index
WITH (
task_type='time_series',
target_column='sales',
time_column='day_index',
seasonal_period=7,
forecast_horizon=14,
algorithms=['seasonal_naive', 'prophet'],
validation_strategy='walk_forward'
);
Interpretable Model for Compliance
CREATE EXPERIMENT loan_approval AS
SELECT * FROM loan_applications
WITH (
task_type='binary_classification',
target_column='approved',
algorithms=['logistic_regression', 'decision_tree'],
max_depth=5
);
Model Operations
Show Models and Experiments
SHOW MODELS;
SHOW EXPERIMENTS;
Deploy a Model
DEPLOY MODEL churn_model FROM EXPERIMENT churn_prediction;
Make Predictions
Select the same feature columns the experiment trained on. The result returns those columns plus the prediction.
PREDICT churn_probability USING churn_model
AS SELECT customer_id, age, tenure, monthly_charges, total_charges FROM new_customers;
For a forecasting model, select the future time steps in time order:
DEPLOY MODEL sales_forecast_model FROM EXPERIMENT sales_forecast;
PREDICT predicted_sales USING sales_forecast_model
AS SELECT day_index FROM future_days ORDER BY day_index;
Inspect a Model
SELECT model_name, algorithm, task_type, feature_names
FROM automl_models
WHERE model_name = 'churn_model';
The automl_experiments and automl_trials views hold each experiment's scores and every trial's algorithm and hyperparameters.
Drop a Model
DROP MODEL churn_model;
Best Practices
-
Parameter Tuning: For classification and regression, each algorithm-specific option goes to every algorithm in the list, and algorithms without that parameter train with their own settings.
-
Default Values: Start with task_type and target_column, plus time_column, seasonal_period and forecast_horizon for forecasting. The other options have working defaults, so add only the ones you want to change.
-
Resource Limits: max_trials caps the number of trials (10 by default). With hyperparameter_strategy='random', the search keeps sampling configurations up to that cap.
-
Reproducibility: Set random_seed to keep the validation split and the sequence of trials the same across runs.
-
Algorithm Compatibility: Match algorithms to the task type, for example linear_regression for regression and logistic_regression for classification. When a list mixes them, the experiment trains the ones that fit the task, keeps the best model, and lists the others in failed_trials.
Document Version: 1.0
Last Updated: November 2026
Website: https://synapcores.com