Skip to main content
Version: v1.4.1

Models

Create, manage, and load machine learning models.

All methods are accessed via client.models.

create_model()

POST/v1/models/create

Create a new model.

Parameters

modelRequired
The XClassifier or XRegressor model
model_namestrRequired
Name of the model
model_descriptionstrRequired
Description of the model
xDataFrameRequired
Feature matrix
ySeriesRequired
Target variable
run_idstrdefault: None
Optional run ID to associate with the model

Returns

tuple — Tuple of (model_id, version_id)

Example

1result = client.models.create_model(
2 model=model,
3 model_name="My Model",
4 model_description="Predicts customer churn",
5 x=X_train,
6 y=y_train,
7 run_id="run_abc123"
8)

add_version()

POST/v1/models/add-version

Add a new version to an existing model.

Parameters

modelRequired
The XClassifier or XRegressor model
model_idstrRequired
ID of the existing model
xDataFrameRequired
Feature matrix
ySeriesRequired
Target variable

Returns

str — The new version_id

Example

1result = client.models.add_version(
2 model=model,
3 model_id="model_abc123",
4 x=X_train,
5 y=y_train
6)

list_team_models()

GET/v1/models/teams/{team_id}

List all models for the current team (based on API key). This method returns comprehensive information about all models accessible to the authenticated user's team.

Returns

list — List of model information including names, descriptions, and metadata

Example

1result = client.models.list_team_models()

get_model()

GET/v1/models/{model_id}

Get detailed information about a model.

Parameters

model_idstrRequired
ID of the model

Returns

ModelInfo — Model information

Example

1result = client.models.get_model(
2 model_id="model_abc123"
3)

list_model_versions()

GET/v1/models/versions/{model_id}

List all versions of a model.

Parameters

model_idstrRequired
ID of the model

Returns

list — List of model versions

Example

1result = client.models.list_model_versions(
2 model_id="model_abc123"
3)

list_model_version_partitions()

GET/v1/models/partitions/{version_id}

List all partitions for a model version.

Parameters

version_idstrRequired
ID of the model version (or "latest")

Returns

dict — Dictionary containing partition information

Example

1result = client.models.list_model_version_partitions(
2 version_id="version_xyz789"
3)

PUT/v1/preprocessors/link-preprocessor

Link a model version to a preprocessor version.

Parameters

model_version_idstrRequired
The model version ID
preprocessor_version_idstrRequired
The preprocessor version ID

Returns

None

Example

1result = client.models.link_preprocessor(
2 model_version_id="version_xyz789",
3 preprocessor_version_id="ppv_xyz789"
4)

train_model()

Train an xplainable model on a dataset and upload it to the platform. Provide ONE of: dataset_id (preferred for hosted MCP), file_path (local CSV), dataset_name (xplainable public dataset), or csv_content (raw CSV string).

Parameters

target_columnstrRequired
Name of the column to predict.
model_namestrRequired
Name for the uploaded model.
model_descriptionstrdefault: ''
Description for the uploaded model.
file_pathstrdefault: None
Path to a local CSV file.
dataset_namestrdefault: None
Name of an xplainable public dataset (e.g. "telco_churn").
dataset_idstrdefault: None
ID of a dataset already on the xplainable platform. Use datasets_list_team_datasets to find available IDs. This is the preferred method for hosted/remote MCP servers.
csv_contentstrdefault: None
Raw CSV string for when file paths aren't accessible.
model_typestrdefault: 'classifier'
Either "classifier" or "regressor".
preprocessor_version_idstrdefault: None
Optional preprocessor version ID to load and apply a fitted pipeline to the features before training.
drop_columnslistdefault: None
Optional list of column names to exclude from features.
test_sizefloatdefault: 0.2
Fraction of data to hold out for testing (0 to 1).
max_depthintdefault: 8
Maximum depth of the model decision tree.
min_info_gainfloatdefault: 0.0001
Minimum information gain required to split.
min_leaf_sizefloatdefault: 0.0001
Minimum leaf size as a fraction of training data.
weightfloatdefault: 1.0
Model weight parameter.
power_degreefloatdefault: 1.0
Power degree parameter.
sigmoid_exponentfloatdefault: 0.0
Sigmoid exponent parameter.
tail_sensitivityfloatdefault: 1.0
Tail sensitivity parameter.

Returns

dict — Dictionary with model_id, version_id, train/test metrics, feature_importances, and train/test sample counts.

Example

1result = client.models.train_model(
2 target_column="target",
3 model_name="My Model",
4 model_description="Predicts customer churn",
5 file_path="./data.csv",
6 dataset_name="...",
7 dataset_id="ds_abc123"
8)

refit_model()

Rapidly refit an existing model with new parameters without retraining. This is orders of magnitude faster than train_model because it reuses the pre-computed feature partitions from the original training. Only the scores and profile are recomputed with the new parameters. Use this to iterate on hyperparameters after an initial train_model call. The model structure (splits) stays the same -- only the scoring changes.

Parameters

model_idstrRequired
ID of the existing model.
version_idstrRequired
ID of the model version to refit.
target_columnstrRequired
Name of the target column.
file_pathstrdefault: None
Path to a local CSV (same data used for training).
dataset_namestrdefault: None
Name of an xplainable public dataset.
dataset_idstrdefault: None
csv_contentstrdefault: None
Raw CSV string (for remote MCP servers).
model_typestrdefault: 'classifier'
Either "classifier" or "regressor".
featureslistdefault: None
List of feature names to update. Defaults to all features.
preprocessor_version_idstrdefault: None
Preprocessor version ID if one was used in training.
drop_columnslistdefault: None
Columns to drop (same as in original training).
test_sizefloatdefault: 0.2
Test split fraction (use same value as original training).
max_depthintdefault: None
New max depth (None = keep current).
min_info_gainfloatdefault: None
New min info gain (None = keep current).
min_leaf_sizefloatdefault: None
New min leaf size (None = keep current).
weightfloatdefault: None
New weight (None = keep current).
power_degreefloatdefault: None
New power degree (None = keep current).
sigmoid_exponentfloatdefault: None
New sigmoid exponent (None = keep current).
tail_sensitivityfloatdefault: None
New tail sensitivity (None = keep current).

Returns

dict — Dictionary with new version_id, train/test metrics, feature_importances, and the parameters that were changed.

Example

1result = client.models.refit_model(
2 model_id="model_abc123",
3 version_id="version_xyz789",
4 target_column="target",
5 file_path="./data.csv",
6 dataset_name="...",
7 dataset_id="ds_abc123"
8)

get_model_profile()

GET/v1/models/{model_id}

Get the model profile showing feature contributions and decision boundaries.

Parameters

version_idstrRequired
ID of the model version.

Returns

dict — Dictionary containing the model profile data.

Example

1result = client.models.get_model_profile(
2 version_id="version_xyz789"
3)

get_model_evaluation()

GET/v1/models/{model_id}

Get detailed evaluation metrics for a model partition.

Parameters

partition_idstrRequired
ID of the model partition.

Returns

dict — Dictionary containing evaluation metrics.

Example

1result = client.models.get_model_evaluation(
2 partition_id="..."
3)

get_feature_info()

GET/v1/models/feature-info/{version_id}

Get feature information including types, health metrics, and distributions.

Parameters

version_idstrRequired
ID of the model version.

Returns

dict — Dictionary containing feature information.

Example

1result = client.models.get_feature_info(
2 version_id="version_xyz789"
3)