58fd0b00cb660f2f02b937fa7875556875ff2b86,category_encoders/tests/test_ordinal.py,TestOrdinalEncoder,test_inverse_transform_BothFieldsAreReturnNanWithNan_ExpectValueError,#TestOrdinalEncoder#,165
Before Change
enc.fit(train)
result = enc.transform(test)
with warnings.catch_warnings(record=True) as w:
enc.inverse_transform(result)
self.assertEqual(1, len(w))
self.assertEqual("inverse_transform is not supported because transform impute "
"the unknown category nan when encode city", str(w[0].message))
def test_inverse_transform_HaveMissingAndNoUnknown_ExpectInversed(self):
train = pd.DataFrame({"city": ["chicago", np.nan]})
test = pd.DataFrame({"city": ["chicago", "los angeles"]})
After Change
message = "inverse_transform is not supported because transform impute "\
"the unknown category nan when encode city"
with self.assertWarns(UserWarning, msg=message) as w:
enc.inverse_transform(result)
def test_inverse_transform_HaveMissingAndNoUnknown_ExpectInversed(self):
train = pd.DataFrame({"city": ["chicago", np.nan]})
test = pd.DataFrame({"city": ["chicago", "los angeles"]})
In pattern: SUPERPATTERN
Frequency: 6
Non-data size: 8
Instances Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: 58fd0b00cb660f2f02b937fa7875556875ff2b86
Time: 2019-03-21
Author: datarian@againstthecurrent.ch
File Name: category_encoders/tests/test_ordinal.py
Class Name: TestOrdinalEncoder
Method Name: test_inverse_transform_BothFieldsAreReturnNanWithNan_ExpectValueError
Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: 58fd0b00cb660f2f02b937fa7875556875ff2b86
Time: 2019-03-21
Author: datarian@againstthecurrent.ch
File Name: category_encoders/tests/test_one_hot.py
Class Name: TestOneHotEncoderTestCase
Method Name: test_inverse_transform_BothFieldsAreReturnNanWithNan_ExpectValueError
Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: c96143bd4e48aa3af847f0ff45bd70c13d99a28d
Time: 2019-03-21
Author: datarian@againstthecurrent.ch
File Name: category_encoders/tests/test_ordinal.py
Class Name: TestOrdinalEncoder
Method Name: test_inverse_transform_HaveUnknown_ExpectWarning
Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: 58fd0b00cb660f2f02b937fa7875556875ff2b86
Time: 2019-03-21
Author: datarian@againstthecurrent.ch
File Name: category_encoders/tests/test_ordinal.py
Class Name: TestOrdinalEncoder
Method Name: test_inverse_transform_HaveUnknown_ExpectWarning
Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: 58fd0b00cb660f2f02b937fa7875556875ff2b86
Time: 2019-03-21
Author: datarian@againstthecurrent.ch
File Name: category_encoders/tests/test_basen.py
Class Name: TestBaseNEncoder
Method Name: test_inverse_transform_BothFieldsAreReturnNanWithNan_ExpectValueError
Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: c96143bd4e48aa3af847f0ff45bd70c13d99a28d
Time: 2019-03-21
Author: datarian@againstthecurrent.ch
File Name: category_encoders/tests/test_ordinal.py
Class Name: TestOrdinalEncoder
Method Name: test_inverse_transform_BothFieldsAreReturnNanWithNan_ExpectValueError