NeuroKit
NeuroKit copied to clipboard
Issue computing ApEn with scikit-learn version 1.3.1
Describe the bug
Tried to run hrv()
after upgrading from scikit-learn 1.3.0 to 1.3.1 and got the following error:
out["ApEn"], _ = entropy_approximate(rri, delay=1, dimension=2, tolerance=tolerance)
/neurokit2/complexity/entropy_approximate.py", line 100, in entropy_approximate
out, _ = _entropy_apen(signal, delay, dimension, info["Tolerance"], **kwargs)
/neurokit2/complexity/optim_complexity_tolerance.py", line 363, in _entropy_apen
phi, info = _phi(
/neurokit2/complexity/utils.py", line 29, in _phi
embedded1, count1, kdtree1 = _get_count(
/neurokit2/complexity/utils.py", line 115, in _get_count
valid_metrics = sklearn.neighbors.KDTree.valid_metrics() + ["range"]
TypeError: 'list' object is not callable
Downgrading to scikit-learn 1.3.0 fixed it.
System Specifications I am using neurokit2 0.2.6, pandas 1.5.3, scipy 1.11.2, and numpy 1.24.3