Skip to Content
OchreML
MCP Tools

ochreml_eval

Evaluate a saved .dit model on labeled data using zero-dependency classification or regression metrics.

ochreml_eval loads a .dit model, runs predictions on a labeled CSV, TSV, or Parquet dataset, and computes classification or regression metrics in pure Python with zero external dependencies.

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

Input Schema

ParameterTypeRequiredDefaultDescription
model_pathstringYes—Path to .dit model file (.dit extension enforced).
data_pathstringYes—Path to labeled dataset.
targetstringYes—Target column name.
taskstringNo"auto"Enum: "auto", "classification", or "regression".

Task Auto-Detection

When task is "auto", OchreML infers the task in order:

  1. If the loaded model has classes_, "Classifier" in its class name, or ends with "NB" or "SVC" -> "classification".
  2. If the class name contains "Regressor" or is in LinearRegression, Ridge, RidgeCV, Lasso, ElasticNet, SVR, KernelRidge -> "regression".
  3. Otherwise, falls back to inspecting the target vector y.

Example JSON-RPC Call

{
  "jsonrpc": "2.0",
  "id": 8,
  "method": "tools/call",
  "params": {
    "name": "ochreml_eval",
    "arguments": {
      "model_path": "models/iris_rf.dit",
      "data_path": "data/iris_val.csv",
      "target": "species",
      "task": "auto"
    }
  }
}

Response Fields

FieldTypeDescription
model_pathstringResolved .dit model path.
model_typestringLoaded estimator class name.
taskstringResolved task ("classification" or "regression").
n_samplesintegerNumber of evaluated samples.
metricsobjectComputed metric dictionary (rounded to 6 decimal places).

Metrics Returned

  • Classification: accuracy, f1_macro, precision_macro, recall_macro, and log_loss (when the model exposes predict_proba()).
  • Regression: r2, rmse, mae, mse.

On this page