Member-only story
How I used Tensorflow to handle a credit card competition question
One thing that the modern world is interested in is card fraud, especially now that there are contactless cards that are so easy to clone. Therefore, when Kaggle had a community competition centering around credit card fraud, I jumped at the chance to solve the computing problem.
I recall a few years ago that I worked on a fraud problem with the DataFlair website, where the model used was sklearn’s PassiveAggressiveClassifier. I decided to try it out this time but, sadly, I did not achieve satisfactory results. I therefore had to try other models, to include random forest and extra trees models, both to no avail.
I have decided that I am going to get back into using Tensorflow because there is a lot of documentation available on the use of this library, so I decided to give it another try. I had not really used Tensorflow in around six months, and I was quite surprised to discover that the library has undergone two revisions since that time. Nevertheless, I decided to see if I could make some headway using this library.
I have used Tensorflow’s sequential model to predict on the probabilities of whether a transaction is fraudulent is this competition question. A Sequential model is appropriate for a plain stack of layers where each layer has exactly one input tensor and one output…