From 46e44253234c867ee61873f37b40d64c4804f4cc Mon Sep 17 00:00:00 2001 From: Weiyu Date: Fri, 6 Aug 2021 14:54:08 -0400 Subject: [PATCH] Updated test data for data yield feature --- docs/developers/test-cases.md | 3 +- .../external/aware_csv/phone_light_raw.csv | 66 +++++++++++++++++-- .../data/manual/aware_csv/phone_light_raw.csv | 33 +++++++++- .../android/phone_data_yield.csv | 6 +- .../mtz_frequency/android/phone_light.csv | 6 +- .../mtz_periodic/android/phone_data_yield.csv | 16 ++--- .../mtz_periodic/android/phone_light.csv | 16 ++--- .../android/phone_data_yield.csv | 6 +- .../stz_frequency/android/phone_light.csv | 6 +- .../stz_periodic/android/phone_data_yield.csv | 16 ++--- .../stz_periodic/android/phone_light.csv | 16 ++--- tests/settings/stz_periodic_config.yaml | 2 +- 12 files changed, 144 insertions(+), 48 deletions(-) diff --git a/docs/developers/test-cases.md b/docs/developers/test-cases.md index 7e45df15..27c22181 100644 --- a/docs/developers/test-cases.md +++ b/docs/developers/test-cases.md @@ -245,7 +245,7 @@ Description - The 4-day raw light data is contained in `phone_light_raw.csv` - One episode for each daily segment (`night`, `morning`, `afternoon` and `evening`) - Two episodes locate in the same 30-min segment (`Fri 00:07:27.000` and `Fri 00:12:00.000`) -- Two episodes locate in the same daily segment (`Fri 01:00:01.000` and `Fri 03:59:59.654`) +- Two episodes locate in the same daily segment (`Fri 01:00:00` and `Fri 03:59:59.654`) - One episode before the time switch (`Sun 00:08:00.000`) and one episode after the time switch (`Sun 05:36:00.000`) Checklist @@ -385,6 +385,7 @@ screen unlock session. In the screen unlock episode starting from Fri 05:56:51, Description - Two sensors were picked for testing, `phone_screen` and `phone_light`. `phone_screen` is event based and `phone_light` is sampling at regular frequency +- A 31-min episode (from `Fri 01:00:00` to `Fri 01:30:00`) in phone_light data, which is considered as a `validyieldedhours` Checklist diff --git a/tests/data/external/aware_csv/phone_light_raw.csv b/tests/data/external/aware_csv/phone_light_raw.csv index c03bb8a2..3791b1b2 100644 --- a/tests/data/external/aware_csv/phone_light_raw.csv +++ b/tests/data/external/aware_csv/phone_light_raw.csv @@ -1,8 +1,37 @@ timestamp,device_id,double_light_lux,accuracy,label 1583471247000,android,15258.0,3, 1583471520000,android,1469.0,3, -1583474401000,android,0.0,3, -1583474411000,android,0.0,3, +1583474400000,android,100.0,3, +1583474460000,android,100.0,3, +1583474520000,android,100.0,3, +1583474580000,android,100.0,3, +1583474640000,android,100.0,3, +1583474700000,android,100.0,3, +1583474760000,android,100.0,3, +1583474820000,android,100.0,3, +1583474880000,android,100.0,3, +1583474940000,android,100.0,3, +1583475000000,android,100.0,3, +1583475060000,android,100.0,3, +1583475120000,android,100.0,3, +1583475180000,android,100.0,3, +1583475240000,android,100.0,3, +1583475300000,android,100.0,3, +1583475360000,android,100.0,3, +1583475420000,android,100.0,3, +1583475480000,android,100.0,3, +1583475540000,android,100.0,3, +1583475600000,android,100.0,3, +1583475660000,android,100.0,3, +1583475720000,android,100.0,3, +1583475780000,android,100.0,3, +1583475840000,android,100.0,3, +1583475900000,android,100.0,3, +1583475960000,android,100.0,3, +1583476020000,android,100.0,3, +1583476080000,android,100.0,3, +1583476140000,android,100.0,3, +1583476200000,android,100.0,3, 1583485199654,android,0.065,3, 1583492400461,android,472.52,3, 1583499599053,android,37252.0,3, @@ -46,8 +75,37 @@ timestamp,device_id,double_light_lux,accuracy,label 1583793300000,android,18030.0,3, 1604030847000,android,15258.0,3, 1604031120000,android,1469.0,3, -1604034001000,android,0.0,3, -1604034011000,android,0.0,3, +1604034000000,android,100.0,3, +1604034060000,android,100.0,3, +1604034120000,android,100.0,3, +1604034180000,android,100.0,3, +1604034240000,android,100.0,3, +1604034300000,android,100.0,3, +1604034360000,android,100.0,3, +1604034420000,android,100.0,3, +1604034480000,android,100.0,3, +1604034540000,android,100.0,3, +1604034600000,android,100.0,3, +1604034660000,android,100.0,3, +1604034720000,android,100.0,3, +1604034780000,android,100.0,3, +1604034840000,android,100.0,3, +1604034900000,android,100.0,3, +1604034960000,android,100.0,3, +1604035020000,android,100.0,3, +1604035080000,android,100.0,3, +1604035140000,android,100.0,3, +1604035200000,android,100.0,3, +1604035260000,android,100.0,3, +1604035320000,android,100.0,3, +1604035380000,android,100.0,3, +1604035440000,android,100.0,3, +1604035500000,android,100.0,3, +1604035560000,android,100.0,3, +1604035620000,android,100.0,3, +1604035680000,android,100.0,3, +1604035740000,android,100.0,3, +1604035800000,android,100.0,3, 1604044799654,android,0.065,3, 1604052000461,android,472.52,3, 1604059199053,android,37252.0,3, diff --git a/tests/data/manual/aware_csv/phone_light_raw.csv b/tests/data/manual/aware_csv/phone_light_raw.csv index c59ada47..83686fe7 100644 --- a/tests/data/manual/aware_csv/phone_light_raw.csv +++ b/tests/data/manual/aware_csv/phone_light_raw.csv @@ -1,8 +1,37 @@ test_time,device_id,double_light_lux,accuracy,label Fri 00:07:27.000,android,15258.0,3, Fri 00:12:00.000,android,1469.0,3, -Fri 01:00:01.000,android,0.0,3, -Fri 01:00:11.000,android,0.0,3, +Fri 01:00:00,android,100,3, +Fri 01:01:00,android,100,3, +Fri 01:02:00,android,100,3, +Fri 01:03:00,android,100,3, +Fri 01:04:00,android,100,3, +Fri 01:05:00,android,100,3, +Fri 01:06:00,android,100,3, +Fri 01:07:00,android,100,3, +Fri 01:08:00,android,100,3, +Fri 01:09:00,android,100,3, +Fri 01:10:00,android,100,3, +Fri 01:11:00,android,100,3, +Fri 01:12:00,android,100,3, +Fri 01:13:00,android,100,3, +Fri 01:14:00,android,100,3, +Fri 01:15:00,android,100,3, +Fri 01:16:00,android,100,3, +Fri 01:17:00,android,100,3, +Fri 01:18:00,android,100,3, +Fri 01:19:00,android,100,3, +Fri 01:20:00,android,100,3, +Fri 01:21:00,android,100,3, +Fri 01:22:00,android,100,3, +Fri 01:23:00,android,100,3, +Fri 01:24:00,android,100,3, +Fri 01:25:00,android,100,3, +Fri 01:26:00,android,100,3, +Fri 01:27:00,android,100,3, +Fri 01:28:00,android,100,3, +Fri 01:29:00,android,100,3, +Fri 01:30:00,android,100,3, Fri 03:59:59.654,android,0.065,3, Fri 06:00:00.461,android,472.52,3, Fri 07:59:59.053,android,37252.0,3, diff --git a/tests/data/processed/features/mtz_frequency/android/phone_data_yield.csv b/tests/data/processed/features/mtz_frequency/android/phone_data_yield.csv index c43a768c..0ebc838f 100644 --- a/tests/data/processed/features/mtz_frequency/android/phone_data_yield.csv +++ b/tests/data/processed/features/mtz_frequency/android/phone_data_yield.csv @@ -4,12 +4,14 @@ "thirtyminutes0000#2020-10-30 00:00:00,2020-10-30 00:29:59","thirtyminutes0000","2020-10-30 00:00:00","2020-10-30 00:29:59",0.0666667037037243,0 "thirtyminutes0000#2020-10-31 00:00:00,2020-10-31 00:29:59","thirtyminutes0000","2020-10-31 00:00:00","2020-10-31 00:29:59",0.0666667037037243,0 "thirtyminutes0001#2020-03-08 00:30:00,2020-03-08 00:59:59","thirtyminutes0001","2020-03-08 00:30:00","2020-03-08 00:59:59",0.0333333518518621,0 -"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",0.0333333518518621,0 +"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",1,1 "thirtyminutes0002#2020-03-07 01:00:00,2020-03-07 01:29:59","thirtyminutes0002","2020-03-07 01:00:00","2020-03-07 01:29:59",0.0666667037037243,0 "thirtyminutes0002#2020-03-08 01:00:00,2020-03-08 01:29:59","thirtyminutes0002","2020-03-08 01:00:00","2020-03-08 01:29:59",0.0333333518518621,0 -"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",0.0333333518518621,0 +"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",1,1 "thirtyminutes0002#2020-10-31 01:00:00,2020-10-31 01:29:59","thirtyminutes0002","2020-10-31 01:00:00","2020-10-31 01:29:59",0.0666667037037243,0 +"thirtyminutes0003#2020-03-06 01:30:00,2020-03-06 01:59:59","thirtyminutes0003","2020-03-06 01:30:00","2020-03-06 01:59:59",0.0333333518518621,0 "thirtyminutes0003#2020-03-08 01:30:00,2020-03-08 01:59:59","thirtyminutes0003","2020-03-08 01:30:00","2020-03-08 01:59:59",0.0333333518518621,0 +"thirtyminutes0003#2020-10-30 01:30:00,2020-10-30 01:59:59","thirtyminutes0003","2020-10-30 01:30:00","2020-10-30 01:59:59",0.0333333518518621,0 "thirtyminutes0003#2020-11-01 01:30:00,2020-11-01 01:59:59","thirtyminutes0003","2020-11-01 01:30:00","2020-11-01 01:59:59",0.0333333518518621,0 "thirtyminutes0004#2020-11-01 02:00:00,2020-11-01 02:29:59","thirtyminutes0004","2020-11-01 02:00:00","2020-11-01 02:29:59",0.0333333518518621,0 "thirtyminutes0005#2020-03-06 02:30:00,2020-03-06 02:59:59","thirtyminutes0005","2020-03-06 02:30:00","2020-03-06 02:59:59",0.0666667037037243,0 diff --git a/tests/data/processed/features/mtz_frequency/android/phone_light.csv b/tests/data/processed/features/mtz_frequency/android/phone_light.csv index c1a43ad1..3a38389f 100644 --- a/tests/data/processed/features/mtz_frequency/android/phone_light.csv +++ b/tests/data/processed/features/mtz_frequency/android/phone_light.csv @@ -1,9 +1,11 @@ "local_segment","local_segment_label","local_segment_start_datetime","local_segment_end_datetime","phone_light_rapids_count","phone_light_rapids_maxlux","phone_light_rapids_minlux","phone_light_rapids_avglux","phone_light_rapids_medianlux","phone_light_rapids_stdlux" "thirtyminutes0000#2020-03-06 00:00:00,2020-03-06 00:29:59","thirtyminutes0000","2020-03-06 00:00:00","2020-03-06 00:29:59",2,15258,1469,8363.5,8363.5,9750.2954057813 "thirtyminutes0000#2020-10-30 00:00:00,2020-10-30 00:29:59","thirtyminutes0000","2020-10-30 00:00:00","2020-10-30 00:29:59",2,15258,1469,8363.5,8363.5,9750.2954057813 -"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",2,0,0,0,0,0 -"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",2,0,0,0,0,0 +"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",30,100,100,100,100,0 +"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",30,100,100,100,100,0 +"thirtyminutes0003#2020-03-06 01:30:00,2020-03-06 01:59:59","thirtyminutes0003","2020-03-06 01:30:00","2020-03-06 01:59:59",1,100,100,100,100,NA "thirtyminutes0003#2020-03-08 01:30:00,2020-03-08 01:59:59","thirtyminutes0003","2020-03-08 01:30:00","2020-03-08 01:59:59",1,872,872,872,872,NA +"thirtyminutes0003#2020-10-30 01:30:00,2020-10-30 01:59:59","thirtyminutes0003","2020-10-30 01:30:00","2020-10-30 01:59:59",1,100,100,100,100,NA "thirtyminutes0005#2020-03-09 02:30:00,2020-03-09 02:59:59","thirtyminutes0005","2020-03-09 02:30:00","2020-03-09 02:59:59",1,500,500,500,500,NA "thirtyminutes0005#2020-11-01 02:30:00,2020-11-01 02:59:59","thirtyminutes0005","2020-11-01 02:30:00","2020-11-01 02:59:59",1,872,872,872,872,NA "thirtyminutes0005#2020-11-02 02:30:00,2020-11-02 02:59:59","thirtyminutes0005","2020-11-02 02:30:00","2020-11-02 02:59:59",1,500,500,500,500,NA diff --git a/tests/data/processed/features/mtz_periodic/android/phone_data_yield.csv b/tests/data/processed/features/mtz_periodic/android/phone_data_yield.csv index b7eac783..543d9bd3 100644 --- a/tests/data/processed/features/mtz_periodic/android/phone_data_yield.csv +++ b/tests/data/processed/features/mtz_periodic/android/phone_data_yield.csv @@ -1,9 +1,9 @@ "local_segment","local_segment_label","local_segment_start_datetime","local_segment_end_datetime","phone_data_yield_rapids_ratiovalidyieldedminutes","phone_data_yield_rapids_ratiovalidyieldedhours" -"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",0.0229166669319059,0 +"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",0.0437500005063657,0.0416666671489198 "daily#2020-03-07 00:00:00,2020-03-07 23:59:59","daily","2020-03-07 00:00:00","2020-03-07 23:59:59",0.0152777779546039,0 "daily#2020-03-08 00:00:00,2020-03-08 23:59:59","daily","2020-03-08 00:00:00","2020-03-08 23:59:59",0.00652173920919975,0 "daily#2020-03-09 00:00:00,2020-03-09 23:59:59","daily","2020-03-09 00:00:00","2020-03-09 23:59:59",0.00555555561985597,0 -"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",0.0229166669319059,0 +"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",0.0437500005063657,0.0416666671489198 "daily#2020-10-31 00:00:00,2020-10-31 23:59:59","daily","2020-10-31 00:00:00","2020-10-31 23:59:59",0.0152777779546039,0 "daily#2020-11-01 00:00:00,2020-11-01 23:59:59","daily","2020-11-01 00:00:00","2020-11-01 23:59:59",0.00600000006666667,0 "daily#2020-11-02 00:00:00,2020-11-02 23:59:59","daily","2020-11-02 00:00:00","2020-11-02 23:59:59",0.00555555561985597,0 @@ -13,15 +13,15 @@ "morning#2020-10-30 06:00:00,2020-10-30 11:59:59","morning","2020-10-30 06:00:00","2020-10-30 11:59:59",0.0222222232510289,0 "morning#2020-10-31 06:00:00,2020-10-31 11:59:59","morning","2020-10-31 06:00:00","2020-10-31 11:59:59",0.00833333371913582,0 "morning#2020-11-02 06:00:00,2020-11-02 11:59:59","morning","2020-11-02 06:00:00","2020-11-02 11:59:59",0.00277777790637861,0 -"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",0.015023474237181,0 +"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",0.0220657277858597,0.0140845070973572 "threeday#2020-03-07 00:00:00,2020-03-09 23:59:59","threeday","2020-03-07 00:00:00","2020-03-09 23:59:59",0.0091549296132822,0 "threeday#2020-03-08 00:00:00,2020-03-10 23:59:59","threeday","2020-03-08 00:00:00","2020-03-10 23:59:59",0.00399061034425121,0 "threeday#2020-03-09 00:00:00,2020-03-11 23:59:59","threeday","2020-03-09 00:00:00","2020-03-11 23:59:59",0.00185185185899634,0 -"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",0.00763888891835991,0 -"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",0.0127314815305999,0 -"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0146118722017195,0 +"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",0.0145833333895962,0.0138888889424726 +"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",0.0196759260018361,0.0138888889424726 +"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0214611872962754,0.013698630189112 "threeday#2020-10-31 00:00:00,2020-11-02 23:59:59","threeday","2020-10-31 00:00:00","2020-11-02 23:59:59",0.00890410962292279,0 "threeday#2020-11-01 00:00:00,2020-11-03 23:59:59","threeday","2020-11-01 00:00:00","2020-11-03 23:59:59",0.00388127855358173,0 "threeday#2020-11-02 00:00:00,2020-11-04 23:59:59","threeday","2020-11-02 00:00:00","2020-11-04 23:59:59",0.00185185185899634,0 -"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",0.015023474237181,0 -"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0146118722017195,0 +"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",0.0220657277858597,0.0140845070973572 +"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0214611872962754,0.013698630189112 diff --git a/tests/data/processed/features/mtz_periodic/android/phone_light.csv b/tests/data/processed/features/mtz_periodic/android/phone_light.csv index a0f66ba7..7fbbdb78 100644 --- a/tests/data/processed/features/mtz_periodic/android/phone_light.csv +++ b/tests/data/processed/features/mtz_periodic/android/phone_light.csv @@ -1,9 +1,9 @@ "local_segment","local_segment_label","local_segment_start_datetime","local_segment_end_datetime","phone_light_rapids_count","phone_light_rapids_maxlux","phone_light_rapids_minlux","phone_light_rapids_avglux","phone_light_rapids_medianlux","phone_light_rapids_stdlux" -"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",24,114615,0,40204.385875,19836,43707.8141548465 +"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",53,114615,0.065,18264.2502075472,100,35369.5932468868 "daily#2020-03-07 00:00:00,2020-03-07 23:59:59","daily","2020-03-07 00:00:00","2020-03-07 23:59:59",12,76000,128,21158.6666666667,21000,22960.9118813744 "daily#2020-03-08 00:00:00,2020-03-08 23:59:59","daily","2020-03-08 00:00:00","2020-03-08 23:59:59",5,32010,872,18078.4,24510,14357.0353067756 "daily#2020-03-09 00:00:00,2020-03-09 23:59:59","daily","2020-03-09 00:00:00","2020-03-09 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 -"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",24,114615,0,40204.385875,19836,43707.8141548465 +"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",53,114615,0.065,18264.2502075472,100,35369.5932468868 "daily#2020-10-31 00:00:00,2020-10-31 23:59:59","daily","2020-10-31 00:00:00","2020-10-31 23:59:59",12,76000,128,21158.6666666667,21000,22960.9118813744 "daily#2020-11-01 00:00:00,2020-11-01 23:59:59","daily","2020-11-01 00:00:00","2020-11-01 23:59:59",5,32010,872,18078.4,24510,14357.0353067756 "daily#2020-11-02 00:00:00,2020-11-02 23:59:59","daily","2020-11-02 00:00:00","2020-11-02 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 @@ -13,15 +13,15 @@ "morning#2020-10-30 06:00:00,2020-10-30 11:59:59","morning","2020-10-30 06:00:00","2020-10-30 11:59:59",4,114615,472.52,60659.38,63775,51510.5823438666 "morning#2020-10-31 06:00:00,2020-10-31 11:59:59","morning","2020-10-31 06:00:00","2020-10-31 11:59:59",3,31000,21000,26360,27080,5038.72999871992 "morning#2020-11-02 06:00:00,2020-11-02 11:59:59","morning","2020-11-02 06:00:00","2020-11-02 11:59:59",1,13200,13200,13200,13200,NA -"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 +"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 "threeday#2020-03-07 00:00:00,2020-03-09 23:59:59","threeday","2020-03-07 00:00:00","2020-03-09 23:59:59",21,76000,128,19201.2380952381,21000,18877.3957046642 "threeday#2020-03-08 00:00:00,2020-03-10 23:59:59","threeday","2020-03-08 00:00:00","2020-03-10 23:59:59",9,32010,500,16591.3333333333,18030,12352.1273876203 "threeday#2020-03-09 00:00:00,2020-03-11 23:59:59","threeday","2020-03-09 00:00:00","2020-03-11 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 -"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",24,114615,0,40204.385875,19836,43707.8141548465 -"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",36,114615,0,33855.8128055556,21000,38781.3405052496 -"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 +"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",53,114615,0.065,18264.2502075472,100,35369.5932468868 +"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",65,114615,0.065,18798.6040153846,100,33291.7108781101 +"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 "threeday#2020-10-31 00:00:00,2020-11-02 23:59:59","threeday","2020-10-31 00:00:00","2020-11-02 23:59:59",21,76000,128,19201.2380952381,21000,18877.3957046642 "threeday#2020-11-01 00:00:00,2020-11-03 23:59:59","threeday","2020-11-01 00:00:00","2020-11-03 23:59:59",9,32010,500,16591.3333333333,18030,12352.1273876203 "threeday#2020-11-02 00:00:00,2020-11-04 23:59:59","threeday","2020-11-02 00:00:00","2020-11-04 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 -"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 -"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 +"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 +"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 diff --git a/tests/data/processed/features/stz_frequency/android/phone_data_yield.csv b/tests/data/processed/features/stz_frequency/android/phone_data_yield.csv index 8a5fad97..b681349d 100644 --- a/tests/data/processed/features/stz_frequency/android/phone_data_yield.csv +++ b/tests/data/processed/features/stz_frequency/android/phone_data_yield.csv @@ -5,10 +5,12 @@ "thirtyminutes0000#2020-10-30 00:00:00,2020-10-30 00:29:59","thirtyminutes0000","2020-10-30 00:00:00","2020-10-30 00:29:59",0.0666667037037243,0 "thirtyminutes0000#2020-10-31 00:00:00,2020-10-31 00:29:59","thirtyminutes0000","2020-10-31 00:00:00","2020-10-31 00:29:59",0.0666667037037243,0 "thirtyminutes0000#2020-11-01 00:00:00,2020-11-01 00:29:59","thirtyminutes0000","2020-11-01 00:00:00","2020-11-01 00:29:59",0.100000055555586,0 -"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",0.0333333518518621,0 +"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",1,1 "thirtyminutes0002#2020-03-07 01:00:00,2020-03-07 01:29:59","thirtyminutes0002","2020-03-07 01:00:00","2020-03-07 01:29:59",0.0666667037037243,0 -"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",0.0333333518518621,0 +"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",1,1 "thirtyminutes0002#2020-10-31 01:00:00,2020-10-31 01:29:59","thirtyminutes0002","2020-10-31 01:00:00","2020-10-31 01:29:59",0.0666667037037243,0 +"thirtyminutes0003#2020-03-06 01:30:00,2020-03-06 01:59:59","thirtyminutes0003","2020-03-06 01:30:00","2020-03-06 01:59:59",0.0333333518518621,0 +"thirtyminutes0003#2020-10-30 01:30:00,2020-10-30 01:59:59","thirtyminutes0003","2020-10-30 01:30:00","2020-10-30 01:59:59",0.0333333518518621,0 "thirtyminutes0005#2020-03-06 02:30:00,2020-03-06 02:59:59","thirtyminutes0005","2020-03-06 02:30:00","2020-03-06 02:59:59",0.0666667037037243,0 "thirtyminutes0005#2020-03-09 02:30:00,2020-03-09 02:59:59","thirtyminutes0005","2020-03-09 02:30:00","2020-03-09 02:59:59",0.0333333518518621,0 "thirtyminutes0005#2020-10-30 02:30:00,2020-10-30 02:59:59","thirtyminutes0005","2020-10-30 02:30:00","2020-10-30 02:59:59",0.0666667037037243,0 diff --git a/tests/data/processed/features/stz_frequency/android/phone_light.csv b/tests/data/processed/features/stz_frequency/android/phone_light.csv index d9899224..5e1972fd 100644 --- a/tests/data/processed/features/stz_frequency/android/phone_light.csv +++ b/tests/data/processed/features/stz_frequency/android/phone_light.csv @@ -3,8 +3,10 @@ "thirtyminutes0000#2020-03-08 00:00:00,2020-03-08 00:29:59","thirtyminutes0000","2020-03-08 00:00:00","2020-03-08 00:29:59",2,206,128,167,167,55.1543289325507 "thirtyminutes0000#2020-10-30 00:00:00,2020-10-30 00:29:59","thirtyminutes0000","2020-10-30 00:00:00","2020-10-30 00:29:59",2,15258,1469,8363.5,8363.5,9750.2954057813 "thirtyminutes0000#2020-11-01 00:00:00,2020-11-01 00:29:59","thirtyminutes0000","2020-11-01 00:00:00","2020-11-01 00:29:59",2,206,128,167,167,55.1543289325507 -"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",2,0,0,0,0,0 -"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",2,0,0,0,0,0 +"thirtyminutes0002#2020-03-06 01:00:00,2020-03-06 01:29:59","thirtyminutes0002","2020-03-06 01:00:00","2020-03-06 01:29:59",30,100,100,100,100,0 +"thirtyminutes0002#2020-10-30 01:00:00,2020-10-30 01:29:59","thirtyminutes0002","2020-10-30 01:00:00","2020-10-30 01:29:59",30,100,100,100,100,0 +"thirtyminutes0003#2020-03-06 01:30:00,2020-03-06 01:59:59","thirtyminutes0003","2020-03-06 01:30:00","2020-03-06 01:59:59",1,100,100,100,100,NA +"thirtyminutes0003#2020-10-30 01:30:00,2020-10-30 01:59:59","thirtyminutes0003","2020-10-30 01:30:00","2020-10-30 01:59:59",1,100,100,100,100,NA "thirtyminutes0005#2020-03-09 02:30:00,2020-03-09 02:59:59","thirtyminutes0005","2020-03-09 02:30:00","2020-03-09 02:59:59",1,500,500,500,500,NA "thirtyminutes0005#2020-11-02 02:30:00,2020-11-02 02:59:59","thirtyminutes0005","2020-11-02 02:30:00","2020-11-02 02:59:59",1,500,500,500,500,NA "thirtyminutes0007#2020-03-06 03:30:00,2020-03-06 03:59:59","thirtyminutes0007","2020-03-06 03:30:00","2020-03-06 03:59:59",1,0.065,0.065,0.065,0.065,NA diff --git a/tests/data/processed/features/stz_periodic/android/phone_data_yield.csv b/tests/data/processed/features/stz_periodic/android/phone_data_yield.csv index 5265f2a0..23163f6f 100644 --- a/tests/data/processed/features/stz_periodic/android/phone_data_yield.csv +++ b/tests/data/processed/features/stz_periodic/android/phone_data_yield.csv @@ -1,9 +1,9 @@ "local_segment","local_segment_label","local_segment_start_datetime","local_segment_end_datetime","phone_data_yield_rapids_ratiovalidyieldedminutes","phone_data_yield_rapids_ratiovalidyieldedhours" -"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",0.0229166669319059,0 +"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",0.0437500005063657,0.0416666671489198 "daily#2020-03-07 00:00:00,2020-03-07 23:59:59","daily","2020-03-07 00:00:00","2020-03-07 23:59:59",0.0131944445971579,0 "daily#2020-03-08 00:00:00,2020-03-08 23:59:59","daily","2020-03-08 00:00:00","2020-03-08 23:59:59",0.008695652278933,0 "daily#2020-03-09 00:00:00,2020-03-09 23:59:59","daily","2020-03-09 00:00:00","2020-03-09 23:59:59",0.00555555561985597,0 -"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",0.0229166669319059,0 +"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",0.0437500005063657,0.0416666671489198 "daily#2020-10-31 00:00:00,2020-10-31 23:59:59","daily","2020-10-31 00:00:00","2020-10-31 23:59:59",0.0131944445971579,0 "daily#2020-11-01 00:00:00,2020-11-01 23:59:59","daily","2020-11-01 00:00:00","2020-11-01 23:59:59",0.00800000008888889,0 "daily#2020-11-02 00:00:00,2020-11-02 23:59:59","daily","2020-11-02 00:00:00","2020-11-02 23:59:59",0.00555555561985597,0 @@ -11,15 +11,15 @@ "morning#2020-03-09 06:00:00,2020-03-09 11:59:59","morning","2020-03-09 06:00:00","2020-03-09 11:59:59",0.00277777790637861,0 "morning#2020-10-30 06:00:00,2020-10-30 11:59:59","morning","2020-10-30 06:00:00","2020-10-30 11:59:59",0.0222222232510289,0 "morning#2020-11-02 06:00:00,2020-11-02 11:59:59","morning","2020-11-02 06:00:00","2020-11-02 11:59:59",0.00277777790637861,0 -"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",0.015023474237181,0 +"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",0.0220657277858597,0.0140845070973572 "threeday#2020-03-07 00:00:00,2020-03-09 23:59:59","threeday","2020-03-07 00:00:00","2020-03-09 23:59:59",0.0091549296132822,0 "threeday#2020-03-08 00:00:00,2020-03-10 23:59:59","threeday","2020-03-08 00:00:00","2020-03-10 23:59:59",0.00469483569911908,0 "threeday#2020-03-09 00:00:00,2020-03-11 23:59:59","threeday","2020-03-09 00:00:00","2020-03-11 23:59:59",0.00185185185899634,0 -"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",0.00763888891835991,0 -"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",0.0120370370834762,0 -"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0146118722017195,0 +"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",0.0145833333895962,0.0138888889424726 +"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",0.0189814815547125,0.0138888889424726 +"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0214611872962754,0.013698630189112 "threeday#2020-10-31 00:00:00,2020-11-02 23:59:59","threeday","2020-10-31 00:00:00","2020-11-02 23:59:59",0.00890410962292279,0 "threeday#2020-11-01 00:00:00,2020-11-03 23:59:59","threeday","2020-11-01 00:00:00","2020-11-03 23:59:59",0.00456621006303733,0 "threeday#2020-11-02 00:00:00,2020-11-04 23:59:59","threeday","2020-11-02 00:00:00","2020-11-04 23:59:59",0.00185185185899634,0 -"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",0.015023474237181,0 -"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0146118722017195,0 +"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",0.0220657277858597,0.0140845070973572 +"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",0.0214611872962754,0.013698630189112 diff --git a/tests/data/processed/features/stz_periodic/android/phone_light.csv b/tests/data/processed/features/stz_periodic/android/phone_light.csv index 0a4316ea..6872d4e9 100644 --- a/tests/data/processed/features/stz_periodic/android/phone_light.csv +++ b/tests/data/processed/features/stz_periodic/android/phone_light.csv @@ -1,9 +1,9 @@ "local_segment","local_segment_label","local_segment_start_datetime","local_segment_end_datetime","phone_light_rapids_count","phone_light_rapids_maxlux","phone_light_rapids_minlux","phone_light_rapids_avglux","phone_light_rapids_medianlux","phone_light_rapids_stdlux" -"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",24,114615,0,40204.385875,19836,43707.8141548465 +"daily#2020-03-06 00:00:00,2020-03-06 23:59:59","daily","2020-03-06 00:00:00","2020-03-06 23:59:59",53,114615,0.065,18264.2502075472,100,35369.5932468868 "daily#2020-03-07 00:00:00,2020-03-07 23:59:59","daily","2020-03-07 00:00:00","2020-03-07 23:59:59",10,76000,500,25357,24040,22953.273816362 "daily#2020-03-08 00:00:00,2020-03-08 23:59:59","daily","2020-03-08 00:00:00","2020-03-08 23:59:59",7,32010,128,12960.8571428571,4500,14621.9736404788 "daily#2020-03-09 00:00:00,2020-03-09 23:59:59","daily","2020-03-09 00:00:00","2020-03-09 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 -"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",24,114615,0,40204.385875,19836,43707.8141548465 +"daily#2020-10-30 00:00:00,2020-10-30 23:59:59","daily","2020-10-30 00:00:00","2020-10-30 23:59:59",53,114615,0.065,18264.2502075472,100,35369.5932468868 "daily#2020-10-31 00:00:00,2020-10-31 23:59:59","daily","2020-10-31 00:00:00","2020-10-31 23:59:59",10,76000,500,25357,24040,22953.273816362 "daily#2020-11-01 00:00:00,2020-11-01 23:59:59","daily","2020-11-01 00:00:00","2020-11-01 23:59:59",7,32010,128,12960.8571428571,4500,14621.9736404788 "daily#2020-11-02 00:00:00,2020-11-02 23:59:59","daily","2020-11-02 00:00:00","2020-11-02 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 @@ -11,15 +11,15 @@ "morning#2020-03-09 06:00:00,2020-03-09 11:59:59","morning","2020-03-09 06:00:00","2020-03-09 11:59:59",1,13200,13200,13200,13200,NA "morning#2020-10-30 06:00:00,2020-10-30 11:59:59","morning","2020-10-30 06:00:00","2020-10-30 11:59:59",4,114615,472.52,60659.38,63775,51510.5823438666 "morning#2020-11-02 06:00:00,2020-11-02 11:59:59","morning","2020-11-02 06:00:00","2020-11-02 11:59:59",1,13200,13200,13200,13200,NA -"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 +"threeday#2020-03-06 00:00:00,2020-03-08 23:59:59","threeday","2020-03-06 00:00:00","2020-03-08 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 "threeday#2020-03-07 00:00:00,2020-03-09 23:59:59","threeday","2020-03-07 00:00:00","2020-03-09 23:59:59",21,76000,128,19201.2380952381,21000,18877.3957046642 "threeday#2020-03-08 00:00:00,2020-03-10 23:59:59","threeday","2020-03-08 00:00:00","2020-03-10 23:59:59",11,32010,128,13605.0909090909,13200,12891.9619100783 "threeday#2020-03-09 00:00:00,2020-03-11 23:59:59","threeday","2020-03-09 00:00:00","2020-03-11 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 -"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",24,114615,0,40204.385875,19836,43707.8141548465 -"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",34,114615,0,35837.5076764706,22707,39016.8323601495 -"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 +"threeday#2020-10-28 00:00:00,2020-10-30 23:59:59","threeday","2020-10-28 00:00:00","2020-10-30 23:59:59",53,114615,0.065,18264.2502075472,100,35369.5932468868 +"threeday#2020-10-29 00:00:00,2020-10-31 23:59:59","threeday","2020-10-29 00:00:00","2020-10-31 23:59:59",63,114615,0.065,19390.0835079365,100,33653.1923526504 +"threeday#2020-10-30 00:00:00,2020-11-01 23:59:59","threeday","2020-10-30 00:00:00","2020-11-01 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 "threeday#2020-10-31 00:00:00,2020-11-02 23:59:59","threeday","2020-10-31 00:00:00","2020-11-02 23:59:59",21,76000,128,19201.2380952381,21000,18877.3957046642 "threeday#2020-11-01 00:00:00,2020-11-03 23:59:59","threeday","2020-11-01 00:00:00","2020-11-03 23:59:59",11,32010,128,13605.0909090909,13200,12891.9619100783 "threeday#2020-11-02 00:00:00,2020-11-04 23:59:59","threeday","2020-11-02 00:00:00","2020-11-04 23:59:59",4,27200,500,14732.5,15615,11123.9182994722 -"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 -"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",41,114615,0,31931.7380731707,21000,36931.3823249349 +"weekend#2020-03-06 00:00:00,2020-03-08 23:59:59","weekend","2020-03-06 00:00:00","2020-03-08 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 +"weekend#2020-10-30 00:00:00,2020-11-01 23:59:59","weekend","2020-10-30 00:00:00","2020-11-01 23:59:59",70,114615,0.065,18747.1608714286,339.26,32249.1520878966 diff --git a/tests/settings/stz_periodic_config.yaml b/tests/settings/stz_periodic_config.yaml index 99e8e289..0405cb7f 100644 --- a/tests/settings/stz_periodic_config.yaml +++ b/tests/settings/stz_periodic_config.yaml @@ -214,7 +214,7 @@ PHONE_DATA_YIELD: SENSORS: [PHONE_SCREEN, PHONE_LIGHT] PROVIDERS: RAPIDS: - COMPUTE: False + COMPUTE: True FEATURES: [ratiovalidyieldedminutes, ratiovalidyieldedhours] MINUTE_RATIO_THRESHOLD_FOR_VALID_YIELDED_HOURS: 0.5 # 0 to 1, minimum percentage of valid minutes in an hour to be considered valid. SRC_SCRIPT: src/features/phone_data_yield/rapids/main.R