You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Disallow `method` and `normed` to be used together
58
+
ifisnothing(method)
59
+
isnothing(normed) || Base.depwarn("`normed` kwarg is deprecated, please use `method=:normalized` instead of `normed=true`, and `method=:classic` instead of `normed=false'", :mutualinfo)
60
+
method =ifisnothing(normed) || normed
61
+
:normalized
62
+
else
63
+
:classic
64
+
end
65
+
else
66
+
isnothing(normed) ||throw(ArgumentError("`normed` kwarg is not compatible with `method` kwarg"))
67
+
end
68
+
# Little hack to ensure the correct error is thrown
69
+
if method ===:adjusted&&length(kwargs) >=1&&:aggregate∉keys(kwargs)
70
+
method =:classic
71
+
end
72
+
73
+
_mutualinfo(Val(method), a, b; kwargs...)
74
+
end
75
+
76
+
function_mutualinfo(::Val{:normalized}, a, b)
77
+
return_mutualinfo(counts(a, b)) do hck, hc, hk, _, _, _
78
+
mi = hc - hck
79
+
2*mi/(hc+hk)
80
+
end
81
+
end
82
+
function_mutualinfo(::Val{:classic}, a, b)
83
+
return_mutualinfo(counts(a, b)) do hck, hc, _, _, _, _
0 commit comments