-
Notifications
You must be signed in to change notification settings - Fork 0
/
MultiVar_FS.py
41 lines (25 loc) · 884 Bytes
/
MultiVar_FS.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pandas as pd
import numpy as np
#import pymrmr
from skfeature.function.information_theoretical_based import JMI, MRMR, MIM, MIFS
def apply_Model(X,Y):
result=pymrmr.mRMR(X,'MIQ',10)
print(result)
def import_Data():
Data = pd.read_csv('Disease_Data_BiGram.csv')
# print(Data.shape)
X = Data.iloc[:, 0:Data.shape[1] - 2]
Y = Data['Class']
Y_ = Data['Subject']
return X, Y, Y_
FS={}
X,Y,Y_=import_Data()
FS['MRMR']=X.columns[MRMR.mrmr(np.array(X),Y_,n_selected_features=15)[:15]]
FS['JMI']=X.columns[JMI.jmi(np.array(X),Y_,n_selected_features=15)[:15]]
FS['MIFS']=X.columns[MIFS.mifs(np.array(X),Y_,n_selected_features=15)[:15]]
FS['MIM']=X.columns[MIM.mim(np.array(X),Y_,n_selected_features=15)[:15]]
FS=pd.DataFrame(FS)
print(FS)
FS.to_csv('Selected_Features_MultiVar_BiG.csv')
#print(pd.DataFrame(FS))
#model = apply_Model(X,Y_)