Reputation: 2075
How can I extract from Deepcheck's custom suite result the failed checks + exact "problematic" columns. In my example I had 2 failed checks 'Feature Drift' & 'Multivariate Drift'. For both checks the "problematic" columns were 'col_1' , 'col_5' and 'col_30'.
How using Python I can get something like this :
My code is :
columns_metadata = {'cat_features' : categorical_cols, 'label':y_label_col }
train_dataset = Dataset(df = train_df , **columns_metadata)
test_dataset = Dataset(df = test_df , **columns_metadata )
custom_drift_suite = Suite('My_custom_drift_suite',
FeatureDrift().add_condition_drift_score_less_than( max_allowed_categorical_score=0.2, max_allowed_numeric_score=0.2),
at a time (can’t be recognized with Feature Drift)
MultivariateDrift().add_condition_overall_drift_value_less_than(0.4),
LabelDrift(),
NewCategoryTrainTest()train set )
)
custom_suite_ans = custom_drift_suite.run(train_dataset = train_dataset, test_dataset = test_dataset)
Thanks :) Boris
Upvotes: 0
Views: 170
Reputation: 931
The suite result contains check results which contain conditions results. The following code will print the conditions results:
import deepchecks
for check_result in custom_suite_ans.get_not_passed_checks():
for condition in check_result.conditions_results:
print(condition.name + ': ' + condition.details)
# Access the result of the check - can get columns, etc
print(check_result.value)
Upvotes: 0