def plot_clustering(X_red, labels, title=None):
    (x_min, x_max) = (np.min(X_red, axis=0), np.max(X_red, axis=0))
    X_red = ((X_red - x_min) / (x_max - x_min))
    plt.figure(figsize=(6, 4))
    for i in range(X_red.shape[0]):
        plt.text(X_red[(i, 0)], X_red[(i, 1)], str(y[i]), color=plt.cm.nipy_spectral((labels[i] / 10.0)), fontdict={'weight': 'bold', 'size': 9})
    plt.xticks([])
    plt.yticks([])
    if (title is not None):
        plt.title(title, size=17)
    plt.axis('off')
    plt.tight_layout(rect=[0, 0.03, 1, 0.95])
def plot_clustering(X_red, labels, title=None):
    (x_min, x_max) = (np.min(X_red, axis=0), np.max(X_red, axis=0))
    X_red = ((X_red - x_min) / (x_max - x_min))
    plt.figure(figsize=(6, 4))
    for i in range(X_red.shape[0]):
        plt.text(X_red[(i, 0)], X_red[(i, 1)], str(y[i]), color=plt.cm.nipy_spectral((labels[i] / 10.0)), fontdict={'weight': 'bold', 'size': 9})
    plt.xticks([])
    plt.yticks([])
    if (title is not None):
        plt.title(title, size=17)
    plt.axis('off')
    plt.tight_layout(rect=[0, 0.03, 1, 0.95])