Ask Your Question
0

how to use cvCreateTestSet

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

Fabien R gravatar image

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

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

Comments

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 -0600 )edit

Sorry for the short post. I edited the question.

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

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):

http://www.bytefish.de/wiki/machine_learning_opencv

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

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-09 10:13:51 -0600

Fabien R gravatar image

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-02 09:59:12 -0600

Seen: 251 times

Last updated: Mar 03 '13