This repository contains the implementation of Pegasos algorithm for Support Vector Machine (SVM). The algorithm uses sub gradient method and converts the constraint convex optimiztion problem into unconstrained optmization problem. Batch gradient descent with random shuffling is used for the implementation of algorithm. The a;gorithm aimed to maximize the dis tance between positive an dnegative hyperplanes and hence increasing the classification accuracy. This is a jupyter notebook, so just run the cells for training of algorithm and visulazing the results.
Random dataset is created using sklearn make_classification module. distribution of dataset is given below.
300 iterations are used for the implementation with a batch size of 100 and this is a binary classification problem with learning rate 0.001. The results for implementation are given below
plot of loss Vs Iterations are given below: