neuropsychology / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
https://neuropsychology.github.io/NeuroKit
MIT License
1.57k stars 419 forks source link

Issue computing ApEn with scikit-learn version 1.3.1 #910

Open danibene opened 1 year ago

danibene commented 1 year ago

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

DominiqueMakowski commented 1 year ago

Yes, I just realized it's what messing up with the CIs, let me give it a fix

danibene commented 1 year ago

Seems like it's related to this: https://github.com/scikit-learn/scikit-learn/pull/26754

danibene commented 1 year ago

Yes, I just realized it's what messing up with the CIs, let me give it a fix

Thank you!

DominiqueMakowski commented 1 year ago

Weird the tests still fail as if they weren't running with the update I made

DominiqueMakowski commented 1 year ago

I think I'll merge that branch soon anyway, and then we'll see from dev

stale[bot] commented 7 months ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.