Skip to main content
Glama
Axiomatic-AI

axiomatic-mcp

Official
by Axiomatic-AI

AxModelFitter_cross_validate_model

Cross-validate your model to test generalization using kfold, shuffle, or custom splits. Check R² consistency across folds to detect overfitting.

Instructions

Test how well your model generalizes to new data using cross-validation.

REQUIRED INPUTS (same as fit_model):
- All model parameters: function_source, parameters, bounds, etc.
- data_file: Path to your data file
- input_data: Maps file columns to input variables
- output_data: Maps file columns to output variables

VALIDATION TYPES:
- 'kfold': Split data into equal parts (good default)
- 'shuffle': Random train/test splits
- 'custom': Specify your own train/test indices

TYPICAL USAGE:
1. Use same parameters as your fit_model call
2. Set validation_strategy='kfold' and n_splits=5
3. Check if test R² values are consistent across folds

INTERPRETATION:
- Consistent high R² across folds: Good generalization
- Large R² variation: Model may be overfitting
- Low average R²: Model not capturing data patterns well

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
boundsYesParameter/input/output bounds
max_timeNoMaximum optimization time in seconds per fold
n_splitsNoNumber of validation folds (for kfold and shuffle)
constantsNoFixed constants
data_fileYesPath to data file (CSV, Excel, JSON, Parquet). All data must be provided via file.
test_sizeNoTest set proportion (for shuffle split)
input_dataYesInput column mappings: [{'column': 'time', 'name': 't', 'unit': 'second'}, {'column': 'x_col', 'name': 'x', 'unit': 'meter'}]
model_nameYesModel name for identification
file_formatNoFile format: 'csv', 'excel', 'json', 'parquet' (auto-detect if None)
jit_compileNoEnable JIT compilation
output_dataYesOutput column mapping: {'columns': ['signal'], 'name': 'y', 'unit': 'volt'} OR {'columns': ['y1', 'y2'], 'name': 'y', 'unit': 'volt'}
random_stateNoRandom seed for reproducibility
custom_splitsNoCustom train/test splits: [{'train': [0,1,2], 'test': [3,4]}, ...]
function_nameYesFunction name that computes the model output
optimizer_typeNoOptimizer: 'nlopt' (best default), 'scipy' (simple), 'nevergrad' (gradient-free)nlopt
function_sourceYesJAX function source code using jnp operations
optimizer_configNoOptimizer config: {'use_gradient': True, 'tol': 1e-6, 'max_function_eval': 1000000}
cost_function_typeNoCost function: 'mse', 'mae', 'huber', 'relative_mse'mse
initial_parametersYesInitial parameter guesses for optimization on each fold
validation_strategyNoValidation type: 'kfold', 'shuffle', or 'custom'kfold
Behavior4/5

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

With no annotations, the description carries full burden. It discloses validation types, interpretation of R² values, and that it uses the same inputs as fit_model. It doesn't explicitly state that the tool does not modify the model, but the description implies a read-only evaluation. No contradictions.

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 well-structured with labeled sections (REQUIRED INPUTS, VALIDATION TYPES, TYPICAL USAGE, INTERPRETATION). It is concise, front-loads the purpose, and every sentence adds value. No wasted words.

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

Completeness4/5

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

Given the tool has 20 parameters, 8 required, and no output schema, the description provides a good overview of usage and interpretation. It covers validation strategies and typical steps. It could include more on error handling or edge cases, but the description is sufficiently complete for an agent to select and invoke the tool correctly.

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

Parameters4/5

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

Schema coverage is 100% (all 20 parameters have descriptions). The description adds significant value by grouping parameters and explaining their relationship to fit_model, typical defaults (e.g., validation_strategy='kfold', n_splits=5), and how to use custom_splits. This goes beyond the schema's individual descriptions.

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?

The description clearly states the tool's purpose: 'Test how well your model generalizes to new data using cross-validation.' It specifies the verb (test/cross-validate) and resource (model generalization), and distinguishes it from siblings like fit_model by focusing on validation rather than fitting.

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 provides explicit usage guidance, including required inputs (same as fit_model), typical usage steps (use same parameters, set validation_strategy='kfold', n_splits=5), and interpretation of results. It could benefit from stating when not to use or alternatives, but the context is clear.

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/Axiomatic-AI/ax-mcp'

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