質問編集履歴
1
エラーメッセージを追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -163,3 +163,35 @@
|
|
163
163
|
```
|
164
164
|
|
165
165
|
![イメージ説明](9ff5cfab7f1143e1c518197a69255995.png)
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
例えば以上のコードで実行すると以下のエラーメッセージが出てきます
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
Traceback (most recent call last):
|
174
|
+
|
175
|
+
File "散布図と相関係数.py", line 90, in <module>
|
176
|
+
|
177
|
+
pred=KMeans(n_clusters=3).fit(a)
|
178
|
+
|
179
|
+
File "/usr/lib/python2.7/dist-packages/sklearn/cluster/k_means_.py", line 887, in fit
|
180
|
+
|
181
|
+
X = self._check_fit_data(X)
|
182
|
+
|
183
|
+
File "/usr/lib/python2.7/dist-packages/sklearn/cluster/k_means_.py", line 861, in _check_fit_data
|
184
|
+
|
185
|
+
X.shape[0], self.n_clusters))
|
186
|
+
|
187
|
+
ValueError: n_samples=1 should be >= n_clusters=3
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
------------------
|
194
|
+
|
195
|
+
(program exited with code: 1)
|
196
|
+
|
197
|
+
Press return to continue
|