Guest User

Untitled

a guest
Jul 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. from sklearn.feature_selection import SelectKBest
  2. from minepy import MINE
  3.  
  4. # 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.
  5. def mic(x, y):
  6. m = MINE()
  7. m.compute_score(x, y)
  8. return (m.mic(), 0.5)
  9. #Select K best features, return the data after feature selection
  10. 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