DeepchecksClient.create_tabular_model_version#

DeepchecksClient.create_tabular_model_version(model_name: str, schema: Union[str, Path, TextIOBase, DataSchema], version_name: str = 'v1', reference_dataset: Optional[Dataset] = None, reference_predictions: Optional[ndarray] = None, reference_probas: Optional[ndarray] = None, feature_importance: Optional[Union[Dict[str, float], pd.Series[float]]] = None, task_type: Optional[Union[str, TaskType]] = None, description: str = '', model_classes: Optional[Sequence[str]] = None, create_model_defaults: bool = True, alerts_delay_labels_ratio: float = 1.0, alerts_delay_seconds: int = 259200, monitoring_frequency: str = 'day', obj_store_path: Optional[str] = None) DeepchecksModelVersionClient#

Create a tabular model version and uploads the reference data if provided.

Parameters
model_name: str

The model name. Can be an existing model or a name for a new model.

schemaUnion[str, pathlib.Path, io.TextIOBase, Dict[str, Dict[str, Any]]]

path to a schema file, file like object with schema, or a dictionary representing a schema. This method expects that provided file will be in the next yaml format:

features:

foo: <feature-type> bar: <feature-type>

additional_data:

foo: <feature-type> bar: <feature-type>

where ‘feature-type’ is one of:
  • ‘numeric’

  • ‘integer’

  • ‘categorical’

  • ‘boolean’

  • ‘text’

  • ‘array_float’

  • ‘array_float_2d’

  • ‘datetime’

version_name: str, default: ‘v1’

The version name. Version name must be unique per model.

reference_dataset: Optional[Dataset], default: None

The reference dataset object, Required for uploading reference data. See https://docs.deepchecks.com/stable/user-guide/tabular/dataset_object.html for more info.

reference_predictions: np.ndarray, default: None

The model predictions for the reference data. Should be provided as an array of shape (n_samples,), containing the predicted value for each sample in the dataset. Optional if probabilities are provided.

reference_probas: np.ndarray, default: None

The model predicted class probabilities for the reference data, optional for classification tasks. Should be provided as an array of shape (n_samples, n_classes) containing the predicted probability of each possible class for each sample in the dataset. The classes should be ordered according to alphanumeric order based on the classes names.

feature_importance: Union[Dict[str, float], pandas.Series[float], None], default: None

a dictionary or pandas series of feature names and their feature importance value.

task_type: Optional[str], default: None

The task type of the model, required for creation of a new model. Can be inferred from dataset.label_type if set. Possible values are regression, multiclass, binary

description: str, default: ‘’

A short description of the model.

model_classes: Optional[Sequence[str]], default: None

List of classes used by the model. If not defined and reference_probas is passed, then classes are inferred from predictions and label.

create_model_defaults: bool, default: True

Whether to add default check, monitors and alerts to the model. Has no effect if the model already exists.

alerts_delay_labels_ratio: float, default: 1.0

For alerts which needs labels, set the minimum ratio required to trigger the alert calculation, together with alerts_delay_seconds, trigger occurs on the earliest of the two.

alerts_delay_seconds: int, default: 3 days

For alerts which needs labels, set the minimum time since the data was sent, in order to trigger the alert calculation. Together with alerts_delay_labels_ratio, trigger occurs on the earliest of the two.

monitoring_frequencystr, default ‘day’

The frequency & aggregation window for the default monitors and alerts. One of ‘hour’, ‘day’, ‘week’.

obj_store_pathstr, default None

The path to the model data in the object store. The authentication info should be provided inside the system.

Returns
deepchecks_client.tabular.client.DeepchecksModelVersionClient

Return the created model version client.