Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 4, 2021 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/572633f8986d22268b293bb3f01e5997 to your computer and use it in GitHub Desktop.
Save amankharwal/572633f8986d22268b293bb3f01e5997 to your computer and use it in GitHub Desktop.
train_df = pd.concat([X,y],axis=1)
survived = train_df[train_df['Survived']==1]
deceased = train_df[train_df['Survived']==0]
deceased = deceased.sample(n=len(survived), random_state=101)
train_df = pd.concat([survived,deceased],axis=0)
X_train = train_df.drop('Survived',axis=1)
y_train = train_df['Survived']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment