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 6726727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:57:41+00:00 2026-05-26T09:57:41+00:00

I run a non-parallel randomForest object with no problem like this: > rf <-

  • 0

I run a non-parallel randomForest object with no problem like this:

> rf <- randomForest(t2[,-c(1,2,7,12)],t2[,2],
+                    ,sampsize=c(10000),do.trace=F,importance=TRUE,ntree=1,,forest=TRUE)
Warning message:
In randomForest.default(t2[, -c(1, 2, 7, 12)], t2[, 2], , sampsize = c(10000),  :
  The response has five or fewer unique values.  Are you sure you want to do regression?
> rf

Call:
 randomForest(x = t2[, -c(1, 2, 7, 12)], y = t2[, 2], ntree = 1,      sampsize = c(10000), importance = TRUE, do.trace = F, forest = TRUE) 
               Type of random forest: regression
                     Number of trees: 1
No. of variables tried at each split: 2

          Mean of squared residuals: 0.07444926
                    % Var explained: -19.36
> rf$rsq
[1] -0.1936248

Now I run the same code using parallel stuff and get no MSE or % Var Explained:

> library("foreach")
> library("doSNOW")
> registerDoSNOW(makeCluster(2, type="SOCK"))
> 
> 
> 
> rf <- foreach(ntree = rep(1, 2), .combine = combine, .packages = "randomForest") %dopar%
+ randomForest(t2[,-c(1,2,7,12)],t2[,2],
+                    ,sampsize=c(10000),do.trace=F,importance=TRUE,ntree=1,,forest=TRUE)
> rf

Call:
 randomForest(x = t2[, -c(1, 2, 7, 12)], y = t2[, 2], ntree = 1,      sampsize = c(10000), importance = TRUE, do.trace = F, forest = TRUE) 
               Type of random forest: regression
                     Number of trees: 2
No. of variables tried at each split: 2

> rf$rsq
NULL

Any idea what I’m doing wrong? Thanks.

  • 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-05-26T09:57:41+00:00Added an answer on May 26, 2026 at 9:57 am

    Its not the parallel bits, its the use of combine from the randomForest package. Quoting ?combine:

    The confusion, err.rate, mse and rsq components (as well as the
    corresponding components in the test compnent, if exist) of the
    combined object will be NULL.

    So you’ll have to calculate that stuff yourself using the predicted values.

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

Sidebar

Related Questions

I'd like to provide a browser page to help non-techies run the various tests
Why can't I compile/run this non-CLR program in VC++ 2008? How to do it?
I run across a lot of embarrassingly parallel projects I'd like to parallelize with
I am trying to setup a TeamCity 4.0 build server to run VS2008 (non-TFS)
I have a script which will be run interactively by non-technical users. The script
My C# application crashes under some circumstances when run with a non-admin user. I'm
I run the following html snippet in IE8 and IE7 with non-English characters (we
I frequently run into large, non-template classes in C++ where simple methods are defined
I use to run $s =~ s/[^[:print:]]//g; on Perl to get rid of non
Part of our java application needs to run javascript that is written by non-developers.

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.