SVM (Part 2): How to Perform Breast Cancer Detection?(Practical Data Analysis 17)
Learn how to implement SVM for breast cancer detection using Python's sklearn. Explore data cleaning, feature selection, and classification for 90%+ accuracy.
Welcome to the "Practical Data Analysis" Series
After explaining the principles of SVM, I will guide you through the practical implementation of SVM today.
Before that, let's review some related concepts of SVM.
SVM is a supervised learning model. We need to label the data with categories beforehand and solve the binary classification problem by finding the maximum margin between classes.
To solve a multi-class problem, multiple binary classifiers can be combined to form a multi-class classifier.
In the previous lesson, we discussed hard margins, soft margins, nonlinear SVM, and the formula for the classification margin. You might have found these concepts somewhat abstract. In this lesson, we will explain the usage of tools and the meaning of relevant parameters in practice.
How to Use SVM in sklearn
The SVM algorithm is available in Python's sklearn package, and first, you need to import the package:
from sklearn import svm
SVM can be used for both regression and classification.
When using SVM for regression, we can use SVR or LinearSVR.
SVR stands for Support Vector Regression.
This article only covers classification, so we'll briefly mention this.
For classification, we use SVC or LinearSVC.
SVC stands for Support Vector Classification.
Let me briefly explain the difference between these two.