Skip to content

Conversation

@danimateos
Copy link
Collaborator

Closes #23

This PR implements the basic metrics described in #23:

  • plausibility check: get_implausible_ratio
  • outliers: get_outlier_ratio
  • nan: get_nan_ratio

As well as a detection for stuck values using the number of times the most frequent value is present: get_top_value_ratio

All are implemented as a rolling calculation to detect problematic moments in the device's life and have a consistent interface.

Daniel Mateos added 8 commits November 10, 2025 12:44
- Learnt how to load data from the platform
- Loaded the list of sensors in the Twinair project
- Looked at some test cases for known bad sensors
- Implemented draft outlier detection
- Implemented draft stuck value count
- Implemented draft na rolling count
- Implemented inference of sampling frequency
Utility functions that needn't be inside Device:
- infer_sampling_rate
- mode_count
- Calculate implausible ratio in a rolling window
- get_implausible_values function for deeper investigation
- Use standardized interface as in the other
     Device.get_..._ratio(self, period, subset, ...)
@danimateos danimateos merged commit 20e055d into fablabbcn:master Nov 20, 2025
1 of 10 checks passed
@oscgonfer
Copy link
Collaborator

@danimateos seems that this PR introduced a build error on python 3.9 (it seems like 3.10 and 3.11 are fine). The error is here:

https://github.com/fablabbcn/smartcitizen-data/actions/runs/19734193545/job/56542116176#step:7:52

On one of the new accessory functions for health checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add health metrics for device

2 participants