Kaggle competition: APTOS 2019 Blindness Detection
mask_base =(df_data[target].notnull())
 x_cols = [c for c in df_data.columns if c[:2] == 'x_']
xgb = XGBRegressor()
scores = _evaluate(xgb, df_data[x_cols][mask_base], df_data[target][mask_base])
 df_evaluation.loc[len(df_evaluation)] = 'baseline', np.mean(scores), np.std(scores)
 print('baseline: mean:', np.mean(scores), ', std:', np.std(scores))<statistical_test>
test_df = pd.read_csv('.. /input/aptos2019-blindness-detection/test.csv')
 print(test_df.shape )
df_data['x_busy_period'] = np.where(df_data['MoSold'].isin([3, 4, 5, 6, 7, 8]), 1, 0)
 mask_base =(df_data[target].notnull())
 x_cols = [c for c in df_data.columns if c[:2] == 'x_']
xgb = XGBRegressor()
scores = _evaluate(xgb, df_data[x_cols][mask_base], df_data[target][mask_base])
 df_evaluation.loc[len(df_evaluation)] = 'busy period', np.mean(scores), np.std(scores)
 print('busy period: mean:', np.mean(scores), ', std:', np.std(scores))<feature_engineering>
densenet = DenseNet121(
 weights='.. /input/densenet-keras/DenseNet-BC-121-32-no-top.h5',
include_top=False,
input_shape=(im_size,im_size,3)
)
 def build_model() :
model = Sequential()
model.add(densenet)
 model.add(layers.GlobalAveragePooling2D())
 model.add(layers.Dropout(0.5))
model.add(layers.Dense(5, activation='sigmoid'))
return model
model = build_model()
model.load_weights('.. /input/aptos2019traineddenset/model.h5')
 model.summary()
<feature_engineering><EOS> 
y_test = model.predict(x_test)> 0.5
y_test = y_test.astype(int ).sum(axis=1)- 1
test_df['diagnosis'] = y_test
test_df.to_csv('submission.csv',index=False)
 print(test_df.head() )