CPointExtractionScipyFindPeaks#

class pepbench.algorithms.icg.CPointExtractionScipyFindPeaks(window_c_correction: int = 3, handle_missing_events: Literal['raise', 'warn', 'ignore'] = 'warn')[source]#

C-point extraction algorithm using find_peaks.

This algorithm extracts C-points based on the maximum of the most prominent peak in the ICG derivative signal using the find_peaks function.

Methods

clone()

Create a new instance of the class with all parameters copied over.

extract(*, icg, heartbeats, sampling_rate_hz)

Extract C-points from given cleaned ICG derivative signal using find_peaks.

get_params([deep])

Get parameters for this algorithm.

set_params(**params)

Set the parameters of this Algorithm.

__init__(window_c_correction: int = 3, handle_missing_events: Literal['raise', 'warn', 'ignore'] = 'warn')[source]#

Initialize new CPointExtractionScipyFindPeaks instance.

Parameters:
window_c_correctionint, optional

Number of preceding heartbeats taken into account for C-point correction (using mean R-C-distance). Default: 3.

handle_missing_eventsone of {“warn”, “raise”, “ignore”}, optional

How to handle failing event extraction. Must be one of:

  • "warn": issue a warning and set the event to NaN,

  • "raise": raise an EventExtractionError, or

  • "ignore": continue silently.

Default: "warn".

clone() Self[source]#

Create a new instance of the class with all parameters copied over.

This will create a new instance of the class itself and all nested objects

extract(*, icg: _IcgRawDataFrame | DataFrame, heartbeats: _HeartbeatSegmentationDataFrame | DataFrame, sampling_rate_hz: float | None)[source]#

Extract C-points from given cleaned ICG derivative signal using find_peaks.

The C-point is detected as the maximum of the most prominent peak in the ICG derivative signal within each segmented heartbeat.

The resulting C-points are saved in the points_ attribute of the class instance.

Parameters:
icgDataFrame

cleaned ICG derivative signal

heartbeatsDataFrame

Dataframe containing one row per segmented heartbeat, each row contains start, end, and R-peak. Result from HeartbeatSegmentationNeurokit.

sampling_rate_hzint

Sampling rate of ICG derivative signal in Hz. Not used in this function.

Returns:
self
get_params(deep: bool = True) dict[str, Any][source]#

Get parameters for this algorithm.

Parameters:
deep

Only relevant if object contains nested algorithm objects. If this is the case and deep is True, the params of these nested objects are included in the output using a prefix like nested_object_name__ (Note the two “_” at the end)

Returns:
params

Parameter names mapped to their values.

set_params(**params: Any) Self[source]#

Set the parameters of this Algorithm.

To set parameters of nested objects use nested_object_name__para_name=.