This repository contains a NumPy implementation of a Support Vector Machine (SVM) classifier using the Sequential Minimal Optimization (SMO) algorithm [1] by Platt.
-
Clone the Repository:
git clone https://github.com/nuniz/svm-smo.git
-
Install Dependencies:
pip install -r requirements.txt
Instantiate the SVM classifier with desired parameters and train it using your dataset. Once trained, you can make predictions on new data points.
from svm import SVM
# Create SVM classifier
svm_classifier = SVM(kernel="rbf", max_iterations=200, eps=1e-5, cost=1.0, gamma=1.0)
# Train the classifier with your data (X_train, y_train)
svm_classifier.fit(X_train, y_train)
# Make predictions on new data (X_test)
predictions = svm_classifier.predict(X_test)