1 | initial version |
You can use TrainData classes. First create an object TrainData :
Ptr<ml::traindata> t=ml::TrainData::create(data, ROW_SAMPLE, label);
theh you use SetTrainTestSplitRatio to shuffle data. You can get test data and train data using getTestSample or getTrainSamples method
2 | No.2 Revision |
You can use TrainData classes. First create an object TrainData :
Ptr<ml::traindata> t=ml::TrainData::create(data, ROW_SAMPLE, label);
theh you use SetTrainTestSplitRatio to shuffle data. You can get test data and train data using getTestSample or getTrainSamples method
You can read this example too