how to divide the Dataset into xtrain xtest ytrain ytest
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
i have a dataset 2310x25 table and i want to divide it into xtrain xtest ytain ytest.
0 comentarios
Más respuestas (2)
Chunru
el 25 de Abr. de 2022
Editada: Chunru
el 25 de Abr. de 2022
% 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 comentarios
Chunru
el 28 de Abr. de 2022
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.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!