Skip to content

An interactive Jupyter notebook to guide you setup a linear hard-margin SVM classifer by cvxopt in python3.

License

Notifications You must be signed in to change notification settings

LiuXing1122/hard-margin-SVM-tutorial-by-cvxopt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hard-margin-SVM-tutorial-by-cvxopt

Author: Yin-tao Xu | Date: 2018/9/10

Introduction

This repository is an interactive guidance for setting up a hard-margin SVM binary classifer. The interactive tutorial bases on cvxopt and Jupyter notebook. The very beginning idea to start this repository is to offer a case study for my blog: author's CSDN blog(Chinese).

screenshot of the jupyter notebook

Hard-Margin SVM can be transformed into a standard QP problem. For beginners or researchers focusing on application, it is challenging to implement very detailed numerical optimization method. Rely on magic boxes in cvxopt package, you are able to derive the solution with only one command! At the same time, you are able to grasp critical points of SVM modeling.

Feature

  • Well-designed visualization of the decision boundary!
  • A quick start to get familiar with cvxopt .

Prerequisite

  1. Get familiar with the basic modeling of the hard-margin SVM.

  2. Get familiar with the idea of how to transforming into a QP-Problem

  3. Have cvxopt installed. Install insturction

  4. Python 3(Basic Concept of function, import, OOP, etc.)

  5. Numpy,Jupyter Notebook, matplotlib, etc, Anaconda is a one-stage solution instead of manually installing these frequently used 3-rd party package.

Here are two tutorials in English (Note from standformd CS229) and Chinese(author's CSDN blog).

Note: For notes in standford, first 7 pages will provide you with enough background knowledge about SVM(before lagrange duality).

Quick start

  1. Open terminal at target directory(anywhere you want to start this interactive tutorial)
  2. follow these steps:
git clone https://github.com/liubai01/hard-margin-SVM-tutorial-by-cvxopt.git
cd hard-margin-SVM-tutorial-by-cvxopt/
jupyter notebook

Finally, open your browser to connect your Jupyter session. Open SVM_HARD.ipynb directly.

More case studies of machine learning can be found in my repositories[link]!

About

An interactive Jupyter notebook to guide you setup a linear hard-margin SVM classifer by cvxopt in python3.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 96.5%
  • Python 3.5%