# Mutual information example

```
"""
Mutual information measures mutual dependence between two variables (in bits), being more general than a correlation coefficient. For more information: https://en.wikipedia.org/wiki/Mutual_information.
"""
from sklearn.metrics import mutual_info_score
x = [10,15,17,19,21,26,33,45]
y = [40,16,22,17,14,13,29,37]
print(mutual_info_score(x,y))
# 2.07944154168
y = [100,100,17,19,14,13,29,100]
print(mutual_info_score(x,y))
# 1.66746193343
y = [100,100,100,19,14,100,100,100]
print(mutual_info_score(x,y))
# 0.735621939759
```