Problem 4: Identify Support Vectors
Easypython
Learn the Concept: Support Vector MachinesProblem Description
Write a Python program that trains an SVM on a labeled dataset and prints the actual support vector data points identified by the model.
Input
A labeled dataset.
Output
The support vectors (actual data points) used to define the boundary.
Constraints
- At least 6 labeled training examples.
Example Input
textX=[[1,60],[2,65],[8,95],[9,98],[4,72],[6,88]], y=[0,0,1,1,0,1]
Example Output
textSupport vectors: [[4. 72.] [6. 88.] [2. 65.]]
Concepts Covered
model.support_vectors_.
Related Problems
- Problem 1: Train a Linear SVM ClassifierEasy · pythonSolve Problem
- Problem 2: Compare Linear and RBF KernelsEasy · pythonSolve Problem
- Problem 3: Scale Features Before Training SVMEasy · pythonSolve Problem