python类feature_selection()的实例源码

load_config.py 文件源码 项目:elm 作者: ContinuumIO 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def _validate_feature_selection(self):
        '''Validate the "feature_selection" section of config'''
        feature_selection = self.feature_selection = self.config.get('feature_selection') or {}
        if not feature_selection:
            return True
        self._validate_type(feature_selection, 'feature_selection', dict)
        for k, s in feature_selection.items():
            self._validate_type(k, 'feature_selection:{}'.format(k), str)
            self._validate_type(s, 'feature_selection:{}'.format(s), dict)
            selection = s.get('method')
            if selection and selection not in dir(skfeat):
                raise ValueError('{} is not in dir(sklearn.feature_selection)'.format(selection))
            feature_selection[k] = s
        self.feature_selection = feature_selection


问题


面经


文章

微信
公众号

扫码关注公众号