Bug fixed: set ratiovalidyielded mins/hours value to the range 0 to 1

pull/167/head
Weiyu 2021-08-06 12:32:16 -04:00 committed by JulioV
parent 3c46a1c878
commit 35eebe8a51
2 changed files with 4 additions and 4 deletions

View File

@ -19,8 +19,8 @@ compute_data_yield_features <- function(data, feature_name, time_segment, provid
valid_yielded_hours = sum(valid_hour == TRUE) / 1.0,
duration_minutes = first(duration_minutes),
duration_hours = duration_minutes / 60.0,
ratiovalidyieldedminutes = valid_yielded_minutes / duration_minutes,
ratiovalidyieldedhours = if_else(duration_hours > 1, valid_yielded_hours / duration_hours, valid_yielded_hours))
ratiovalidyieldedminutes = min( valid_yielded_minutes / duration_minutes, 1),
ratiovalidyieldedhours = if_else(duration_hours > 1, min( valid_yielded_hours / duration_hours, 1), valid_yielded_hours))
return(features)
}

View File

@ -21,8 +21,8 @@ compute_data_yield_features <- function(data, feature_name, time_segment, provid
valid_yielded_hours = sum(valid_hour == TRUE) / 1.0,
duration_minutes = first(duration_minutes),
duration_hours = duration_minutes / 60.0,
ratiovalidyieldedminutes = valid_yielded_minutes / duration_minutes,
ratiovalidyieldedhours = if_else(duration_hours > 1, valid_yielded_hours / duration_hours, valid_yielded_hours))
ratiovalidyieldedminutes = min( valid_yielded_minutes / duration_minutes, 1),
ratiovalidyieldedhours = if_else(duration_hours > 1, min( valid_yielded_hours / duration_hours, 1), valid_yielded_hours))
return(features)
}