Skip to content
C

Problem 1: Apply DBSCAN to a Dataset with an Outlier

Easypython

Problem Description

Write a Python program that applies DBSCAN to a dataset containing two dense groups and one clear outlier, printing the resulting cluster assignments.

Input

A 2D dataset with two dense groups and one isolated point.

Output

The cluster label (or noise label, -1) for each point.

Constraints

  • Choose reasonable eps and min_samples values for the given data.

Example Input

text
[[1,1],[1.5,1.5],[1,2],[8,8],[8.5,8.5],[8,9],[50,50]]

Example Output

text
Cluster assignments: [0 0 0 1 1 1 -1]

Concepts Covered

DBSCAN, eps, min_samples, .fit_predict().

Input (stdin)

Output

Run your code to see output here...