How to get score of prediction from random forest?

0 votes
I'm using sklearn's Random Forest classifier for a model I've built. When using it for predictions, I was wondering if there's a way to get the certainty level of the predictions ? Please help.
Sep 9 in Python by Neel
• 3,010 points

1 answer to this question.

0 votes
Well, there's a built-in method for this in the RandomForestClassifier. It is called forest.predict_proba(X). Random forest classifier creates a set of decision trees from a randomly selected subset of the training set. It then aggregates the votes from different decision trees to decide the final class of the test object.

I hope this helps.
answered Sep 9 by Arvind
• 2,960 points

Related Questions In Python

0 votes
1 answer

How to get the size of a string in Python?

If you are talking about the length ...READ MORE

answered Jun 4, 2018 in Python by ariaholic
• 7,340 points
0 votes
1 answer

How to get text label from SAP using pywinauto[python]

Hi. Can you please tell me what ...READ MORE

answered Jun 28, 2018 in Python by Nietzsche's daemon
• 4,260 points
0 votes
1 answer

How to get the return value from a thread using python?

You don't need to change your existing ...READ MORE

answered Dec 3, 2018 in Python by Nymeria
• 3,520 points

edited Dec 19, 2018 by Nymeria 14,130 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 337 views
0 votes
1 answer

How to get a list of built in modules in Python?

simply open the python shell and type ...READ MORE

answered Aug 1 in Python by Arvind
• 2,960 points
+1 vote
1 answer

How to convert records from csv to a list in Python?

If you are using Python 3.x then ...READ MORE

answered Jun 25 in Python by Arvind
• 2,960 points

edited Jun 26 by Kalgi 53 views