Skip to content

Instantly share code, notes, and snippets.

@orico
Created April 24, 2018 06:44
Show Gist options
  • Save orico/9af66d15d395b9beeefc0176511318f7 to your computer and use it in GitHub Desktop.
Save orico/9af66d15d395b9beeefc0176511318f7 to your computer and use it in GitHub Desktop.
PCAAE-plotclusters.py
def plot3clusters(X, title, vtitle):
plt.figure()
colors = ['navy', 'turquoise', 'darkorange']
lw = 2
for color, i, target_name in zip(colors, [0, 1, 2], target_names):
plt.scatter(X[y == i, 0], X[y == i, 1], color=color, alpha=1., lw=lw,
label=target_name)
plt.legend(loc='best', shadow=False, scatterpoints=1)
plt.title(title)
plt.xlabel(vtitle + "1")
plt.ylabel(vtitle + "2")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment