GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MachineLearning/e_SVM at master · carefree0910/MachineLearning

Expand file tree

/

e_SVM

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

e_SVM

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
KP.py
KP.py
 
 
LinearSVM.py
LinearSVM.py
 
 
Perceptron.py
Perceptron.py
 
 
README.md
README.md
 
 
SVM.py
SVM.py
 
 
TestLinear.py
TestLinear.py
 
 
TestSVM.py
TestSVM.py
 
 

README.md

Outline

SVM

Implemented Perceptron, Kernel Perceptron, LinearSVM & SVM

Implemented Tensorflow & PyTorch backend for LinearSVM & SVM

Visualization

Perceptron

Perceptron on Two Clusters

Perceptron on Two Clusters

LinearSVM

LinearSVM on Two Clusters

LinearSVM on Two Clusters

TFLinearSVM

TFLinearSVM on Two Clusters

TFLinearSVM on Two Clusters

TorchLinearSVM

TorchLinearSVM on Two Clusters

TorchLinearSVM on Two Clusters

Kernel Perceptron

GD

Kernel Perceptron on Spiral

SMO

Kernel Perceptron on Spiral

SVM

GD

SVM on Spiral

SMO

SVM on Spiral

Example

from Util.Util import DataUtil
from e_SVM.SVM import SVM

x, y = DataUtil.gen_spiral(20, 4, 2, 2, one_hot=False)
y[y == 0] = -1                          # Get spiral dataset, Notice that y should be 1 or -1

svm = SVM()                             # Build SVM with SMO algorithm
svm.fit(x, y, kernel="poly", p=12)      # Train SVM (kernel: poly, degree: 12)
svm.evaluate(x, y)                      # Print out accuracy
svm.visualize2d(x, y, padding=0.1, dense=400, emphasize=svm["alpha"] > 0)
                                        # Visualize result (2d) (emphasized support vector)

Result

SVM on Spiral

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.