X, y = make_classification(n_samples=1000, n_features=2,\
n_informative=2, n_redundant=0,\
n_classes=1,\
n_clusters_per_class=4, \
random_state=4)
# n_samples:样本点数,也就是n_features微向量的个数
# n_features: 样本点的向量维度
# n_informative: 样本矩阵的秩
# n_redundant: 冗余信息,是其他的样本点的线性组合
# n_repeated:重复信息,也是冗余信息,但是只有一个线性系数是1其他都是0
# n_classes:y=0~n_classes-1,就是将样本分成多少类
# n_clusters_per_class:每一类有多少簇,在类中有进一步细分
# random_state:随机数种子,若等于一个整数,则每次生成的随机样本是固定的,便于固定结果;如果为None,每次重新生成新的随机样本。
# 其中,n_informative + n_redundant + n_repeated <= n_samples ;
# n_classes * n_clusters_per_class <= 2^n_features
sklearn make_classification参数
最新推荐文章于 2023-05-23 08:30:55 发布