Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Importing mutual_info_score function to calculate the mutual information between two variables.
- from sklearn.metrics import mutual_info_score
- #Generating the dataset
- a1 = [2, 5, 3, 1, 2, 3, 2, 6, 7]
- a2 = [3, 3, 1, 9, 9, 9, 0, 0, 0]
- a3 = [2, 2, 2, 6, 6, 6, 4, 4, 4]
- y = [0, 0, 0, 1, 1, 1, 2, 2, 2]
- # Finding mutual information score
- print mutual_info_score(a1, y)
- print mutual_info_score(a1, y)
- print mutual_info_score(a1, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement