# Detect if my ANN model is overfitted

I've been trying the kaggle dataset of Credit card fraud detection Dataset . I've used ANN using keras and tensorflow. You can find the code in the screenshot. The only problem is im getting accuracy to be around 99.9 % , so i think it's surely a case of some false hopes or over fitting. Can you please tell whats wrong with it? And even my test set gave a result of 99.93% accuracy.

• Hi, welcome to Data Science StackExchange! Please avoid posting code as image: it is not easily read, cannot be copy-pasted, and generates unnecessary hosting. – Romain Reboulleau Nov 19 '19 at 5:43
• Please provide train and test loss graphs, there we can check for problems, and accuracy 99.9 %, is it train accuracy or validation accuracy? – Elbek Nov 19 '19 at 6:25
• hey , sorry i didnt knwo about that. @Elbek the training set as well as test set accuracy is 99.9 % .And is it possible to show graphs even for independent 30 independent variables? – Gaurav Roy Nov 19 '19 at 6:35
• @GauravRoy just show graph of loss – Elbek Nov 19 '19 at 8:19
• any link how to do that? – Gaurav Roy Nov 19 '19 at 8:43

• Your model overfits to over-represented class. You can just output not-fraud all the time and you'll get 83% accuracy. Accuracy is counted globally and doesn't account for imbalance. Check this kernel and this one. Before you jump into DNN you should first explore more classical models like random forest or xgboost, they're much faster to fit. This data set is rather tough and you won't get away with just simple rescaler. – Piotr Rarus - Reinstate Monica Nov 19 '19 at 8:57
• Ups, got my math wrong. Constant not-fraud model would give you 99.3% accuracy. – Piotr Rarus - Reinstate Monica Nov 19 '19 at 9:10