Python sklearn 模块,feature_selection() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用sklearn.feature_selection()

项目:elm    作者:ContinuumIO    | 项目源码 | 文件源码
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