I have a dataset of size (140,000, 10) containing 1 dependent variable. I used MinMax scaler on independent variables. For the target value, there is a class imbalance of 94% 0's and 6% 1's. Used RandomOverSampler for oversampling.
When I run a neural network model on my dataset, it gives me the following plot:
With a testing accuracy of 96.34%
This is my neural network:
model = models.Sequential()
model.add(layers.Dense(5, kernel_regularizer=regularizers.l2(0.001),
activation='relu', input_shape=(10,)))
model.add(layers.Dense(5, kernel_regularizer=regularizers.l1(0.001),
activation='relu'))
model.add(layers.Dense(10, kernel_regularizer=regularizers.l2(0.001),
activation='relu'))
model.add(layers.Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy',
optimizer='adam', metrics = ['accuracy'])
history = model.fit(X_over, y_over, epochs=25, batch_size=100, validation_split=0.2, shuffle=True, verbose=1)
I have added regularizers to input and hidden layers to prevent overfitting.
On using a Random Forest Classifier and SVM, I get 100% accuracies for training as well as testing. Is something wrong with my data? How do I solve this?