Skip to content

Commit

Permalink
Remove unecessary time_last variable (#546)
Browse files Browse the repository at this point in the history
We just grouped on this column, so it should be equal to the group
identifier. This removes the variable which was called time_last, but
renames the group id to now be time_last.
  • Loading branch information
CJStadler committed May 20, 2019
1 parent 2546a68 commit 0f7b917
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,16 @@ def calc_results(time_last, ids, precalculated_features=None, training_window=No

grouped = group.groupby(cutoff_df_time_var, sort=True)

for _time_last_to_calc, group in grouped:
for time_last, group in grouped:
# sort group by instance id
ids = group['instance_id'].sort_values().values
time_last = group[cutoff_df_time_var].iloc[0]
if no_unapproximated_aggs and approximate is not None:
window = None
else:
window = training_window

# calculate values for those instances at time _time_last_to_calc
_feature_matrix = calc_results(_time_last_to_calc,
# calculate values for those instances at time time_last
_feature_matrix = calc_results(time_last,
ids,
precalculated_features=precalculated_features,
training_window=window)
Expand Down

0 comments on commit 0f7b917

Please sign in to comment.