0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

サンプル用クラスタリング用のデータを作成しよう

Posted at

datasets.make_blobsでクラスタリング用のデータを作成

sklearn.datasetsのmake_blobs関数をインポート
from sklearn.datasets import make_blobs

Xには1つのプロットの(x,y)が、Yにはそのプロットの所属するクラスター番号が入る
X,Y = make_blobs(n_samples=150, # データ点の総数
n_features=2, # 特徴量(次元数)の指定 default:2
centers=3, # クラスター数
cluster_std=0.5, # クラスタ内の標準偏差
shuffle=True, # サンプルをシャッフル
random_state=0) # 乱数生成器の状態を指定

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?