How to plot actual vs predicted values of my test data in a random forest model

Viewed 13

Please I am new to randomforests model, I am trying to validate my model using my test data set. I have a total of 30 data points. I used 24 for building the model and 6 for testing.

I plotted the actual vs predicted values of the test data, but instead of plotting for the six datapoints which represent my test data, it plots for the 30 datapoints and I don't know how to interpret that. Please help!

 Final_model <- randomForest(trainF$ETc~., data=trainF, mtry = 9, importance= TRUE, na.action = na.omit)
        print(Final_model)

#Testing model with test data
testmodel <- predict(Final_model, data=testF)

#Plotting Actual vs predicted values of Training data
library(ggplot2)
actualvsPredicted = data.frame(actualValue = testF$ETc, 
                                    predictedValue = testmodel)

ggplot(actualvsPredicted,aes(x = actualValue, y = predictedValue)) +
geom_point()+geom_abline()

actual vs predicted

0 Answers
Related