Skip to content

Instantly share code, notes, and snippets.

View keizerzilla's full-sized avatar
💯
🏁

Artur Rodrigues keizerzilla

💯
🏁
  • Brasil
  • 03:37 (UTC -03:00)
View GitHub Profile
@keizerzilla
keizerzilla / dunn-sklearn.py
Created December 2, 2018 01:18
Dunn index for sklearn-generated clusters
import numpy as np
def normalize_to_smallest_integers(labels):
"""Normalizes a list of integers so that each number is reduced to the minimum possible integer, maintaining the order of elements.
:param labels: the list to be normalized
:returns: a numpy.array with the values normalized as the minimum integers between 0 and the maximum possible value.
"""