Fix app episode length bug
parent
065a926a87
commit
bc5c0c9a4f
|
@ -12,7 +12,7 @@ app <- read_csv(snakemake@input[["app"]], col_types = cols_only(timestamp = col_
|
|||
if (nrow(screen_ep) > 0 & nrow(app) > 0){
|
||||
|
||||
joined_dt <- full_join(app, screen_ep, by = "timestamp") %>%
|
||||
arrange("timestamp") %>%
|
||||
arrange(timestamp) %>%
|
||||
mutate(start_timestamp = timestamp, end_timestamp = lead(timestamp)) %>%
|
||||
filter(!is.na(application_name)) %>%
|
||||
select(-c('timestamp')) %>% head(-1) %>%
|
||||
|
|
|
@ -136,9 +136,7 @@ def rapids_features(sensor_data_files, time_segment, provider, filter_data_by_se
|
|||
if app_episodes_requirement:
|
||||
episode_data = pd.read_csv(sensor_data_files["episode_data"])
|
||||
requested_episodes_features = provider["FEATURES"]["APP_EPISODES"]
|
||||
|
||||
episode_data = episode_data.drop(episode_data[ (episode_data['duration'] < provider["IGNORE_EPISODES_SHORTER_THAN"]) & (episode_data['duration'] > provider["IGNORE_EPISODES_LONGER_THAN"])].index)
|
||||
|
||||
episode_data = episode_data.drop(episode_data[ (episode_data['duration'] < provider["IGNORE_EPISODES_SHORTER_THAN"]) | (episode_data['duration'] > provider["IGNORE_EPISODES_LONGER_THAN"])].index)
|
||||
episodes_features = process_app_features(episode_data, requested_episodes_features, time_segment, provider, filter_data_by_segment)
|
||||
|
||||
features = pd.merge(episodes_features, features, how='outer', on='local_segment')
|
||||
|
|
Loading…
Reference in New Issue