Model Inference Time#

from sklearn.datasets import load_iris
from sklearn.ensemble import AdaBoostClassifier
from sklearn.model_selection import train_test_split

from deepchecks.tabular import Dataset
from deepchecks.tabular.checks.methodology import ModelInferenceTime
iris = load_iris(as_frame=True)
train, test = train_test_split(iris.frame, test_size=0.33, random_state=42)

train_ds = Dataset(train, features=iris.feature_names, label='target')
test_ds = Dataset(test, features=iris.feature_names, label='target')

clf = AdaBoostClassifier().fit(train_ds.data[train_ds.features], train_ds.data[train_ds.label_name])
check = ModelInferenceTime()
check.run(test_ds, clf)

Model Inference Time

Measure model average inference time (in seconds) per sample.

Additional Outputs
Average model inference time for one sample (in seconds): 0.00011077


Instantiating check instance with condition#

check = ModelInferenceTime().add_condition_inference_time_is_not_greater_than(0.00001)
check.run(test_ds, clf)

Model Inference Time

Measure model average inference time (in seconds) per sample.

Conditions Summary
Status Condition More Info
Average model inference time for one sample is not greater than 1e-05 Found average inference time (in seconds) above threshold: 0.00011366
Additional Outputs
Average model inference time for one sample (in seconds): 0.00011366


Total running time of the script: ( 0 minutes 0.089 seconds)

Gallery generated by Sphinx-Gallery