Learning curve of random forest in caret

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:

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?

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