Kaggle competition: SIIM-ISIC Melanoma Classification
<SOS> metric: MCAUC Kaggle data source: siim-isic-melanoma-classification<split>
import pandas as pd, numpy as np, os
import matplotlib.pyplot as plt
from scipy.optimize import minimize, fmin
from sklearn.metrics import roc_auc_score
from bayes_opt import BayesianOptimization
from functools import partial
from sklearn import metrics
X_train, X_val, Y_train, Y_val = train_test_split(train_data, target , test_size = 0.1, random_state=42 )<define_variables>
class OptimizeAUC:

 def __init__(self):
self.coef_ = 0
def _auc(self, coef, X, y):

 x_coef = X * coef
predictions = np.sum(x_coef, axis=1)
 auc_score = metrics.roc_auc_score(y, predictions)
 return -1.0 * auc_score
def fit(self, X, y):
loss_partial = partial(self._auc, X=X, y=y)
 initial_coef = np.random.dirichlet(np.ones(X.shape[1]), size=1)
 self.coef_ = fmin(loss_partial, initial_coef, disp=True)
 def predict(self, X):
x_coef = X * self.coef_
predictions = np.sum(x_coef, axis=1)
 return predictions
datagen = ImageDataGenerator(
 featurewise_center=False,
samplewise_center=False,
featurewise_std_normalization=False,
samplewise_std_normalization=False,
zca_whitening=False,
rotation_range=10,
zoom_range = 0.1,
width_shift_range=0.1,
height_shift_range=0.1,
horizontal_flip=False,
vertical_flip=False)
 datagen.fit(X_train )<choose_model_class>
sample_submission = pd.read_csv(".. /input/siim-isic-melanoma-classification/sample_submission.csv" )
learning_rate_reduction = ReduceLROnPlateau(monitor='val_acc',
patience=3,
verbose=1,
factor=0.5,
min_lr=0.0001 )<choose_model_class>
SUB_DIR = ".. /input/siimsubmitionfiles/Final_Submissions/Final_Submissions"
TF_0OFS = ".. /input/siimsubmitionfiles/TF-OOFS/TF-OOFS"
TF_SUBS = ".. /input/siimsubmitionfiles/TF-SUBS/TF-SUBS"
model = Sequential()
model.add(Conv2D(32, kernel_size=(3, 3),activation='relu',kernel_initializer='he_normal',input_shape=input_shape))
model.add(Conv2D(32, kernel_size=(3, 3),activation='relu',kernel_initializer='he_normal'))
model.add(MaxPool2D(( 2, 2)))
 model.add(BatchNormalization())
 model.add(Dropout(0.20))
model.add(Conv2D(64,(3, 3), activation='relu',padding='same',kernel_initializer='he_normal'))
model.add(Conv2D(64,(3, 3), activation='relu',padding='same',kernel_initializer='he_normal'))
model.add(MaxPool2D(pool_size=(2, 2)))
 model.add(BatchNormalization())
 model.add(Dropout(0.25))
model.add(Conv2D(128,(3, 3), activation='relu',padding='same',kernel_initializer='he_normal'))
model.add(Dropout(0.25))
model.add(Flatten())
 model.add(Dense(128, activation='relu'))
model.add(BatchNormalization())
 model.add(Dropout(0.25))
model.add(Dense(num_classes, activation='softmax')) 
<choose_model_class>
offs_b5_df = pd.read_csv(f"{SUB_DIR}/offs_b5_df.csv")
 offs_b5_ns_df = pd.read_csv(f"{SUB_DIR}/offs_b5_ns_df.csv")
 offs_b5_ds_df = pd.read_csv(f"{SUB_DIR}/offs_b5_512_ds_df.csv")
 offs_b5_10_ds_df = pd.read_csv(f"{SUB_DIR}/offs_b5_10_ds_df.csv")
 offs_b5_f_ds_df = pd.read_csv(f"{SUB_DIR}/offs_b5_f_ds_df.csv")
 offs_tf_b5_df = pd.read_csv(f"{SUB_DIR}/offs_tf_b5_df.csv")
 offs_tf_b5_v1_df = pd.read_csv(f"{SUB_DIR}/offs_tf_b5_v1_df.csv")
 offs_b6_df = pd.read_csv(f"{SUB_DIR}/offs_b6_df.csv")
 offs_b6_2_df = pd.read_csv(f"{SUB_DIR}/offs_b6_2_ds_df.csv")
 offs_b6_10_df = pd.read_csv(f"{SUB_DIR}/offs_b6_10_ds_df.csv")
 offs_tf_b6_df = pd.read_csv(f"{SUB_DIR}/offs_tf_b6_df.csv")
 offs_d201_df = pd.read_csv(f"{SUB_DIR}/offs_d201_df.csv")
 offs_d201_ns_df = pd.read_csv(f"{SUB_DIR}/offs_d201_ns_df.csv")
 offs_d201_512_df = pd.read_csv(f"{SUB_DIR}/offs_d201_512_df.csv")
 offs_d201_512_ds_df = pd.read_csv(f"{SUB_DIR}/offs_d201_512_ds_df.csv")
 offs_tf_d201_df = pd.read_csv(f"{SUB_DIR}/offs_tf_d201_df.csv")
 offs_b4_df = pd.read_csv(f"{SUB_DIR}/offs_b4_df.csv")
 offs_b4_f_df = pd.read_csv(f"{SUB_DIR}/offs_b4_f_5_ds_df.csv")
 offs_b7_224_df = pd.read_csv(f"{SUB_DIR}/offs_b7_224_ds_df.csv")
 offs_tf_b7_df = pd.read_csv(f"{SUB_DIR}/offs_tf_b7_df.csv")
 offs_b7_512_ds_df = pd.read_csv(f"{SUB_DIR}/offs_b7_512_ds_df.csv")
 offs_dpn92_ds_df = pd.read_csv(f"{SUB_DIR}/offs_dpn92_ds_df.csv")
 offs_sk50_ds_df = pd.read_csv(f"{SUB_DIR}/offs_sk50_5_ds_df.csv")
 offs_meta_df = pd.read_csv(f"{SUB_DIR}/tabular_oof_df.csv" ).sort_values("image_name")
 offs_meta_df = offs_meta_df[offs_meta_df.image_name.isin(offs_dpn92_ds_df.image_name)].reset_index(drop=True)
 offs_meta_2_df = pd.read_csv(f"{SUB_DIR}/tabular2_oof_df.csv" ).sort_values("image_name")
 offs_meta_2_df = offs_meta_2_df[offs_meta_2_df.image_name.isin(offs_dpn92_ds_df.image_name)].reset_index(drop=True )
model.compile(loss='categorical_crossentropy',
optimizer='Adam',
metrics=['accuracy'] )<train_model>
offs_final_df = pd.DataFrame({
"image_name" : offs_b5_df.image_name.values,
"target" : offs_b5_df.target.values,
"b5" : offs_b5_df.prediction.values,
"b5_ns": offs_b5_ns_df.prediction.values,
"b5_ds": offs_b5_ds_df.prediction.values,
"b5_ds_10": offs_b5_10_ds_df.prediction.values,
"b5_f_ds" : offs_b5_f_ds_df.prediction.values,
"tf_b5" : offs_tf_b5_df.pred.values,
"tf_b5_v1": offs_tf_b5_v1_df.pred.values,
"b6" : offs_b6_df.prediction.values,
"b6_2" : offs_b6_2_df.prediction.values,
"b6_10" : offs_b6_10_df.prediction,
"tf_b6": offs_tf_b6_df.pred.values,
"b4" : offs_b4_df.prediction.values,
"b4_f" : offs_b4_f_df.prediction.values,
"d201" :offs_d201_df.prediction.values,
"d201_ns" : offs_d201_ns_df.prediction.values,
"d201_512" : offs_d201_512_df.prediction.values,
"d201_512_ds" : offs_d201_512_ds_df.prediction.values,
"tf_d201" : offs_tf_d201_df.pred.values,
"b7_224_ds" : offs_b7_224_df.prediction.values,
"tf_b7" : offs_tf_b7_df.pred.values,
"b7_512_ds" : offs_b7_512_ds_df.prediction.values,
"dpn92_ds" : offs_dpn92_ds_df.prediction.values,
"sk50_ds" : offs_sk50_ds_df.prediction.values,
"meta_sub" : offs_meta_df.prediction.values,
"meta_sub_2" : offs_meta_2_df.prediction.values
} )
fitting = model.fit_generator(datagen.flow(X_train, Y_train, batch_size = 90),
epochs = 50, validation_data =(X_val, Y_val),
verbose = 1, callbacks = [learning_rate_reduction] )<predict_on_test>
train_df = offs_final_df
train_cols = [
'b5', 'b5_ns', 'b5_ds', 'b5_ds_10', 'b5_f_ds','tf_b5', 'tf_b5_v1',
'b6', 'b6_2', 'b6_10', 'tf_b6',
'b4', 'b4_f',
'd201', 'd201_ns', 'd201_512', 'd201_512_ds', 'tf_d201',
'b7_224_ds','tf_b7', 'b7_512_ds',
'dpn92_ds',
'sk50_ds',
'meta_sub', 'meta_sub_2'
]
X = train_df[train_cols]
y = train_df["target"]
predicted_classes = model.predict_classes(test_data )<save_to_csv>
opt = OptimizeAUC()
opt.fit(X, y )
submissions=pd.DataFrame({"ImageId": list(range(1,len(predicted_classes)+1)) ,
"Label": predicted_classes})
 submissions.to_csv("submission.csv", index=False, header=True )<set_options>
b5_512_5 = pd.read_csv(f"{SUB_DIR}/Final_B5_512_456_5.csv")["target"]
b5_512_5_ns = pd.read_csv(f"{SUB_DIR}/Final_NS_E5_512_456_5.csv")["target"]
b5_512_5_ds = pd.read_csv(f"{SUB_DIR}/Final_DS_B5_512_456_5.csv")["target"]
b5_512_10_ds = pd.read_csv(f"{SUB_DIR}/Final_DS_B5_512_456_10.csv")["target"]
b5_512_f_ds = pd.read_csv(f"{SUB_DIR}/F_Final_DS_B5_512_456_5.csv")["target"]
b5_512_5_tf = pd.read_csv(f"{SUB_DIR}/TF-B5-512-V.csv")["target"]
b5_512_5_v1 = pd.read_csv(f"{SUB_DIR}/TF-B5-512.csv")["target"]
b6_528_5 = pd.read_csv(f"{SUB_DIR}/Final_B6_768_528_5.csv")["target"]
b6_512_2 = pd.read_csv(f"{SUB_DIR}/Final_DSO_B6_768_528_2.csv")["target"]
b6_512_10 = pd.read_csv(f"{SUB_DIR}/Final_DS_B6_768_528_10.csv")["target"]
b6_512_5_tf = pd.read_csv(f"{SUB_DIR}/TF-B6-512-5.csv")["target"]
b4_300_10 = pd.read_csv(f"{SUB_DIR}/Final_B4_512_380_10.csv")["target"]
b4_f = pd.read_csv(f"{SUB_DIR}/F_Final_DS_B4_512_380_5.csv")["target"]
d201_224_5 = pd.read_csv(f"{SUB_DIR}/Final_D201_512_224_5.csv")["target"]
d201_224_5_ns = pd.read_csv(f"{SUB_DIR}/Final_NS_D201_512_224_5.csv")["target"]
d201_512_5 = pd.read_csv(f"{SUB_DIR}/Final_D201_512_512_5.csv")["target"]
d201_512_5_ds = pd.read_csv(f"{SUB_DIR}/Final_DS_D201_512_512_5.csv")["target"]
d201_512_5_tf = pd.read_csv(f"{SUB_DIR}/TF-D201-512-5.csv")["target"]
b7_224_ds = pd.read_csv(f"{SUB_DIR}/Final_DS_B7_512_224_5.csv")["target"]
b7_512_ds = pd.read_csv(f"{SUB_DIR}/Final_DS_B7_512_512_5.csv")["target"]
b7_512_tf = pd.read_csv(f"{SUB_DIR}/TF-B7-512-5.csv")["target"]
dpn92_ds = pd.read_csv(f"{SUB_DIR}/Final_DS_dpn92_512_512_5.csv")["target"]
sk50_ds = pd.read_csv(f"{SUB_DIR}/Final_DS_sk50_512_512_5.csv")["target"]
meta_1 = pd.read_csv(f"{SUB_DIR}/tabular_test_prediction.csv")["target"]
meta_2 = pd.read_csv(f"{SUB_DIR}/tabular2_test_prediction.csv")["target"]
warnings.filterwarnings("ignore" )<load_from_csv>
W = opt.coef_
pytorch_sub = np.mean([
W[0] * b5_512_5,
W[1] * b5_512_5_ns,
W[2] * b5_512_5_ds,
W[3] * b5_512_10_ds,
W[4] * b5_512_f_ds,
W[5] * b5_512_5_tf,
W[6] * b5_512_5_v1,
W[7] * b6_528_5,
W[8] * b6_512_2,
W[9] * b6_512_10,
W[10] * b6_512_5_tf,
W[11] * b4_300_10,
W[12] * b4_f,
W[13] * d201_224_5,
W[14] * d201_224_5_ns,
W[15] * d201_512_5,
W[16] * d201_512_5_ds,
W[17] * d201_512_5_tf,
W[18] * b7_224_ds,
W[19] * b7_512_ds,
W[20] * b7_512_tf,
W[21] * dpn92_ds,
W[22] * sk50_ds,
W[23] * meta_1,
W[24] * meta_2,
], axis=0 )
df = pd.read_csv('.. /input/train.csv')
 df.head()<load_from_csv>
sample_submission["target"] = pytorch_sub
sample_submission.to_csv("Final_Pytorch.csv", index=False )
test_df = pd.read_csv('.. /input/test.csv')
 test_df.head()<drop_column>
offs_b7_512_15 = pd.read_csv(f"{TF_0OFS}/offs_b7_512_15.csv")
 offs_b6_512_15 = pd.read_csv(f"{TF_0OFS}/offs_b6_512_15.csv")
 offs_b5_512_15 = pd.read_csv(f"{TF_0OFS}/offs_b5_512_15.csv")
 offs_b7_512_10 = pd.read_csv(f"{TF_0OFS}/offs_b7_512_10.csv")
 offs_b6_512_10 = pd.read_csv(f"{TF_0OFS}/offs_b6_512_10.csv")
 offs_b5_512_10 = pd.read_csv(f"{TF_0OFS}/offs_b5_512_10.csv")
 offs_b4_512_10 = pd.read_csv(f"{TF_0OFS}/offs_b4_512_10.csv")
 offs_b3_512_10 = pd.read_csv(f"{TF_0OFS}/offs_b3_512_10.csv")
 offs_b2_512_10 = pd.read_csv(f"{TF_0OFS}/offs_b2_512_10.csv")
 offs_b1_512_10 = pd.read_csv(f"{TF_0OFS}/offs_b1_512_10.csv")
 offs_b7_768_5 = pd.read_csv(f"{TF_0OFS}/offs_b7_768_5.csv")
 offs_b6_768_5 = pd.read_csv(f"{TF_0OFS}/offs_b6_768_5.csv")
 offs_b5_768_5 = pd.read_csv(f"{TF_0OFS}/offs_b5_768_5.csv")
 offs_b4_768_5 = pd.read_csv(f"{TF_0OFS}/offs_b4_768_5.csv")
 offs_b3_768_5 = pd.read_csv(f"{TF_0OFS}/offs_b3_768_5.csv")
 offs_b2_768_5 = pd.read_csv(f"{TF_0OFS}/offs_b2_768_5.csv")
 offs_b1_768_5 = pd.read_csv(f"{TF_0OFS}/offs_b1_768_5.csv")
 offs_b7_384_15 = pd.read_csv(f"{TF_0OFS}/offs_b7_384_15.csv")
 offs_b6_384_15 = pd.read_csv(f"{TF_0OFS}/offs_b6_384_15.csv")
 offs_b5_384_15 = pd.read_csv(f"{TF_0OFS}/offs_b5_384_15.csv" )
test_df.drop(['PassengerId'],axis=1,inplace=True)
 test_df.head()<concatenate>
offs_final_tf_df = pd.DataFrame({
"target" : offs_b7_512_15.target.values,
"image_name" : offs_b7_512_15.image_name.values,
"b7_512_15" : offs_b7_512_15.prediction.values,
"b6_512_15" : offs_b6_512_15.prediction.values,
"b5_512_15" : offs_b5_512_15.prediction.values,
"b7_512_10" : offs_b7_512_10.prediction.values,
"b6_512_10" : offs_b6_512_10.prediction.values,
"b5_512_10" : offs_b5_512_10.prediction.values,
"b4_512_10" : offs_b4_512_10.prediction.values,
"b3_512_10" : offs_b3_512_10.prediction.values,
"b2_512_10" : offs_b2_512_10.prediction.values,
"b1_512_10" : offs_b1_512_10.prediction.values,
"b7_768_5" : offs_b7_768_5.prediction.values,
"b6_768_5" : offs_b6_768_5.prediction.values,
"b5_768_5" : offs_b5_768_5.prediction.values,
"b4_768_5" : offs_b4_768_5.prediction.values,
"b3_768_5" : offs_b3_768_5.prediction.values,
"b2_768_5" : offs_b2_768_5.prediction.values,
"b1_768_5" : offs_b1_768_5.prediction.values,
"b7_384_15" : offs_b7_384_15.prediction.values,
"b6_384_15" : offs_b6_384_15.prediction.values,
"b5_384_15" : offs_b5_384_15.prediction.values,
} )
concated_df = pd.concat([train_df,test_df])
 concated_df.head()<import_modules>
train_df = offs_final_tf_df
train_cols = [
'b7_512_15', 'b6_512_15', 'b5_512_15',
'b7_512_10', 'b6_512_10', 'b5_512_10', 'b4_512_10', 'b3_512_10',
'b2_512_10', 'b1_512_10', 'b7_768_5', 'b6_768_5', 'b5_768_5',
'b4_768_5', 'b3_768_5', 'b2_768_5', 'b1_768_5', 'b7_384_15',
'b6_384_15', 'b5_384_15'
]
X = train_df[train_cols]
y = train_df["target"]
from sklearn import preprocessing as prep<categorify>
B7_512_15 = pd.read_csv(f"{TF_SUBS}/B7_512_15.csv")["target"]
B6_512_15 = pd.read_csv(f"{TF_SUBS}/B6_512_15.csv")["target"]
B5_512_15 = pd.read_csv(f"{TF_SUBS}/B5_512_15.csv")["target"]
B7_512_10 = pd.read_csv(f"{TF_SUBS}/B7_512_10.csv")["target"]
B6_512_10 = pd.read_csv(f"{TF_SUBS}/B6_512_10.csv")["target"]
B5_512_10 = pd.read_csv(f"{TF_SUBS}/B5_512_10.csv")["target"]
B4_512_10 = pd.read_csv(f"{TF_SUBS}/B4_512_10.csv")["target"]
B3_512_10 = pd.read_csv(f"{TF_SUBS}/B3_512_10.csv")["target"]
B2_512_10 = pd.read_csv(f"{TF_SUBS}/B2_512_10.csv")["target"]
B1_512_10 = pd.read_csv(f"{TF_SUBS}/B1_512_10.csv")["target"]
B7_768_5 = pd.read_csv(f"{TF_SUBS}/B7_768_5.csv")["target"]
B6_768_5 = pd.read_csv(f"{TF_SUBS}/B6_768_5.csv")["target"]
B5_768_5 = pd.read_csv(f"{TF_SUBS}/B5_768_5.csv")["target"]
B4_768_5 = pd.read_csv(f"{TF_SUBS}/B4_768_5.csv")["target"]
B3_768_5 = pd.read_csv(f"{TF_SUBS}/B3_768_5.csv")["target"]
B2_768_5 = pd.read_csv(f"{TF_SUBS}/B2_768_5.csv")["target"]
B1_768_5 = pd.read_csv(f"{TF_SUBS}/B1_768_5.csv")["target"]
B7_384_15 = pd.read_csv(f"{TF_SUBS}/B7_384_15.csv")["target"]
B6_384_15 = pd.read_csv(f"{TF_SUBS}/B6_384_15.csv")["target"]
B5_384_15 = pd.read_csv(f"{TF_SUBS}/B5_384_15.csv")["target"]
le = prep.LabelEncoder()
concated_df.Sex =le.fit_transform(concated_df.Sex)
 df.Sex[0:10]<drop_column>
W = opt.coef_
tf_sub = np.mean([
W[0] * B7_512_15,
W[1] * B6_512_15,
W[2] * B5_512_15,
W[3] * B7_512_10,
W[4] * B6_512_10,
W[5] * B5_512_10,
W[6] * B4_512_10,
W[7] * B3_512_10,
W[8] * B2_512_10,
W[9] * B1_512_10,
W[10] * B7_768_5,
W[11] * B6_768_5,
W[12] * B5_768_5,
W[13] * B4_768_5,
W[14] * B3_768_5,
W[15] * B2_768_5,
W[16] * B1_768_5,
W[17] * B7_384_15,
W[18] * B6_384_15,
W[19] * B5_384_15,
], axis=0 )
concated_df.drop(['Cabin'],axis=1,inplace=True)
 concated_df.head()<string_transform>
sample_submission["target"] = tf_sub
sample_submission.to_csv("Final_TF.csv", index=False )
NameSplit = concated_df.Name.str.split('[,.]')
 NameSplit.head()<define_variables>
train_df = pd.merge(offs_final_df, offs_final_tf_df, how="left", left_on=["image_name", "target"], right_on=["image_name", "target"])
 train_cols = [
'b5', 'b5_ns', 'b5_ds', 'b5_ds_10', 'b5_f_ds',
'tf_b5', 'tf_b5_v1', 'b6', 'b6_2', 'b6_10', 'tf_b6', 'b4', 'b4_f',
'd201', 'd201_ns', 'd201_512', 'd201_512_ds', 'tf_d201', 'b7_224_ds',
'tf_b7', 'b7_512_ds', 'dpn92_ds', 'sk50_ds',
'b7_512_15', 'b6_512_15', 'b5_512_15', 'b7_512_10', 'b6_512_10',
'b5_512_10', 'b4_512_10', 'b3_512_10', 'b2_512_10', 'b1_512_10',
'b7_768_5', 'b6_768_5', 'b5_768_5', 'b4_768_5', 'b3_768_5', 'b2_768_5',
'b1_768_5', 'b7_384_15', 'b6_384_15', 'b5_384_15'
]
X = train_df[train_cols]
y = train_df["target"]
titles = [str.strip(name[1])for name in NameSplit.values]
titles[:10]<feature_engineering>
opt = OptimizeAUC()
opt.fit(X, y )
concated_df['Title'] = titles
concated_df.head()<feature_engineering>
W = opt.coef_
pytorch_tf_sub = np.mean([
W[0] * b5_512_5,
W[1] * b5_512_5_ns,
W[2] * b5_512_5_ds,
W[3] * b5_512_10_ds,
W[4] * b5_512_f_ds,
W[5] * b5_512_5_tf,
W[6] * b5_512_5_v1,
W[7] * b6_528_5,
W[8] * b6_512_2,
W[9] * b6_512_10,
W[10] * b6_512_5_tf,
W[11] * b4_300_10,
W[12] * b4_f,
W[13] * d201_224_5,
W[14] * d201_224_5_ns,
W[15] * d201_512_5,
W[16] * d201_512_5_ds,
W[17] * d201_512_5_tf,
W[18] * b7_224_ds,
W[19] * b7_512_ds,
W[20] * b7_512_tf,
W[21] * dpn92_ds,
W[22] * sk50_ds,
W[23] * B7_512_15,
W[24] * B6_512_15,
W[25] * B5_512_15,
W[26] * B7_512_10,
W[27] * B6_512_10,
W[38] * B5_512_10,
W[39] * B4_512_10,
W[30] * B3_512_10,
W[31] * B2_512_10,
W[32] * B1_512_10,
W[33] * B7_768_5,
W[34] * B6_768_5,
W[35] * B5_768_5,
W[36] * B4_768_5,
W[37] * B3_768_5,
W[38] * B2_768_5,
W[39] * B1_768_5,
W[40] * B7_384_15,
W[41] * B6_384_15,
W[42] * B5_384_15,
], axis=0 )
concated_df.Title.values[concated_df.Title.isin(['Mme', 'Mmle'])] = 'Mmle'<feature_engineering>
sample_submission["target"] = pytorch_tf_sub
sample_submission.to_csv("Final_Pytorch_TF.csv", index=False )
concated_df.Title.values[concated_df.Title.isin(['Capt', 'Don', 'Major', 'Sir'])] = 'Sir'
concated_df.Title.values[concated_df.Title.isin(['Dona', 'Lady', 'the Countess', 'Jonkheer'])] = 'Lady'<categorify>
W = [1] * 50
simple_avg = np.mean([
W[0] * b5_512_5,
W[1] * b5_512_5_ns,
W[2] * b5_512_5_ds,
W[3] * b5_512_10_ds,
W[4] * b5_512_f_ds,
W[5] * b5_512_5_tf,
W[6] * b5_512_5_v1,
W[7] * b6_528_5,
W[8] * b6_512_2,
W[9] * b6_512_10,
W[10] * b6_512_5_tf,
W[11] * b4_300_10,
W[12] * b4_f,
W[13] * d201_224_5,
W[14] * d201_224_5_ns,
W[15] * d201_512_5,
W[16] * d201_512_5_ds,
W[17] * d201_512_5_tf,
W[18] * b7_224_ds,
W[19] * b7_512_ds,
W[20] * b7_512_tf,
W[21] * dpn92_ds,
W[22] * sk50_ds,
W[23] * B7_512_15,
W[24] * B6_512_15,
W[25] * B5_512_15,
W[26] * B7_512_10,
W[27] * B6_512_10,
W[38] * B5_512_10,
W[39] * B4_512_10,
W[30] * B3_512_10,
W[31] * B2_512_10,
W[32] * B1_512_10,
W[33] * B7_768_5,
W[34] * B6_768_5,
W[35] * B5_768_5,
W[36] * B4_768_5,
W[37] * B3_768_5,
W[38] * B2_768_5,
W[39] * B1_768_5,
W[40] * B7_384_15,
W[41] * B6_384_15,
W[42] * B5_384_15,
], axis=0 )
<feature_engineering><EOS> 
sample_submission["target"] = simple_avg
sample_submission.to_csv("Final_simple_avg.csv", index=False )