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

Different results in python 2.7.8 and python 3.6.8 #19

Open
RedonaBrahimetaj opened this issue Aug 8, 2019 · 1 comment
Open

Different results in python 2.7.8 and python 3.6.8 #19

RedonaBrahimetaj opened this issue Aug 8, 2019 · 1 comment

Comments

@RedonaBrahimetaj
Copy link

Hello,
I have noticed a considerable difference on my results when running the exact same code in python 2.7.8 and python 3.6.8.
I have been considering results as correct when running on python 3.6.8 taking into account that the support/test for the used libraries is better for python 3.6.8 but I would like to ask whether you have fully tested your implementation for python 3.6 or i should consider python 2.7.
Does anyone come across the same issue? Or, are there specific versions of libraries that I should use?
Thanks in advance,
Redona

@garydoranjr
Copy link
Owner

Hello @RedonaBrahimetaj, thank you for letting me know about the discrepancy in results between Python 2.7 and Python 3.6.

Is this specifically when running the included example, or in other scenarios as well? If it occurs in other scenarios, would you share example code that reproduces the behavior?

I was able to reproduce the discrepancy when running this example, but I traced it back to differences in ordering of the bags when the example code is run (since the example only does one train/test split, there is a lot of variance in the result given changes in the ordering of the examples). Specifically, when I sort the items of the dictionary in this line:

return [Bag(bag_id, value) for bag_id, value in bag_dict.items()]

the results agree across Python versions.

That being said, I originally wrote the library in Python 2.7 and I'm more confident in the correctness of the code when running under that version. Other developers have contributed to making the code compatible with Python 3, but I have not personally tested extensively running this library under Python 3.

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

No branches or pull requests

2 participants