Skip to content

Commit

Permalink
logging for time_encoding_minute
Browse files Browse the repository at this point in the history
  • Loading branch information
rchan26 committed Nov 14, 2023
1 parent d87e40e commit 3cedfbc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nlpsig/data_preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ def _set_time_features(self) -> pd.DataFrame:
# reset index so that we can return to the starting index afterwards
self.df = self.df.reset_index()

# obtain time encoding for minute by computing the fraction of minute it is in
if self.verbose:
print("[INFO] Adding 'time_encoding_minute' feature...")

# add a column for the time fraction of the minute
self.df["time_encoding_minute"] = self.df["datetime"].map(
lambda t: self._time_fraction_minute(t)
Expand Down

0 comments on commit 3cedfbc

Please sign in to comment.