Giter VIP home page Giter VIP logo

soft-margin-svm's Introduction

Soft-Margin SVM

We will apply soft-margin SVM to handwritten digits from the processed US Postal Service Zip Code data set.

In this dataset, the 1st column is digit label and 2nd and 3rd columns are the features. We will train a one-versus-one (one digit is class +1 and another digit is class -1) classifier for the digits ‘1’ (+1) and ‘5’ (-1). (In the original dataset, only consider data samples(rows) with the label as either 1 or 5, for both train and test settings.

In this exercise we try to answer the following questions:

(a) Consider the linear kernel K(xn, xm) = xn^Txm. Train using the provided training data
and test using the provided test data, and report your accuracy over the entire test set,
and the number of support vectors.

(b) In continuation, train only using the first {50, 100, 200, 800} points with the linear
kernel. Report the accuracy over the entire test set, and the number of support vectors
in each of these cases.

(c) Consider the polynomial kernel K(xn, xm) = (1 + xn^Txm), where Q is the degree of
the polynomial. Comparing Q = 2 with Q = 5, comment whether each of the following
statements is TRUE or FALSE.
    i. When C = 0.0001, training error is higher at Q = 5.
    ii. When C = 0.001, the number of support vectors is lower at Q = 5.
    iii. When C = 0.01, training error is higher at Q = 5.
    iv. When C = 1, test error is lower at Q = 5.

(d) Consider the radial basis function (RBF) kernel K(xn, xm) = e(−||xn − xm||2) in the soft-margin SVM approach. Which value of C ∈ {0.01, 1, 100, 104, 106} results in the
lowest training error? The lowest test error? Show the error values for all the C values.

Dataset

The data (extracted features of intensity and symmetry) for training and testing are available at:

http://www.amlbook.com/data/zip/features.train

http://www.amlbook.com/data/zip/features.test

Authors

soft-margin-svm's People

Contributors

ayanpahari avatar

Watchers

 avatar  avatar

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.