Skip to content
C

Problem 4: Identify Support Vectors

Easypython

Problem 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

text
X=[[1,60],[2,65],[8,95],[9,98],[4,72],[6,88]], y=[0,0,1,1,0,1]

Example Output

text
Support vectors: [[4. 72.] [6. 88.] [2. 65.]]

Concepts Covered

model.support_vectors_.

Input (stdin)

Output

Run your code to see output here...