Skip to content

Commit

Permalink
Merge pull request #458 from cagov/mmmiah-patch-5
Browse files Browse the repository at this point in the history
added new tag as 'observed_unimputed" when null metric was not impuited
  • Loading branch information
mmmiah authored Nov 1, 2024
2 parents f94ec9c + cbfa61f commit 1993c98
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ hybrid_five_mins_agg as (
when
(detector_is_good = false or volume_sum is null) and volume_regional_avg is not null
then 'regional_avg'
when
(detector_is_good = false or volume_sum is null)
and volume_local_regression is null
and volume_regional_regression is null
and volume_global_regression is null
and volume_local_avg is null
and volume_regional_avg is null
then 'observed_unimputed'
else 'observed'
end as volume_imputation_method,
case
Expand All @@ -119,6 +127,14 @@ hybrid_five_mins_agg as (
when
(detector_is_good = false or speed_five_mins is null) and speed_regional_avg is not null
then 'regional_avg'
when
(detector_is_good = false or speed_five_mins is null)
and speed_local_regression is null
and speed_regional_regression is null
and speed_global_regression is null
and speed_local_avg is null
and speed_regional_avg is null
then 'observed_unimputed'
else 'observed'
end as speed_imputation_method,
case
Expand All @@ -137,6 +153,14 @@ hybrid_five_mins_agg as (
when
(detector_is_good = false or occupancy_avg is null) and occupancy_regional_avg is not null
then 'regional_avg'
when
(detector_is_good = false or occupancy_avg is null)
and occupancy_local_regression is null
and occupancy_regional_regression is null
and occupancy_global_regression is null
and occupancy_local_avg is null
and occupancy_regional_avg is null
then 'observed_unimputed'
else 'observed'
end as occupancy_imputation_method
from obs_imputed_five_minutes_agg
Expand Down

0 comments on commit 1993c98

Please sign in to comment.