Add weights to samples in the training set?

asked 2017-02-16 06:55:09 -0500

I'd like to implement an ensemble of linear SVM classifiers using a custom implementation of Adaboost.

Is it possible to add weights to certain samples in the training set before letting a linear SVM train on it?

Note: I'm not referring to class weights to correct imbalanced TP/TN training data but set the importance of individual samples as done by the Adaboost algorithm.

If it's not possible to do so, how can I simulate giving more importance to certain samples? Will it be enough to add the sample x number of times in the training set? Do I add the weights of the sample as an extra feature?

Thanks in advance

edit retag flag offensive close merge delete


SVM is simply not made for that, while boosting is. Is there any reason why you want to stick to SVM, which has equal sample weights for all by default?

StevenPuttemans gravatar imageStevenPuttemans ( 2017-02-16 09:01:42 -0500 )edit

@StevenPuttemans Thanks for your response. Not particularly. I was following the guidelines described to me to set up a base implementation for pedestrian detection. I explored the HOG + Linear SVM approach described by Dalal to set up an initial (weak) classifier. Only after I already implemented the classifier and got the initial results I wanted to use AdaBoost to further refine the result to reduce the amount of the false positives, unaware that SVM seems to be a poor choice for a weak classifier. The work I'm doing is part of my master thesis to explore and evaluate various features from RGB and Depth images on the KITTI dataset.

drake7707 gravatar imagedrake7707 ( 2017-02-16 10:00:47 -0500 )edit

Well actually you can do it, you can combine boosting and use SVM internally as some sort of weak classifier to build your cascades, but you will need to construct that yourself using the available separate parts. The cascade classifier training pipeline in OpenCV only supports binary decision trees as weak classifiers.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-02-17 03:12:47 -0500 )edit