Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the monks data set, monks - 1 . train and monks - 1 . test that has six attributes and binary class labels, please

Using the monks data set, monks-1.train and monks-1.test that has six attributes and binary class labels, please write python code for a jupyter notebook that satisfies the following.
1. Implement a three layer neural network, layer one 8 nodes snd a hyperbolic tangent activation function, layer two has 6 nofed snd a relu activation function, layer 3 has one node and a sigmoid activation function. Can use either the sequential and dense layer grom keras or sckit learn MLPClassifier or implement your own neural network function.
2. Use the cross entropy function as the loss function for logistic regression
3. Set the learning rate as 0.01 or change to other values if you find 0.01 is not suitable for this problem.
4. For the two optimizers: stochastic gradient descent and Adam, record the testing accuracy of these two optimizers with respect to the epochs number
An example of 2 layer neural network using keras with 12 nodes in hidden layer: from keras.models import Sequential from keras.layers import Dense model = Sequential()
model.add(Dense(12, input_dim=8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='sgd')
model.fit(X,y)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions