├── sorting_hat_ESP32/ │ ├── sorting_hat_esp_button.ino # Arduino sketch │ └── sorting_hat_model.h # Exported ML model ├── src/ │ ├── sorting_hat_laptop.py # Python model training │ └── Sorting_Dataset.csv # 10-question dataset ├── assets/ │ └── sorting_hat_button.png # Wiring diagram (if applicable) ├── requirements.txt # Python dependencies └── README.md # This file
Not all 10 questions are equally important. After analyzing the data and running the model with various subsets, we found that removing low-impact questions such as Q6 (mystery book behavior) and Q7 (preferred pet) had little effect on accuracy. To streamline user experience, we could reduce the number of questions to 6–7 while maintaining similar performance by keeping only the most informative ones.
We could:
Collect more diverse and balanced data across all houses
Use a more expressive model (e.g., RandomForestClassifier or XGBoost) before converting to embedded C++
Apply feature selection techniques to reduce redundancy
Optimize the decision tree depth and prune it to reduce overfitting
Some ideas to enhance the UX:
A microphone with simple voice recognition to answer questions verbally
A gesture sensor (like APDS-9960) to allow contactless input
RGB LEDs to display the house colors
A speaker module to play house themes when sorted
Touch screen instead of physical buttons for future versions
Decision trees are suitable for symbolic and categorical data, like button presses. However, with new sensors like microphones or gesture inputs that generate continuous or time-series data, decision trees may not be sufficient. For such inputs:
A small neural network (e.g., 1D CNN or TFLite Micro model) would be more appropriate
Alternatively, KNN or Naive Bayes could handle simple gestures if data is well-structured
Thus, decision trees are great for current use but limited if we expand to more dynamic sensor inputs.