what is the difference between using cvpartition inside or outside fitting function ?

조회 수: 1 (최근 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:
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개)

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by