adpfeature.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:dmon-adp 作者: igabriel85 项目源码 文件源码
def varianceSelection(self, df, threashold=.8):
        if not isinstance(df, pandas.core.frame.DataFrame):
            logger.error('[%s] : [ERROR] Variance selection only possible on Dataframe not %s',
                                         datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S'), type(df))
            sys.exit(1)
        sel = VarianceThreshold(threshold=(threashold * (1 - threashold)))
        sel.fit_transform(df)
        return df[[c for (s, c) in zip(sel.get_support(), df.columns.values) if s]]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号