无法使用FeatureSelector库打印

2024-06-02 06:56:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试运行下面的代码。一切正常,直到我到达最后一行,然后我得到以下错误:

AttributeError: 'FeatureSelector' object has no attribute 'reset_plot'

这是我正在测试的代码

from feature_selector import FeatureSelector
import pandas as pd

df = pd.read_csv("C:\\path_here\\credit.csv")
df.head()

df = df.select_dtypes(include=[np.number])

train_labels = df['TARGET']
df.head()

df = df.drop(columns = ['TARGET'])

fs = FeatureSelector(data = df, labels = train_labels)
fs.identify_missing(missing_threshold=0.6)

missing_features = fs.ops['missing']
missing_features[:10]

fs.plot_missing()

看起来计算结果是正确的,但我无法描绘结果。你知道这里有什么问题吗?我在谷歌上搜索了一个解决方案,但没有找到任何有用的

我正在查看此链接中的示例

https://towardsdatascience.com/a-feature-selection-tool-for-machine-learning-in-python-b64dd23710f0

谢谢


Tags: csv代码importtargetdflabelsplottrain