This project is a terminal-based application built with Python that uses Machine Learning to predict a Pokémon’s generation based on its attributes.
It runs entirely in the terminal, featuring a clean, pastel, minimalist interface implemented with Textual, combining ML, UI design, and aesthetics without relying on web technologies.
- A public Pokémon dataset was used
(source: Kaggle Dataset). - The data was cleaned and preprocessed (missing values, mixed types, normalization).
- Categorical features were converted using One-Hot Encoding.
- Three Machine Learning models were trained to predict Pokémon generations.
- Models were evaluated using a 70/30 hold-out split.
- All predictions and results were integrated into an interactive terminal UI built with Textual.
Given a Pokémon with information such as:
- primary and secondary type
- base stats
- capture rate
- height, weight, and related attributes
the system attempts to answer:
“Which generation does this Pokémon most likely belong to?”
| Model | Description |
|---|---|
| Decision Tree | Decision tree with controlled depth |
| Random Forest | Ensemble of decision trees with voting |
| MLP | Fully connected neural network (Multi-Layer Perceptron) |
Each model produces an independent prediction, allowing direct comparison between approaches.
- Source: Kaggle
- Name: Pokémon with stats
- Link: https://www.kaggle.com/datasets/rounakbanik/pokemon
The file pokemon.csv must be located in the same directory as the main script.
The interface was developed using Textual, a modern library for building rich terminal applications.
- Pastel interface (soft yellow surfaces, blue borders, very light pink background)
- Sidebar with main actions
- Pokémon search by name
- Random Pokémon prediction
- Information card with Pokémon details
- Table comparing model predictions
- Model accuracy visualization
r→ Random Pokémons→ Search by nameenter→ Run searchq→ Quit
- Very light pink background
- Soft yellow panels
- Subtle blue borders
- Clean spacing and layout
- No emojis or distracting elements
💡 Tip: for the best appearance, use a modern monospace font in your terminal:
- JetBrains Mono
- Cascadia Mono
- Fira Code
Accuracy varies depending on the data split, but the general pattern is:
- Decision Tree: stable baseline performance
- Random Forest: best overall performance
- MLP: competitive, but sensitive to feature scaling
The main goal is not maximum accuracy, but exploring the integration of Machine Learning with terminal-based UI design.
pip install numpy pandas scikit-learn textual
python pokedex_clean.py.
├── pokedex_clean.py
├── pokemon.csv
└── README.md
- One-Hot Encoding for categorical variables
- StandardScaler for neural network inputs
- Stratified train/test split
- Fixed
random_state=42for reproducibility - UI logic separated from ML logic
This project was developed as a hobby, with the goal of:
- Exploring modern terminal interfaces
- Practicing applied Machine Learning
- Experimenting with visual design outside the web
- Building something functional and aesthetically pleasing
- Prediction history
- Alternative color themes
- Animated splash screen
- Deeper statistical comparison between models
- Exporting prediction results
- Author: Laura Barbosa Henrique
- Contact:
laura.henrique@mail.uft.edu.br
Educational and experimental project. Free to use, modify, and learn from.
“I trained Machine Learning models to predict a Pokémon’s generation and presented the results in a clean, interactive terminal UI. The focus is not only accuracy, but also user experience and design.”