Answered step by step
Verified Expert Solution
Question
1 Approved Answer
*R* I've trained two knn models, knn1 and knn2. I want to plot a graph of cross-validation RMSE vs neighbors for each but on the
*R*
I've trained two knn models, knn1 and knn2. I want to plot a graph of cross-validation RMSE vs neighbors for each but on the SAME plot, not two seperate plots.
Current code:
set.seed(1337) knn1 = train(....)
set.seed(1337) knn2 = train(....)
What I'm doing currently is:
plot(knn1, main = 'KNN 1') plot(knn2, main = 'KNN 2')
This plots them but separetely. How can I plot it so its on the same graph?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started