Skip to main content
Glama

train_model

Train and evaluate a baseline model on a CSV dataset with automatic preprocessing (one-hot encoding, imputation, scaling) and save it for prediction.

Instructions

Train a baseline scikit-learn model, evaluate it on a held-out split, and persist it to models/.

Categorical features are one-hot encoded and numeric features are imputed +
scaled inside a single sklearn Pipeline, so it works on raw Kaggle CSVs.

Args:
    filename: CSV file inside datasets/.
    target: Column to predict.
    features: Columns to use as predictors. Defaults to all other columns.
    task: "classification", "regression", or "auto" (inferred from target).
    test_size: Fraction held out for evaluation.
    random_state: Reproducibility seed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskNoauto
targetYes
featuresNo
filenameYes
test_sizeNo
random_stateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full transparency burden. It discloses key behaviors: one-hot encoding, imputation, scaling within a Pipeline, and persistence to models/. It also explains task inference for the 'auto' value. Missing details like overwrite behavior are not stated, but the core side effects and preprocessing are well covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the main purpose, followed by a compact preprocessing note and a clear Args list. Every sentence adds value, and the Args section is necessary given the empty schema descriptions. No fluff or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is a moderately complex training operation with 6 parameters, but the description covers all of them and explains the preprocessing steps. Since an output schema exists, the absence of return-value details is acceptable. The description provides a complete picture for selecting and invoking the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description's Args section explains every parameter: filename, target, features, task, test_size, random_state. This fully compensates for the lack of schema descriptions and provides meaning well beyond parameter names/types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description opens with 'Train a baseline scikit-learn model, evaluate it on a held-out split, and persist it to models/' which clearly identifies the action, resource, and outcome. It is fully distinguished from sibling tools like predict, list_models, profile_dataset, etc., which cover other stages of the ML workflow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context of what the tool does and states it 'works on raw Kaggle CSVs', implying it is suitable for end-to-end training from raw data. It does not explicitly name alternatives or exclusions, but the context is clear enough for an agent to know when to invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Bert305/kaggle_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server