what is the difference between using cvpartition inside or outside fitting function ?
2 次查看(过去 30 天)
显示 更早的评论
Hi,
There is something that i couldn't make sense of. We can use cvpartition outside of the fitting function as following:
Well that makes sense because we want to train the model with some part of the data and test it with new ones. But we can also use the cvpartition and holdout inside the model as the following:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/607660/image.png)
holdout=0.35;
fitrlinear(LevelChange,Outflow,'Learner','leastsquares','Regularization','Ridge','Lambda',lambda,'HoldOut',holdout)
In this case, we didn't split it for training and test so we cannot know which ones it select for training right ?
Furthermore, As far as i can see, using K-fold with regularized models are really effective because it uses this folds to get the best penality term value. But how can we select the best model ? When we trained a regularized linear regression model with kfold=5, there are 5 different models but i couldn't see option to compare such as RMSE.
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!