Decision Tree Classifier
decision_tree_classifierTrain a classification tree on a prepared numerical train/test split and return performance metrics, top features, and overfitting warnings.
Instructions
Train a decision tree classifier. Easy to interpret and needs no scaling, but overfits easily when max_depth is not limited. The split must have only numerical, complete features. Args: split_id (str): ID of a split made by train_test_split. criterion (str): Split quality measure: "gini", "entropy" or "log_loss". Default is "gini". max_depth (int, optional): Maximum tree depth. Default is None (unlimited); 3-10 is a common range. min_samples_split (int): Minimum rows needed to split a node. Default is 2. min_samples_leaf (int): Minimum rows in a leaf. Default is 1. class_weight (str, optional): "balanced" to counter imbalanced classes. Default is None. random_state (int): Seed. Default is 42. Returns: dict: model_id, train/test metrics (accuracy, precision, recall, F1, ROC-AUC), top features and warnings.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"split_id": "<split_id>"
},
"name": "decision_tree_classifier"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| split_id | Yes | ||
| criterion | No | gini | |
| max_depth | No | ||
| class_weight | No | ||
| random_state | No | ||
| min_samples_leaf | No | ||
| min_samples_split | No |