In [20]:
plt.figure(figsize=(14, 14))
num_iterations = [5000, 15000,17000, 20000, 30000]
for i, it in enumerate(num_iterations):
    plt.subplot(5, 2, i + 1)
    plt.title('Num of iterations %d' % it)
    learning_rate = 0.1
    n_h = 4
    parameters = NN_model(X_train,y_train,n_h, it, learning_rate)
    
    predictions = predict(parameters, X_test)
    accuracy = 100 - np.mean(np.abs(predictions - y_test)) * 100
    plot_grid(parameters, X_train)
    title_string = 'number of iterations = ' + str(it)+ ' classified with accuracy = ' + str(accuracy)+'%'
    plot_classified(X_test, predictions, 'LightBlue', 'Orange', title_string )