teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

3

説明文修正

2018/02/24 06:06

投稿

wakame
wakame

スコア1170

answer CHANGED
@@ -1,4 +1,4 @@
1
- [追記]
1
+ **[追記]**
2
2
  本が手元にないので翻訳元の[introduction_to_ml_with_python](https://github.com/amueller/introduction_to_ml_with_python)リポジトリを調べてみました。
3
3
  関連しそうなIssueがあったので参考にしてください。
4
4
  [amueller/introduction_to_ml_with_python - Question about make_blobs(n_samples)](https://github.com/amueller/introduction_to_ml_with_python/issues/60)

2

説明追記

2018/02/24 06:06

投稿

wakame
wakame

スコア1170

answer CHANGED
@@ -1,9 +1,24 @@
1
1
  [追記]
2
- https://github.com/amueller/introduction_to_ml_with_python/issues/60
2
+ 本が手元にないので翻訳元の[introduction_to_ml_with_python](https://github.com/amueller/introduction_to_ml_with_python)リポジトリを調べてみました。
3
+ 関連しそうなIssueがあったので参考にしてください。
4
+ [amueller/introduction_to_ml_with_python - Question about make_blobs(n_samples)](https://github.com/amueller/introduction_to_ml_with_python/issues/60)
3
5
  sklearnのmake_blobsを使うのではなく
4
- https://github.com/amueller/introduction_to_ml_with_python/blob/cdc33dd1e483dd8f3d494b41c49916119e78a1db/mglearn/make_blobs.py
6
+ [amueller/introduction_to_ml_with_python/mglearn/make_blobs.py](https://github.com/amueller/introduction_to_ml_with_python/blob/cdc33dd1e483dd8f3d494b41c49916119e78a1db/mglearn/make_blobs.py)
5
7
  こちらのリポジトリのmake_blobsを使うのではないですか。
6
8
 
9
+ ```python
10
+ # 質問者様が抽出しているコード?
11
+ # sklearn.datasetsのmake_blobs使ってないですね
12
+ from mglearn.datasets import make_blobs
13
+ X, y = make_blobs(n_samples=(400, 50), centers=2, cluster_std=[7.0, 2],
14
+ random_state=22)
15
+ X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
16
+ svc = SVC(gamma=.05).fit(X_train, y_train)
17
+ ```
18
+
19
+ [amueller/introduction_to_ml_with_python/05-model-evaluation-and-improvement.ipynb](https://github.com/amueller/introduction_to_ml_with_python/blob/master/05-model-evaluation-and-improvement.ipynb)
20
+
21
+ ---
7
22
  tupleで渡しているのが悪いのでは?
8
23
 
9
24
  > n_samples : int, optional (default=100)

1

質問追記

2018/02/24 06:05

投稿

wakame
wakame

スコア1170

answer CHANGED
@@ -1,3 +1,9 @@
1
+ [追記]
2
+ https://github.com/amueller/introduction_to_ml_with_python/issues/60
3
+ sklearnのmake_blobsを使うのではなく
4
+ https://github.com/amueller/introduction_to_ml_with_python/blob/cdc33dd1e483dd8f3d494b41c49916119e78a1db/mglearn/make_blobs.py
5
+ こちらのリポジトリのmake_blobsを使うのではないですか。
6
+
1
7
  tupleで渡しているのが悪いのでは?
2
8
 
3
9
  > n_samples : int, optional (default=100)