Skip to content

Conversation

@hayd
Copy link
Member

@hayd hayd commented Dec 12, 2014

There's a failing test on py3, classification correct 50% of the time (always correct on python 2).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tom-de-smedt these functions aren't quite right (before), as if you passed a bytes e.g. b"a" it became 'b"a"'. Python 3 is much less forgiving!

@hayd
Copy link
Member Author

hayd commented Dec 12, 2014

@tom-de-smedt It would be good to get some expert eyes on this! (tbh I'm not sure what I'm looking for whilst debugging.) The test is nosetests test/test_vector.py:TestClassifier.test_igtree. :)

@hayd
Copy link
Member Author

hayd commented Jan 9, 2015

bump. @tom-de-smedt ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC without this change there was an infinite loop / recursion.

@hayd hayd mentioned this pull request Jan 9, 2015
35 tasks
@hayd
Copy link
Member Author

hayd commented May 30, 2015

Actually on looking again the tests are intermittant failures. This makes me think a. we aren't seeding enough (perhaps as python 3 walks tests/dicts in a different/random order). But also there is some hidden logic failures (which may also exist on python 2).

Run a few times... (nearly) all different 😢:

(py34) % nosetests test/test_vector.py
.............................F.............................
======================================================================
FAIL: test_model_reduce (test_vector.TestLSA)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/andy/proj/pattern/test/test_vector.py", line 784, in test_model_reduce
    self.assertTrue(t2 * 2 < t1)       # KNN over 2x faster.
AssertionError: False is not true

----------------------------------------------------------------------
Ran 59 tests in 40.858s

FAILED (failures=1)
(py34) % nosetests test/test_vector.py
..F........................................................
======================================================================
FAIL: test_igtree (test_vector.TestClassifier)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/andy/proj/pattern/test/test_vector.py", line 984, in test_igtree
    self._test_classifier(vector.IGTREE, method=vector.GAINRATIO)
  File "/Users/andy/proj/pattern/test/test_vector.py", line 938, in _test_classifier
    self.assertEqual(v.classify(message), type)
AssertionError: False != True

----------------------------------------------------------------------
Ran 59 tests in 37.582s

FAILED (failures=1)
(py34) % nosetests test/test_vector.py
..E........................................................
======================================================================
ERROR: test_igtree (test_vector.TestClassifier)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/andy/proj/pattern/test/test_vector.py", line 984, in test_igtree
    self._test_classifier(vector.IGTREE, method=vector.GAINRATIO)
  File "/Users/andy/proj/pattern/test/test_vector.py", line 945, in _test_classifier
    v.save(Classifier.__name__)
  File "/Users/andy/proj/pattern/test/../pattern/vector/__init__.py", line 2430, in save
    f.write(cPickle.dumps(self, 1))  # 1 = binary
RuntimeError: maximum recursion depth exceeded while calling a Python object

----------------------------------------------------------------------
Ran 59 tests in 31.865s

FAILED (errors=1)
(py34) % nosetests test/test_vector.py
...........................................................
----------------------------------------------------------------------
Ran 59 tests in 44.550s

OK
(py34) % nosetests test/test_vector.py
..F........................................................
======================================================================
FAIL: test_igtree (test_vector.TestClassifier)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/andy/proj/pattern/test/test_vector.py", line 984, in test_igtree
    self._test_classifier(vector.IGTREE, method=vector.GAINRATIO)
  File "/Users/andy/proj/pattern/test/test_vector.py", line 938, in _test_classifier
    self.assertEqual(v.classify(message), type)
AssertionError: False != True

----------------------------------------------------------------------
Ran 59 tests in 29.723s

FAILED (failures=1)

Perhaps there is a cache which is getting propogated in a random (due to python dict no longer being ordered)... Eeeep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant