train_model
Train machine learning models for classification or regression with configurable persistence and optional hyperparameter tuning.
Instructions
Train a machine learning model with configurable persistence (memory-only, filesystem, or hybrid storage)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_name | No | Name of the loaded dataset (use list_datasets to see available datasets) | |
| dataset_path | No | Path to the dataset file (CSV, JSON, Parquet) - alternative to dataset_name | |
| target_column | Yes | Name of the target/label column | |
| algorithm | No | Machine learning algorithm to use | random_forest |
| model_type | No | Type of machine learning problem | auto |
| test_size | No | Proportion of data to use for testing | |
| enable_tuning | No | Enable hyperparameter tuning | |
| cv_folds | No | Number of cross-validation folds | |
| random_state | No | Random state for reproducibility | |
| feature_columns | No | Specific feature columns to use (optional) | |
| output_name | No | Name for the trained model (optional) | |
| persistence_mode | No | How to store artifacts: memory_only (in-memory, MCP-friendly), filesystem (traditional files), hybrid (both) | memory_only |
| validation_size | No | Proportion of training data to use for validation | |
| stratify | No | Use stratified sampling for train/test split | |
| tuning_method | No | Hyperparameter tuning method (used when enable_tuning=true) | grid_search |
| tuning_cv | No | Number of CV folds for hyperparameter tuning | |
| tuning_scoring | No | Scoring metric for hyperparameter tuning (optional) | |
| max_iter | No | Maximum iterations for iterative algorithms | |
| enable_cross_validation | No | Enable cross-validation during training | |
| scoring_metrics | No | List of scoring metrics for evaluation | |
| save_model | No | Save the trained model | |
| save_metrics | No | Save training metrics | |
| save_predictions | No | Save model predictions |