BPointExtractionLozano2007QuadraticRegression#

class pepbench.algorithms.icg.BPointExtractionLozano2007QuadraticRegression(moving_average_window: int = 1, handle_missing_events: Literal['raise', 'warn', 'ignore'] = 'warn')[source]#

B-point extraction algorithm by Lozano et al. (2007) [1] based on quadratic regression of R-C interval.

This algorithm extracts B-points based on the quadratic regression of the relationship between the R-C interval and the B-point.

References

[1]

Lozano, D. L., Norman, G., Knox, D., Wood, B. L., Miller, B. D., Emery, C. F., & Berntson, G. G. (2007). Where to B in dZ/dt. Psychophysiology, 44(1), 113-119. https://doi.org/10.1111/j.1469-8986.2006.00468.x

Methods

clone()

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

extract(*, icg, heartbeats, c_points, ...)

Extract B-points from given ICG derivative signal.

get_params([deep])

Get parameters for this algorithm.

set_params(**params)

Set the parameters of this Algorithm.

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

Initialize new BPointExtractionLozano2007QuadraticRegression instance.

Parameters:
moving_average_windowint, optional

Window size for moving average filter (in heartbeats, centered around the current heartbeat) to compute the R-C interval. Default: 1 (no moving average)

handle_missing_eventsone of {“warn”, “raise”, “ignore”}, optional
How to handle failing event extraction. Can be one of:
  • “warn”: issue a warning and set the event to NaN

  • “raise”: raise an EventExtractionError

  • “ignore”: ignore the error and continue with the next event

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, c_points: _CPointDataFrame | DataFrame, sampling_rate_hz: float)[source]#

Extract B-points from given ICG derivative signal.

This algorithm extracts B-points using quadratic regression based on the relationship between the R-C interval and the B-point.

The results are saved in the points_ attribute of the super class.

Parameters:
icgDataFrame

ICG derivative signal

heartbeatsDataFrame

Segmented heartbeats. Each row contains start, end, and R-peak location (in samples from beginning of signal) of that heartbeat, index functions as id of heartbeat

c_pointsDataFrame

Extracted C-points. Each row contains the C-point location (in samples from beginning of signal) for each heartbeat, index functions as id of heartbeat. C-point locations can be NaN if no C-points were detected for certain heartbeats

sampling_rate_hzint

sampling rate of ICG derivative signal in hz

Returns:
self
Raises:
EventExtractionError

If the event extraction fails and handle_missing is set to “raise”

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=.