Train a CART decision tree
predictive-analytics_decision-tree-trainFit a classification or regression CART tree with depth and leaf limits, readable rules, feature importance and optional predictions. Price $0.03 USDC. POST /api/v1/predictive-analytics/decision-tree-train. An unpaid call returns the x402 payment terms and does not run.
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": {
"task": "<task>",
"columns": "<columns>",
"rows": "<rows>",
"target": "<target>"
},
"name": "predictive-analytics_decision-tree-train"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | rows, array. Required. | |
| task | Yes | task, string, one of classification, regression. Required. | |
| target | Yes | target, array. Required. | |
| columns | Yes | columns, array. Required. | |
| predict | No | predict, array. Optional. | |
| maxDepth | No | maxDepth, integer, from 1 to 20. Required. | |
| minSamplesLeaf | No | minSamplesLeaf, integer, from 1 to 1000. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caps | No | caps. Object. | |
| tree | No | tree. Object. | |
| rules | No | rules. Array. | |
| sources | No | sources. Array. | |
| rowsUsed | No | rowsUsed. Number. | |
| warnings | No | warnings. Array. | |
| droppedRows | No | droppedRows. Number. | |
| limitations | No | limitations. Array. | |
| predictions | No | predictions. Array. | |
| trainAccuracy | No | trainAccuracy. Number. | |
| featureImportance | No | featureImportance. Object. |