train_model
Train and evaluate a baseline model on a CSV dataset with automatic preprocessing (one-hot encoding, imputation, scaling) and save it for prediction.
Instructions
Train a baseline scikit-learn model, evaluate it on a held-out split, and persist it to models/.
Categorical features are one-hot encoded and numeric features are imputed +
scaled inside a single sklearn Pipeline, so it works on raw Kaggle CSVs.
Args:
filename: CSV file inside datasets/.
target: Column to predict.
features: Columns to use as predictors. Defaults to all other columns.
task: "classification", "regression", or "auto" (inferred from target).
test_size: Fraction held out for evaluation.
random_state: Reproducibility seed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | auto | |
| target | Yes | ||
| features | No | ||
| filename | Yes | ||
| test_size | No | ||
| random_state | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |