Kaggle competition: Allstate Claims Severity
display_batch_of_images(next(test_batch))<choose_model_class>
train_data = pd.read_csv('.. /input/allstate-claims-severity/train.csv')
 test_data = pd.read_csv('.. /input/allstate-claims-severity/test.csv')
 print("Finished reading train and test data..." )
with strategy.scope() :
enb7 = efn.EfficientNetB7(weights='noisy-student', include_top=False, input_shape=[*IMAGE_SIZE, 3])
 enb7.trainable = True
model1 = tf.keras.Sequential([
enb7,
tf.keras.layers.GlobalAveragePooling2D() ,
tf.keras.layers.Dense(len(CLASSES), activation='softmax')
 ])
 model1.compile(
 optimizer = tf.keras.optimizers.Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, amsgrad=False),
loss = 'sparse_categorical_crossentropy',
metrics=['sparse_categorical_accuracy'] 
)
 model1.summary()<choose_model_class>
X_train = train_data.drop(['id', 'loss'], axis = 1)
 y_train = train_data["loss"]
print("Building and training neural network on {} data points...".format(len(train_data)))
 claimNet= MLPRegressor(activation='relu', alpha=0.0001, batch_size='auto', beta_1=0.9,
beta_2=0.999, early_stopping=True, epsilon=1e-08,
hidden_layer_sizes=(1500,1500,1500), learning_rate='constant',
learning_rate_init=0.001, max_iter=500, momentum=0.9,
n_iter_no_change=10, nesterovs_momentum=True, power_t=0.5,
random_state=None, shuffle=True, solver='adam', tol=0.0001,
validation_fraction=0.1, verbose=True, warm_start=False)
 claimNet.fit(X_train,y_train)
 print("Finished training..." )
with strategy.scope() :
enb5 = efn.EfficientNetB5(weights='noisy-student', include_top=False, input_shape=[*IMAGE_SIZE, 3])
 enb5.trainable = True
model2 = tf.keras.Sequential([
enb5,
tf.keras.layers.GlobalAveragePooling2D() ,
tf.keras.layers.Dense(len(CLASSES), activation='softmax')
 ])
 model2.compile(
 optimizer = tf.keras.optimizers.Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, amsgrad=False),
loss = 'sparse_categorical_crossentropy',
metrics=['sparse_categorical_accuracy'] 
)
 model2.summary()<choose_model_class>
print("Loading test data...")
with strategy.scope() :
enb4 = efn.EfficientNetB4(weights='noisy-student', include_top=False, input_shape=[*IMAGE_SIZE, 3])
 enb4.trainable = True
model3 = tf.keras.Sequential([
enb4,
tf.keras.layers.GlobalAveragePooling2D() ,
tf.keras.layers.Dense(len(CLASSES), activation='softmax')
 ])
 model3.compile(
 optimizer = tf.keras.optimizers.Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, amsgrad=False),
loss = 'sparse_categorical_crossentropy',
metrics=['sparse_categorical_accuracy'] 
)
 model3.summary()<init_hyperparams>
x_test = test_data.drop(['id'], axis = 1)
 print("Starting predictions on {} data points".format(len(x_test)))
 predictions = claimNet.predict(x_test)
 output = pd.DataFrame({'id': test_data.id,'loss': np.exp(predictions)-200})
 sns.distplot(np.exp(predictions)-200, hist = True, rug = True)
 output.to_csv('submission.csv', index=False)
 print("Finished test and I/O to csv file" )