Skip to Content
OchreML
MCP Tools

ochreml_compare

Lightweight AutoML that cross-validates top OchreML estimators and optionally saves the winner to .dit.

ochreml_compare runs deterministic K-Fold cross-validation (seed=42) across OchreML's top candidate estimators for the detected task, ranks them in a leaderboard, and optionally refits the winning model on the full dataset and saves it to .dit.

It is backed by ochreml._ops.op_compare().

Input Schema

ParameterTypeRequiredDefaultDescription
data_pathstringYes—Path to dataset (CSV, TSV, or Parquet).
targetstringYes—Target column name.
taskstringNo"auto"Enum: "auto", "classification", or "regression".
devicestringNo"auto"Target device (auto, cpu, cuda:0, cuda:all, wgpu, tpu).
cvintegerNo3Number of K-Fold splits (must be >= 2 and <= n_samples).
out_pathstringNonullOptional .dit path to refit and save the winning model (.dit extension enforced).

Candidate Estimators

  • Classification (ranked by accuracy):
    • LogisticRegression
    • RidgeClassifier
    • DecisionTreeClassifier(max_depth=8)
    • RandomForestClassifier(n_estimators=20, max_depth=8)
    • ExtraTreesClassifier(n_estimators=20, max_depth=8)
    • HistGradientBoostingClassifier(max_iter=30)
    • GaussianNB
  • Regression (ranked by r2):
    • LinearRegression
    • Ridge(alpha=1.0)
    • DecisionTreeRegressor(max_depth=8)
    • RandomForestRegressor(n_estimators=20, max_depth=8)
    • ExtraTreesRegressor(n_estimators=20, max_depth=8)
    • HistGradientBoostingRegressor(max_iter=30)

Example JSON-RPC Call

{
  "jsonrpc": "2.0",
  "id": 9,
  "method": "tools/call",
  "params": {
    "name": "ochreml_compare",
    "arguments": {
      "data_path": "data/housing.csv",
      "target": "price",
      "cv": 3,
      "device": "auto",
      "out_path": "models/housing_winner.dit"
    }
  }
}

Response Fields

FieldTypeDescription
taskstringResolved task ("classification" or "regression").
metricstringRanking metric ("accuracy" or "r2").
cvintegerNumber of CV folds used.
devicestringRequested device.
n_samplesintegerDataset row count.
n_featuresintegerFeature column count.
best_modelstring | nullWinning estimator class name.
best_scorenumber | nullMean CV score of the winner.
out_pathstring | nullSaved .dit path if out_path was provided.
leaderboardobject[]Sorted entries with model, mean_score, std_score, cv_time_sec, status ("ok" or "error"), and optional error.

On this page