Answers.Body: <p>No, random forest is not guaranteed to get 100% accuracy on the test data.  But it also doesn’t mean it’s overfit because relatively high scores on test data are common with random forests.</p>
  <p>The trees of a random forest are trained to leaf purity.  BUT, they are only trained on a subset of the samples/features.  A pure decision tree rarely generalizes well so samples not in a given tree's subset of the training samples might be wrong.  The voting mechanism of random forest tends to even out all of the mistakes and provide a good score but a sample in a training set may be so misrepresented by enough decision trees to outweigh the correct votes resulting in an incorrect prediction.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-29T03:32:42.907Z
Answers.LastActivityDate: 2024-05-01T15:49:40.983Z
Answers.LastEditDate: 2024-05-01T15:49:40.983Z
Answers.UserDisplayName: foreverska
Body: <p>Due to the way that decision trees work, do random forest classifiers always get 100% accuracy on their own training data? My random forest classifier got 100% accuracy on its own training data, so I'm not sure if this is a fluke or if there is a logical reason for this. The model got 99.4% accuracy on its testing data, so it may have just had high accuracy in general.</p>
  
Tags: <machine-learning><classification><accuracy><random-forests>
Title: Does a random forest classifier always get 100% accuracy on its own training data?
UserDisplayName: user1181399
ThreadText: # Does a random forest classifier always get 100% accuracy on its own training data?
  
  (Asked by: username_0 on 2024-04-29)
  
  Due to the way that decision trees work, do random forest classifiers always get 100% accuracy on their own training data? My random forest classifier got 100% accuracy on its own training data, so I'm not sure if this is a fluke or if there is a logical reason for this. The model got 99.4% accuracy on its testing data, so it may have just had high accuracy in general.
  
  **Tags:** machine-learning, classification, accuracy, random-forests
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-29. Score: 1 | Accepted answer
  
  No, random forest is not guaranteed to get 100% accuracy on the test data. But it also doesn’t mean it’s overfit because relatively high scores on test data are common with random forests.
  
  The trees of a random forest are trained to leaf purity. BUT, they are only trained on a subset of the samples/features. A pure decision tree rarely generalizes well so samples not in a given tree's subset of the training samples might be wrong. The voting mechanism of random forest tends to even out all of the mistakes and provide a good score but a sample in a training set may be so misrepresented by enough decision trees to outweigh the correct votes resulting in an incorrect prediction.
  
  
  ---
  
  