python - ValueError:信息、冗余和重复特征的数量必须总和小于总特征的数量
问题描述
我正在尝试使用以下代码为分类模型生成数据集:
from sklearn.datasets import make_classification
import matplotlib.pyplot as plt
X, y = make_classification(n_features=2)
plt.plot(X, y)
plt.show()
但这会返回错误:
raise ValueError("Number of informative,redundant and repeat") ValueError: 提供信息的、冗余的和重复的特征的数量总和必须小于总特征的数量
解决方案
推荐阅读
- python - PyGithub:如何使用 get_repositories 搜索多个主题
- amazon-web-services - 我们可以将 Amazon Honeycode 应用程序移至 Android Play 商店吗?
- vba - 将每个数组项输出到文本框中的行中
- java - 从满足条件的数组中获取随机对象
- scala - sbt 错误:对象 spark 不是包 org.apache 的成员
- java - 使用 Java Spring Framework 连接到 SQL Server 时出错 - 无法加载 JDBC 驱动程序类
- mysql - 在内部连接中迭代地使用 MySQL LAG()
- odoo - 我有一个 many2many 表,但我需要提供域,因为只有模型中的合作伙伴记录需要显示在 many2many 表中
- git - Git extensions not working in VSCode for only one project
- python - 如何在cvxpy中写日志函数的透视图?