train
Generate a predictive pricing model from your local CSV with automatic leakage prevention and log-target recommendation. Runs locally, keeps data on your machine.
Instructions
Train a new P2Predict model from a local CSV file.
Prefer calling `propose_training_plan` first and confirming with the user
— this tool is the execution step. The CSV must have spec columns and a
price/cost target column. Training runs locally; no data leaves the
machine. The trained model is saved and immediately available.
Safe defaults (always surfaced in the returned `warnings` list):
- When features are auto-selected (features=None), columns that look
like target leakage — a near-duplicate of the price being predicted —
are excluded automatically.
- For a strictly-positive (price/cost) target where the automatic skew
test leaves the log-target off, the result recommends log_target="on".
algorithm: "auto" (default), "ridge", "random_forest", or "xgboost".
budget: "fast" (default) or "thorough".
log_target: "auto" (default), "on", or "off". Use "on" for prices.
allow_leaky_features: set True only to override the leakage guard and
train on an explicitly-requested feature that looks like leakage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| budget | No | fast | |
| target | Yes | ||
| csv_path | Yes | ||
| features | No | ||
| algorithm | No | auto | |
| log_target | No | auto | |
| max_features | No | ||
| outlier_policy | No | warn | |
| allow_leaky_features | No | ||
| feature_outlier_policy | No | warn |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |