Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what can I do to increase the accuracy? im using the iris dataset to build a feedforward NN but the accuracy is not improving I

what can I do to increase the accuracy?
im using the iris dataset to build a feedforward NN but the accuracy is not improving I tried changing the loss function and the activation function it didi not work I need the necessary code in python to improve accuracy
image text in transcribed
* Feature Scaling \[ \begin{array}{l} \text { scaler = MinMaxScaler( ) } \\ X_{\text {_train }} \text { = scaler.fit_transform(X_train) } \\ X \text { test }=\text { scaler. } \text { transform(X_test) } \\ \end{array} \] H A Building the nodel model = tf. keras.models. Sequential() H \# Adding the input layer and the first hidden layer model. add(tf. keras. layers. Dense(units =8, activation='relu", input shape= (4,7)) ) M A Adding the second hidden layer model.add(tf.keras, layers. Dense(units=4, activation='relu')) H A Adding the output layer model. add(tf.keras. layers. Dense(units=3, activation='signoid')) H HCompiling the model model. compile(optimizer=' adam', loss= 'ku1lback_leibler_divergence', metrics=[ 'accuracy']) H H. Training the model model. fit(x_train, y_train, epochs=10, batch_size=32) Epoch 1/10 Epoch 2/10 Epoch 2/1025 6mis/step - loss: 2.3363 - accuracy: 0.6667 Epoch 3/10 Epoch 4/10 Epoch 5/10 - 10 - Es 6ms/step - loss: 2.2138 - accuracy: 0.6500 Epoch 7/10 Epoch 8/182/4.0. Epoch 9/10

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions