how to use cvCreateTestSet

asked 2013-03-02 09:59:12 -0500

Fabien R gravatar image

updated 2013-03-03 05:36:42 -0500

I'm trying to generate test samples for MLP (OpenCV 2.3).

I found the function cvCreateTestSet in ml.hpp but I did not see explanations about how to use it.

Any hints ?

Edit: I would like to adapt this excellent wiki by replacing kMeans by MLP(back_prop). I was wondering if cvCreateTestSet could be used somewhere in the process.

edit retag flag offensive close merge delete


it might help, if you could be more specific, about how you want to use that mlp.

what does your input look like ?

are you trying to do some classification ? are there 2 'classes' or more ?

for training, the mlp wants 2 things:

* a set of input 'examples', either as a Mat with 1 row per sample, 
  or as a vector of 1 row samples,
  ( the size of the colums being the number of your input nodes ) 
* and a vector of (float) labels, same size as num samplerows.
  ( there's a  label for every output node, and each input sample belongs to exactly one label )

there's a lot of ways to get that data, be a bit more specific, so ppl here can help you better ;)

berak gravatar imageberak ( 2013-03-02 15:24:13 -0500 )edit

Sorry for the short post. I edited the question.

Fabien R gravatar imageFabien R ( 2013-03-03 05:37:35 -0500 )edit

oh, that's a nice wiki link.

looking at the code ( ml/src/testset.cpp, 59 ) it seems, i's constructing a very special set of randomized inputdata for the case of CV_TS_CONCENTRIC_SPHERES (what's that ? no idea.)

so, it CONSTRUCTS random features.

not what you wanted, i guess

please, have a look here, too. rosetta-stone like approach at comparative implementations of ml techniques (including mlp):

berak gravatar imageberak ( 2013-03-03 05:49:01 -0500 )edit

Thanks berak. For the moment, I think I will stick to what everyone does, i.e., removing a part of the training sample set to feed the testing process.

Fabien R gravatar imageFabien R ( 2013-03-09 10:13:51 -0500 )edit