Calculates normalized mutual information for every numeric or factor or mixed variable pair in a dataset.
Details
The normalized mutual information is calculated using maxNMI
from linkpotter package
Examples
pair_nmi(iris)
#> # A tibble: 10 × 6
#> x y score group value pair_type
#> <chr> <chr> <chr> <chr> <dbl> <chr>
#> 1 Petal.Length Sepal.Length nmi all 0.699 nn
#> 2 Petal.Width Sepal.Length nmi all 0.632 nn
#> 3 Sepal.Length Sepal.Width nmi all 0.203 nn
#> 4 Petal.Length Sepal.Width nmi all 0.379 nn
#> 5 Petal.Width Sepal.Width nmi all 0.370 nn
#> 6 Petal.Length Petal.Width nmi all 0.835 nn
#> 7 Sepal.Length Species nmi all 0.487 fn
#> 8 Sepal.Width Species nmi all 0.261 fn
#> 9 Petal.Length Species nmi all 0.870 fn
#> 10 Petal.Width Species nmi all 0.892 fn