利用feature-selector进行特征选择

dataset = pd.read_csv(’/content/drive/My Drive/test_lightGBM/EUR_USD_NEWS_SOCIAL_daily_fe.csv’)
y = dataset[‘bid_chg_on’].values
x = dataset.drop(columns=[‘date’,‘bid_chg_on’,‘ask_chg_on’,‘bid_chg_1w’,‘ask_chg_1w’,‘bid_chg_1m’,‘ask_chg_1m’,‘bid_chg_2m’,‘ask_chg_2m’,‘bid_chg_3m’,‘ask_chg_3m’,‘bid_chg_6m’,‘ask_chg_6m’])

# 创建 feature-selector 实例,并传入features 和labels
fs = FeatureSelector(data = x, labels = y)
fs.identify_missing(missing_threshold=0.3)
fs.ops[‘missing’]
fs.plot_missing()

你可能感兴趣的:(机器学习)