MousaviSajad / ECG-Heartbeat-Classification-seq2seq-model

Inter- and intra- patient ECG heartbeat classification for arrhythmia detection: a sequence to sequence deep learning approach
Other
175 stars 54 forks source link

Add a python3 and tensorflow2 version of seq_seq_annot_aami.py #13

Closed mio-19 closed 2 months ago

mio-19 commented 1 year ago

Converted using 2to3 and tensorflow migration tool. Manually fixed a few places.

To use imbalanced-learn 0.4.3 with latest scikit-learn, I patched some files:

python3 -m venv tf3
. tf3/bin/activate.sh
python3 -m pip install numpy scipy scikit-learn matplotlib imbalanced-learn==0.4.3 tensorflow tensorflow-addons
sed -i 's|from sklearn.externals import six|import six|g' /home/user/PyEnv/tf3/lib/python3.10/site-packages/imblearn/base.py
sed -i 's|sklearn.neighbors.base|sklearn.neighbors._base|g;s|from sklearn.externals import six|import six|g' /home/user/PyEnv/tf3/lib/python3.10/site-packages/imblearn/utils/_validation.py
sed -i 's|from sklearn.utils import check_random_state, safe_indexing|from sklearn.utils import check_random_state, _safe_indexing|g' /home/user/PyEnv/tf3/lib/python3.10/site-packages/imblearn/over_sampling/_adasyn.py
sed -i 's|from sklearn.utils import check_X_y, check_random_state, safe_indexing|from sklearn.utils import check_X_y, check_random_state, _safe_indexing|g' /home/user/PyEnv/tf3/lib/python3.10/site-packages/imblearn/over_sampling/_random_over_sampler.py
sed -i 's|from sklearn.utils import safe_indexing|from sklearn.utils import _safe_indexing|g' /home/user/PyEnv/tf3/lib/python3.10/site-packages/sklearn/utils/__init__.py /home/user/PyEnv/tf3/lib/python3.10/site-packages/imblearn/over_sampling/_smote.py
sed -i 's| safe_indexing| _safe_indexing|g' /home/user/PyEnv/tf3/lib/python3.10/site-packages/imblearn/*/*.py