projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80102b7
)
add TestData::getTestSamples()
author
ahb
<andreas.bihlmaier@gmx.de>
Sat, 5 Dec 2015 11:48:02 +0000
(12:48 +0100)
committer
Maksim Shabunin
<maksim.shabunin@itseez.com>
Fri, 12 Feb 2016 09:11:10 +0000
(12:11 +0300)
modules/ml/include/opencv2/ml.hpp
patch
|
blob
|
history
diff --git
a/modules/ml/include/opencv2/ml.hpp
b/modules/ml/include/opencv2/ml.hpp
index
7acce7f
..
da0cea8
100644
(file)
--- a/
modules/ml/include/opencv2/ml.hpp
+++ b/
modules/ml/include/opencv2/ml.hpp
@@
-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.