Skip to content

Commit

Permalink
clarify ID drop
Browse files Browse the repository at this point in the history
  • Loading branch information
ourownstory committed Jul 3, 2024
1 parent 6284088 commit ed82d3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion neuralprophet/time_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ def __init__(

# self.tensor_data = torch.tensor(df.values, dtype=torch.float32
self.df["ds"] = self.df["ds"].astype(int) // 10**9 # Convert to Unix timestamp in seconds
# skipping col "ID" is string type that is interpreted as object by torch (self.df[col].dtype == "O")
# "ID" is stored in self.meta["df_name"]
self.tensor_dict = {
col: torch.tensor(self.df[col].values, dtype=torch.float32) for col in self.df if self.df[col].dtype != "O"
col: torch.tensor(self.df[col].values, dtype=torch.float32) for col in self.df if col != "ID"
}

# Construct index map
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/benchmark_time_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,4 +470,4 @@ def measure_times():
compare.print()


# measure_times()
measure_times()

0 comments on commit ed82d3c

Please sign in to comment.