【问题标题】:How to control the CutPoints(while performing supervised binning) in R如何在 R 中控制 CutPoints(在执行监督分箱时)
【发布时间】:2015-10-15 09:19:00
【问题描述】:

我正在使用 R 的“离散化”包。在找到切点时,我得到以下结果。

命令:

discretization::cutPoints(data3$Dist_to_Stream, data3$Malaria_w3)

其中Dist_to_Stream 是数值变量,Malaria_w3 是类(分类)

 [1]    5.118175   95.484400  119.386500  300.842000  311.320500
 [6]  338.104000  387.722500  460.783000  472.821500  551.741500
 [11]  910.745500  214.143000  234.124500  260.812000  358.513000
 [16]  361.015500  449.447500  538.411500  589.118500  626.888000
 [21]  657.261000  648.304500  698.310500  953.814500 1091.265000
 [26] 1181.350000 2023.885000 2040.360000 2069.390000 2201.395000
 [31] 2120.185000 2142.255000 2456.820000 2819.860000

输出切点太多(34 个 bin)。有没有办法在监督(基于熵)分箱时控制切割点的数量?

提前致谢..

【问题讨论】:

    标签: r binning discretization


    【解决方案1】:

    Rdiscretization 包的函数不提供任何此类参数来控制 bin 的数量 (Discretization Documentation)。这可以通过 SPSS 的Optimal Binning 选项轻松完成。可以在执行分箱之前设置最大分箱数(仍然是有监督的分箱)。

    更多信息 Optimal Binning.

    【讨论】:

      猜你喜欢
      • 2010-12-31
      • 1970-01-01
      • 2014-09-12
      • 1970-01-01
      • 2016-08-08
      • 1970-01-01
      • 2019-11-02
      • 2017-12-08
      • 2021-06-26
      相关资源
      最近更新 更多