Hi,
I am trying to create a model for a classification task .
I have 24k rows data regarding patent . Out of which only 7k is ranked as High and 18k data is ranked as low .
On test set below are the observations:
-
234/234 [==============================] - 0s 1ms/step - loss: 0.0736 - accuracy: 0.9264
Model loss on the test set: 0.07359422743320465
Model accuracy on the test set: 92.64057874679565 -
Confusion_matrix: tf.Tensor(
[[6936 0]
[ 551 0]], shape=(2, 2), dtype=int32)
Can someone expert please help to let me know what can I do to minimize false negative?
Below is the snippet of the code
normalize = layers.Normalization()
normalize.adapt(x)
x_train, y_train = x[:16800], y[:16800]
x_test, y_test = x[16800:], y[16800:]
x_train.shape, x_test.shape
tf.random.set_seed(42)
model_1 = tf.keras.Sequential([
tf.keras.layers.Dense(200, activation = ‘relu’),
tf.keras.layers.Dense(50, activation = ‘relu’),
#tf.keras.layers.Dense(50, activation = ‘relu’),
tf.keras.layers.Dense(1, activation = ‘sigmoid’)
])
model_1.compile( loss= tf.keras.losses.MeanSquaredError(),
optimizer = tf.keras.optimizers.Adam(lr = 0.01),
metrics = [‘accuracy’])
model_1.fit(x_train, y_train, epochs = 100, verbose = 0)