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