-
Notifications
You must be signed in to change notification settings - Fork 85
Added per-class probability prediction for random forests #138
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
Conversation
@AlanRace thank you for your contribution to Smartcore! The change looks good, but you might want to look at |
I have added a test here but there is something wrong, please take a look: |
Add test to predict probabilities
@Mec-iS Thanks for supplying the test - I am guessing there was a problem due to row-major vs column-major storage of |
Codecov Report
@@ Coverage Diff @@
## development #138 +/- ##
===============================================
+ Coverage 83.40% 84.01% +0.60%
===============================================
Files 78 81 +3
Lines 8377 8751 +374
===============================================
+ Hits 6987 7352 +365
- Misses 1390 1399 +9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
thanks @AlanRace it is probably better to adhere to the DenseMatrix format, so it would be nice for the method to return the transposed values or directly a DenseMatrix. |
Maybe I am misunderstanding, but It looks like Would you prefer that the matrix returned from |
yeah, probably in the shape returned by |
@morenol @VolodymyrOrlov could you please take a look to the WASM test failing? it looks like we have different results for different targets. Looks like rounding works different for WASM, the results look close but not close enough. |
Hello guys, when does this fucntion will be available ? I totally need it in order to perform model ensembling ! Thanks a lot |
@alexis2804 unfortunately we have problems with some tests, you can take a look at them by fetching this branch |
moved to #211 to solve conflicts |
Added a function to predict the per-class probability of each class for each observation.
probabilities
is a KxC matrix, where K is the number of observations and C is the number of classes. Probabilities are calculated as the fraction of trees in the random forest that predicted the given class.Answer to #50 for random forests.