2
$\begingroup$

I have data with about 1250 rows and 97 features. Using random forest for classification in caret R package, I've trained a model and now, I want to plot the learning curve using the learning_curve_dat funtion:

    learning_curve <- learning_curve_dat(data, "obs", 
        c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1), 
        verbose = TRUE, method = "rf", metric = "ROC", 
        trControl=trainControl(method="cv", 
        summaryFunction = twoClassSummary, classProbs = TRUE ), 
        tuneLength = 15), 
        test_prop = 0.2)



       ggplot(learning_curve, aes(x = Training_Size, y = ROC, color = Data))  +     
geom_smooth(method = loess, span = .8)  + scale_x_continuous(expand = c(0, 0)) + 
    scale_y_continuous(expand = c(0, 0))

I got this plot: Learning curve of random forest

It is clearly overfitted by having AUC = 1 for training data. However, I cannot find a way to reduce overfitting. I tried to set mtry to a very low constant value (like 1, 3 or 5), I still got something similar. I have no idea what's happening, anybody could help me?

$\endgroup$
  • 3
    $\begingroup$ What is the meaning of the resampling curve. $\endgroup$ – Matthew Drury May 2 '17 at 14:44
  • $\begingroup$ I have figured out: the maxdepth of the trees were not set, this caused the overfitting of the model. $\endgroup$ – aqua May 3 '17 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.