我有以下代码
rf = RandomForestClassifier()
rf.fit(X_train, Y_train)
print("Features sorted by their score:")
print(sorted(zip(map(lambda x: round(x, 2), rf.feature_importances_), X_train), reverse=True))
我收到以下错误:
> TypeError Traceback (most recent call last)
>
> ipython-input-109-c48c3ffd74e2> in <module>()
>
> 2 rf.fit(X_train, Y_train)
>
> 3 print ("Features sorted by their score:")
>
> ----> 4 print (sorted(zip(map(lambda x: round(x, 2),
> rf.feature_importances_), X_train), reverse=True))
>
> TypeError: '<' not supported between instances of 'int' and 'str'
我不确定我做错了什么。我的数据框中只有 int 和 float 。