PREDICTIVE MODELS
Ship a model without leaving the database.
Train on a table, read how trustworthy the result is, promote a version and write scores back to a table your dashboards already query.
STEP 1
Train on a table you own
One call trains a model on the rows you select. The model, its metrics and its training data reference are recorded together.
- No export, no separate ML platform
psql
-- train a model on a table you own
SELECT status, metrics
FROM openpgray.train('churn_model',
'SELECT tenure, plan, usage, label FROM core.customers',
'{}', 'LogisticRegression');osdbstore
Predictive models: the model health tab1400 x 1000 pxDelete this block and drop in an Image or Video widget
STEP 2
Read the health report
Metrics come with plain-language checks: ROC AUC, calibration, and warnings about features that leak the answer.
- Leakage warnings before you promote
- Compare versions side by side
STEP 3
Promote and score
Promote the version you trust, then score new rows in batch. Predictions land in a table with the probability next to each row.
- Registry with promote and roll back
psql
-- score new rows
SELECT row_id, prediction, probability
FROM openpgray.predict('churn_model',
'SELECT tenure, plan, usage FROM core.customers_new ORDER BY id');osdbstore
Predictive models: drift check and retrain history1400 x 1000 pxDelete this block and drop in an Image or Video widget
STEP 4
Retrain when the data drifts
A drift check watches incoming data. When it moves enough, retraining runs on its own and the new version waits for your approval.
- Drift-gated retraining
- Every run is recorded