Reputation: 1
I have been doing a project in machine learning. I need to implement an algorithm to select features in a gene expression data efficiently. How to modify the code below to rank the features in the order of highest GI (Gini Importance) and MIC (Maximum Information Coefficient)?
This is the code I've tried: I've used the outer for loop to find the feature importance of every feature in the feature subset S1 using GI. Then used inner for loop to find the feature relevancy of every feature with respect to every other feature in S1 using MIC.
for i in (S1):
rf_classifier=
RandomForestClassifier(n_estimators=100,random_state=42)
rf_classifier.fit(S1, y_train)
GI = rf_classifier.feature_importances_
print(GI)
for j in range (i, len(S1)):
mine = MINE()
mine.compute_score(S1[i], S1[j])
MIC = mine.mic()
print(f"Maximum Information Coefficient: {MIC}")
Upvotes: 0
Views: 54