Hello, everyone. This is my first time posting on this forum. This is my project for Recommendation System portfolio project, for the Computer Science career path. Feel free to review, comment, suggest, or criticize.
I didn’t want to just have the restaurant’s suggestion. Then I remember a game I play and it has lots of options to choose a hero from, and I came up with a Dota2 Recommendation System.
What is the Dota 2 Hero Recommendation System?
This program allows users to explore heroes based on attributes, roles, complexity, and descriptive tags. Additionally, it includes a feature to display all heroes whose names start with a specific letter.
The goal was to create a simple, interactive tool to help players make informed decisions quickly. The system uses a Python-based implementation with a clear user interface and flexible search functionality.
I created a hero database file, gathering information from the official website(HTTP://www.dota2.com), for all the 126 heroes released. Then another file with the code to run the program.
How It Works
Data Structure
The program uses a Python dictionary to store hero data, including attributes, roles, complexity, and tags. Here’s a snippet of how the hero data is structured:
heroes = {
'Anti-Mage': {
'attributes': 'agility',
'role': ['carry'],
'complexity': 'low',
'tags': ['melee', 'escape', 'nuker']
},
'Axe': {
'attributes': 'strength',
'role': ['offlaner'],
'complexity': 'moderate',
'tags': ['melee', 'durable', 'initiator']
},
# More heroes...
}
Filtering Logic
The program filters heroes based on user input. For example, selecting strength
, low complexity
, and carry
would return heroes like Axe. Here’s a simplified version of the filtering function:
def filter_heroes(attribute=None, complexity=None, role=None, tags=None):
filtered = []
for hero, data in heroes.items():
if attribute and data['attributes'] != attribute:
continue
if complexity and data['complexity'] != complexity:
continue
if role and role not in data['role']:
continue
if tags and not all(tag in data['tags'] for tag in tags):
continue
filtered.append(hero)
return filtered
Interactive Menu
The program features a menu to guide users:
Menu:
1. Search for heroes based on criteria
2. Show all heroes by the first letter
3. Exit
Visual Example
Here’s a GIF of the program in action:
Link to GitHub
Explore the full code and documentation on GitHub:
Dota 2 Hero Recommendation System
I Hope you Enjoy it and give some feedback.
Thank you