不同的结果 - Weka.infogain vs sklearn.mutual_info_classif

时间:2017-11-26 19:03:28

标签: machine-learning scikit-learn weka feature-selection information-gain

我的数据如下:

DATA | FEATURE1 | FEATURE2 | ... 
I    | 0.3213   | 1.231    | ...
A    | 5.0945   | 0.923    | ...
I    | 0.3213   | 0.761    | ...
...  | ...      | ....     | ...

我正在使用该代码:

import csv
import numpy as np
from sklearn.feature_selection import SelectKBest, mutual_info_classif

def get_ranks (path_to_csv_file, features_columns, label_column):
    stats_file = list(csv.reader(open(path_to_csv_file)))
    features, label = np.array(stats_file)[feature_columns],np.array(stats_file)[label_column]
    mutual_info = mutual_info_classif(features, label)

使用Weka,我需要做的就是选择InfogainAttrebuteEval并获得FEATURES的排名列表。 出于某种原因,我不能使用上面的代码获得相同的排名结果。
有什么问题?

0 个答案:

没有答案