Running into an error while splitting dataset into train and test?

9 vues (au cours des 30 derniers jours)
pp
pp le 19 Juin 2020
I have a dataset for machine learning that I'm trying to split into train and test using the KFold method.
What I've done is:
cv = cvpartition(data, 'KFold', 5)
% isolate the first set of training data
trainData = data(training(cv, 1), :);
When I try to do the same for the test set
testData = data(test(cv,1), :);
I run into an error :
Subscripting into a table using one subscript (as in t(i)) or three or more subscripts (as in t(i,j,k)) is not supported. Always specify a row subscript
and a variable subscript, as in t(rows,vars).
Why does this happen and is there another way to do this?

Réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by