-
Notifications
You must be signed in to change notification settings - Fork 77
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
Implement predict_proba as per #138 #211
base: development
Are you sure you want to change the base?
Conversation
Add test to predict probabilities
Hey guys! My team and I have just started using this library for our project. This functionality would be awesome for what we're doing. Is there any update on the progress of this? |
Hey, I think that there have not been more updates, none of the contributors have had time to finish it |
It would be nice to have somebody with understanding of this feature, please help if you know how to implement this. It seems there are some differences between the results returned by smartcore and the ones returned by sklearn. |
Hi! Thanks for providing this nice library, we are finding the random forest implementations really useful. I am very interested in getting predicted class probabilities from the random forest classifier, so I have been looking into this issue. As far as I can tell, the way I have implemented this in a separate Since the results are pretty similar to before, they still deviate by up to 10% from Here is a small test case showing a difference in splitting between This from sklearn.tree import DecisionTreeClassifier
X = [
[1., 1., 0.],
[1., 1., 0.],
[1., 1., 1.],
[1., 0., 0.],
[1., 0., 1.],
]
y = [1, 1, 0, 0, 1]
dt = DecisionTreeClassifier()
dt.fit(X, y)
assert dt.tree_.node_count == 7 This corresponding let x = DenseMatrix::from_2d_array(&[
&[1., 1., 0.],
&[1., 1., 0.],
&[1., 1., 1.],
&[1., 0., 0.],
&[1., 0., 1.],
])
.unwrap();
let y = vec![1, 1, 0, 0, 1];
// We use the same defaults as sklearn
let classifier =
DecisionTreeClassifier::fit(&x, &y, DecisionTreeClassifierParameters::default())
.unwrap();
assert_eq!(classifier.nodes().len(), 7); This might be old news, but I think it shows that we can't expect to get the same probabilities as Since we have now tried two different |
Hi! It would be really nice to move forwards on this. Do you have any thoughts, @Mec-iS, @montanalow, @morenol? |
See #138
Last test
fit_predict_probabilities
is failing, I don't know if because of the implementation or I am missing something in replicating the test insklearn
: