data format for using ML

asked 2017-01-25 13:47:53 -0500

updated 2017-01-25 19:43:43 -0500

I have been evaluating the machine learning methods in openCV. So far I got 4 (mlp, knn, svm and bayes) working. Interestingly, svm and bayes require the training lable matrix to be in format of CV_32SC1, mlp and knn need the training labe matrix in the format of CV_32FC1. Otherwise train() would crash.

It would be great if anyone can post the data formats for other methods decision tree, etc.


edit retag flag offensive close merge delete


Which opencv version ?

LBerger gravatar imageLBerger ( 2017-01-25 14:01:34 -0500 )edit

Latest release 3.2.0. I am exercising these methods and plan to post my sample code later. If you are interested, I can send you my current version. The code is based on the sample from bytefish.

Jason - Like Imaging gravatar imageJason - Like Imaging ( 2017-01-25 14:10:10 -0500 )edit

If my memory is good I haven't got this problem

LBerger gravatar imageLBerger ( 2017-01-25 14:14:51 -0500 )edit

With the sample code from LBerger, I think I have a much better understanding on how to setup the parameters in using ML methods. Also I came up with a very nice package to demonstrate the results for different test data generated for verifying the classification capability of several methods.

Again many thanks go to LBerger.

Jason - Like Imaging gravatar imageJason - Like Imaging ( 2017-01-26 09:34:24 -0500 )edit

LBerger, do you have working code for EM algorithm? If so please post it here. Thanks.

BTW, I'd like to post the code I tested but dont know where to publish them.

Jason - Like Imaging gravatar imageJason - Like Imaging ( 2017-01-26 16:38:45 -0500 )edit

still working EM::predict method seems not compatible with other predict method. I made an issue..

I have update my code on gihub

LBerger gravatar imageLBerger ( 2017-01-27 03:34:18 -0500 )edit

Thanks, just ran your update, EM does not crash but gave me meaningless results. I used EM algorithm for medical image segmentation long time ago. May need take a detailed look to see how openCV implements the algorithm later. Busy today and will catch up with you later.

Jason - Like Imaging gravatar imageJason - Like Imaging ( 2017-01-27 09:46:23 -0500 )edit