ML.NET: Credit Card Fraud Detection

The starting point for any ML.NET app is a class named MLContext. It begins by creating a new instance of MLContext class, and when you do so, you have the option to seed for a random number generator.
If you don't specify a seed, you'll get different results each time you train and score the model.

Loading a data set and creating a data pipeline

Preprocessing data in ML.NET is unique and different from other frameworks because it requires an explicit class of our data structure. To do so, we create a class called InputModel, and we will state all the columns of our data set.

The next step should be loading downloaded .csv data; Having defined model input and datafile path, and other constructor options.

Afterward, we will define the data process configuration with pipeline data transformations.

Training and saving the Model

Next, setting the training algorithm and evaluating the quality of the Model.

Usage of the saved model and prediction of credit card fraud are included in program.cs on Github page.

AI / .NET

Add comment

reload, if the code cannot be seen