add TestData::getTestSamples()

This commit is contained in:
ahb 2015-12-05 12:48:02 +01:00 committed by Maksim Shabunin
parent 80102b76f9
commit 15793b1301

View File

@ -224,6 +224,12 @@ public:
CV_WRAP virtual void setTrainTestSplitRatio(double ratio, bool shuffle=true) = 0;
CV_WRAP virtual void shuffleTrainTest() = 0;
CV_WRAP Mat getTestSamples() const {
Mat idx = getTestSampleIdx();
Mat samples = getSamples();
return idx.empty() ? Mat() : getSubVector(samples, idx);
}
CV_WRAP static Mat getSubVector(const Mat& vec, const Mat& idx);
/** @brief Reads the dataset from a .csv file and returns the ready-to-use training data.