maxframe.learn.datasets.make_regression#

maxframe.learn.datasets.make_regression(n_samples=100, n_features=100, *, n_informative=10, n_targets=1, bias=0.0, effective_rank=None, tail_strength=0.5, noise=0.0, shuffle=True, coef=False, random_state=None)[源代码]#

生成一个随机回归问题。

输入集可以是良好条件的(默认)或者具有低秩-肥尾奇异值分布。详情请参见 make_low_rank_matrix()

输出通过将具有 n_informative 个非零回归系数的(可能带偏置的)随机线性回归模型应用于先前生成的输入,并加上一些可调尺度的高斯中心噪声生成。

更多内容请参见 用户指南

参数:
  • n_samples (int, default=100) -- 样本数量。

  • n_features (int, default=100) -- 特征数量。

  • n_informative (int, default=10) -- 信息特征的数量,即用于构建生成输出的线性模型的特征数量。

  • n_targets (int, default=1) -- 回归目标的数量,即与样本关联的 y 输出向量的维度。默认情况下,输出是标量。

  • bias (float, default=0.0) -- 底层线性模型中的偏置项。

  • effective_rank (int, default=None) -- 如果不为 None:用于通过线性组合解释大部分输入数据所需的奇异向量的近似数量。在输入中使用这种奇异谱可以使得生成器重现实际中常见的相关性。如果为 None:输入集是良好条件的、中心化的且具有单位方差的高斯分布。

  • tail_strength (float, default=0.5) -- 如果 effective_rank 不为 None,则为奇异值分布中肥尾噪声部分的相对重要性。当为浮点数时,应在 0 和 1 之间。

  • noise (float, default=0.0) -- 应用于输出的高斯噪声的标准差。

  • shuffle (bool, default=True) -- 打乱样本和特征的顺序。

  • coef (bool, default=False) -- 如果为 True,则返回底层线性模型的系数。

  • random_state (int, RandomState instance or None, default=None) -- 确定数据集创建时的随机数生成方式。传入一个整数以在多次函数调用中获得可重现的输出。参见 术语表

返回:

  • X (tensor of shape (n_samples, n_features)) -- 输入样本。

  • y (tensor of shape (n_samples,) or (n_samples, n_targets)) -- 输出值。

  • coef (tensor of shape (n_features,) or (n_features, n_targets)) -- 底层线性模型的系数。仅在 coef 为 True 时返回。