Kaggle competition: Google Cloud & NCAA® ML Competition 2019-Women's
<SOS> metric: LogLoss Kaggle data source: womens-machine-learning-competition-2019<categorify>
df1 = pd.read_csv('.. /input/myncaa/W-0.1-hamid.csv')
 df2 = pd.read_csv('.. /input/myncaa/W-0.12-duketemon.csv')
 df1.head()
def label_encode(df, column_name):
ordered_column = np.sort(df[column_name].unique())
 df[column_name] = df[column_name].map(
 dict(zip(np.sort(df[column_name].unique()),[x for x in range(len(df[column_name].unique())) ])) 
)
 return df
def compare(df,column_name, with_table=False, with_graph=True, compare_to='Survived'):
if with_table:
print(df[df[compare_to] < 3].groupby([compare_to,column_name] ).size().sort_index())
 if with_graph:
g = sns.FacetGrid(df, col=compare_to ).map(sns.distplot, column_name)
 def show_correlation(df, column_name='Survived'):
return df.corr() [column_name].apply(abs ).sort_values(na_position='first' ).reset_index()
def get_IQR(df, column_name):
Q3 = df[column_name].quantile(0.75)
 Q1 = df[column_name].quantile(0.25)
 IQR = Q3 - Q1
return Q1, Q3, IQR
def detect_outliers(df, n, features):
outlier_indices = []
for col in features:
Q1, Q3, IQR = get_IQR(df, col)
 outlier_step = 1.5 * IQR
outlier_list_col = df[(df[col] < Q1 - outlier_step)|(df[col] > Q3 + outlier_step)].index
outlier_indices.extend(outlier_list_col)
 outlier_indices = Counter(outlier_indices)
 multiple_outliers = list(k for k, v in outlier_indices.items() if v > n)
 return multiple_outliers<load_from_csv>
df1['Pred'] =.94*df1['Pred'] +.06*df2['Pred']
df1.head()
<feature_engineering><EOS> 
df1.to_csv('sub.csv',index=False )