CINC2017¶
- class torch_ecg.databases.CINC2017(db_dir: str | bytes | PathLike | None = None, working_dir: str | bytes | PathLike | None = None, verbose: int = 1, **kwargs: Any)[source]¶
Bases:
PhysioNetDataBase
AF Classification from a Short Single Lead ECG Recording – The PhysioNet Computing in Cardiology Challenge 2017
ABOUT
training set contains 8,528 single lead ECG recordings lasting from 9 s to just over 60 s, and the test set contains 3,658 ECG recordings of similar lengths
records are of frequency 300 Hz and have been band pass filtered
data distribution:
Type
# recording
Time length (s)
Mean
SD
Max
Median
Min
Normal
5154
31.9
10.0
61.0
30
9.0
AF
771
31.6
12.5
60
30
10.0
Other rhythm
2557
34.1
11.8
60.9
30
9.1
Noisy
46
27.1
9.0
60
30
10.2
Total
8528
32.5
10.9
61.0
30
9.0
Webpage of the database on PhysioNet [1].
Usage
Atrial fibrillation (AF) detection
References
Citation
10.22489/CinC.2017.065-469
- Parameters:
db_dir (path-like, optional) – Storage path of the database. If not specified, data will be fetched from Physionet.
working_dir (path-like, optional) – Working directory, to store intermediate files and log files.
verbose (int, default 1) – Level of logging verbosity.
kwargs (dict, optional) – Auxilliary key word arguments.
- property database_info: DataBaseInfo¶
The
DataBaseInfo
object of the database.
- load_ann(rec: str | int, original: bool = False, ann_format: str = 'a') str [source]¶
Load the annotation of the record.
- Parameters:
rec (str or int) – Record name or index of the record in
all_records
.original (bool, default False) – If True, load annotations from the annotation file
REFERENCE-original.csv
, otherwise fromREFERENCE.csv
.ann_format ({"a", "f"}, optional) –
Format of returned annotation, by default “a”.
”a” - abbreviation
”f” - full name
- Returns:
ann – Annotation (label) of the record.
- Return type:
- plot(rec: str | int, data: ndarray | None = None, ann: str | None = None, ticks_granularity: int = 0, rpeak_inds: Sequence[int] | ndarray | None = None) None [source]¶
Plot the ECG signal of the record.
- Parameters:
rec (str or int) – Record name or index of the record in
all_records
.data (numpy.ndarray, optional) – The ECG signal to plot. If not None, data of rec will not be used. This is useful when plotting filtered data.
ann (dict, optional,) – Annotations for data, which is a dict with keys “SPB_indices”, “PVC_indices”, and with
ndarray
values. Ignored if data is None.ticks_granularity (int, default 0) – Granularity to plot axis ticks, the higher the more ticks. 0 (no ticks) –> 1 (major ticks) –> 2 (major + minor ticks)
rpeak_inds (array_like, optional) – Array of indices of R peaks.
- Return type:
None