Models
Create, manage, and load machine learning models.
All methods are accessed via client.models.
create_model()
Create a new model.
Parameters
model Required
The XClassifier or XRegressor model
model_name str Required
Name of the model
model_description str Required
Description of the model
x DataFrame Required
Feature matrix
y Series Required
Target variable
run_id str default: None
Optional run ID to associate with the model
Returns
tuple — Tuple of (model_id, version_id)
Example
1 result = 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
model Required
The XClassifier or XRegressor model
model_id str Required
ID of the existing model
x DataFrame Required
Feature matrix
y Series Required
Target variable
Returns
str — The new version_id
Example
1 result = 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
1 result = client . models . list_team_models ( )
get_model()
Get detailed information about a model.
Parameters
model_id str Required
ID of the model
Returns
ModelInfo — Model information
Example
1 result = 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_id str Required
ID of the model
Returns
list — List of model versions
Example
1 result = 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_id str Required
ID of the model version (or "latest")
Returns
dict — Dictionary containing partition information
Example
1 result = client . models . list_model_version_partitions (
2 version_id = "version_xyz789"
3 )
link_preprocessor()
PUT /v1/preprocessors/link-preprocessor
Link a model version to a preprocessor version.
Parameters
model_version_id str Required
The model version ID
preprocessor_version_id str Required
The preprocessor version ID
Returns
None
Example
1 result = 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_column str Required
Name of the column to predict.
model_name str Required
Name for the uploaded model.
model_description str default: ''
Description for the uploaded model.
file_path str default: None
Path to a local CSV file.
dataset_name str default: None
Name of an xplainable public dataset (e.g. "telco_churn").
dataset_id str default: 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_content str default: None
Raw CSV string for when file paths aren't accessible.
model_type str default: 'classifier'
Either "classifier" or "regressor".
preprocessor_version_id str default: None
Optional preprocessor version ID to load and apply a fitted pipeline to the features before training.
drop_columns list default: None
Optional list of column names to exclude from features.
test_size float default: 0.2
Fraction of data to hold out for testing (0 to 1).
max_depth int default: 8
Maximum depth of the model decision tree.
min_info_gain float default: 0.0001
Minimum information gain required to split.
min_leaf_size float default: 0.0001
Minimum leaf size as a fraction of training data.
weight float default: 1.0
Model weight parameter.
power_degree float default: 1.0
Power degree parameter.
sigmoid_exponent float default: 0.0
Sigmoid exponent parameter.
tail_sensitivity float default: 1.0
Tail sensitivity parameter.
Returns
dict — Dictionary with model_id, version_id, train/test metrics, feature_importances, and train/test sample counts.
Example
1 result = 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_id str Required
ID of the existing model.
version_id str Required
ID of the model version to refit.
target_column str Required
Name of the target column.
file_path str default: None
Path to a local CSV (same data used for training).
dataset_name str default: None
Name of an xplainable public dataset.
dataset_id str default: None
csv_content str default: None
Raw CSV string (for remote MCP servers).
model_type str default: 'classifier'
Either "classifier" or "regressor".
features list default: None
List of feature names to update. Defaults to all features.
preprocessor_version_id str default: None
Preprocessor version ID if one was used in training.
drop_columns list default: None
Columns to drop (same as in original training).
test_size float default: 0.2
Test split fraction (use same value as original training).
max_depth int default: None
New max depth (None = keep current).
min_info_gain float default: None
New min info gain (None = keep current).
min_leaf_size float default: None
New min leaf size (None = keep current).
weight float default: None
New weight (None = keep current).
power_degree float default: None
New power degree (None = keep current).
sigmoid_exponent float default: None
New sigmoid exponent (None = keep current).
tail_sensitivity float default: 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
1 result = 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 the model profile showing feature contributions and decision boundaries.
Parameters
version_id str Required
ID of the model version.
Returns
dict — Dictionary containing the model profile data.
Example
1 result = client . models . get_model_profile (
2 version_id = "version_xyz789"
3 )
get_model_evaluation()
Get detailed evaluation metrics for a model partition.
Parameters
partition_id str Required
ID of the model partition.
Returns
dict — Dictionary containing evaluation metrics.
Example
1 result = 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_id str Required
ID of the model version.
Returns
dict — Dictionary containing feature information.
Example
1 result = client . models . get_feature_info (
2 version_id = "version_xyz789"
3 )