Craigacp / MIToolbox

Mutual Information functions for C and MATLAB
BSD 3-Clause "New" or "Revised" License
141 stars 59 forks source link

Different result compared with sklearn.metric.mutual_info_score #9

Open kaixiongg opened 2 years ago

kaixiongg commented 2 years ago

Readme provides the result as 0.02, is there any normalization or what influence the result?

x = np.array([1,1,1,0,0]) y=np.array([1,0,1,1,0]) mutual_info_score(x,y) 0.013844293808390418

Craigacp commented 2 years ago

MIToolbox uses log base 2 for all computations, scikit-learn uses log base e. So our units are "bits" and theirs are "nats".

kaixiongg commented 2 years ago

Understood. thanks for your reply