how to divide the Dataset into xtrain xtest ytrain ytest
9 ビュー (過去 30 日間)
古いコメントを表示
その他の回答 (2 件)
Chunru
2022 年 4 月 25 日
編集済み: Chunru
2022 年 4 月 25 日
% doc cvpartition
data = randn(2310, 25);
%cv = cvpartition(2310, 'Holdout', 0.3);
%idxTrain = training(cv);
%idxTest = test(cv);
cv = cvpartition(2310, 'KFold', 10);
idxTrain = training(cv, 1);
idxTest = test(cv, 1);
traindata = data(idxTrain, :);
testdata = data(idxTest, :);
whos
5 件のコメント
Chunru
2022 年 4 月 28 日
I don't have your data so that I have to assume the dimension.
You can always read in the data and find the dimension.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!