This API is a simple Rails application designed to detect fraud in a series of transactions.
- Ruby: 3.3
- Rails: 7.2
- Postgres
To start the application using Docker and set up the initial database, execute the following commands:
- Build the Docker images:
docker compose build
- Start the application:
docker compose up
- Create the initial database:
docker exec fraud rails db:create
To run tests using Docker, follow these steps:
- Bash into the container:
docker exec -it fraud bash
- Run the tests with RSpec:
rspec
There is a dedicated test designed to evaluate the success rate of the fraud detection algorithm. You can run it with:
rspec spec/requests/multiple_transactions.rb
This test populates the database with data from the CSV file, selects samples from the database, and checks whether the model accurately predicts the has_cbk value in more than 90% of the cases.
The reports of data analysis on the data sample can be found in the analysis_journals
folder.
The conclusions from these reports served as a basis for the development of the detection algorithm.