Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.feature_selection import SelectKBest
- from minepy import MINE
- # Since the design of MINE is not functional, the mic method is defined as a functional one, returning a binary group, and the second item of the binary group is set to a fixed P value of 0.5.
- def mic(x, y):
- m = MINE()
- m.compute_score(x, y)
- return (m.mic(), 0.5)
- #Select K best features, return the data after feature selection
- SelectKBest(lambda X, Y: array(map(lambda x:mic(x, Y), X.T)).T, k=2).fit_transform(iris.data, iris.target)
Add Comment
Please, Sign In to add comment