This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
def concat_df(train_data, test_data): | |
#Returns a concatenated df of training and test set | |
return pd.concat([train_data, test_data], sort=True).reset_index(drop=True) | |
#2 | |
df_train = pd.read_csv('https://storage.googleapis.com/dqlab-dataset/challenge/feature-engineering/titanic_train.csv') | |
df_test = pd.read_csv('https://storage.googleapis.com/dqlab-dataset/challenge/feature-engineering/titanic_test.csv') | |
df_all = concat_df(df_train, df_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
sns.set(style="darkgrid") | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.preprocessing import OneHotEncoder, LabelEncoder, StandardScaler | |
from sklearn.metrics import roc_curve, auc | |
from sklearn.model_selection import StratifiedKFold |