Skip to content

Commit 96c12d5

Browse files
removed 321 col tests
1 parent 0f9f866 commit 96c12d5

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

tests/test_encoders.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_np(self):
4848
def test_classification(self):
4949
for encoder_name in encoders.__all__:
5050
with self.subTest(encoder_name=encoder_name):
51-
cols = ['unique_str', 'underscore', 'extra', 'none', 'invariant', 321, 'categorical', 'na_categorical', 'categorical_int']
51+
cols = ['unique_str', 'underscore', 'extra', 'none', 'invariant', 'categorical', 'na_categorical', 'categorical_int']
5252

5353
enc = getattr(encoders, encoder_name)(cols=cols)
5454
enc.fit(X, np_y)
@@ -249,7 +249,7 @@ def test_inverse_transform(self):
249249
# we do not allow None in these data (but "none" column without any missing value is ok)
250250
X = th.create_dataset(n_rows=100, has_missing=False)
251251
X_t = th.create_dataset(n_rows=50, has_missing=False)
252-
cols = ['underscore', 'none', 321, 'categorical', 'categorical_int']
252+
cols = ['underscore', 'none', 'categorical', 'categorical_int']
253253

254254
for encoder_name in ['BaseNEncoder', 'BinaryEncoder', 'OneHotEncoder', 'OrdinalEncoder']:
255255
with self.subTest(encoder_name=encoder_name):
@@ -403,7 +403,7 @@ def test_unique_column_is_not_predictive(self):
403403
def test_cols(self):
404404
# Test cols argument with different data types, which are array-like or scalars
405405
cols_list = ['extra', 'invariant']
406-
cols_types = [cols_list, pd.Series(cols_list), np.array(cols_list), 'extra', 321, set(cols_list),
406+
cols_types = [cols_list, pd.Series(cols_list), np.array(cols_list), 'extra', set(cols_list),
407407
('extra', 'invariant'), pd.Categorical(cols_list, categories=cols_list)]
408408

409409
for encoder_name in encoders.__all__:
@@ -713,7 +713,6 @@ def test_columns(self):
713713
self.assertTrue(result['float'].min() < 1, 'should still be a number and untouched')
714714
self.assertTrue(result['float_edge'].min() < 1, 'should still be a number and untouched')
715715
self.assertTrue(result['unique_int'].min() < 1, 'should still be a number and untouched')
716-
self.assertTrue(result[321].min() < 1, 'should still be a number')
717716

718717
def test_ignored_columns_are_untouched(self):
719718
# Make sure None values in ignored columns are preserved.

tests/test_one_hot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_one_hot(self):
4747
# test inverse_transform
4848
X_i = th.create_dataset(n_rows=100, has_missing=False)
4949
X_i_t = th.create_dataset(n_rows=50, has_missing=False)
50-
cols = ['underscore', 'none', 'extra', 321, 'categorical']
50+
cols = ['underscore', 'none', 'extra', 'categorical']
5151

5252
enc = encoders.OneHotEncoder(verbose=1, use_cat_names=True, cols=cols)
5353
enc.fit(X_i)

tests/test_ordinal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def test_inverse_transform_HaveHandleMissingValueAndHandleUnknownReturnNan_Expec
242242

243243
def test_inverse_with_mapping(self):
244244
df = X.copy(deep=True)
245-
categoricals = ['unique_int', 'unique_str', 'invariant', 'underscore', 'none', 'extra', 321]
245+
categoricals = ['unique_int', 'unique_str', 'invariant', 'underscore', 'none', 'extra']
246246
mapping = [{'col': c, 'mapping': pd.Series(data=range(len(df[c].unique())), index=df[c].unique()), 'data_type': X[c].dtype} for c in categoricals]
247247
enc = encoders.OrdinalEncoder(cols=categoricals, handle_unknown='ignore', mapping=mapping, return_df=True)
248248
df[categoricals] = enc.fit_transform(df[categoricals])

tests/test_woe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class TestWeightOfEvidenceEncoder(TestCase):
1919
def test_woe(self):
20-
cols = ['unique_str', 'underscore', 'extra', 'none', 'invariant', 321, 'categorical', 'na_categorical', 'categorical_int']
20+
cols = ['unique_str', 'underscore', 'extra', 'none', 'invariant', 'categorical', 'na_categorical', 'categorical_int']
2121

2222
# balanced label with balanced features
2323
X_balanced = pd.DataFrame(data=['1', '1', '1', '2', '2', '2'], columns=['col1'])

0 commit comments

Comments
 (0)