Updated sms sensor to messages

pull/95/head
kaguillera 2020-06-26 12:20:47 -04:00
parent 17f41588d8
commit 533d0adab3
25 changed files with 49 additions and 48 deletions

View File

@ -37,8 +37,8 @@ MESSAGES:
DB_TABLE: messages
TYPES : [received, sent]
FEATURES:
received: [count, distinctcontacts, timefirstsms, timelastsms, countmostfrequentcontact]
sent: [count, distinctcontacts, timefirstsms, timelastsms, countmostfrequentcontact]
received: [count, distinctcontacts, timefirstmessage, timelastmessage, countmostfrequentcontact]
sent: [count, distinctcontacts, timefirstmessage, timelastmessage, countmostfrequentcontact]
DAY_SEGMENTS: *day_segments
# Communication call features config, TYPES and FEATURES keys need to match

View File

@ -107,8 +107,8 @@ Name Units Description
========================= ========= =============
count messages Number of messages of type ``messages_type`` that occurred during a particular ``day_segment``.
distinctcontacts contacts Number of distinct contacts that are associated with a particular ``messages_type`` during a particular ``day_segment``.
timefirstsms minutes Number of minutes between 12:00am (midnight) and the first ``message`` of a particular ``messages_type``.
timelastsms minutes Number of minutes between 12:00am (midnight) and the last ``message`` of a particular ``messages_type``.
timefirstmessages minutes Number of minutes between 12:00am (midnight) and the first ``message`` of a particular ``messages_type``.
timelastmessages minutes Number of minutes between 12:00am (midnight) and the last ``message`` of a particular ``messages_type``.
countmostfrequentcontact messages Number of messages from the contact with the most messages of ``messages_type`` during a ``day_segment`` throughout the whole dataset of each participant.
========================= ========= =============
@ -120,7 +120,7 @@ countmostfrequentcontact messages Number of messages from the contact wi
...
TYPES: [sent]
FEATURES:
sent: [count, distinctcontacts, timefirstsms, timelastsms, countmostfrequentcontact]
sent: [count, distinctcontacts, timefirstmessages, timelastmessages, countmostfrequentcontact]
.. _call-sensor-doc:
@ -747,7 +747,7 @@ unknownexpectedfraction Ration between minutesunknown an
========================= ================= =============
**Assumptions/Observations:**
N/A
.. ------------------------------- Begin Fitbit Section ----------------------------------- ..

View File

@ -9,51 +9,51 @@ filter_by_day_segment <- function(data, day_segment) {
return(data %>% head(0))
}
base_sms_features <- function(sms, sms_type, day_segment, requested_features){
base_messages_features <- function(messages, messages_type, day_segment, requested_features){
# Output dataframe
features = data.frame(local_date = character(), stringsAsFactors = FALSE)
# The name of the features this function can compute
base_features_names <- c("countmostfrequentcontact", "count", "distinctcontacts", "timefirstsms", "timelastsms")
base_features_names <- c("countmostfrequentcontact", "count", "distinctcontacts", "timefirstmessage", "timelastmessage")
# The subset of requested features this function can compute
features_to_compute <- intersect(base_features_names, requested_features)
# Filter rows that belong to the sms type and day segment of interest
sms <- sms %>% filter(message_type == ifelse(sms_type == "received", "1", ifelse(sms_type == "sent", 2, NA))) %>%
# Filter rows that belong to the message type and day segment of interest
messages <- messages %>% filter(message_type == ifelse(messages_type == "received", "1", ifelse(messages_type == "sent", 2, NA))) %>%
filter_by_day_segment(day_segment)
# If there are not features or data to work with, return an empty df with appropiate columns names
if(length(features_to_compute) == 0)
return(features)
if(nrow(sms) < 1)
return(cbind(features, read.csv(text = paste(paste("sms", sms_type, day_segment, features_to_compute, sep = "_"), collapse = ","), stringsAsFactors = FALSE)))
if(nrow(messages) < 1)
return(cbind(features, read.csv(text = paste(paste("messages", messages_type, day_segment, features_to_compute, sep = "_"), collapse = ","), stringsAsFactors = FALSE)))
for(feature_name in features_to_compute){
if(feature_name == "countmostfrequentcontact"){
# Get the number of messages for the most frequent contact throughout the study
mostfrequentcontact <- sms %>%
mostfrequentcontact <- messages %>%
group_by(trace) %>%
mutate(N=n()) %>%
ungroup() %>%
filter(N == max(N)) %>%
head(1) %>% # if there are multiple contacts with the same amount of messages pick the first one only
pull(trace)
feature <- sms %>%
feature <- messages %>%
filter(trace == mostfrequentcontact) %>%
group_by(local_date) %>%
summarise(!!paste("sms", sms_type, day_segment, feature_name, sep = "_") := n()) %>%
summarise(!!paste("messages", messages_type, day_segment, feature_name, sep = "_") := n()) %>%
replace(is.na(.), 0)
features <- merge(features, feature, by="local_date", all = TRUE)
} else {
feature <- sms %>%
feature <- messages %>%
group_by(local_date)
feature <- switch(feature_name,
"count" = feature %>% summarise(!!paste("sms", sms_type, day_segment, feature_name, sep = "_") := n()),
"distinctcontacts" = feature %>% summarise(!!paste("sms", sms_type, day_segment, feature_name, sep = "_") := n_distinct(trace)),
"timefirstsms" = feature %>% summarise(!!paste("sms", sms_type, day_segment, feature_name, sep = "_") := first(local_hour) * 60 + first(local_minute)),
"timelastsms" = feature %>% summarise(!!paste("sms", sms_type, day_segment, feature_name, sep = "_") := last(local_hour) * 60 + last(local_minute)))
"count" = feature %>% summarise(!!paste("messages", messages_type, day_segment, feature_name, sep = "_") := n()),
"distinctcontacts" = feature %>% summarise(!!paste("messages", messages_type, day_segment, feature_name, sep = "_") := n_distinct(trace)),
"timefirstmessage" = feature %>% summarise(!!paste("messages", messages_type, day_segment, feature_name, sep = "_") := first(local_hour) * 60 + first(local_minute)),
"timelastmessage" = feature %>% summarise(!!paste("messages", messages_type, day_segment, feature_name, sep = "_") := last(local_hour) * 60 + last(local_minute)))
features <- merge(features, feature, by="local_date", all = TRUE)
}

View File

@ -1,20 +1,20 @@
# If you want to implement extra features, source(..) a new file and duplicate the line "features <- merge(...)", then
# swap base_sms_features(...) for your own function
# swap base_sms_features(...) for your own function
source("renv/activate.R")
source("src/features/messages/messages_base.R")
library(dplyr, warn.conflicts = FALSE)
sms <- read.csv(snakemake@input[[1]])
messages <- read.csv(snakemake@input[[1]])
day_segment <- snakemake@params[["day_segment"]]
requested_features <- snakemake@params[["features"]]
sms_type <- snakemake@params[["messages_type"]]
messages_type <- snakemake@params[["messages_type"]]
features <- data.frame(local_date = character(), stringsAsFactors = FALSE)
# Compute base SMS features
features <- merge(features, base_sms_features(sms, sms_type, day_segment, requested_features), by="local_date", all = TRUE)
features <- merge(features, base_messages_features(messages, messages_type, day_segment, requested_features), by="local_date", all = TRUE)
if(ncol(features) != length(requested_features) + 1)
stop(paste0("The number of features in the output dataframe (=", ncol(features),") does not match the expected value (=", length(requested_features)," + 1). Verify your SMS feature extraction functions"))
stop(paste0("The number of features in the output dataframe (=", ncol(features),") does not match the expected value (=", length(requested_features)," + 1). Verify your Messages (SMS) feature extraction functions"))
write.csv(features, snakemake@output[[1]], row.names = FALSE)

View File

@ -1,2 +1,2 @@
"local_date","sms_received_afternoon_countmostfrequentcontact","sms_received_afternoon_count","sms_received_afternoon_distinctcontacts","sms_received_afternoon_timefirstsms","sms_received_afternoon_timelastsms"
"local_date","messages_received_afternoon_countmostfrequentcontact","messages_received_afternoon_count","messages_received_afternoon_distinctcontacts","messages_received_afternoon_timefirstmessage","messages_received_afternoon_timelastmessage"
"2020-05-28",1,2,2,830,949

1 local_date sms_received_afternoon_countmostfrequentcontact messages_received_afternoon_countmostfrequentcontact sms_received_afternoon_count messages_received_afternoon_count sms_received_afternoon_distinctcontacts messages_received_afternoon_distinctcontacts sms_received_afternoon_timefirstsms messages_received_afternoon_timefirstmessage sms_received_afternoon_timelastsms messages_received_afternoon_timelastmessage
2 2020-05-28 1 1 2 2 2 2 830 830 949 949

View File

@ -1,3 +1,3 @@
"local_date","sms_received_daily_countmostfrequentcontact","sms_received_daily_count","sms_received_daily_distinctcontacts","sms_received_daily_timefirstsms","sms_received_daily_timelastsms"
"local_date","messages_received_daily_countmostfrequentcontact","messages_received_daily_count","messages_received_daily_distinctcontacts","messages_received_daily_timefirstmessage","messages_received_daily_timelastmessage"
"2020-05-28",7,12,6,6,1382
"2020-05-29",3,6,4,401,1382

1 local_date sms_received_daily_countmostfrequentcontact messages_received_daily_countmostfrequentcontact sms_received_daily_count messages_received_daily_count sms_received_daily_distinctcontacts messages_received_daily_distinctcontacts sms_received_daily_timefirstsms messages_received_daily_timefirstmessage sms_received_daily_timelastsms messages_received_daily_timelastmessage
2 2020-05-28 7 7 12 12 6 6 6 6 1382 1382
3 2020-05-29 3 3 6 6 4 4 401 401 1382 1382

View File

@ -1,3 +1,3 @@
"local_date","sms_received_evening_countmostfrequentcontact","sms_received_evening_count","sms_received_evening_distinctcontacts","sms_received_evening_timefirstsms","sms_received_evening_timelastsms"
"local_date","messages_received_evening_countmostfrequentcontact","messages_received_evening_count","messages_received_evening_distinctcontacts","messages_received_evening_timefirstmessage","messages_received_evening_timelastmessage"
"2020-05-28",2,3,2,1173,1382
"2020-05-29",2,3,2,1173,1382

1 local_date sms_received_evening_countmostfrequentcontact messages_received_evening_countmostfrequentcontact sms_received_evening_count messages_received_evening_count sms_received_evening_distinctcontacts messages_received_evening_distinctcontacts sms_received_evening_timefirstsms messages_received_evening_timefirstmessage sms_received_evening_timelastsms messages_received_evening_timelastmessage
2 2020-05-28 2 2 3 3 2 2 1173 1173 1382 1382
3 2020-05-29 2 2 3 3 2 2 1173 1173 1382 1382

View File

@ -1,3 +1,3 @@
"local_date","sms_received_morning_countmostfrequentcontact","sms_received_morning_count","sms_received_morning_distinctcontacts","sms_received_morning_timefirstsms","sms_received_morning_timelastsms"
"local_date","messages_received_morning_countmostfrequentcontact","messages_received_morning_count","messages_received_morning_distinctcontacts","messages_received_morning_timefirstmessage","messages_received_morning_timelastmessage"
"2020-05-28",1,3,3,401,660
"2020-05-29",1,3,3,401,660

1 local_date sms_received_morning_countmostfrequentcontact messages_received_morning_countmostfrequentcontact sms_received_morning_count messages_received_morning_count sms_received_morning_distinctcontacts messages_received_morning_distinctcontacts sms_received_morning_timefirstsms messages_received_morning_timefirstmessage sms_received_morning_timelastsms messages_received_morning_timelastmessage
2 2020-05-28 1 1 3 3 3 3 401 401 660 660
3 2020-05-29 1 1 3 3 3 3 401 401 660 660

View File

@ -1,2 +1,2 @@
"local_date","sms_received_night_countmostfrequentcontact","sms_received_night_count","sms_received_night_distinctcontacts","sms_received_night_timefirstsms","sms_received_night_timelastsms"
"local_date","messages_received_night_countmostfrequentcontact","messages_received_night_count","messages_received_night_distinctcontacts","messages_received_night_timefirstmessage","messages_received_night_timelastmessage"
"2020-05-28",4,4,1,6,312

1 local_date sms_received_night_countmostfrequentcontact messages_received_night_countmostfrequentcontact sms_received_night_count messages_received_night_count sms_received_night_distinctcontacts messages_received_night_distinctcontacts sms_received_night_timefirstsms messages_received_night_timefirstmessage sms_received_night_timelastsms messages_received_night_timelastmessage
2 2020-05-28 4 4 4 4 1 1 6 6 312 312

View File

@ -1,2 +1,2 @@
"local_date","sms_sent_afternoon_countmostfrequentcontact","sms_sent_afternoon_count","sms_sent_afternoon_distinctcontacts","sms_sent_afternoon_timefirstsms","sms_sent_afternoon_timelastsms"
"local_date","messages_sent_afternoon_countmostfrequentcontact","messages_sent_afternoon_count","messages_sent_afternoon_distinctcontacts","messages_sent_afternoon_timefirstmessage","messages_sent_afternoon_timelastmessage"
"2020-05-28",1,3,3,722,979

1 local_date sms_sent_afternoon_countmostfrequentcontact messages_sent_afternoon_countmostfrequentcontact sms_sent_afternoon_count messages_sent_afternoon_count sms_sent_afternoon_distinctcontacts messages_sent_afternoon_distinctcontacts sms_sent_afternoon_timefirstsms messages_sent_afternoon_timefirstmessage sms_sent_afternoon_timelastsms messages_sent_afternoon_timelastmessage
2 2020-05-28 1 1 3 3 3 3 722 722 979 979

View File

@ -1,3 +1,3 @@
"local_date","sms_sent_daily_countmostfrequentcontact","sms_sent_daily_count","sms_sent_daily_distinctcontacts","sms_sent_daily_timefirstsms","sms_sent_daily_timelastsms"
"local_date","messages_sent_daily_countmostfrequentcontact","messages_sent_daily_count","messages_sent_daily_distinctcontacts","messages_sent_daily_timefirstmessage","messages_sent_daily_timelastmessage"
"2020-05-28",3,8,6,219,1401
"2020-05-29",1,4,4,388,1401

1 local_date sms_sent_daily_countmostfrequentcontact messages_sent_daily_countmostfrequentcontact sms_sent_daily_count messages_sent_daily_count sms_sent_daily_distinctcontacts messages_sent_daily_distinctcontacts sms_sent_daily_timefirstsms messages_sent_daily_timefirstmessage sms_sent_daily_timelastsms messages_sent_daily_timelastmessage
2 2020-05-28 3 3 8 8 6 6 219 219 1401 1401
3 2020-05-29 1 1 4 4 4 4 388 388 1401 1401

View File

@ -1,3 +1,3 @@
"local_date","sms_sent_evening_countmostfrequentcontact","sms_sent_evening_count","sms_sent_evening_distinctcontacts","sms_sent_evening_timefirstsms","sms_sent_evening_timelastsms"
"local_date","messages_sent_evening_countmostfrequentcontact","messages_sent_evening_count","messages_sent_evening_distinctcontacts","messages_sent_evening_timefirstmessage","messages_sent_evening_timelastmessage"
"2020-05-28",1,2,2,1218,1401
"2020-05-29",1,2,2,1218,1401

1 local_date sms_sent_evening_countmostfrequentcontact messages_sent_evening_countmostfrequentcontact sms_sent_evening_count messages_sent_evening_count sms_sent_evening_distinctcontacts messages_sent_evening_distinctcontacts sms_sent_evening_timefirstsms messages_sent_evening_timefirstmessage sms_sent_evening_timelastsms messages_sent_evening_timelastmessage
2 2020-05-28 1 1 2 2 2 2 1218 1218 1401 1401
3 2020-05-29 1 1 2 2 2 2 1218 1218 1401 1401

View File

@ -1,3 +1,3 @@
"local_date","sms_sent_morning_countmostfrequentcontact","sms_sent_morning_count","sms_sent_morning_distinctcontacts","sms_sent_morning_timefirstsms","sms_sent_morning_timelastsms"
"local_date","messages_sent_morning_countmostfrequentcontact","messages_sent_morning_count","messages_sent_morning_distinctcontacts","messages_sent_morning_timefirstmessage","messages_sent_morning_timelastmessage"
"2020-05-28",1,2,2,388,654
"2020-05-29",1,2,2,388,654

1 local_date sms_sent_morning_countmostfrequentcontact messages_sent_morning_countmostfrequentcontact sms_sent_morning_count messages_sent_morning_count sms_sent_morning_distinctcontacts messages_sent_morning_distinctcontacts sms_sent_morning_timefirstsms messages_sent_morning_timefirstmessage sms_sent_morning_timelastsms messages_sent_morning_timelastmessage
2 2020-05-28 1 1 2 2 2 2 388 388 654 654
3 2020-05-29 1 1 2 2 2 2 388 388 654 654

View File

@ -1,2 +1,2 @@
"local_date","sms_sent_night_countmostfrequentcontact","sms_sent_night_count","sms_sent_night_distinctcontacts","sms_sent_night_timefirstsms","sms_sent_night_timelastsms"
"local_date","messages_sent_night_countmostfrequentcontact","messages_sent_night_count","messages_sent_night_distinctcontacts","messages_sent_night_timefirstmessage","messages_sent_night_timelastmessage"
"2020-05-28",1,1,1,219,219

1 local_date sms_sent_night_countmostfrequentcontact messages_sent_night_countmostfrequentcontact sms_sent_night_count messages_sent_night_count sms_sent_night_distinctcontacts messages_sent_night_distinctcontacts sms_sent_night_timefirstsms messages_sent_night_timefirstmessage sms_sent_night_timelastsms messages_sent_night_timelastmessage
2 2020-05-28 1 1 1 1 1 1 219 219 219 219

View File

@ -1,2 +1,2 @@
"local_date","sms_received_afternoon_countmostfrequentcontact","sms_received_afternoon_count","sms_received_afternoon_distinctcontacts","sms_received_afternoon_timefirstsms","sms_received_afternoon_timelastsms"
"local_date","messages_received_afternoon_countmostfrequentcontact","messages_received_afternoon_count","messages_received_afternoon_distinctcontacts","messages_received_afternoon_timefirstmessage","messages_received_afternoon_timelastmessage"
"2020-05-28",1,2,2,830,949

1 local_date sms_received_afternoon_countmostfrequentcontact messages_received_afternoon_countmostfrequentcontact sms_received_afternoon_count messages_received_afternoon_count sms_received_afternoon_distinctcontacts messages_received_afternoon_distinctcontacts sms_received_afternoon_timefirstsms messages_received_afternoon_timefirstmessage sms_received_afternoon_timelastsms messages_received_afternoon_timelastmessage
2 2020-05-28 1 1 2 2 2 2 830 830 949 949

View File

@ -1,3 +1,3 @@
"local_date","sms_received_daily_countmostfrequentcontact","sms_received_daily_count","sms_received_daily_distinctcontacts","sms_received_daily_timefirstsms","sms_received_daily_timelastsms"
"local_date","messages_received_daily_countmostfrequentcontact","messages_received_daily_count","messages_received_daily_distinctcontacts","messages_received_daily_timefirstmessage","messages_received_daily_timelastmessage"
"2020-05-28",1,12,12,6,1382
"2020-05-29",0,6,6,401,1382

1 local_date sms_received_daily_countmostfrequentcontact messages_received_daily_countmostfrequentcontact sms_received_daily_count messages_received_daily_count sms_received_daily_distinctcontacts messages_received_daily_distinctcontacts sms_received_daily_timefirstsms messages_received_daily_timefirstmessage sms_received_daily_timelastsms messages_received_daily_timelastmessage
2 2020-05-28 1 1 12 12 12 12 6 6 1382 1382
3 2020-05-29 0 0 6 6 6 6 401 401 1382 1382

View File

@ -1,3 +1,3 @@
"local_date","sms_received_evening_countmostfrequentcontact","sms_received_evening_count","sms_received_evening_distinctcontacts","sms_received_evening_timefirstsms","sms_received_evening_timelastsms"
"local_date","messages_received_evening_countmostfrequentcontact","messages_received_evening_count","messages_received_evening_distinctcontacts","messages_received_evening_timefirstmessage","messages_received_evening_timelastmessage"
"2020-05-28",1,3,3,1173,1382
"2020-05-29",0,3,3,1173,1382

1 local_date sms_received_evening_countmostfrequentcontact messages_received_evening_countmostfrequentcontact sms_received_evening_count messages_received_evening_count sms_received_evening_distinctcontacts messages_received_evening_distinctcontacts sms_received_evening_timefirstsms messages_received_evening_timefirstmessage sms_received_evening_timelastsms messages_received_evening_timelastmessage
2 2020-05-28 1 1 3 3 3 3 1173 1173 1382 1382
3 2020-05-29 0 0 3 3 3 3 1173 1173 1382 1382

View File

@ -1,3 +1,3 @@
"local_date","sms_received_morning_countmostfrequentcontact","sms_received_morning_count","sms_received_morning_distinctcontacts","sms_received_morning_timefirstsms","sms_received_morning_timelastsms"
"local_date","messages_received_morning_countmostfrequentcontact","messages_received_morning_count","messages_received_morning_distinctcontacts","messages_received_morning_timefirstmessage","messages_received_morning_timelastmessage"
"2020-05-28",1,3,3,401,660
"2020-05-29",0,3,3,401,660

1 local_date sms_received_morning_countmostfrequentcontact messages_received_morning_countmostfrequentcontact sms_received_morning_count messages_received_morning_count sms_received_morning_distinctcontacts messages_received_morning_distinctcontacts sms_received_morning_timefirstsms messages_received_morning_timefirstmessage sms_received_morning_timelastsms messages_received_morning_timelastmessage
2 2020-05-28 1 1 3 3 3 3 401 401 660 660
3 2020-05-29 0 0 3 3 3 3 401 401 660 660

View File

@ -1,2 +1,2 @@
"local_date","sms_received_night_countmostfrequentcontact","sms_received_night_count","sms_received_night_distinctcontacts","sms_received_night_timefirstsms","sms_received_night_timelastsms"
"local_date","messages_received_night_countmostfrequentcontact","messages_received_night_count","messages_received_night_distinctcontacts","messages_received_night_timefirstmessage","messages_received_night_timelastmessage"
"2020-05-28",1,4,4,6,312

1 local_date sms_received_night_countmostfrequentcontact messages_received_night_countmostfrequentcontact sms_received_night_count messages_received_night_count sms_received_night_distinctcontacts messages_received_night_distinctcontacts sms_received_night_timefirstsms messages_received_night_timefirstmessage sms_received_night_timelastsms messages_received_night_timelastmessage
2 2020-05-28 1 1 4 4 4 4 6 6 312 312

View File

@ -1,2 +1,2 @@
"local_date","sms_sent_afternoon_countmostfrequentcontact","sms_sent_afternoon_count","sms_sent_afternoon_distinctcontacts","sms_sent_afternoon_timefirstsms","sms_sent_afternoon_timelastsms"
"local_date","messages_sent_afternoon_countmostfrequentcontact","messages_sent_afternoon_count","messages_sent_afternoon_distinctcontacts","messages_sent_afternoon_timefirstmessage","messages_sent_afternoon_timelastmessage"
"2020-05-28",1,3,3,722,979

1 local_date sms_sent_afternoon_countmostfrequentcontact messages_sent_afternoon_countmostfrequentcontact sms_sent_afternoon_count messages_sent_afternoon_count sms_sent_afternoon_distinctcontacts messages_sent_afternoon_distinctcontacts sms_sent_afternoon_timefirstsms messages_sent_afternoon_timefirstmessage sms_sent_afternoon_timelastsms messages_sent_afternoon_timelastmessage
2 2020-05-28 1 1 3 3 3 3 722 722 979 979

View File

@ -1,3 +1,3 @@
"local_date","sms_sent_daily_countmostfrequentcontact","sms_sent_daily_count","sms_sent_daily_distinctcontacts","sms_sent_daily_timefirstsms","sms_sent_daily_timelastsms"
"local_date","messages_sent_daily_countmostfrequentcontact","messages_sent_daily_count","messages_sent_daily_distinctcontacts","messages_sent_daily_timefirstmessage","messages_sent_daily_timelastmessage"
"2020-05-28",1,8,8,219,1401
"2020-05-29",0,4,4,388,1401

1 local_date sms_sent_daily_countmostfrequentcontact messages_sent_daily_countmostfrequentcontact sms_sent_daily_count messages_sent_daily_count sms_sent_daily_distinctcontacts messages_sent_daily_distinctcontacts sms_sent_daily_timefirstsms messages_sent_daily_timefirstmessage sms_sent_daily_timelastsms messages_sent_daily_timelastmessage
2 2020-05-28 1 1 8 8 8 8 219 219 1401 1401
3 2020-05-29 0 0 4 4 4 4 388 388 1401 1401

View File

@ -1,3 +1,3 @@
"local_date","sms_sent_evening_countmostfrequentcontact","sms_sent_evening_count","sms_sent_evening_distinctcontacts","sms_sent_evening_timefirstsms","sms_sent_evening_timelastsms"
"local_date","messages_sent_evening_countmostfrequentcontact","messages_sent_evening_count","messages_sent_evening_distinctcontacts","messages_sent_evening_timefirstmessage","messages_sent_evening_timelastmessage"
"2020-05-28",1,2,2,1218,1401
"2020-05-29",0,2,2,1218,1401

1 local_date sms_sent_evening_countmostfrequentcontact messages_sent_evening_countmostfrequentcontact sms_sent_evening_count messages_sent_evening_count sms_sent_evening_distinctcontacts messages_sent_evening_distinctcontacts sms_sent_evening_timefirstsms messages_sent_evening_timefirstmessage sms_sent_evening_timelastsms messages_sent_evening_timelastmessage
2 2020-05-28 1 1 2 2 2 2 1218 1218 1401 1401
3 2020-05-29 0 0 2 2 2 2 1218 1218 1401 1401

View File

@ -1,3 +1,3 @@
"local_date","sms_sent_morning_countmostfrequentcontact","sms_sent_morning_count","sms_sent_morning_distinctcontacts","sms_sent_morning_timefirstsms","sms_sent_morning_timelastsms"
"local_date","messages_sent_morning_countmostfrequentcontact","messages_sent_morning_count","messages_sent_morning_distinctcontacts","messages_sent_morning_timefirstmessage","messages_sent_morning_timelastmessage"
"2020-05-28",1,2,2,388,654
"2020-05-29",0,2,2,388,654

1 local_date sms_sent_morning_countmostfrequentcontact messages_sent_morning_countmostfrequentcontact sms_sent_morning_count messages_sent_morning_count sms_sent_morning_distinctcontacts messages_sent_morning_distinctcontacts sms_sent_morning_timefirstsms messages_sent_morning_timefirstmessage sms_sent_morning_timelastsms messages_sent_morning_timelastmessage
2 2020-05-28 1 1 2 2 2 2 388 388 654 654
3 2020-05-29 0 0 2 2 2 2 388 388 654 654

View File

@ -1,2 +1,2 @@
"local_date","sms_sent_night_countmostfrequentcontact","sms_sent_night_count","sms_sent_night_distinctcontacts","sms_sent_night_timefirstsms","sms_sent_night_timelastsms"
"local_date","messages_sent_night_countmostfrequentcontact","messages_sent_night_count","messages_sent_night_distinctcontacts","messages_sent_night_timefirstmessage","messages_sent_night_timelastmessage"
"2020-05-28",1,1,1,219,219

1 local_date sms_sent_night_countmostfrequentcontact messages_sent_night_countmostfrequentcontact sms_sent_night_count messages_sent_night_count sms_sent_night_distinctcontacts messages_sent_night_distinctcontacts sms_sent_night_timefirstsms messages_sent_night_timefirstmessage sms_sent_night_timelastsms messages_sent_night_timelastmessage
2 2020-05-28 1 1 1 1 1 1 219 219 219 219

View File

@ -2,6 +2,7 @@
# If you are extracting screen or Barnett's location features, screen and locations tables are mandatory.
TABLES_FOR_SENSED_BINS: [messages, calls, screen]
# Participants to include in the analysis
# You must create a file for each participant named pXXX containing their device_id. This can be done manually or automatically
PIDS: [test01, test02]
@ -17,8 +18,8 @@ MESSAGES:
DB_TABLE: messages
TYPES : [received, sent]
FEATURES:
received: [count, distinctcontacts, timefirstsms, timelastsms, countmostfrequentcontact]
sent: [count, distinctcontacts, timefirstsms, timelastsms, countmostfrequentcontact]
received: [count, distinctcontacts, timefirstmessage, timelastmessage, countmostfrequentcontact]
sent: [count, distinctcontacts, timefirstmessage, timelastmessage, countmostfrequentcontact]
DAY_SEGMENTS: *day_segments
# Communication call features config, TYPES and FEATURES keys need to match