Skip to content

Commit

Permalink
fix: correctly set holiday feature to 1 for all holiday dates (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k authored Nov 20, 2024
1 parent 1c1f24f commit 7fb6a74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/augurs-prophet/src/prophet/prep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,11 @@ impl<O> Prophet<O> {
};
let mut col = vec![0.0; ds.len()];

// Get the index of the adjusted date in the original data, if it exists.
// Set the value of the holiday column 1.0 for that date.
if let Some(loc) = ds
// Get the indices of the ds column that are 'on holiday'.
// Set the value of the holiday column 1.0 for those dates.
for loc in ds
.iter()
.position(|x| (x - (x % ONE_DAY_IN_SECONDS_INT)) == occurrence)
.positions(|x| (x - (x % ONE_DAY_IN_SECONDS_INT)) == occurrence)
{
col[loc] = 1.0;
}
Expand Down

0 comments on commit 7fb6a74

Please sign in to comment.