Skip to content

Instantly share code, notes, and snippets.

@lukas
Created January 8, 2020 02:22
Show Gist options
  • Save lukas/04d7779e82bf08ba48c12018a3d037fa to your computer and use it in GitHub Desktop.
Save lukas/04d7779e82bf08ba48c12018a3d037fa to your computer and use it in GitHub Desktop.
import wandb
import matplotlib.pyplot as plt
from sklearn import datasets
wandb.init()
iris = datasets.load_iris()
X = iris.data[:, :2] # we only take the first two features.
y = iris.target
x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5
plt.figure(2, figsize=(8, 6))
plt.clf()
# Plot the training points
plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Set1,
edgecolor='k')
plt.xlabel('Sepal length')
plt.ylabel('Sepal width')
plt.xlim(x_min, x_max)
plt.ylim(y_min, y_max)
plt.xticks(())
plt.yticks(())
wandb.log({"dataset":plt})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment