python 使用最大信息系数

python 使用最大信息系数

定义MIC函数

def mic(x, y):
     m = MINE()
     m.compute_score(x, y)
     return (m.mic(), 0.5)

定义SelectKBest中的函数钩子

res = lambda X, Y: tuple(map(tuple,np.array(list(map(lambda x: mic(x, Y),X.T))).T))

使用SelectKBest函数

   skb = SelectKBest(res, k=30)
   data_new = skb.fit_transform(data, target)

你可能感兴趣的:(机器学习,python,python,最大信息系数)