Skip to content

tinywin/pokemon-gen-predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Pokédex — Generation Prediction (Terminal UI)

Python Scikit-Learn Textual Kaggle Dataset Status


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.


🧠 What was done (simple explanation)

  1. A public Pokémon dataset was used
    (source: Kaggle Dataset).
  2. The data was cleaned and preprocessed (missing values, mixed types, normalization).
  3. Categorical features were converted using One-Hot Encoding.
  4. Three Machine Learning models were trained to predict Pokémon generations.
  5. Models were evaluated using a 70/30 hold-out split.
  6. All predictions and results were integrated into an interactive terminal UI built with Textual.

🔍 Problem definition

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?”


🧠 Machine Learning models

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.


📊 Dataset

The file pokemon.csv must be located in the same directory as the main script.


🖥️ Terminal UI

The interface was developed using Textual, a modern library for building rich terminal applications.

Features

  • 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

Keyboard shortcuts

  • r → Random Pokémon
  • s → Search by name
  • enter → Run search
  • q → Quit

🎨 Visual style

  • 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

📈 Model evaluation

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.


⚙️ How to run

pip install numpy pandas scikit-learn textual
python pokedex_clean.py

🗂️ Project structure

.
├── pokedex_clean.py
├── pokemon.csv
└── README.md

🧪 Technical notes

  • One-Hot Encoding for categorical variables
  • StandardScaler for neural network inputs
  • Stratified train/test split
  • Fixed random_state=42 for reproducibility
  • UI logic separated from ML logic

🚀 Motivation

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

🛠️ Possible future improvements

  • Prediction history
  • Alternative color themes
  • Animated splash screen
  • Deeper statistical comparison between models
  • Exporting prediction results

👩‍💻 Author

  • Author: Laura Barbosa Henrique
  • Contact: laura.henrique@mail.uft.edu.br

⚖️ License

Educational and experimental project. Free to use, modify, and learn from.


🧾 Short summary

“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.”

About

Terminal-based application that uses Machine Learning to predict a Pokémon’s generation, featuring a clean pastel UI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages