Kaggle competition: IEEE-CIS Fraud Detection
<SOS> metric: AUC Kaggle data source: ieee-cis-fraud-detection<count_missing_values>
warnings.filterwarnings("ignore")
 %matplotlib inline
train_df.AgeType.isna().sum()<filter>
LABELS = ["isFraud"]
all_files = glob.glob(".. /input/lgmodels/*.csv")
 all_files
test_df[test_df.Fare.isna() ]<filter>
outs = [pd.read_csv(f, index_col=0)for f in all_files]
concat_sub = pd.concat(outs, axis=1)
 cols = list(map(lambda x: "m" + str(x), range(len(concat_sub.columns))))
concat_sub.columns = cols
concat_sub.reset_index(inplace=True )
train_df[(train_df.Pclass==3)&(train_df.AgeType=='Senior')&(train_df.Embarked=='S')&(train_df.Title=='Mr')]['Fare'].mean()<correct_missing_values>
rank = np.tril(concat_sub.iloc[:,1:].corr().values,-1)
 m =(rank>0 ).sum()
m_gmean, s = 0, 0
for n in range(min(rank.shape[0],m)) :
mx = np.unravel_index(rank.argmin() , rank.shape)
 w =(m-n)/(m+n)
 print(w)
 m_gmean += w*(np.log(concat_sub.iloc[:,mx[0]+1])+np.log(concat_sub.iloc[:,mx[1]+1])) /2
s += w
rank[mx] = 1
m_gmean = np.exp(m_gmean/s )
<filter><EOS> 
concat_sub['isFraud'] = m_gmean
concat_sub[['TransactionID','isFraud']].to_csv('stack_gmean.csv',
index=False, float_format='%.4g' )