对于当前数据集 D,设标签为 0 的比例为 p0,标签为 1 的比例为 p1,则:
给定一个二分类数据集 X 和标签 y,请你实现决策树中基于 Gini 指数下降量 的最佳划分选择。
对于每个特征,需要枚举所有可能的划分阈值 threshold,将样本划分为左右两个子集:
X[i][feature] <= thresholdX[i][feature] > thresholdGini 指数定义如下:
Scan the QR code below with WeChat to sign in
First-time scan will create your account automatically
请使用微信扫描下方二维码完成注册