Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7853515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:43:23+00:00 2026-06-02T19:43:23+00:00

I am using a random forest classifier to classify a dataset that has two

  • 0

I am using a random forest classifier to classify a dataset that has two classes.

  • The number of features is 512.
  • The proportion of the data is 1:4. I.e, 75% of the data is from the first class and 25% of the second one.
  • I am using 500 trees.

The classifier produces an out of bag error of 21.52%.
The per class error for the first class (which is represented by 75% of the training data) is 0.0059. While the classification error for the second class is really high: 0.965.

I am looking for an explanation for this behaviour and if you have suggestion to improve the accuracy for the second class.

I am looking forwards to your help.

Thanks

In forgot to say that I’m using R and that I used nodesize of 1000 in the above test.

Here I repeated the training with only 10 trees and nodesize= 1 (just to give an idea) and below is the function call in R and the confusion matrix:

  • randomForest(formula = Label ~ ., data = chData30PixG12, ntree = 10,importance = TRUE, nodesize = 1, keep.forest = FALSE, do.trace = 50)

  • Type of random forest: classification

  • Number of trees: 10

  • No. of variables tried at each split: 22

  • OOB estimate of error rate: 24.46%

  • Confusion matrix:

             Irrelevant , Relevant , class.error
 Irrelevant  37954      ,  4510    , 0.1062076
 Relevant    8775       ,  3068    , 0.7409440
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:43:25+00:00Added an answer on June 2, 2026 at 7:43 pm

    I agree with @usr that generally speaking when you see a Random Forest simply classifying (nearly) each observation as the majority class, this means that your features don’t provide much information to distinguish the two classes.

    One option is to run the Random Forest such that you over-sample observations from the minority class (rather than sampling with replacement from the entire data set). So you might specify that each tree is built on a sample of size N where you force N/2 of the observations to come from each class (or some other ratio of your choosing).

    While that might help some, it is by no means a cure-all. It’s might be more likely that you’ll get more mileage out of finding better features that do a good job of distinguishing the classes than tweaking the RF settings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that time(0) is commonly using for seeding random number generators and that
I am using random forests in a big data problem, which has a very
Using the Xorshift random number generator... I already have the generator, but I haven't
I'm using a custom random number function rand48 in CUDA. The function does not
I am generating some test data for dates by using a random amount of
I am using the following to generate a near random number. 3> erlang:ref_to_list(make_ref()). #Ref<0.0.0.36>
These two questions give similar algorthims for shuffling an IEnumerable: C#: Is using Random
I am using random.sample to sample all possible combinations of sets of data (about
When we are using a random number generator in C#, we can define a
I am using a random number generator in my application. However, sometimes it hapeens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.