首页 > 解决方案 > Scikit-feature CFS 在 python 上崩溃

问题描述

我正在尝试在 python 中对我的数据框执行基于相关的特征选择(CFS)。我使用来自 scikit-feature 的 CFS:https ://github.com/jundongl/scikit-feature/blob/master/skfeature/function/statistical_based/CFS.py - 这是算法

我的数据集有100+ features2119 rows。当我通过算法运行它时,它并没有结束。它最终崩溃了,我不知道为什么。

我通过同一个存储库中的其他算法运行我的数据集,我没有问题。当我这样做时,我在 WEKA 中也没有问题。

这是我的代码:

self.dataset = pd.DataFrame(pd.read_csv(filenames[0], encoding = 'latin-1'))
self.X = self.dataset.iloc[:, :-1].values
self.y = self.dataset.iloc[:, -1].values
X_train, X_test, y_train, y_test = train_test_split(self.X, self.y, test_size=0.2,random_state=0)
score = CFS.cfs(X_train, y_train) # this doesn't end and eventually crashes
print(score)

关于为什么会发生这种情况以及如何解决这个问题的任何想法?

谢谢!

标签: pythonpandasfeature-selection

解决方案


推荐阅读