A graphical Python application inspired by the Harry Potter Sorting Hat. Enter your traits, and the Choixpeau will assign you to your Hogwarts house using the Manhattan distance algorithm and a dataset of fictional students. In this project, I learnt a way on how decisions can be taken by an AI
Jean1000levrai GitHub: https://github.com/Jean1000levrai
The app reads a dataset of students from choixpeauMagique.csv, each labeled with a Hogwarts house and traits:
- Courage
- Loyalty
- Wisdom
- Cunning
When you enter your own traits, the algorithm compares them to the dataset using Manhattan distance and assigns you the house that is most common among your 7 nearest neighbors.
src/main.pysrc/gui.pysrc/function.pysrc/open_img_tk.pychoixpeauMagique.csvimg/
- 🪄 GUI interface with animations using
tkinter - 📊 Data-driven sorting using k-Nearest Neighbors (k-NN, k=7)
- 🎓 Hogwarts-style house assignment
- 🖼️ Visual assets support (Sorting Hat images & speech bubble)
- Python 3.7+
- Required packages listed in
requirements.txt(you must create this file with needed libraries, e.g.,Pillow)
- Clone the repository:
git clone https://github.com/Jean1000levrai/choixpeau.git cd choixpeau/ - Install dependencies:
cd src/ pip install -r requirements.txt cd ..
- Run the application:
python src/main.py
This project is licensed under the MIT license