erroranalysis 0.4.3__tar.gz → 0.4.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {erroranalysis-0.4.3/erroranalysis.egg-info → erroranalysis-0.4.4}/PKG-INFO +1 -1
  2. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/surrogate_error_tree.py +2 -2
  3. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/analyzer/error_analyzer.py +1 -1
  4. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/version.py +1 -1
  5. {erroranalysis-0.4.3 → erroranalysis-0.4.4/erroranalysis.egg-info}/PKG-INFO +1 -1
  6. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_cohort_filter.py +42 -41
  7. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_error_report.py +19 -9
  8. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_importances.py +5 -1
  9. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_matrix_filter.py +27 -26
  10. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_surrogate_error_tree.py +3 -3
  11. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/LICENSE +0 -0
  12. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/MANIFEST.in +0 -0
  13. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/README.md +0 -0
  14. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/__init__.py +0 -0
  15. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/__init__.py +0 -0
  16. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/cohort_filter.py +0 -0
  17. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/constants.py +0 -0
  18. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/error_analyzer/__init__.py +0 -0
  19. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/error_report/__init__.py +0 -0
  20. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/matrix_filter.py +0 -0
  21. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/metrics.py +0 -0
  22. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/process_categoricals.py +0 -0
  23. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/utils.py +0 -0
  24. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/_internal/version_checker.py +0 -0
  25. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/analyzer/__init__.py +0 -0
  26. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/error_correlation_methods/__init__.py +0 -0
  27. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/error_correlation_methods/ebm.py +0 -0
  28. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/error_correlation_methods/gbm.py +0 -0
  29. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/report/__init__.py +0 -0
  30. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis/report/error_report.py +0 -0
  31. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis.egg-info/SOURCES.txt +0 -0
  32. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis.egg-info/dependency_links.txt +0 -0
  33. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis.egg-info/requires.txt +0 -0
  34. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/erroranalysis.egg-info/top_level.txt +0 -0
  35. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/requirements.txt +0 -0
  36. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/setup.cfg +0 -0
  37. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/setup.py +0 -0
  38. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_metrics.py +0 -0
  39. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_pyspark_surrogate_error_tree.py +0 -0
  40. {erroranalysis-0.4.3 → erroranalysis-0.4.4}/tests/test_root_stats.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: erroranalysis
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Core error analysis APIs
5
5
  Home-page: https://github.com/microsoft/responsible-ai-widgets
6
6
  Author: Roman Lutz, Ilya Matiach, Ke Xu
@@ -302,7 +302,7 @@ def get_surrogate_booster_local(filtered_df, analyzer, is_model_analyzer,
302
302
  if is_pandas:
303
303
  true_y = true_y.to_numpy()
304
304
  else:
305
- input_data = input_data.to_numpy()
305
+ input_data = input_data.to_numpy(copy=True)
306
306
  if is_model_analyzer:
307
307
  pred_y = analyzer.model.predict(input_data)
308
308
  if analyzer.model_task == ModelTask.CLASSIFICATION:
@@ -316,7 +316,7 @@ def get_surrogate_booster_local(filtered_df, analyzer, is_model_analyzer,
316
316
  if not isinstance(true_y, np.ndarray):
317
317
  true_y = np.array(true_y)
318
318
  if is_pandas:
319
- input_data = input_data.to_numpy()
319
+ input_data = input_data.to_numpy(copy=True)
320
320
 
321
321
  if analyzer.categorical_features:
322
322
  # Inplace replacement of columns
@@ -442,7 +442,7 @@ class BaseAnalyzer(ABC):
442
442
  input_data = self.dataset
443
443
  diff = self.get_diff()
444
444
  if isinstance(self.dataset, pd.DataFrame):
445
- input_data = input_data.to_numpy()
445
+ input_data = input_data.to_numpy(copy=True)
446
446
  if self.categorical_features:
447
447
  # Inplace replacement of columns
448
448
  indexes = self.categorical_indexes
@@ -4,5 +4,5 @@
4
4
  name = 'erroranalysis'
5
5
  _major = '0'
6
6
  _minor = '4'
7
- _patch = '3'
7
+ _patch = '4'
8
8
  version = '{}.{}.{}'.format(_major, _minor, _patch)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: erroranalysis
3
- Version: 0.4.3
3
+ Version: 0.4.4
4
4
  Summary: Core error analysis APIs
5
5
  Home-page: https://github.com/microsoft/responsible-ai-widgets
6
6
  Author: Roman Lutz, Ilya Matiach, Ke Xu
@@ -6,8 +6,8 @@ import pandas as pd
6
6
  import pytest
7
7
 
8
8
  from erroranalysis._internal.cohort_filter import filter_from_cohort
9
- from erroranalysis._internal.constants import (PRED_Y, ROW_INDEX, TRUE_Y,
10
- ModelTask)
9
+ from erroranalysis._internal.constants import (ARG, COLUMN, METHOD, PRED_Y,
10
+ ROW_INDEX, TRUE_Y, ModelTask)
11
11
  from erroranalysis._internal.error_analyzer import ModelAnalyzer
12
12
  from rai_test_utils.datasets.tabular import (create_diabetes_data,
13
13
  create_iris_data,
@@ -15,6 +15,7 @@ from rai_test_utils.datasets.tabular import (create_diabetes_data,
15
15
  from rai_test_utils.models.sklearn import (
16
16
  create_sklearn_random_forest_regressor, create_sklearn_svm_classifier,
17
17
  create_titanic_pipeline)
18
+ from raiutils.cohort import CohortFilterMethods
18
19
 
19
20
  TOL = 1e-10
20
21
  SEPAL_WIDTH = 'sepal width'
@@ -28,9 +29,9 @@ class TestCohortFilter(object):
28
29
  def test_cohort_filter_equal(self):
29
30
  X_train, X_test, y_train, y_test, feature_names, _ = \
30
31
  create_iris_pandas()
31
- filters = [{'arg': [2.8],
32
- 'column': SEPAL_WIDTH,
33
- 'method': 'equal'}]
32
+ filters = [{ARG: [2.8],
33
+ COLUMN: SEPAL_WIDTH,
34
+ METHOD: CohortFilterMethods.METHOD_EQUAL}]
34
35
  validation_data = create_validation_data(X_test, y_test)
35
36
  validation_data = validation_data.loc[X_test[SEPAL_WIDTH] == 2.8]
36
37
  model_task = ModelTask.CLASSIFICATION
@@ -53,9 +54,9 @@ class TestCohortFilter(object):
53
54
  "in Predicted Y cohort filtering")
54
55
  X_train, X_test, y_train, y_test, feature_names, classes = \
55
56
  create_iris_pandas(use_str_labels)
56
- filters = [{'arg': [2],
57
- 'column': target_type,
58
- 'method': 'includes'}]
57
+ filters = [{ARG: [2],
58
+ COLUMN: target_type,
59
+ METHOD: CohortFilterMethods.METHOD_INCLUDES}]
59
60
  validation_data = create_validation_data(X_test, y_test)
60
61
  if use_str_labels:
61
62
  validation_filter = y_test == classes[2]
@@ -79,9 +80,9 @@ class TestCohortFilter(object):
79
80
  def test_cohort_filter_less(self):
80
81
  X_train, X_test, y_train, y_test, feature_names, _ = \
81
82
  create_iris_pandas()
82
- filters = [{'arg': [2.8],
83
- 'column': SEPAL_WIDTH,
84
- 'method': 'less'}]
83
+ filters = [{ARG: [2.8],
84
+ COLUMN: SEPAL_WIDTH,
85
+ METHOD: CohortFilterMethods.METHOD_LESS}]
85
86
  validation_data = create_validation_data(X_test, y_test)
86
87
  validation_data = validation_data.loc[X_test[SEPAL_WIDTH] < 2.8]
87
88
  model_task = ModelTask.CLASSIFICATION
@@ -100,9 +101,9 @@ class TestCohortFilter(object):
100
101
  X_train, X_test, y_train, y_test, feature_names, _ = \
101
102
  create_iris_pandas()
102
103
 
103
- filters = [{'arg': [2.8],
104
- 'column': SEPAL_WIDTH,
105
- 'method': 'less and equal'}]
104
+ filters = [{ARG: [2.8],
105
+ COLUMN: SEPAL_WIDTH,
106
+ METHOD: CohortFilterMethods.METHOD_LESS_AND_EQUAL}]
106
107
  validation_data = create_validation_data(X_test, y_test)
107
108
  validation_data = validation_data.loc[X_test[SEPAL_WIDTH] <= 2.8]
108
109
  model_task = ModelTask.CLASSIFICATION
@@ -120,9 +121,9 @@ class TestCohortFilter(object):
120
121
  def test_cohort_filter_greater(self):
121
122
  X_train, X_test, y_train, y_test, feature_names, _ = \
122
123
  create_iris_pandas()
123
- filters = [{'arg': [2.8],
124
- 'column': SEPAL_WIDTH,
125
- 'method': 'greater'}]
124
+ filters = [{ARG: [2.8],
125
+ COLUMN: SEPAL_WIDTH,
126
+ METHOD: CohortFilterMethods.METHOD_GREATER}]
126
127
  validation_data = create_validation_data(X_test, y_test)
127
128
  validation_data = validation_data.loc[X_test[SEPAL_WIDTH] > 2.8]
128
129
  model_task = ModelTask.CLASSIFICATION
@@ -140,9 +141,9 @@ class TestCohortFilter(object):
140
141
  def test_cohort_filter_greater_and_equal(self):
141
142
  X_train, X_test, y_train, y_test, feature_names, _ = \
142
143
  create_iris_pandas()
143
- filters = [{'arg': [2.8],
144
- 'column': SEPAL_WIDTH,
145
- 'method': 'greater and equal'}]
144
+ filters = [{ARG: [2.8],
145
+ COLUMN: SEPAL_WIDTH,
146
+ METHOD: CohortFilterMethods.METHOD_GREATER_AND_EQUAL}]
146
147
  validation_data = create_validation_data(X_test, y_test)
147
148
  validation_data = validation_data.loc[X_test[SEPAL_WIDTH] >= 2.8]
148
149
  model_task = ModelTask.CLASSIFICATION
@@ -160,9 +161,9 @@ class TestCohortFilter(object):
160
161
  def test_cohort_filter_in_the_range_of(self):
161
162
  X_train, X_test, y_train, y_test, feature_names, _ = \
162
163
  create_iris_pandas()
163
- filters = [{'arg': [2.8, 3.4],
164
- 'column': SEPAL_WIDTH,
165
- 'method': 'in the range of'}]
164
+ filters = [{ARG: [2.8, 3.4],
165
+ COLUMN: SEPAL_WIDTH,
166
+ METHOD: CohortFilterMethods.METHOD_RANGE}]
166
167
  validation_data = create_validation_data(X_test, y_test)
167
168
  validation_data = validation_data.loc[
168
169
  (X_test[SEPAL_WIDTH] <= 3.4) & (X_test[SEPAL_WIDTH] >= 2.8)]
@@ -190,9 +191,9 @@ class TestCohortFilter(object):
190
191
 
191
192
  # the index 1, corresponds to incorrect prediction
192
193
  # the index 0 correspond to correct prediction
193
- filters = [{'arg': arg,
194
- 'column': CLASSIFICATION_OUTCOME,
195
- 'method': 'includes'}]
194
+ filters = [{ARG: arg,
195
+ COLUMN: CLASSIFICATION_OUTCOME,
196
+ METHOD: CohortFilterMethods.METHOD_INCLUDES}]
196
197
  pred_y = model.predict(X_test)
197
198
  validation_data = create_validation_data(X_test, y_test, pred_y)
198
199
  if correct_prediction:
@@ -221,9 +222,9 @@ class TestCohortFilter(object):
221
222
  clf = create_titanic_pipeline(X_train, y_train)
222
223
  categorical_features = categorical
223
224
  # the indexes 0, 2 correspond to S, C
224
- filters = [{'arg': [0, 2],
225
- 'column': EMBARKED,
226
- 'method': 'includes'}]
225
+ filters = [{ARG: [0, 2],
226
+ COLUMN: EMBARKED,
227
+ METHOD: CohortFilterMethods.METHOD_INCLUDES}]
227
228
  validation_data = create_validation_data(X_test, y_test)
228
229
  filter_embarked = X_test[EMBARKED].isin(['S', 'C'])
229
230
  validation_data = validation_data.loc[filter_embarked]
@@ -244,9 +245,9 @@ class TestCohortFilter(object):
244
245
  clf = create_titanic_pipeline(X_train, y_train)
245
246
  categorical_features = categorical
246
247
  # the indexes other than 0, 2 correspond to Q
247
- filters = [{'arg': [0, 2],
248
- 'column': EMBARKED,
249
- 'method': 'excludes'}]
248
+ filters = [{ARG: [0, 2],
249
+ COLUMN: EMBARKED,
250
+ METHOD: CohortFilterMethods.METHOD_EXCLUDES}]
250
251
  validation_data = create_validation_data(X_test, y_test)
251
252
  filter_embarked = X_test[EMBARKED].isin(['Q'])
252
253
  validation_data = validation_data.loc[filter_embarked]
@@ -269,9 +270,9 @@ class TestCohortFilter(object):
269
270
  categorical_features = categorical
270
271
  # the indexes 1, 2 correspond to false positives and false negatives
271
272
  # the indexes 0, 3 correspond to true positives and true negatives
272
- filters = [{'arg': arg,
273
- 'column': CLASSIFICATION_OUTCOME,
274
- 'method': 'includes'}]
273
+ filters = [{ARG: arg,
274
+ COLUMN: CLASSIFICATION_OUTCOME,
275
+ METHOD: CohortFilterMethods.METHOD_INCLUDES}]
275
276
  pred_y = clf.predict(X_test)
276
277
  validation_data = create_validation_data(X_test, y_test, pred_y)
277
278
  if not outcome:
@@ -296,9 +297,9 @@ class TestCohortFilter(object):
296
297
  X_train, X_test, y_train, y_test, feature_names, _ = \
297
298
  create_iris_pandas()
298
299
  # filter on index, which can be done from the RAI dashboard
299
- filters = [{'arg': [40],
300
- 'column': ROW_INDEX,
301
- 'method': 'less and equal'}]
300
+ filters = [{ARG: [40],
301
+ COLUMN: ROW_INDEX,
302
+ METHOD: CohortFilterMethods.METHOD_LESS_AND_EQUAL}]
302
303
  validation_data = create_validation_data(X_test, y_test)
303
304
  validation_data = validation_data.loc[validation_data[ROW_INDEX] <= 40]
304
305
  model_task = ModelTask.CLASSIFICATION
@@ -321,9 +322,9 @@ class TestCohortFilter(object):
321
322
 
322
323
  # filter on regression error, which can be done from the
323
324
  # RAI dashboard
324
- filters = [{'arg': [40],
325
- 'column': REGRESSION_ERROR,
326
- 'method': 'less and equal'}]
325
+ filters = [{ARG: [40],
326
+ COLUMN: REGRESSION_ERROR,
327
+ METHOD: CohortFilterMethods.METHOD_LESS_AND_EQUAL}]
327
328
 
328
329
  model = create_sklearn_random_forest_regressor(X_train, y_train)
329
330
  pred_y = model.predict(X_test)
@@ -1,8 +1,6 @@
1
1
  # Copyright (c) Microsoft Corporation
2
2
  # Licensed under the MIT License.
3
3
 
4
- import uuid
5
-
6
4
  import numpy as np
7
5
  import pandas as pd
8
6
  import pytest
@@ -11,9 +9,13 @@ from erroranalysis._internal.error_analyzer import ModelAnalyzer
11
9
  from erroranalysis._internal.error_report import ErrorReport
12
10
  from rai_test_utils.datasets.tabular import (create_cancer_data,
13
11
  create_housing_data,
14
- create_iris_data)
12
+ create_iris_data,
13
+ create_simple_titanic_data)
15
14
  from rai_test_utils.models.model_utils import (create_models_classification,
16
15
  create_models_regression)
16
+ from rai_test_utils.models.sklearn import \
17
+ create_complex_classification_pipeline
18
+ from rai_test_utils.utilities import is_valid_uuid
17
19
 
18
20
 
19
21
  class TestErrorReport(object):
@@ -79,13 +81,21 @@ class TestErrorReport(object):
79
81
  categorical_features,
80
82
  filter_features=filter_features)
81
83
 
84
+ def test_error_report_titanic(self):
85
+ X_train, X_test, y_train, y_test, numeric, categorical = \
86
+ create_simple_titanic_data()
87
+
88
+ # Drop all numeric features
89
+ X_train = X_train.drop(['pclass', 'age', 'fare'], axis=1)
90
+ X_test = X_test.drop(['pclass', 'age', 'fare'], axis=1)
91
+
92
+ clf = create_complex_classification_pipeline(
93
+ X_train, y_train, [], ['embarked', 'sex'])
82
94
 
83
- def is_valid_uuid(id):
84
- try:
85
- uuid.UUID(str(id))
86
- return True
87
- except ValueError:
88
- return False
95
+ # Pass the remaining categorical features
96
+ run_error_analyzer(clf, X_test, y_test, ['embarked', 'sex'],
97
+ ['embarked', 'sex'],
98
+ filter_features=[])
89
99
 
90
100
 
91
101
  def run_error_analyzer(model, X_test, y_test, feature_names,
@@ -115,7 +115,11 @@ class TestImportances(object):
115
115
  print(execution_time)
116
116
  # assert we don't take too long and downsample the dataset
117
117
  # note execution time is in seconds
118
- assert execution_time < 20
118
+ # note GBM_SHAP is slower than the other methods
119
+ if error_correlation_method == GBM_SHAP:
120
+ assert execution_time < 35
121
+ else:
122
+ assert execution_time < 25
119
123
 
120
124
  @pytest.mark.parametrize('num_rows', [1, 2, 3, 4])
121
125
  @pytest.mark.parametrize('error_correlation_method',
@@ -6,8 +6,9 @@ import pandas as pd
6
6
  import pytest
7
7
 
8
8
  from erroranalysis._internal.cohort_filter import filter_from_cohort
9
- from erroranalysis._internal.constants import (ROW_INDEX, TRUE_Y, MatrixParams,
10
- Metrics, ModelTask, f1_metrics,
9
+ from erroranalysis._internal.constants import (ARG, COLUMN, METHOD, ROW_INDEX,
10
+ TRUE_Y, MatrixParams, Metrics,
11
+ ModelTask, f1_metrics,
11
12
  metric_to_display_name,
12
13
  precision_metrics,
13
14
  recall_metrics)
@@ -50,9 +51,9 @@ class TestMatrixFilter(object):
50
51
  # cohort was chosen in tree view
51
52
  X_train, X_test, y_train, y_test, feature_names, _ = create_iris_data()
52
53
 
53
- filters = [{'arg': [2.85],
54
- 'column': feature_names[1],
55
- 'method': 'less and equal'}]
54
+ filters = [{ARG: [2.85],
55
+ COLUMN: feature_names[1],
56
+ METHOD: 'less and equal'}]
56
57
 
57
58
  model_task = ModelTask.CLASSIFICATION
58
59
  run_error_analyzer_on_models(X_train, y_train, X_test,
@@ -67,9 +68,9 @@ class TestMatrixFilter(object):
67
68
  X_train = pd.DataFrame(X_train, columns=feature_names)
68
69
  X_test = pd.DataFrame(X_test, columns=feature_names)
69
70
 
70
- filters = [{'arg': [2.85],
71
- 'column': feature_names[1],
72
- 'method': 'less and equal'}]
71
+ filters = [{ARG: [2.85],
72
+ COLUMN: feature_names[1],
73
+ METHOD: 'less and equal'}]
73
74
 
74
75
  model_task = ModelTask.CLASSIFICATION
75
76
  run_error_analyzer_on_models(X_train, y_train, X_test,
@@ -222,24 +223,24 @@ class TestMatrixFilter(object):
222
223
 
223
224
  composite_filters = [{'compositeFilters':
224
225
  [{'compositeFilters':
225
- [{'arg': [11.364, 13.182],
226
- 'column': 'mean radius',
227
- 'method': 'in the range of'}],
226
+ [{ARG: [11.364, 13.182],
227
+ COLUMN: 'mean radius',
228
+ METHOD: 'in the range of'}],
228
229
  'operation': 'and'},
229
230
  {'compositeFilters':
230
- [{'arg': [13.182, 15],
231
- 'column': 'mean radius',
232
- 'method': 'in the range of'}],
231
+ [{ARG: [13.182, 15],
232
+ COLUMN: 'mean radius',
233
+ METHOD: 'in the range of'}],
233
234
  'operation': 'and'},
234
235
  {'compositeFilters':
235
- [{'arg': [15, 16.817],
236
- 'column': 'mean radius',
237
- 'method': 'in the range of'}],
236
+ [{ARG: [15, 16.817],
237
+ COLUMN: 'mean radius',
238
+ METHOD: 'in the range of'}],
238
239
  'operation': 'and'},
239
240
  {'compositeFilters':
240
- [{'arg': [16.817, 18.635],
241
- 'column': 'mean radius',
242
- 'method': 'in the range of'}],
241
+ [{ARG: [16.817, 18.635],
242
+ COLUMN: 'mean radius',
243
+ METHOD: 'in the range of'}],
243
244
  'operation': 'and'}],
244
245
  'operation': 'or'}]
245
246
 
@@ -293,12 +294,12 @@ class TestMatrixFilter(object):
293
294
  def test_matrix_filter_housing_filters(self):
294
295
  X_train, X_test, y_train, y_test, feature_names = create_housing_data()
295
296
 
296
- filters = [{'arg': [600],
297
- 'column': 'Population',
298
- 'method': 'less and equal'},
299
- {'arg': [6],
300
- 'column': 'AveRooms',
301
- 'method': 'greater'}]
297
+ filters = [{ARG: [600],
298
+ COLUMN: 'Population',
299
+ METHOD: 'less and equal'},
300
+ {ARG: [6],
301
+ COLUMN: 'AveRooms',
302
+ METHOD: 'greater'}]
302
303
 
303
304
  model_task = ModelTask.REGRESSION
304
305
  run_error_analyzer_on_models(X_train, y_train, X_test,
@@ -77,9 +77,9 @@ class TestSurrogateErrorTree(object):
77
77
  X_train, X_test, y_train, y_test, categorical_features = \
78
78
  create_adult_census_data()
79
79
  model = create_kneighbors_classifier(X_train, y_train)
80
- filters = [{'arg': [40],
81
- 'column': 'Age',
82
- 'method': 'less and equal'}]
80
+ filters = [{ARG: [40],
81
+ COLUMN: 'Age',
82
+ METHOD: 'less and equal'}]
83
83
  run_error_analyzer(model, X_test, y_test, list(X_train.columns),
84
84
  analyzer_type, categorical_features,
85
85
  filters=filters)
File without changes
File without changes
File without changes
File without changes
File without changes