This project performs Support Vector Machine (SVM) analysis on the Iris dataset using Python and scikit-learn. It includes code to train an SVM classifier, evaluate its performance metrics, and visualize the results.
IrisSVMHingeLossVisualizer.py
: Python script containing the SVM analysis code.figure_1.png
: Image file showing the SVM decision boundary visualization.sample.py
: This script provides a small dataset consisting of 30 data pairs labeled as 0 and 1. The goal is to use this data to train a machine learning model to predict the label of new data based on its features.
The IrisSVMHingeLossVisualizer.py
script loads the Iris dataset, preprocesses the data, splits it into training and testing sets, trains a LinearSVC classifier, evaluates its performance metrics including accuracy and hinge loss, and visualizes the decision boundary.
Ensure you have Python and the necessary libraries installed. You can run the IrisSVMHingeLossVisualizer.py
script to perform the analysis.
python IrisSVMHingeLossVisualizer.py
# IrisSVMHingeLossAnalysis