Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion Error #39

Open
ryanjshih opened this issue Nov 13, 2018 · 2 comments
Open

Assertion Error #39

ryanjshih opened this issue Nov 13, 2018 · 2 comments
Assignees
Labels

Comments

@ryanjshih
Copy link

Copied and pasted the example code to and got an Assertion Error as per the end of this post,
I'm running this code on Windows 10 and Python 3.6 with Anaconda.

I printed out the scored_matrix and found that some of the values are of inf and therefore caused the assertion error seeing that the assertion error checks the value for integer of float.

But I don't know why it will generates infinity values...

Thank you for making this package!

(0, 0) inf
(0, 1) inf
(0, 2) 1.309320092201233
(0, 3) inf
(0, 4) 0.7615997791290283
(0, 5) 0.27188003063201904
(0, 6) inf
(1, 0) inf
(1, 1) inf
(1, 2) 1.309320092201233
(1, 3) inf
(1, 4) 0.7615997791290283
(1, 5) 0.27188003063201904
(1, 6) inf

File "C:\Users\Ryan\Anaconda3\lib\site-packages\DocumentFeatureSelection\models.py", line 276, in convert_score_matrix2score_record
frequency_matrix=self.frequency_matrix

File "C:\Users\Ryan\Anaconda3\lib\site-packages\DocumentFeatureSelection\models.py", line 367, in get_feature_dictionary
weight_value_index_items = self.make_non_zero_information(weighted_matrix)

File "C:\Users\Ryan\Anaconda3\lib\site-packages\DocumentFeatureSelection\models.py", line 317, in make_non_zero_information
self.__get_value_index(row_indexes[i], column_indexes[i], weight_csr_matrix))

File "C:\Users\Ryan\Anaconda3\lib\site-packages\DocumentFeatureSelection\models.py", line 292, in __get_value_index
assert isinstance(row_index, (int, int32, int64))

AssertionError

@Kensuke-Mitsuzawa
Copy link
Owner

@ryanjshih Thanks for making the issue. Yeah, infinite values here are strange. Considering that no problems on Linux or MacOS, Windows calls different core module of Python.
Luckily, I recently changed my laptop from Mac into Windows+Ubuntu, so I could run debug on my laptop ;)

@o0windseed0o
Copy link

Also waiting for the updated version. got this assertion even running on the basic example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants