multi_sensor_validation
multi_sensor_validation ¤
MultiSensorValidationEvents ¤
MultiSensorValidationEvents(
dataframe: DataFrame,
sensor_uuids: List[str],
*,
value_column: str = "value_double",
event_uuid: str = "quality:multi_sensor",
time_column: str = "systime"
)
Bases: Base
Quality: Multi-Sensor Cross-Validation
Cross-validate redundant inline sensors measuring the same process variable. Detects disagreement, identifies drifting sensors, and assesses measurement consensus.
Methods: - detect_disagreement: Flag windows where sensor spread exceeds threshold. - pairwise_bias: Mean difference between each sensor pair per window. - consensus_score: Per-window measurement consensus across sensors. - identify_outlier_sensor: Find the sensor furthest from the group.
detect_disagreement ¤
detect_disagreement(
threshold: float, window: str = "5m"
) -> pd.DataFrame
Flag windows where sensor spread exceeds threshold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Maximum acceptable spread (max - min) across sensors. |
required |
window
|
str
|
Resample window size. |
'5m'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: window_start, window_end, max_spread, |
DataFrame
|
sensor_high, sensor_low, duration. |
pairwise_bias ¤
pairwise_bias(window: str = '1h') -> pd.DataFrame
Mean difference between each sensor pair per window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
Resample window size. |
'1h'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: window_start, sensor_a, sensor_b, |
DataFrame
|
bias, abs_bias. |
consensus_score ¤
consensus_score(window: str = '1h') -> pd.DataFrame
Per-window measurement consensus across sensors.
Score = 1.0 means perfect agreement, 0.0 means high disagreement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
Resample window size. |
'1h'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: window_start, consensus_mean, |
DataFrame
|
spread_std, consensus_score. |
identify_outlier_sensor ¤
identify_outlier_sensor(
window: str = "1h", method: str = "median"
) -> pd.DataFrame
Identify the sensor furthest from the group per window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
Resample window size. |
'1h'
|
method
|
str
|
'median' or 'mean' — central tendency for comparison. |
'median'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: window_start, outlier_sensor, |
DataFrame
|
deviation, other_sensors_mean. |