我正在尝试使用KBinsDiscretizer
from sklearn.preprocessing
,但它返回整数值 1,2,..,N (表示间隔)。是否可以将正确的间隔返回为(0.2, 0.5)或者尚未实现?
问问题
1157 次
1 回答
1
基于文档:https ://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.KBinsDiscretizer.html :
属性: n_bins_:int 数组,形状(n_features,):
Number of bins per feature. Bins whose width are too small (i.e., <= 1e-8) are removed with a warning. bin_edges_ : array of arrays,
形状(n_features,):
The edges of each bin. Contain arrays of varying shapes (n_bins_, ) Ignored features will have empty arrays.
在您的情况下,这将意味着否。还有一个提示:
The inverse_transform function converts the binned data into the original feature space. Each value will be equal to the mean of the two bin edges.```
于 2019-09-27T07:24:56.397 回答