AI/ML
knowledge skill
Train a supervised classification model on labeled tabular data and return the trained model artifact. The agent loads a CSV file, extracts features and labels, fits a scikit-learn classifier, and serializes the estimator to disk as a .pkl file.
Worked examples
- {"input": {"data_path": "/data/iris.csv", "target_column": "species", "test_size": 0.2}, "output": {"model_path": "/models/iris_model_20240520.pkl", "metrics": {"accuracy": 0.9667, "f1_macro": 0.9664}}}
- {"input": {"data_path": "/data/credit_default.csv", "target_column": "default", "test_size": 0.3}, "output": {"model_path": "/models/credit_model_20240520.pkl", "metrics": {"roc_auc": 0.8921, "precision": 0.8123}}}
Input
- data_path: string / Path to CSV file containing features and a 'label' column
- target_column: string / Name of the column containing class labels
- test_size: float / Fraction of data to reserve for validation (0.0–1.0)
Output
- model_path: string / Filesystem path to the saved .pkl model
- metrics: object / Dict of validation metrics (accuracy, f1, etc.)
Details
- Skill type: knowledge skill
- Safety level: safe_public_research
- Version: 1.0.0