[FIX] Trees: Fix classification from sparse data#2496
Conversation
|
Works. 🌈 🥇 💫 |
|
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