This repository contains the source code and data for a machine learning project aimed at matching gamers based on their information. The project includes data preprocessing, model training, and an API for retrieving matching users.
The project's folder structure is organized as follows:
- Matching
- dataset
gamers-info.csv
- models
matching-model.ipynb
test.ipynb
- Api
- pickle
games-encoded.pkl
matching.pkl
users.pkl
main.py
test.py
.gitignore
Dockerfile
requirements.txt
-
Matching: This directory contains the code and data related to the matching algorithm.
- dataset: This directory contains the dataset used for training the model. The file
gamers-info.csv
contains mock data about gamers' information. - models: This directory contains Jupyter Notebook files (
matching-model.ipynb
andtest.ipynb
) used for data preprocessing and model training.
- dataset: This directory contains the dataset used for training the model. The file
-
Api: This directory contains the code and files related to the API implementation.
- pickle: This directory contains the pickle files used by the API.
games-encoded.pkl
: A pickle file containing encoded information about games.matching.pkl
: A pickle file containing the trained matching model.users.pkl
: A pickle file containing user data.
main.py
: The main file for the API implementation.test.py
: A file containing test cases for the API.
- pickle: This directory contains the pickle files used by the API.
-
.gitignore
: This file specifies which files and directories should be ignored by Git version control. -
Dockerfile
: A Dockerfile that specifies the Docker image configuration for the project. -
requirements.txt
: A file listing the Python dependencies required to run the project.
To run the project and utilize the API, follow the instructions below:
-
Clone this repository to your local machine:
git clone <repository-url>
-
Install the required Python dependencies:
pip install -r requirements.txt
-
Preprocess the data and train the matching model by executing the matching-model.ipynb and test.ipynb notebooks located in the Matching/models directory.
-
Generate the necessary pickle files (games-encoded.pkl, matching.pkl, and users.pkl) by running the code in the matching-model.ipynb notebook.
-
Start the API server by running the main.py file in the Api directory. Do not forget the give your own password.
uvicorn main:app --reload
-
The API will be accessible at http://localhost:8000 by default. You can test the API by using the provided endpoints. Refer to the documentation or the code in main.py for details on available endpoints and their usage.
This project includes a Dockerfile, allowing you to containerize the application. To use Docker, follow these steps:
-
Build the Docker image using the provided Dockerfile:
docker build -t gamer-matching .
-
Run a container using the built image:
docker run -d -p 8000:8000 gamer-matching
The API will be accessible at http://localhost:8000 within the Docker container, and you can access it through the same URL on your host machine.
This project is licensed under the MIT License.
Contributions to this project are welcome. If you find any.