Retraining Policies
Retraining policies define when and how Inferpathio triggers automated model retraining. Policies are written in YAML and can combine multiple trigger conditions using boolean logic.
Policy structure
policy:
name: fraud-retraining-policy
model: fraud-detector
trigger:
any:
- type: drift
metric: psi
threshold: 0.20
window: 7d
- type: schedule
cron: "0 2 * * 1" # every Monday at 2am UTC
job:
type: airflow_dag
dag_id: retrain_fraud_dag
run_config:
data_window: 90d
auto_promote: false
Trigger types
Drift-based trigger
- type: drift
metric: psi # psi | ks_pvalue | wasserstein
threshold: 0.20
feature_group: transaction_features # optional — scoped to group
window: 7d
Metric degradation trigger
- type: metric_threshold
metric: accuracy
operator: lt # lt | gt | lte | gte
value: 0.88
evaluation_window: 3d
Data freshness trigger
- type: data_freshness
max_age: 14d # retrain if training data is older than this
Schedule trigger
- type: schedule
cron: "0 3 * * 0" # every Sunday at 3am UTC
Boolean composition
Use all (AND) and any (OR) to compose conditions:
trigger:
all:
- type: drift
metric: psi
threshold: 0.15
- type: metric_threshold
metric: f1_score
operator: lt
value: 0.82
Job configuration
The job block defines what runs when a trigger fires:
type: airflow_dag— invoke an Airflow DAG run via the Airflow REST APItype: github_actions— dispatch a GitHub Actions workflowtype: kubeflow_pipeline— create a Kubeflow pipeline runtype: sagemaker_pipeline— start a SageMaker pipeline execution
job:
type: github_actions
repo: myorg/ml-models
workflow: retrain.yml
ref: main
inputs:
model_name: fraud-detector
data_window: 90d
Cooldown period
To prevent repeated triggers in a short window, add a cooldown field to the policy root. The policy won't fire again until the cooldown expires after the last trigger.
policy:
...
cooldown: 48h