Skip to content

Commit

Permalink
remove duplicate lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-Maladiere committed Jan 14, 2025
1 parent 6fd2723 commit 1668e54
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions hazardous/_survival_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,6 @@ def draw(self, ipcw_training=False, X=None):
# sampled time horizon;
# * 0 when an event has happened before the sampled time horizon.
# The sample weight is zero in that case.
n_samples = self.duration_train.shape[0]
sampled_time_horizons = self.time_sampler.sample(n_samples)

# Add some hard zeros to make sure that the model learns to
# predict 0 incidence at t=0.
n_hard_zeros = max(int(self.hard_zero_fraction * n_samples), 1)
hard_zero_indices = self.rng.choice(n_samples, n_hard_zeros, replace=False)
sampled_time_horizons[hard_zero_indices] = 0.0

if not hasattr(self, "inv_any_survival_train"):
self.inv_any_survival_train = self.ipcw_estimator.compute_ipcw_at(
Expand Down

0 comments on commit 1668e54

Please sign in to comment.