EDITAR: se sabe lo siguiente no sea una implementación completa de OPTICS.
Hice una búsqueda rápida y encontré lo siguiente (Optics). No puedo garantizar su calidad, sin embargo, el algoritmo parece bastante simple, por lo que debería poder validarlo/adaptarlo rápidamente.
Aquí está un ejemplo rápido de cómo construir racimos en la salida del algoritmo de la óptica:
def cluster(order, distance, points, threshold):
''' Given the output of the options algorithm,
compute the clusters:
@param order The order of the points
@param distance The relative distances of the points
@param points The actual points
@param threshold The threshold value to cluster on
@returns A list of cluster groups
'''
clusters = [[]]
points = sorted(zip(order, distance, points))
splits = ((v > threshold, p) for i,v,p in points)
for iscluster, point in splits:
if iscluster: clusters[-1].append(point)
elif len(clusters[-1]) > 0: clusters.append([])
return clusters
rd, cd, order = optics(points, 4)
print cluster(order, rd, points, 38.0)
¿miraste SciPy: http://docs.scipy.org/doc/scipy/reference/cluster.html? – vartec
@vartec - Sí, lo hice. En realidad, estaba usando los métodos de agrupación jerárquica que se proporcionan allí (fcluster). Pero ahora, me gustaría cambiar a OPTICS. –
¿OPTICS es un algoritmo tan desconocido/desconocido que mi pregunta no recibe atención? = ( –