InputTags#

class sklearn.utils.InputTags(one_d_array: bool = False, two_d_array: bool = True, three_d_array: bool = False, sparse: bool = False, categorical: bool = False, string: bool = False, dict: bool = False, positive_only: bool = False, allow_nan: bool = False, pairwise: bool = False)[源代码]#

输入数据的标签。

参数:
one_d_array布尔,默认=假

输入是否可以是1D数组。

two_d_array布尔,默认=True

输入是否可以是2D数组。请注意,大多数常见测试当前仅在此标志设置为时运行 True .

three_d_array布尔,默认=假

输入是否可以是3D数组。

sparse布尔,默认=假

输入是否可以是稀疏矩阵。

categorical布尔,默认=假

输入是否可以分类。

string布尔,默认=假

输入是否可以是类似数组的字符串。

dict布尔,默认=假

输入是否可以是词典。

positive_only布尔,默认=假

估计量是否需要正值X。

allow_nan布尔,默认=假

Whether the estimator supports data with missing values encoded as np.nan.

pairwise布尔,默认=假

此布尔属性指示数据是否 (X ), fit 类似的方法包括对样本的成对测量,而不是每个样本的特征表示。 它通常是 True 其中估计器有 metricaffinitykernel 值为“预先计算”的参数。其主要目的是支持 meta-estimator 或者交叉验证过程,提取旨在用于成对估计器的数据子样本,其中数据需要在两个轴上进行索引。具体来说,此标签由以下人员使用 sklearn.utils.metaestimators._safe_split 切片行和列。

请注意,如果将此标签设置为 True 意味着估计器只能取正值, positive_only 标签必须反映它,并且还设置为 True .