Skip to content

Commit f7620be

Browse files
davidroblesjnothman
authored andcommitted
DOC Make target variable Y lowercase in example (scikit-learn#7905)
1 parent c20b062 commit f7620be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/datasets/plot_iris_dataset.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# import some data to play with
3232
iris = datasets.load_iris()
3333
X = iris.data[:, :2] # we only take the first two features.
34-
Y = iris.target
34+
y = iris.target
3535

3636
x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
3737
y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5
@@ -40,7 +40,7 @@
4040
plt.clf()
4141

4242
# Plot the training points
43-
plt.scatter(X[:, 0], X[:, 1], c=Y, cmap=plt.cm.Paired)
43+
plt.scatter(X[:, 0], X[:, 1], c=y, cmap=plt.cm.Paired)
4444
plt.xlabel('Sepal length')
4545
plt.ylabel('Sepal width')
4646

@@ -54,7 +54,7 @@
5454
fig = plt.figure(1, figsize=(8, 6))
5555
ax = Axes3D(fig, elev=-150, azim=110)
5656
X_reduced = PCA(n_components=3).fit_transform(iris.data)
57-
ax.scatter(X_reduced[:, 0], X_reduced[:, 1], X_reduced[:, 2], c=Y,
57+
ax.scatter(X_reduced[:, 0], X_reduced[:, 1], X_reduced[:, 2], c=y,
5858
cmap=plt.cm.Paired)
5959
ax.set_title("First three PCA directions")
6060
ax.set_xlabel("1st eigenvector")

0 commit comments

Comments
 (0)