Kaggle competition: Aerial Cactus Identification
prediction_add = model_ada.predict(X_test)
 ada_accuracy = accuracy_score(prediction_add, Y_test)* 100
print('ada accuarcy: {}'.format(ada_accuracy))<compute_train_metric>
train_dir=".. /input/train/train"
test_dir=".. /input/test/test"
train = pd.read_csv('.. /input/train.csv')
 test = pd.read_csv(".. /input/sample_submission.csv")
 data_folder = Path(".. /input")
model_linear_d= LinearDiscriminantAnalysis()
model_linear_d.fit(X_train,Y_train)
 prediction_lda=model_linear_d.predict(X_test)
 LDA_Accuracy = accuracy_score(prediction_lda, Y_test)
 print("Accuracy LDA: {}".format(LDA_Accuracy))<define_variables>
learn = cnn_learner(train_img, models.densenet161, metrics=[error_rate, accuracy])
models = {
'LinearDiscriminant': [LDA_Accuracy, prediction_lda],
'ADA': [ada_accuracy, prediction_add],
'DecisionTreeClassifier':[tree_acc,tree_predict],
'GaussianNB': [gaussian_acc,prediction_naive],
'LinearSVC':[SVC_acc,predictions_svc],
'RandomForestClassifier':[Random_Forest_Acc,predictions_random],
'LogisticRegression':[Linear_Reg_acc,predictions]
}<define_variables>
learn.lr_find()
models_acc = {
'LinearDiscriminant': LDA_Accuracy,
'ADA': ada_accuracy,
'DecisionTreeClassifier':tree_acc,
'GaussianNB': gaussian_acc,
'LinearSVC':SVC_acc,
'RandomForestClassifier':Random_Forest_Acc,
'LogisticRegression':Linear_Reg_acc}<find_best_params>
lr = 1e-02
learn.fit_one_cycle(3, slice(lr))
max_acc = max(models_acc, key=models_acc.get)
 print("MAx accuracy is : {}".format(max_acc))
print(models_acc[max_acc] )<predict_on_test>
preds,_ = learn.get_preds(ds_type=DatasetType.Test )
pred_test = svc_model.predict(testdf)
 pred_test<create_dataframe>
test.has_cactus = preds.numpy() [:, 0]
<save_to_csv><EOS> 
test.to_csv('submission.csv', index=False )