Throughout this book, we've focused on giving ready-to-use examples for real-world problems. For some relatively simple tasks, a simple neural network can provide a good-enough solution to a problem. In this recipe, we'll demonstrate how straightforward it can be to implement a shallow neural network for binary classification in Keras.
Using a shallow neural network for binary classification
How to do it...
- Start with importing all libraries as follows:
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from keras.models import Sequential
from keras.layers import Dense
from keras.callbacks import EarlyStopping
- Next, we load the dataset:
dataframe = pandas.read_csv("Data/sonar...