Skip to content

Test case failed (Nondeterministic): test_multinomial_logistic_regression_string_inputs() #7966

Closed
@chenhe95

Description

@chenhe95

Description

#7962 Reported a failure in AppVeyor, but I ran the test case on my own computer for the latest master (December 2, 2016) of scikit-learn, and the test case also fails.

The test case fails for
sklearn.linear_model.tests.test_logistic.test_multinomial_logistic_regression_string_inputs()

Here is the output

>>> t.test_multinomial_logistic_regression_string_inputs()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sklearn/linear_model/tests/test_logistic.py", line 437, in test_multinomial_logistic_regression_string_inputs
    assert_equal(sorted(np.unique(lr_cv_str.predict(X_ref))), ['bar', 'baz'])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 515, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 744, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 726, in assertSequenceEqual
    self.fail(msg)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 412, in fail
    raise self.failureException(msg)
AssertionError: Lists differ: ['baz'] != ['bar', 'baz']

First differing element 0:
baz
bar

Second list contains 1 additional elements.
First extra element 1:
baz

- ['baz']
+ ['bar', 'baz']

Steps/Code to Reproduce

Download and build December 2, 2016 master version of scikit-learn.
Run the test case, multiple times (like 200?)
The chance of failing is like 1/20

>>> import sklearn.linear_model.tests.test_logistic as t
>>> t.test_multinomial_logistic_regression_string_inputs()
>>> for i in xrange(200):
...     t.test_multinomial_logistic_regression_string_inputs()
... 

Expected Results

The test case does not fail.

Actual Results

The test case fails. (See output log)

Versions

Darwin-15.6.0-x86_64-i386-64bit
('Python', '2.7.10 (default, Oct 23 2015, 19:19:21) \n[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]')
('NumPy', '1.11.1')
('SciPy', '0.13.0b1')
('Scikit-Learn', '0.19.dev0')

Metadata

Metadata

Assignees

No one assigned

    Labels

    EasyWell-defined and straightforward way to resolve

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions