The Very Best Beast: Analyzing Use-Based Tier Placement Trends in Competitive Doubles Pokémon​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

Alex R.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌​‌‌​‌‌‌‌‍‌​‌‍‌‌‌‍‍‌‌​‌‌‌‍‍‌‍​‌‌‍‌‌‍‌‌​‍​‍‌‌

 | 
BASIS Independent Brooklyn ‘24

Advisor: Mr. Mark Opirhory​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‌‌‍‌​‌‌‍‌‍‍‌‌​‌‍‌​‍​‍​‍‌‌
Internship Location: Smogon University (online community)​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍‍‌‌‍‍‌‌​‌‍‌‌‌​‍‌‍‍‌​‌‍‍​‌‍‍‌‌​​‌‌‌‍​‌‍‌‍​‌‍​‌‌‌​‌‍‍‌‌‍‌‍‍​‍​‍‌‌
Onsite Mentor: Ricardo Lopes​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍‌‍‍‌​‌‍‍‌‌‌​‌‍‌‌‌‌‌‍‌‌‍‌‌‌‍‍‌‌​‌‍‌​‍​‍​‍‌‌

While the term "Pokémon trainer" typically refers to someone training their Pokémon, the trainer themself also goes through a dynamic learning process. People gain expertise through a cycle of watching and practicing. They internalize data, attempt to replicate it, then repeat the process to understand the implicit rules of success. For many years, I have played the online two-player game "Pokémon Showdown". To master the battlefield like great competitive players, I decided to create a model to break down successful patterns by offloading the "watching" part of learning to a custom-built machine learning algorithm. Called a "classifying function", this algorithm is trained on the basic building blocks of a Pokémon battle, like names and abilities, taken from top-ranked players. Encoded data is transformed by a chain of "layers", then decoded to give a result. For this specific classifier, the input parameters are the battlefield state, and the output is a list of actions to be taken by each player (with assumed optimality). The function extends and generalizes the concepts at play in oversaturated usage out to all potential Pokémon. As an on-site placement, I worked virtually with a data analyst who created a website for analyzing trends in Pokémon usage, where I helped design the graphical user interface. Under the classifier's guidance, aspiring trainers will more easily understand how to win in any circumstance. If "truly skilled trainers should try to win with their favorites" (Pokémon Crystal), I want to provide a resource to help people achieve that.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍‌‌‍‌‍‌‌‌​‍‌‌‍‌‍‍‌‌‍‌‌‌‌​‍​‍‌‌

Project Blog

Week 0: Introductory Blog Post​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​​​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

March 18, 2024

Hey everyone! My name is Alex Rosenzweig, and I've been a student at BASIS Independent Brooklyn since 4th grade. For my senior project, I'm analyzing Pokémon "doubles battle" statistics to find out what is most important when creating a strong team. BASIS's strong math curriculum let me take complex math classes, like Calculus BC and Probability & Statistics, leading math to become my favorite subject.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​​​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Pokémon and Inspiration

On the margins of my math notes I would always be doodling Pokémon. The mechanics behind Pokémon battling and the ways that Pokémon are designed are so fascinating. Reconciling the two, it was clear what to do for my senior project that would be most meaningful to me. I do not yet have an on-site placement or advisor, but I plan on finding one that can help me compile large amounts of multidimensional data and unearth trends through data mining. I will also interview successful competitive Pokémon players to see what they think makes a strong, synergizing doubles team, and use that to guide my results.

Project Projected Trajectory (Projectory?)

For my tangible deliverable, I plan to either work with Mr. Opirhory to make a guidebook that compiles my findings, which would make competitive Pokémon much more accessible, or make my own Pokémon following the trends I discover, then have people play-test them to see if they actually fit in well in the doubles battling environment. Right now, I'm just focusing on finalizing my trajectory for the project, including finding an on-site and creating a comprehensive research schedule. For more information on my senior project, you can click here. I'm excited to share my findings with you all!

'Till next time, Alex R.

Fig. 1: Author's illustration of a Pokémon battle (2021)

Fig. 2: Author's illustration of a Pokémon battle (2015)

Week 1: Type-based Usage Weights​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

April 6, 2024

Hi all! This week I spent most of my time refreshing my knowledge of how to extract data in Mathematica, the coding language I plan on doing the majority of my project in. I also was looking for an on-site advisor for the project, as I didn't yet have one and I need one to proceed with my project. Coming into school every morning for my AM AP Physics class anyways, I worked out a plan with Mr. Brauch and Mr. O for how to proceed. For the first few weeks of my project, I'll be working with a data analyst online who has previous experience working with Pokémon-based statistics. He made the website showdowngraphs.com which I used in my senior project defense presentation. I'm going to reach out to my potential previous contacts to get a placement later on at an academic institution, like MoMATH.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Move Type Effectiveness What??

Going back to my progress from this week, I've detailed the slight progress I've made towards a "move type effectiveness value" which will function as a parameter for my planned model. The sub-subsection with the code is attached below as a PDF printout. I also attempted to extract a typing chart table from smogon.com/dex/sv/pokemon but Mathematica isn't exactly optimized for website data scraping. I'm going to work with my on-site advisor to refine my skills in these regards. My next steps are to successfully import the typing chart assignment table for all potential Pokémon identified in the usage data and then create associations between the Pokémon names and their typing. This will be good practice for soon when I have to work with a lot more variable association in creating the statistical model, so that parameters are correctly attributed to a specific Pokémon.

Itinerary - WIP

I'm also going to work on a concrete itinerary for the future of this project; right now, I'm working towards the general idea of my project goal but am not quite sure how to get there yet. By completing this, I'll have a clear path for how to progress in the project and seeing what variables I have to obtain, identify, and consider.

Best, Alex R.

Fig. 1: Showdown Graphs's display of Gouging Fire's most common teammates on a given turn. This is the kind of data I hope to analyze and generalize to make comprehensive. Source: senorlopez, showdowngraphs.com

https://pdf.ac/2zoJkV (PDF printout of the week's progress in Mathematica text format)

Week 2: Type-based Usage Weights (cont'd.)​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‍​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

April 17, 2024

Hey readers! I spent this week continuing my work on compiling typing effectiveness data. However, my initial results gave me an insight into a potential issue with my project that could come up again- a minor coding oversight resulted in the wrong data being analyzed and displayed. Instead, I extracted graphs showing type occurrence in the Doubles OU format. I only noticed this because of a strange spike appearing early on in the timeline. But on the bright side, this was an opportunity for context-dependent research! Turns out- there were a lot of Dark-types being used in early 2023 because of the Treasures of Ruin Pokémon.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‍​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Fig. 1: My draft type effectiveness table.

The Treasures of Ruin

Very recently introduced, this collection of 4 Pokémon: Wo-Chien, Chien-Pao, Chi-Yu, and Ting-Lu, all part Dark-type (also the type with the most commonly used moves, so they all get Same Type Attack Bonus (STAB) on their attacks) also come with their own abilities that reduce everyone else's offenses or defenses. Those that lower others' defenses are very versatile in tandem with strong attacking Pokémon to nearly One-Hit KO targets. All of them are so strong that they easily make up for their glaring weaknesses (Chien-Pao with a 4x weakness to Fighting-type attacks and Wo-Chien with one to Bug). Pokémon like the Treasures of Ruin used to be anomalies. But recently, these "gimmick-ey" Pokémon have become more common, and more volatile in usage. I'll have to keep a close eye out for them when I start trying to identify patterns, as, being outliers, they can easily skew and confuse the data.

Fig. 2: Graphic of Wo-Chien, the first Treasure of Ruin.

Table Issues + Cleanup

I was able to correct this coding oversight fairly easily, and spend a while cleaning up and optimizing the code. This wasn't too essential as it's a one-time calculation, but it's good practice to make sure that I can write efficiently, especially given the short timeframe of this project. Simply by swapping the typing table's rows and columns, I was also able to generate another output graph signifying the defensive capabilities of a type during a snapshot. There was one other problem I came across though: type immunities throwing off the data. An example of this is that Ghost-types are immune to Normal-type attacks, no matter the target's other type. So Flutter Mane, a Ghost- and Fairy-type would be counted as the types separately, and this would make Normal-type attacks appear to be more effective overall. I had to rework the basic data I was working off of in order to accommodate this, calculating type effectiveness against each individual species and then doing a weighted sum. Again, not too difficult once I figured out how to do it.

Fig. 3: Attack type effectiveness table. Note the y-axis corresponds to the average multiplier coefficient to an attack of that type.

Fig. 4: Defense type effectiveness table. Note the y-axis corresponds to the average multiplier coefficient to an attack against a Pokémon of that type.

Note: apologies for the incoherence and tangled nature of the graphs. They are intermediate graphics, not part of the final deliverable. Lines are colored in accordance with their types; this may help those who are familiar with the types already.

What now?

Now that I have this typing data, I'm not quite sure what to do. I'm going to take some time to figure out how to proceed with this project, especially in terms of deciding what kind of final deliverable I want to present. My original goal was to make a series of fake Pokémon to exemplify usage trends, but this 1. was not a very helpful result, and 2. ignored the importance of player decision-making. So, I switched the idea to instead be a pseudo-guidebook detailing a variety of tips and tricks for how to be successful in competitive Pokémon. But if I do this, how do I choose what information to include? I'm not sure if I'll get clear results from my pattern analysis.

I'll be contemplating such questions and more for the time being. Hasta la vista!

Alex R.

Week 3: Making Generalizations​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

April 19, 2024

Howdy! This week, I switched focus from work to doing research in order to determine the best progression for my project. In short, I need some method of pattern recognition by sorting through condensed battle replay logs (aka text file play-by-plays automatically generated from a battle). In their rawest forms​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌, these logs give very specific details needed to understand every movement in battle on the surface, but it's too general to really create a good model out of. The sheer variety of Pokémon and "builds" (different customizations for them so that they can specialize in different attacks or niches) is too much fine detail. So instead, my mission right now is also to build code that can categorize the Pokémon and their actions into archetypes.

Fig. 1: Raw data for Flutter Mane's usage in the January 2024 Doubles OU (rank ≥1825) snapshot. Source: https://www.smogon.com/stats/2023-11/moveset/gen9doublesou-1825.txt

Archetypes

Another recently-introduced Pokémon currently dominating the metagame is Flutter Mane: a strong special attacker that almost always goes first thanks to its massive speed stat, and with an excellent typing (both offensively and defensively) to boot - Fairy and Ghost. Two of its most common moves are Shadow Ball and Moonblast, both strong "special attacks" (as opposed to physical). But these attributes can be abstracted to determine general trends. Say, instead, we have a strong special attacker (spatk) with high speed (spd) and a good defensive + offensive typing, and it uses special attacks with base power ≥80. With these generalized attributes, it's easy to see a stronger trend in usage for Pokémon similar to Flutter Mane - occupying the same "niche".

Fig. 2: Graphic of Flutter Mane using Moonblast and Shadow Ball, both strong special attacks with great offensive coverave and STAB (Same Type Attack Bonus).

Academic Advisory

Part one of the long term plan therefore is just to come up with some automatic way of categorizing the Pokémon and actions used in a battle replay log. This simplifies the data I'll be working with into broad groups that a user can fall into, and broad groups for their actions. But this is the easy part. How I string together these actions is still the meat of this project, and that's what I'm having trouble with. I reached out to Professor Steven Strogatz of Cornell University, the host of the Strogatz Prize which I won 1st place in last year, asking about methods for pattern analysis. Unfortunately, he was too busy to provide any direct help, but he referred me to his former student Professor Daniel Abrams at Northwestern University (my to-be alma mater!). Emailing Prof. Abrams, he agreed to meet with me when I go to visit the campus for admitted students day on April 12th. Both professors' work in network theory seem promising as potential project pathways.

Fig. 3: My first-place award-winning piece, The Face Field, from the 2023 Strogatz Prize.

Fig. 4: Graphic depicting an example network, with clusters of vertices. Source: https://www.complexityexplorer.org/explore/glossary/320-small-world-network

I'm eagerly awaiting my next steps in this project! I haven't gained much traction yet, but I'll soon be picking up steam. Até mais!

Alex R.

Week 4: Neural Networks Are Like Onions​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌​​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

May 3, 2024

Hey guys! I went to visit Northwestern this week for an admitted students day and also talk to Prof. Abrams. We didn't meet for too long, but he introduced me to a pretty interesting approach to data science that he took with Prof. Strogatz for a model. Basically, he took the idea of chemical-mixture equilibrium dynamics and applied it to language-speaking populations, specifically Quechua/Spanish speakers in Peru​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌​​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌. This specific concept isn't directly related to my project of collecting Pokémon data. But it got me thinking about ways to be more creative in my understanding of data mining.

Neural Networks

I spent some time thinking about existing models that I could extend to Pokémon battle replays. Prof. Abrams mentioned Eigenvectors as a potential avenue, but outside of quantifying discrete data (turning things like word strings into high-dimensional vectors), I couldn't figure out how they would actually be able to help without a lot of research. Something to do with quantification though, that was a huge lead.

While browsing lessons on YouTube about general Mathematica usage, I stumbled across a video by 3Blue1Brown detailing the actual process behind GPT's. In short, they employ a series of layers which accept vector inputs and transform them somehow into new vectors, then repeat for as many layers as there are until a final numerical result is reached. This numerical result is typically a softmax layer, which turns the final results into pure probabilities, which are then used to give a "most likely" final result. I did some more research into this process, and turns out, Mathematica has a plethora of built-in layering functions for this exact purpose.

Game Plan

Now that I have a concrete method to process my data, there's really only two major steps to the project. 1. Create a database of simple input-output pairs from battle replays. 2. Customize a classifier function (the entire body for the layers) to train the data on. But interestingly, the difficulties flip here -- now my major concern is splitting up the replays into the chunks. This part would likely be much easier with Python, but it's too late at this point to try to learn the language.

In a way, this process is meta-reflective of the idea of Pokémon as a whole. A novice trainer (the empty classifier function) is training itself on battle data. It analyzes battle after battle to instill a working idea of how to optimally play the game. I like thinking in this way; it humanizes the process and motivates me to carry it to a passable condition. Hopefully this will also inspire me to finally get a tangible start on the project!

Hoping for some good news next week!

Alex R.

Week 5: Taking Notes​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌‌​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

May 10, 2024

Welcome back to my blog! I spent the bulk of this week doing more research into the idea of neural networks for my project direction, and thinking about how to get to my deliverable in general. Much of this was informed by online recordings of Wolfram U courses. These are free, public videos of people teaching a certain aspect of Wolfram language usage.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌‌​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Publishing notebooks

While before I was considering finding some way to make a website where my classifying/predicting function could be hosted, this seemed a little daunting; after all, I have zero clue how to handle web design. The videos I was watching also felt a little disconnected from real life. So, I registered to participate in a bunch of upcoming Wolfram U live classes in hopes of spurring my imagination.

The first course I signed up for was in notebook design and creation -- basically the fundamentals of creating a codeable document in Mathematica. I was fairly familiar with the subject going in. By no means was I an expert, but I familiarized myself with the layout between my previous coursework and recent tinkering with the software. I expected a straightforward class that I could zone out in, knowing all the content, but I actually found myself learning a lot- especially about publication. Notebooks, basically interactive environments where the code and output are displayed, can be either uploaded or deployed to the cloud.

To my understanding, uploading a notebook allows you to visit the notebook's edifice online, and then download it to make adjustments to on your own version of Mathematica. While this would be an ideal situation, I haven't figured out how to interact with the notebooks online when they're published, and also you need a license to use Mathematica in its full- which costs a non-insignificant amount of money. With deployed notebooks, they're put out on Wolfram cloud (basically browser Mathematica), and are much more interactive. The problem with these notebooks are that they cannot access certain web-related functions, which could be an issue with the project in later stages.

My goal would be to upload a notebook (likely deployed in cloud form to be easily accessed) which people could specify the parameters of the battle's current state, which would be fed into a classifying function to output a best course of action.

Notebook interface

If I want my deliverable to be a notebook of sorts, it can't be a messy lump of code- I need to actually make the code 1. presentable and easy to understand, and 2. repeatedly interactive without getting stuck upon multiple evaluations. So, I also signed up for a class on notebook manipulation and presentation upon export. I'll report back on my progress next week! Right now, the only parts of a notebook I know how to make look nice are: manipulate, animate, and cell formatting. I've attached a notebook URL to demonstrate this.

I have a feeling that this week is going to go well!

Till death (or senior project) do us part,

Alex R.

Week 6: Smogon U to Wolfram U, Parsing Practice​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌‍​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

May 11, 2024

This week was a little bit of a doozy. I split my attention between two main things: attempts at parsing replay data and attending Wolfram U classes.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌‍​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Parsing replay data progress

String manipulation in Mathematica is definitely not as easy as I had thought when I initially conceived of the project. A string is really just a non-numeric, text-based piece of data, specified to the program by using quotation marks. "This is a string in the eyes of Mathematica and most other coding languages." When I import a replay, I get a giant messy string, basically the untranslated instructions to the display- so not exactly the most comprehensible. It's at least written in English-adjacent blocks, so not too hard to wrap your head around what it means.

Each "line" in the actual replay begins with a |, and then some word to signify what's going on in that line. For example, a text line would look like |t:|, followed by the message that would be displayed. Or, alternatively, if a Pokémon was using an attack on that line, it would look like |move|, then it would say the user (stored as p1a, p1b, p2a, or p2b in shorthand), the attack that was used, the target (again following the shorthand naming rules), and then all effects of the action (e.g. damage, stat drops).

This data is exactly what I need for the project, so now I have to split it into usable parts. Ideally, the structure that I extract would look something like this:

, where each thing in green is a value that I determine from the big lump of replay data, and a {...} means that the data inside the curly brackets follows the same structure as the previous one. The process of getting all this data for every turn seems simple on paper, but actually becomes very daunting very fast.

Parsing concerns

My major concerns at the moment are about storing data inside the parser as it goes through the lines of text, because a lot of the variables that remain constant aren't actually said out loud in the text. So, if a Pokémon switched into the p1a slot last turn and hasn't switched out, the text doesn't specify that p1a is that Pokémon -- it just says p1a. p1a is only said to be the Pokémon when its value changes. Likewise, I need to somehow store the p1a value until it's updated, and do the same for every single other potential static unannounced variable.

At the moment, this is not something I know how to do! Once I figure out this issue of holding onto data across writing down the parts of the battle that I need, I also have to arrange some string manipulator functions in a way that can get the basic values I need from a line of code. For example, such manipulators would input something like :

"|move|p2b: Hawlucha|Drain Punch|p1a: Ambipom", \
"|-supereffective|p1a: Ambipom", "|-damage|p1a: Ambipom|0 fnt", \
"|-heal|p2b: Hawlucha|100/100|[from] drain|[of] p1a: Ambipom", \
"|faint|p1a: Ambipom"

, and output something like

"action"-> {"user"->"p2a"->"Hawlucha","move"->"Drain Punch","target"->"p1a"->"Ambipom"} (I would only need the first line of code since the computer doesn't need to determine effects of an action to understand what to do)

Here are the links to my scratch notebooks from this week:

Parsing tests and potential type-viability value function.

Usage stats raw data tests.

Wolfram U Class

I'll talk more about my experiences so far with Wolfram U next week. I've signed up for a bunch of courses though with live instructors that I can ask questions to, so I'm optimistic about getting more formal experience with the coding language!

Best,

Alex R.

Week 7: Creative Computation​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

May 17, 2024

Week 7​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‌​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Welcome, one and all! This week I spent my time participating in an entire week-long coding course through Wolfram U called "Creative Computation." I think these live sessions are doing wonders for my motivation, and I really hope to push myself to get a proper, satisfying result with their help.

Creative Computation

The class I attended this week, Creative Computation, is actually a new courser that Wolfram U is testing out- so technically I was participating in the experimental phase of the class. The goal of this class was to teach interactive content creation within Mathematica using the built-in software of the notebooks. Some functions that we could use in making a notebook viewer-interactive are Manipulate[] and Dynamic[_].

Day 1

Day 1 of the class had us cover the basics of the Wolfram language, as this was supposed to be a beginner-friendly course. We learned about how to display shapes and alter the styling parameters of them, imported image manipulation like removing backgrounds and color key shifts, and using natural language input (giving an object in plain english that is then decoded into Wolfram language code/graphics automatically).

Day 2

Day 2 of the class we focused solely on string manipulation. Going back to last week's blog post, this stuff involves really just finding specific patterns in words, and then splicing the whole text to create new text results. I did learn about the "__<>`x__`<>__" functionality, which, when inserted into a string, tells Mathematica to keep that space open, then check later for anything corresponding to x__ and replace it with that inside the line before executing it as a string. This is a small detail, but something I can definitely see becoming useful in cutting down on code later down the line.

Day 3

On day 3, we spent the class talking about dataset creation and manipulation. Datasets are actually their own way of storing data, structured tables instead of just cobbled together bits of code. I didn't know the difference between the two up to this point so I had never considered even using datasets for the project. Since the thought process behind datasets is a little different especially when it comes to feeding data into a classifier function, I'm not sure if it's something I'll invest too much more time looking into, but I definitely wish I knew about this stuff at the beginning of the project.

Day 4

Today's class was the penultimate in the course, but it was basically the last one where we learned new content, finally touching on the idea of interactive notebook elements- the aspect of the course that caught my initial interest. I was familiar with the Manipulate[] function previously, where it contains a changing display according to the rules that you put in (e.g. make a graph of y=1+x/z from x=-5 to x=5) and the variable that you want to change (z in this case, probably as a slider). Here's this Manipulate[] function in action. Here's an example notebook with Manipulate[], made a little fancier. Dynamic[_] is a little different in that all cases of Dynamic[_] are, well, dynamic across the notebook, and auto-update to each other. This allows for more precise customization control with interactive content, as you're basically able to format as you like as long as you know how to work with placing graphics and elements inside a notebook.

Conclusions

After taking this week-long course, I can definitely say I learned some nuances within the Wolfram language that will make my life easier going forward. I'm still on the lookout for a way to properly learn the full scope of string parsing and data extraction. This course instead focused more on a later aspect I'm hoping to work with, being the interactivity, so I think I need to take a small step back and focus on what's most important for the project right now. Either way, it was a fun experience, and I'm glad I signed up for a multi-day class commitment like it!

Next week, I'll discuss two other classes I'm planning on taking regarding other technical code-related aspects of Mathematica. Until then!

Alex R.

Week 8: Classification and Class​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‍​​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

June 6, 2024

Greetings! I split my attention this week between work on the Classifier function and doing some more classes with Wolfram- specifically about Neural Network programming.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‍​​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Classifier Function

After some initial drafts experimenting with it, I came across some problems with its basic functionality. Basically, my idea of how to input the data (pictured below) does not work -- the "jagged array" structure is not supported for data science inputs, and is typically a non-ideal approach. So, I had to look into a function that could flatten out the Key names and make all the data into a flattened list. An analogous process is how in a file explorer, you save files under folders inside of folders etc. The directory for these files then looks something like users/username/desktop/file/document.format. These directories are the reasons you can have files with the same name in different locations. The name identifier is actually the last step in the directory identification.

I can't pull this same kind of thing with data processing. Instead, I have to compress down the nested association directories into a singular Key name. Now, instead of a Pokémon's status being stored as attacker/pokemon/status/statuscondition, the pathway is condensed down so that the statuscondition attribute is now known as attacker_pokemon_status_statuscondition. It's a small fix, but it does wonders for readability in the code and my own personal sanity.

Input scrambling

After I made the function that flattens out association directory names, I had to grapple with another issue. How do I assure that the Classifier knows what all available inputs are and knows what it can output instead of just making things up? To fix this, I need to create a series of encoding indices. These encoding indices are basically lists of all potential values that a Pokémon's aspect can be. (e.g. what species can it be, what abilities can it have, what moves can it use).

To make these indices, I had to go back to the mountain of scrambled lines of data from https://www.smogon.com/dex/sv/pokemon/ , and find a way to parse the very interweaved data values into specific names. This was frustrating, but eventually I got a rhythm down. I use StringSplit to split a long line of code into multiple smaller lines based on some pattern identified throughout. Multiple iterations of this to cut down on the amount of data I have to parse at once. I would eventually get the lists I need to turn into encoders. The only encoders I made this way are: species, moves, abilities, and types. I may think of more later, but this is all the data intrinsic to the website. (at least for right now)

Neural Network Class

The first of my classes this week was a 2.5 hour-long course on the workflow behind NN's. It taught me a few things that I can apply to this project. Firstly, there's the general idea of reward-based reinforcement learning. Reinforcement learning operates on a randomly initialized neural network (e.g. a dumb baby). Then it runs the data through it to see how close its result is to the intended result, then adjusts the parameters of the layers inside of the neural network to get closer to the intended result. This turns the dumb baby algorithm into a smart professor algorithm with enough steps. Then, the smart professor is tested on never-before-seen data, and gets tested to see if it performs well when faced with that too.

Overfitting

One issue with reinforcement learning is overfitting- training the network on the same data too many times can accustom it solely to that data specifically. This means it becomes really good at knowing how to work with that data but completely fails when it sees something new. It's kinda similar to memorizing for a test without understanding the underlying systems. One way to prevent this is with validation data on top of the test data, kind of like a third test to assure that the function can process unseen tasks. You can also use regularization, which sees when a network becomes too complicated and tells it to stop. Both of these have their pros and cons, and you can read more about them here.

Workflow

With supervised machine learning, a typical workflow looks like this:

  • Get data

  • Choose a model

  • Train the model

  • Test the model performance

  • Deploy for real-world use

I'm working right now on the data-collection part, and once I get that done it could be smooth sailing if I take the easy route and use the built-in Classifier[] function. However, I want to design my own custom NN so that I can declare explicit connections between certain data types specifically (like saying that the typing of the opponent's active Pokémon has more of an effect on what a player does than the defense stat of a Pokémon in their party).

Next time, I hope to finally nail down the data structure and extraction process.

Until then,

Alex R.

Week 9: PM (Pattern Matching or Parsing Mayhem?)​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‍‌​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

June 17, 2024

Hey guys! This week, I focused mainly on data extraction -- the part of my project I've been hyping up for all this time.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​‍‌​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Iteration

The main reason I steered so clear of this part of the project was I had zero clue how to approach it. In my head, the computer should automatically read through the data the same way I do. So then how do I explicitly define that process? Eventually, I decided to test out procedural part steps: taking each line of the data one at a time and using logic statements to see how to work with them.

This relies pretty heavily on something called a Which[] function. As the name implies, it literally sees which of the conditions it reads through are true. The first argument to evaluate True has its procedure initiated. My Which[] function looked something like this.

The structure is alternating, so it goes "argument, procedure, argument, procedure, argument, etc…" Each argument evaluates a pattern match on the line with a predefined pattern.

Pattern Matching

In order to write the patterns to match with the lines, I needed to look through a bunch of battle logs to just see what are all the potential types of lines of code that I care about in this project. All of these patterns have corresponding outputs to them, so I can use the matching and the replacement parts of patterns from the same ones. Basically, think of it like some program that looks at the sentence "I eat green apples." The program, starting from the beginning of the string/sentence, looks for a subject. (maybe said to be "I", "You", or "*Other pronoun*"), a color ("Green", "Red", or "Yellow"), and then the last word "apples".

This wouldn't match with the sentence "I drink green beverage" or "I eat orange apples." But upon seeing the sentence "I eat red apples", it would see that to match the pattern, and then perform the replacement -- in this case, maybe it simply outputs the subject and the apple color. Through some extra syntax, these outputs are assigned to different association values (think "Subject"->"_" or "Apple_color"->"_"), and then appended to a large database containing all of the other relevant information.

Output Extraction

A similar whichList is used with a Which[] function for actions, just with different things to look out for. I decided to have the outputs be in the form of p1a_actions, p1b_actions, p2a_actions, and p2b_actions. So, I have to keep track of the player-intended actions by each Pokémon on the field throughout the resulting turn. This gets a little complicated when you consider not all actions that a Pokémon takes are what the player wanted. For example, the move Encore makes the target use the same move for the next 3 turns. Say you wanted to use a certain move and right before attacking you're hit with Encore. Here, your choice would be overwritten. This isn't exactly something I can account for, so I'll have to just accept that source of error.

Another example is forced switch/dragging. This is when, as the name suggests, your Pokémon is forced to switch unexpectedly due to an enemy attack. Luckily, this is triggered by a different command type than simple switching, so I can just tell the program to ignore lines starting with "|-drag|". One final point is that your Pokémon may be knocked out before it gets a chance to make a move! In these cases, we can never know what the players were intending to do. If I don't do anything about it, then there just won't be any value for that Pokémon's action (Null).

Initialization

To remedy this, and any other potential missing data, I'll need to introduce an initialization step. Basically, instead of building from ground-up with every new line, initialization tells the program all the parameters it will need to ever look out for, and also assign default value "none" to them. It's not ideal, but this will at least make sure the network isn't fussy about missing training data. Hopefully once the neural network spits out results, I can just make sure that all "none" values it gives are removed.

Next week, I plan to finally start on the neural network's construction! See you then!

-Alex R.

Week 10: The Artificial Pokémon (Trainer)​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​​​​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

June 17, 2024

We're finally here! I've spent so long theorizing how to make this project work, but now it's so close. All the research, all the trying and failing, all the slowly building experience has led me to this week. So let's get into it!​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​​​​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Layer Selecting

The first step in the neural network construction is figuring out how I want to actually structure it. I have to use a series of Layers, basically matrix functions that transform the data successively until outputting desired results. A large amount of these layers are learnable, meaning that the way that they transform the data changes depending on how good of a job they did. This process of learning is done through gradient descent. This uses calculus to find the fastest way towards a minimum amount of "loss". Loss is a numeric measure of how far-off from a desired result the network is. The whole idea of training a network is to minimize this loss.

LinearLayer[]

Linear layers are learnable layers that perform simple mx+b operations on the data (just in matrix form instead of single-number form). This way, they can both change the numbers of the data, and change the matrix size of the data (reshaping).

FunctionLayer[]

Function layers map apply a function over its inputs. For example, a FunctionLayer[Plus] with 3 different input ports of maybe {1}, {3}, and {5.3} would output {9.3} as a result. Function layers can also be written in pure function form, basically a way of constructing custom mathematical functions without naming them. These typically require you to specify the amount of inputs a function will intake -- after all, if you were plugging in 4 and 3 into the function 2x+1, it's unclear which one to use. I used FunctionLayer[] specifically to join data on a higher dimension instead of simply catenating it (think like stacking sheets of paper to give the stack height instead of taping them together on the sides to make them wider).

ConvolutionLayer[]

Convolution layers are a more recent breakthrough in machine learning, but they're incredibly resourceful. Instead of transforming data the same way every time, like a LinearLayer[], convolution layers learn how to change it in a way where every aspect of the input affects the input as a whole. Everything is interconnected, and allows for much more complexity in the program's understanding of patterns on higher levels. I used convolution layers for the bulk of the data processing. I felt they captured the intricacy of the factors a player takes in when making decisions.

RandomArrayLayer[]

Random arrays are simply just matrices of random numbers that I hooked up to some ports in the network to give it a little kick. Adding randomness has been proven to greatly improve network productivity. On top of that idea of stimulating the program, I also wanted to use this to emulate how Pokémon battles have randomness intrinsic to them. Randomized damage multipliers are threaded over every attack, sometimes moves can miss, sometimes a move will be a critical hit, sometimes secondary effects will proc, etc.

SoftmaxLayer[]

Softmax layers are the final piece of a neural network, as they simply turn the resulting matrices of numbers into probability values for a decoder to then translate out into a class. It's just a simple operation of totaling the matrix and dividing each element by the sum.

NetGraph

In order to link all these layers together, I need to manually hook up the ports together during NetGraph construction. Every layer has to have a specified port, be it input or output, or else the program won't know how to arrange it. Not only do I have to link all the layers together in a cohesive path, but I also have to link the association inputs/outputs into their respective encoders/decoders and then link those into the starting/ending layers. After doing all that, the NetGraph is done!

Next week, I'll finally mesh together the network and the training data to complete my project. I'm so excited!

-Alex R.

Week 11: A Trainer Never Quits​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​​‌​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

June 17, 2024

Welcome back to the last content-driven week of my Senior project! I took the final steps of training the network I constructed in week 10 with the data I collected using the functions I explained in week 9.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​​‌​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

NetTrain

Remember how I said that training a network relies on the idea of minimizing loss? Well, loss is outputted by attaching an aptly named LossLayer[] to the end of a function. Luckily, NetTrain[] does this for us automatically. All I have to do is sit back, relax, watch some Pokémon battles to find ones I think will be good to train on, then process them and feed them into the network. I had to iron out some kinks in the data extraction process, but everything went surprisingly smoothly! I'll publish it next week, but I finally have a working prototype.

It feels so weird to be done- looking back, I realize how easy this project would be with what I know now. But I think that's the point. This Pokémon classifier function isn't going to change the world. At best, it'll make competitive Pokémon more accessible to a wider audience. Rather, I really valued learning firsthand the workflow in a larger research project like this. Making mistakes and learning is, in my opinion, the real treasure of the senior project.

Next week, I'll do a larger retrospective piece on the project. I'm also going to present a child-friendly version at the BASIS Independent Brooklyn Lower School to get the young'uns hyped for high school! Until then, I recommend checking out replay.pokemonshowdown.com and watching some battles to see with your own eyes how battles work, and maybe even trying out your own battles on play.pokemonshowdown.com. Smell ya later!

-Alex R.

Week 12: The Very Best Beast​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​​‍​‍‍‌‍‌‍‌‌‌‌‍​‌‍​‌‌‌‌​‌‍‍‌‌‌​‌‍​‌‍‌‌​‍​‍‌‌

June 18, 2024

And with that, my senior project has ended! My presentations went really great, and my final deliverable turned out fairly good all things considered.​​​​‌‍​‍​‍‌‍‌​‍‌‍‍‌‌‍‌‌‍‍‌‌‍‍​‍​‍​‍‍​‍​‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍​‍​‍​​‍​‍‌‍‍​‌​‍‌‍‌‌‌‍‌‍​‍​‍​‍‍​‍​‍‌‍‍​‌‌​‌‌​‌​​‌​​‍‍​‍​‍‌‍​‍‌‍​‌‌​‌‍‍‌‌​​‍‍‌‍​‌‌‍‌​‌‍‌‌‍‍‌‌‍‍​‍‍‌‍‌​‌‍​‌‌‌​‌‍‌‍​‌‍‌‌​​‍‍‌‍​‌‍‌‍‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​‌‍‌​‍​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌‌‌‌​‌‍‌‌​​‌‍‌‌‌​​‍‌‌‍​​‍‌‌​‌‌‌‌‌‌‌‌​‌‌‌​​‌​‍‌‌​‌‌​‌​‍‌​‌​‌‌‍‍‌​‌​​‌‌‌‌‌​‌‌‍‍‍‌‍‌‌‌‌‌‌‌​‌‌​‌​‍‌‍‍‌‌‌​‌‍‌‌‌‍‌‌​​‍‌‍‌‌‌‍‌​‌​‌‌‍‌​‌‍​‍‌‌‌​‌‍‌​‌‍‍‍‌‌​‍​​‌​‍‌​‌​‌‌‌​‌‌‌‌‌​‌​‌​‌​‌​​‌‌​​‌​​‌‌​​‌‍‌‌‌‌​‌​‍‌‍‌‌‌‍‌​‌‍‍‌‌‌​​‍​‌‍‌‍‌‍‍‌‌‍‌‌‌‍​‌‍‌​‌‌​​‌‍​‌‌‌​‌‍‍​​‌‌‍​‍‌‍​‌‍‌‍‌‌‌‌​​‌‍‌​‌‌​‌​​‍‍​​‌​​‍​‍‍‌‍​‌‌​‍‌‌​‌‍‍‌‌‍​‌‍​‌‍‌‌​‍​‍‌‌

Presentation

Lower School

On Tuesday, Samantha G., Alexa L., and I journeyed to BASIS Independent Brooklyn Lower School to give the 1st and 2nd graders presentations on our senior projects. Each of the 4 times that I gave my 7-minute spiel on Pokémon to those kids, I could hear their bumbling excitement as I got ready to present and they saw the giant text saying "Pokémon" on the first slide. I really enjoyed getting to share the project with them, they were all so fun and it really eased my nerves going into the ~actual~ presentation.

I went through the idea of Pokémon, neural networks, training neural networks, and my intentions behind the project with them. After I was done, it was really hard to get the idea of presenting to kids out of my head. Having fun as a presenter with a presentation and making sure the audience is also engaged and having fun is just super enjoyable, and I was scared that my real one wouldn't have that same magic.

Upper School

Come Friday, and I was psyched out of my mind to present. I really loved how the presentation came out with all the 3D models and transitions, as well as the topic itself. While I downed a bottle of water in the minutes leading up to it, actually speaking went surprisingly naturally. I barely looked at the slides -- the information just kinda flowed out. Hopefully I also knew how to pace myself in presenting, though I'll have to wait for the recording to see that for myself. I hope that I communicated the concepts well enough to be understood by people without an extensive math/CS background.

Retrospective

I loved getting the chance to do this project. I learned so much about coding basics, machine learning (which I think will be a fairly important skillset in the coming years), data scraping/parsing, and most importantly, Pokémon. Going forward I want to refine the program, as so much of it has become redundant over the creation process. I also want to train it more and define more specific rules for outputs, so it can for example know explicitly not to pair the outputs "Switch" and "Attack" together. Or, maybe I can even find out how to limit the outputs to only be ones possible from a Pokémon by looking at its movepool.

One piece of feedback from my presentation that I got was potential overcomplexity in the network that could cause overfitting. I aim to look more into more detailed neural network structuring paradigms. Finally, I want to try extending the network to work on a more large-scale gameplan rather than turn-by-turn, though I would like to have more active mentorship if I were to pursue this avenue. There are so many ways I could take the framework this project helped me lay down.

Thank-you's

I'd like to use this last bit to thank some people who helped me in this project.

Ricardo Lopes for being my senior project advisor and helping me directly connect Pokémon and data science, as well as being a good general resource.

Mark Opirhory for keeping my project in line and keeping an eye on me throughout as I came in practically every day to discuss with him.

Yuna Stechert for lending an ear to my woes and taking me to Cold Spring Harbor Laboratory for a workplace one day.

Anbo Chen for giving me some guidance with Java, Python, and Mathematica in terms of coding languages and workflows.

Diego Griffin for battletesting with me online to help me figure out portions of the code through trial and error, and stopping me from getting stuck.

Jo Goldfarb for helping me in the initial stages of the project in trying to find an advisor, as well as orchestrating the talk with the lower school at the end.

Jacob Helzner for guiding me through the senior project process from the student perspective, and helping plan out the project trajectory.

My parents for giving me free space and letting me do the project in peace.

All my other friends (not listed) for emotional support throughout.

Gabriella Baessa for help with the yearbook concurrent to the senior project work.

And of course,

Valued readers for keeping up with this roller coaster of a project throughout.

Thank you so, so much! I hope to do more great things in the future!

All the best,

Alex R.