Skip to content

Instantly share code, notes, and snippets.

@MoGaber
Created December 14, 2020 05:13
Show Gist options
  • Save MoGaber/e1b5215b2b312c8ed255b036bc2e5c9b to your computer and use it in GitHub Desktop.
Save MoGaber/e1b5215b2b312c8ed255b036bc2e5c9b to your computer and use it in GitHub Desktop.
resample
positive = model_dataset[ model_dataset["q_answered?"] != 0]
negative = model_dataset[ model_dataset["q_answered?"] == 0]
negative_sample = negative.sample(5000)
resampled_data = pd.concat([positive,negative_sample ])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment