-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[FIX] Trees: Fix classification from sparse data #2496
Conversation
Works. 🌈 🥇 💫 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me. @janezd, thanks for a prompt fixup!
Oops, this expects csr. @nikicc, it would be trivial to add a function for csc, too. Or do I just call to_csr? |
@janezd I would just call |
Codecov Report
@@ Coverage Diff @@
## master #2496 +/- ##
==========================================
+ Coverage 74.53% 74.59% +0.05%
==========================================
Files 321 321
Lines 56134 56141 +7
==========================================
+ Hits 41838 41876 +38
+ Misses 14296 14265 -31 |
I added a separate function for csr; it's almost the same, just with different indexing. I've no idea about Mosaic. Let's see if it fails again. |
It's tremendous satisfaction working in a team that agrees on what to optimize for. >>> import scipy.sparse
>>> csr = scipy.sparse.random(1e5, 1e4, format='csr')
>>> %timeit csr.tocsc()
417 ms ± 2.65 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) |
Half a second. If the code that I added is executed ten (OK, twenty) times (on the data of this size), the time saved by adding the code will roughly equal the time I spent by adding it. |
Thanks, that's exactly what I meant. 😃 |
Related to #2370. |
Issue
Tree prediction for sparse data does not work.
Description of changes
Added a corresponding function in Cython.
Includes