質問編集履歴
1
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
X, y = make_blobs(centers=4, random_state=8)
|
13
13
|
y = y %2
|
14
14
|
|
15
|
-
X_new = np.hstack([X, X[:,1:]*
|
15
|
+
X_new = np.hstack([X, X[:,1:]*2]) # うまくteratail上で表示できませんが, X[:,1:]の2乗としたいです.
|
16
16
|
from mpl_toolkits.mplot3d import Axes3D, axes3d
|
17
17
|
figure = plt.figure()
|
18
18
|
ax = Axes3D(figure, elev=-152, azim=-26)
|
@@ -20,7 +20,7 @@
|
|
20
20
|
ax.scatter(X_new[mask,0], X_new[mask,1], X_new[mask,2], c='b',
|
21
21
|
cmap=mglearn.cm2, s=60)
|
22
22
|
ax.scatter(X_new[~mask,0], X_new[~mask,1], X_new[~mask,2], c='r',
|
23
|
-
marker='^', cmap=mglearn.cm2, s=60)
|
23
|
+
marker='^', cmap=mglearn.cm2, s=60) # この行の~maskの意味がわかりません
|
24
24
|
ax.set_xlabel('feature0')
|
25
25
|
ax.set_ylabel('feature1')
|
26
26
|
ax.set_zlabel('feature1 ** 2')
|