I found two ways to implement MRMR to select functions in python. The source of the article containing this method is:
https://www.dropbox.com/s/tr7wjpc2ik5xpxs/doc.pdf?dl=0
This is my dataset code.
import numpy as np import pandas as pd from sklearn.datasets import make_classification from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" X, y = make_classification(n_samples=10000, n_features=6, n_informative=3, n_classes=2, random_state=0, shuffle=False)
Method 1: Use MRMR using pymrmr
Contains MID and MIQ
which is published by the author Link https://github.com/fbrundu/pymrmr
import pymrmr pymrmr.mRMR(df, 'MIQ',6)
['Feature 4', 'Feature 5', 'Feature 2', 'Feature 6', 'Feature 1', 'Feature 3']
or performed using the second method
pymrmr.mRMR(df, 'MID',6)
['Feature 4', 'Feature 6', 'Feature 5', 'Feature 2', 'Feature 1', 'Feature 3']
Both of these methods, on the dataset above, give this 2 output. Another GitHub author claims that you can use its version to apply the MRMR method. However, when I use it for the same dataset, I have a different result.
Method 2. Application of MRMR using MIFS
github link
https://github.com/danielhomola/mifs
import mifs for i in range(1,11): feat_selector = mifs.MutualInformationFeatureSelector('MRMR',k=i) feat_selector.fit(X_train, y_train)
And if you run the above iteration for all different values โโof i, there will be no time when both methods actually give the same output of the function selection.
What could be the problem here?