autofeat 的特征筛选原理

该博客详细介绍了autofeat库在特征筛选过程中的方法。首先,它使用85%的样本进行初步筛选,然后通过标准化数据。接下来,应用特征筛选函数,结合噪声过滤策略,对特征进行多次迭代和筛选。在这一过程中,特征被逐步减少,通过添加高斯噪音和进行多次迭代,确保筛选的有效性。最终,通过统计特征在多次筛选后的保留情况,确定最优特征集合。
摘要由CSDN通过智能技术生成

主要代码在autofeat.autofeat.AutoFeatModel#fit_transform, 在做完特征生成后, 调用 autofeat.featsel.select_features函数做特征筛选。

select_features函数, 会做featsel_runs次特征筛选

            selected_columns = []
            for i in range(featsel_runs):
                selected_columns.extend(run_select_features(i))

run_select_features 是一个定义在本地的Local 函数。

    def run_select_features(i):
        if verbose > 0:
            print("[featsel] Feature selection run %i/%i" % (i+1, featsel_runs))
        np.random.seed(i) # todo rng
        rand_idx = np.random.permutation(df_scaled.index)[:max(10, int(0.85 * len(df_scaled)))]
        return _select_features_1run(df_scaled.iloc[rand_idx], target_scaled[rand_idx], problem_type,
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值