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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:39:40+00:00 2026-06-11T11:39:40+00:00

I am using randomForest package in R platform for classification task. rf_object<-randomForest(data_matrix, label_factor, cutoff=c(k,1-k))

  • 0

I am using randomForest package in R platform for classification task.

rf_object<-randomForest(data_matrix, label_factor, cutoff=c(k,1-k))

where k ranges from 0.1 to 0.9.

pred <- predict(rf_object,test_data_matrix)

I have the output from the random forest classifier and I compared it with the labels. So, I have the performance measures like accuracy, MCC, sensitivity, specificity, etc for 9 cutoff points.

Now, I want to plot the ROC curve and obtain the area under the ROC curve to see how good the performance is. Most of the packages in R (like ROCR, pROC) require prediction and labels but I have sensitivity (TPR) and specificity (1-FPR).

Can any one suggest me if the cutoff method is correct or reliable to produce ROC curve?
Do you know any way to obtain ROC curve and area under the curve using TPR and FPR?

I also tried to use the following command to train random forest. This way the predictions were continuous and were acceptable to ROCR and pROC packages in R. But, I am not sure if this is correct way to do. Can any one suggest me about this method?

rf_object <- randomForest(data_matrix, label_vector)
pred <- predict(rf_object, test_data_matrix)

Thank you for your time reading my problem! I have spent long time surfing for this. Thank you for your suggestion/advice.

  • 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-11T11:39:42+00:00Added an answer on June 11, 2026 at 11:39 am

    Why don’t you output class probabilities ? This way, you have a ranking of your predictions and you can directly input that to any ROC package.

    m = randomForest(data_matrix, labels)
    predict(m,newdata_matrix,type='prob')
    

    Note that, to use randomForest as a classification tool, labels must be a vector of factor.

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

Sidebar

Related Questions

I am using the randomForest package in R (R version 2.13.1, randomForest version 4.6-2)
I'm using R's randomForest package. Is there a way for me to figure out
I'm trying to work around the randomForest package limit of 32 levels for factors.
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using mercurial, I've run into an odd problem where a line from one committer
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using Java,I have to fetch multiple sets of values from an XML file to
Using Yii, I want to delete all the rows that are not from today.
Does anyone know what the mechanism is that the R randomForest package uses to
Using code from http://ideone.com/5MHVz I am curious how is it possible that I can

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.