Commit e7437efb authored by Alexander Lercher's avatar Alexander Lercher

Minor cleanup Role Detection Clusterer

parent cb80a8d9
import json
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import DBSCAN, OPTICS
from sklearn.cluster import OPTICS
from typing import List, Dict, Any, TypeVar
from deprecated import deprecated
......@@ -11,12 +11,12 @@ ClusterGroup = Dict[Any, List[Dict]]
class Clusterer:
'''
Clusterer for applying density-based clustering on datasets.
The clustering is done with DBSCAN.
The clustering is done with OPTICS.
:param epsilon: Epsilon used in DBSCAN
:param min_points: Min_points used in DBSCAN
:param epsilon: Eps used in OPTICS
:param min_points: MinPts used in OPTICS
'''
def __init__(self, epsilon=11, min_points=2):
def __init__(self, epsilon=11, min_points=5):
self.epsilon = epsilon
self.min_points = min_points
......@@ -59,7 +59,7 @@ class Clusterer:
if features is None or len(features) == 0:
return features # trash in trash out
dbsc = OPTICS() # DBSCAN(eps = self.epsilon, min_samples = self.min_points)
dbsc = OPTICS(min_samples=self.min_points) # DBSCAN(eps = self.epsilon, min_samples = self.min_points)
dbsc = dbsc.fit(features)
labels = dbsc.labels_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment