What exactly do these codes do dataTrain = textdata(training(cvp),:); / dataTest = textdata(test(cvp),:); ?
1 次查看(过去 30 天)
显示 更早的评论
What exactly do these codes do
dataTrain = textdata(training(cvp),:);
dataTest = textdata(test(cvp),:);
回答(1 个)
Meet
2023-4-4
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.
Please refer Partition data for cross-validation - MATLAB (mathworks.com), Training indices for cross-validation - MATLAB training (mathworks.com) and Test indices for cross-validation - MATLAB test (mathworks.com) for more details on cvpartition, training and test functions respectively.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!