What exactly do these codes do dataTrain = textdata(t​raining(cv​p),:); / dataTest = textdata(test(cvp),:); ?

6 vues (au cours des 30 derniers jours)
Hind Aljallaf
Hind Aljallaf le 28 Mar 2023
Réponse apportée : Meet le 4 Avr 2023
What exactly do these codes do
dataTrain = textdata(training(cvp),:);
dataTest = textdata(test(cvp),:);

Réponses (1)

Meet
Meet le 4 Avr 2023
The cvpartition function will create a random partion indices for train and test data and assign a cvpartition object to cvp. The training and test functions are the object functions for cvpartition object.
In line dataTrain = textdata(training(cvp),:); : The training function is used to get the indices of training data. Using these indices, the training data is extracted from textdata and is assigned to dataTrain.
Similarly, in line dataTest = textdata(test(cvp),:); : The test function is used to get the indices of testing data. Using these indices, the testing data is extracted from textdata and is assigned to dataTest.

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by