Git Product home page Git Product logo

svmsgd's Introduction

C++ Stochastic Gradient Descent SVM

This repository is meant to provide an easy-to-use implementation of the SVM classifier using the Stochastic Gradient Descent.
This approach followed the one presented in Bottou, Léon. "Large-scale machine learning with stochastic gradient descent." Proceedings of COMPSTAT'2010. Physica-Verlag HD, 2010. 177-186. To run the code you need OpenCV. For a non-dependent OpenCV implementation you just need to substitute the Mats for float arrays as well as remove all OpenCV dependencies (I pretend to do the same later).

News: SVMSGD was submitted to the OpenCV library. I would like to thank to Marina Noskova ([email protected]) for refactoring the code to be consistent with the existing ml classifiers.

Original PR: opencv/opencv#5291

Refactored PR: opencv/opencv#6096

Code Example

To use the SVM classifier you just need to create the object:
SvmSgd SVMSGD;
or
SvmSgd SVMSGD(updateFrequency);

And train the classifier with your training features and the corresponding labels:
SVMSGD.train(trainFeatures, labels);

After that you can predict the label of your new feature vector:
predictedLabel = SVMSGD.predict(predictFeatures.row(i));

Results

The main advantage when compared to others SVM classifiers (like the one present in OpenCV, for example) is the speed performance and the online update of the wheights.
The out.avi shows the performance of the presented classifier when used to classify cars using HOG features. As can be seen, the cars are correctly classified.

Questions and suggestions

You can contact me by email: [email protected]

svmsgd's People

Contributors

joaofaro avatar

Stargazers

踏雪寻殇 avatar  avatar frankfanslc avatar Andreas Christopoulos Charitos avatar  avatar Ning Zhou avatar Haipeng Wang avatar Yong Yuan avatar Utkarsh Chauhan avatar  avatar  avatar Ali Burak Ünal avatar Collin Yao avatar Nihar Rao avatar Ranganathan Sankaralingam avatar PixLab | Symisc Systems avatar  avatar Rish Bhardwaj avatar Andrews Cordolino Sobral avatar Albert Tavares de Almeida avatar Dr. Juan Miguel Cejuela avatar  avatar João Machado Santos avatar Joshan avatar Eric avatar

Watchers

Eric avatar  avatar Rish Bhardwaj avatar

Forkers

anryyang sunsiz

svmsgd's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.