Closed codemasta14 closed 5 years ago
Hey there! As you've probably seen, I haven't worked on this on a long time. I just wanted to see if I could make this fairly efficiently, but I never ended up using it anywhere.
Are you using it somehow?
And... if you had all the trees, how would you calculate the "probability of a random forest"?
I see, I am using it, just with it's intended use, to take a model I trained in R, to move it into c#. Calculating the probability of a random forest means if you have 40 trees voting true and 60 false, your random forest would return a false prediction. If it returned a probability, it would return .4, or 40%.
oh, so for your particular data, return that probability... that should be fairly straightforward :) I'll see if I can find out some time to work on it.
Alright, I was able to put together a proof of concept. I'll work on it on the weekend :)
That's amazing! Thank you so much! This is helping me out a great deal, and so I really appreciate it!
Done! This has been implemented on the 0.2.2 version (available for update on nuget), and the way you use it is as if you wanted to get a prediction,
var cSharpProbabilities = classificationRF.GetProbabilities(item);
You can see an example here, where I verified that the results obtained by the c# code match what R returns.
That's amazing! Thank you so much!
<3
Hello! I'm not sure how much work you are interested in doing on this package, but something that would be extremely helpful is if the predict function had a input such as in R
predict(my_model,training,type = 'prob')
To return the probability of a random forest. I would offer to work on it myself, but I do not do c#.