[英]Data sets generation for binary logistic regression
I have classifier line in the form of y = mx + c
.我有
y = mx + c
形式的分类器线。
I would to generate random data points that are above and below this line.我会生成这条线上方和下方的随机数据点。
I tried using the numpy
random
function but I am not able figure how to specifically generate random data sets.我尝试使用
numpy
random
函数,但我无法弄清楚如何专门生成随机数据集。
You could try scikit-learn's make_classification
utility function:你可以试试 scikit-learn 的
make_classification
实用函数:
Generate a random n-class classification problem.
生成一个随机的 n 类分类问题。
For example:例如:
from sklearn.datasets import make_classification
X, y = make_classification(n_features=2, random_state=444)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.