Skip to content

Implementation of Support Vector Machine algorithm using Lagrange Multipliers method for solving non-linear constrained optimization problems.

License

Notifications You must be signed in to change notification settings

contimatteo/SVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Support Vector Machines

Support Vector Machine: Classification

Introduction

In machine learning, support-vector machines (SVMs, also support-vector networks) are supervised learning models with associated learning algorithms that analyze data for classification and regression analysis. SVMs are one of the most robust prediction methods, being based on statistical learning frameworks or VC theory proposed by Vapnik (1982, 1995) and Chervonenkis (1974). Given a set of training examples, each marked as belonging to one of two categories, an SVM training algorithm builds a model that assigns new examples to one category or the other, making it a non-probabilistic binary linear classifier (although methods such as Platt scaling exist to use SVM in a probabilistic classification setting).

More details available on Wikipedia

Literature

A support vector machine constructs a hyper-plane or set of hyper-planes in a high or infinite dimensional space, which can be used for classification, regression or other tasks. Intuitively, a good separation is achieved by the hyper-plane that has the largest distance to the nearest training data points of any class (so-called functional margin), since in general the larger the margin the lower the generalization error of the classifier.

Evgeniou et al. SVM: Theory and Applications, 2001

Scikit-Learn Module

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

INSTALLING

Create and enable the virtual environment:

$ mkdir venv
$ python -m venv venv
$ source venv/bin/activate

Apple M1 Chip

Currently it is not possible to run this project on the new Apple M1 Chip due to the issue with the cvxopt library. More details about this issue are available at this link.

Run the Software

below you can find all the details in order to run the script:

$ python src/main.py --help
  usage: main.py [-h] --dataset {1,2,3,4,5,6}

  Support Vector Machine (implementation from scratch)

  optional arguments:
    -h, --help                show this help message and exit
    --dataset {1,2,3,4,5,6}   index of the dataset to use

if you want to run the algorithm on the third dataset, you can simply run:

$ python src/main.py --dataset 3

Built With

  • CVXOPT - Convex Optimization Library

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Implementation of Support Vector Machine algorithm using Lagrange Multipliers method for solving non-linear constrained optimization problems.

Topics

Resources

License

Stars

Watchers

Forks