Persist an XGM v2 model from a pre-serialized JSON blob. The client never imports xplainable_gm and so cannot fit a v2 model locally; the blob is produced by an internal/agent training path (the closed package) and posted as-is to the v2 create endpoint.
Optional train-set metric dict. When provided, the platform materialises it into the shared evaluation table so aggregate endpoints surface the v2 model (parity with v1).
feature_importancesdictdefault: None
Optional normalised importance dict, materialised onto the v2 partition row alongside the evaluation.
health_infolistdefault: None
Optional per-feature health list (XScan profile shape), materialised into the shared partition-health table.
profiledictdefault: None
Optional v1-shaped ``{base_value, numeric, categorical}`` per-bin profile, materialised onto the v2 partition row so the model-profile UI renders the same two-panel view as v1.
xDataFramedefault: None
Optional training feature matrix. When provided (and ``health_info`` is not), the client computes ``health_info`` via XScan — the SAME open-``xplainable`` code path v1 ``create_model`` uses (never ``xplainable_gm``).
ySeriesdefault: None
Optional training target. Together with ``y_prob``/``y_pred`` (and when ``evaluation`` is not supplied) the client computes ``evaluation`` as ``{'train': evaluate_classification(...)}`` or ``{'train': evaluate_regression(...)}`` — v1's exact shape.
y_probdefault: None
Predicted probabilities (required to auto-compute a classification evaluation).
y_preddefault: None
Predicted values (required to auto-compute a regression evaluation).
created_bystrdefault: None
User id the model is attributed to, for producers that train on a user's behalf (e.g. the autotrain service account). Only the platform's training service may name a user other than the caller; defaults to the caller. Explicit ``evaluation=``/``health_info=`` always take precedence over anything computed from ``x``/``y``.
Add a new version to an EXISTING XGM v2 model (retrain path). v2 counterpart of add_version: persists a pre-serialized blob as a new version under the same model instead of creating a new one. The parent model must have algorithm_version='v2'.
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.
List all versions of a model. Each version carries parameters — what it was fitted with. For v2 (XGM) versions that is a per-feature map, e.g. \{"Tenure": \{"model_class": "XNumericClassification", "num_splines": 12, "l2": 10.0, ...\}\}. Read it before tuning.
Rapidly refit an existing v1 model with new parameters without retraining. v1 (tree-partition) models only; v2 (XGM) models refit per feature via refit_features. Everything happens server-side in a single API call -- data never leaves the platform. Two modes: 1. Same params for features: set max_depth, weight, etc. directly. Use 'features' to target specific features, or omit for all. 2. Per-feature params: pass feature_params dict to tune each feature independently in one call. e.g.: feature_params={"Tenure Months": {"max_depth": 3}, "Contract": {"max_depth": 5}}
Refit chosen features of a trained (v2 / XGM) model into a new version. The iterate step between training runs: each named feature's submodel is re-solved against the residual of all the others under your overrides; every other feature is untouched. The new version carries fresh train/test metrics, importances and profile, so you can compare it with the original directly. Read the current values first: list_model_versions returns parameters per version ({feature: {knob: value}}); change one thing, refit, compare. Knobs (unspecified ones keep their fitted values): numeric features: num_splines (basis functions; fewer = smoother), l2 (shrinkage; raise to tame an overfitting feature), d2 (smoothness penalty), spacing, monotonic ("increasing" | "decreasing" | null to remove), monotonic_penalty. categorical features: l2 only. Interaction features ("a_&_b") cannot be refitted. Cost: roughly half a training run (the probability calibration is redone), not instant.
dict — Dict with the new version_id, refit_of, run_id, train_metrics, test_metrics, feature_importances, changed ({feature: applied overrides}) and parameters (post-refit knobs for every feature).
Re-apply the training dataset's current feature relationships to an existing (v2 / XGM) model version. Models trained after datasets.set_relationships already carry the declaration; use this for versions trained before it, or after the declaration changed. Feasibility rules and derived columns are recompiled and written into the version's optimisation config — costs, bounds, immutables and grid settings are kept. Rules naming a column the model does not have are skipped and reported.
dict — Dict with relationships_revision, rules {added, removed, kept}, derived, warnings and deployment_stale — when True, re-deploy the version (deployments_deploy) for the rules to take effect.