Sklearn合并过程-可以返回一个间隔吗?

问题描述 投票:0回答:1

我正在尝试使用KBinsDiscretizer中的sklearn.preprocessing,但它返回的整数值为1,2,.. N(代表间隔)。是否可以将正确的间隔返回为(0.2,0.5)或尚未实现?

python-3.x python-2.7 scikit-learn binning discretization
1个回答
0
投票

基于文档: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.```
© www.soinside.com 2019 - 2024. All rights reserved.