Created
February 1, 2019 06:12
-
-
Save codeAshu/ac29a16ed47e43b419a6f57d96c8344d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pylab as pl | |
from itertools import cycle | |
def plot_2D(data, target, target_names): | |
colors = cycle('rgbcmykw') | |
target_ids = range(len(target_names)) | |
pl.figure() | |
for i, c, label in zip(target_ids, colors, target_names): | |
pl.scatter(data[target == i, 0], data[target == i, 1], | |
c=c, label=label) | |
pl.legend() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment