Skip to content

Commit

Permalink
Merge pull request #18 from AC-BO-Hackathon:subsampling-function
Browse files Browse the repository at this point in the history
Subsampling-function
  • Loading branch information
koerper authored Mar 27, 2024
2 parents 421de83 + ac61b72 commit 87218b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/subsampling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import numpy as np

def random_subsample(df, num_samples):
np.random.seed(42)
indices = np.random.choice(df.index, num_samples, replace=False)
subsampled_df = df.loc[indices]
return subsampled_df

0 comments on commit 87218b5

Please sign in to comment.