Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw user exception for 'not handling missing data error' #2144

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions responsibleai/responsibleai/rai_insights/rai_insights.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,10 @@ def _validate_rai_insights_input_parameters(
if np.any(test[feature].isnull()):
list_of_feature_having_missing_values.append(feature)
if len(list_of_feature_having_missing_values) > 0:
warnings.warn(
raise UserConfigValidationException(
f"Features {list_of_feature_having_missing_values} "
"have missing values in test data")
"have missing values in test data. "
"Please check your data.")

self._validate_feature_metadata(
feature_metadata, train, task_type, model, target_column)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def test_missing_data_warnings(self):
model = create_complex_classification_pipeline(
X_train, y_train, ['Column1', 'Column2'], [])

with pytest.warns(
UserWarning,
with pytest.raises(
UserConfigValidationException,
match="['Column1']"):
RAIInsights(
model=model,
Expand Down
Loading