mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
ml: moved getTestSamples implementation to src
This commit is contained in:
parent
15793b1301
commit
54abb83c82
@ -224,11 +224,8 @@ 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);
|
||||
}
|
||||
/** @brief Returns matrix of test samples */
|
||||
CV_WRAP Mat getTestSamples() const;
|
||||
|
||||
CV_WRAP static Mat getSubVector(const Mat& vec, const Mat& idx);
|
||||
|
||||
|
@ -50,6 +50,13 @@ static const int VAR_MISSED = VAR_ORDERED;
|
||||
|
||||
TrainData::~TrainData() {}
|
||||
|
||||
Mat TrainData::getTestSamples() const
|
||||
{
|
||||
Mat idx = getTestSampleIdx();
|
||||
Mat samples = getSamples();
|
||||
return idx.empty() ? Mat() : getSubVector(samples, idx);
|
||||
}
|
||||
|
||||
Mat TrainData::getSubVector(const Mat& vec, const Mat& idx)
|
||||
{
|
||||
if( idx.empty() )
|
||||
|
Loading…
Reference in New Issue
Block a user