Skip to content
CampusEduX

Problem 4: Identify Support Vectors

Easypython
Learn the Concept: Support Vector Machines

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_.

Related Problems

  • Problem 1: Train a Linear SVM Classifier
    Easy · python
    Solve Problem
  • Problem 2: Compare Linear and RBF Kernels
    Easy · python
    Solve Problem
  • Problem 3: Scale Features Before Training SVM
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...