Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mathfi.ai/llms.txt

Use this file to discover all available pages before exploring further.

The problem: self-checkout fraudulent activity detection

The number of self-checkout stations is on the rise, helping avoid long lines while speeding up the paying process for individual customers. But retailers should be able to decide which purchases to check to prevent revenue loss and expose fraudsters without annoying innocent customers. MathFi.ai platform can help retailers detect the suspicious self-checkout activities seamlessly. We use a labelled training data based on anonymous real-life customer self-checkout data to train the models.

The data

In this case, we’re going to develop a binary classification model to detect which self-checkouts to check. The base dataset (SelfCheckoutFraud.csv) includes the following features:
ParameterUnits / TypeDescription
IDidentifierID of the self-checkout purchase session.
P1numeric (score)Trust level in the customer based on past purchase history, credit history, etc.
P2secondsTotal scan time in seconds.
P3secondsTotal shopping time.
P4countNumber of voids of line items.
P5countNumber of scans without registration.
P6countNumber of quantity modifications.
P7rate (items/sec)Number of scanned line items per second.
P8rate (value/sec)Purchase value per second.
P9rate (voids/position)Number of line item voids per position.
Fraudcategorical (0/1)Target variable — 0 if normal, 1 if fraudulent.

Self Checkout CSV

Dataset creation

Use the following parameters for dataset creation:
  • number of buckets: 20
Dataset creation

Training

This is the best training attempt:
  • scaling factor: 200
  • performance threshold: 0.97
Training params And the created champion model: Training best
The final performance of 0.97 was achieved after few iterations of hyperparameter tuning:
Number of BucketsScaling FactorPerformance Threshold
20190.80
20190.90
20190.95
20800.97
202000.97

Final result

When performing binary classifications or predictions, MathFi.ai platform’s underlying proprietary algorithms calculate the probability of certainty for a prediction outcome.
  • One label (e.g.1) will be selected when the probability is equal or above 0.5
  • and the other one (e.g. 0) will be selected when the probability is below 0.5
The closer the value is to 0 or 1, the more certain is the prediction. The probability is presented in a dedicated column in the prediction result file. Using this unseen unlabelled data, the resulting labelled CSV looks like this:
  • With 88% Accuracy: 27 out of 31 fraud cases were detected successfully.
Prediction 2
Build this yourself — Follow the Quickstart to run your first prediction, or go straight to API Recipes to integrate programmatically.