【发布时间】:2016-09-30 09:33:52
【问题描述】:
我基本上有一个 python 脚本,它尝试结合各种分类器的各种降维技术。 我试图为每个分类器收集信息最丰富的特征:
if 'forest' in type(classifier).__name__.lower():
importances = classifier.feature_importances_
coefs_with_fns = numpy.argsort(importances)[::-1]
else:
coefs_with_fns = sorted(zip(classifier.coef_, reduced_training.columns))
虽然这原则上有效,但输出只是一系列整数,(我假设)对应于分类器之前特征数组中的列号。这给我带来了问题:这个数组是一维降维方法的直接结果,它丢弃了所有以前附加的列标签。
所以我的问题是:有没有办法将降维的结果追溯到原始数据集中的实际列/标签?
【问题讨论】:
标签: python machine-learning scikit-learn