Which Pokémon Should You Eat for Dinner: A Machine Learning Approach
Versão em português aqui.
In this project, we’ll find out if the most common Machine Learning processes and techniques are enough to determine out of the 898 Pokémon up to the 8th generation of the games are edible.
In the world of Pokémon, there are plenty of creatures and certainly not all of them are captured and trained for battle. Some of these remain wild, become firefighters, or even father figures for 10-year-old protagonists. But is that the full extent of its use in the Pokémon universe?
Pokémon are essentially made of meat or plants, if not made of stone, metal, mud, or garbage. Separating the sheep from the goats, we can assume that as there are only pokemons and humans, and not all humans in this world are vegan, so pokemon made of meat are used as livestock and those made of plants as crops, in one way or another. Since in this universe there is a need to turn pokemons into food, we can classify them as edible or inedible.
Before we determine which pokémon are under the dinner table waiting for food and which are on the table with an apple in their mouth, can we please avoid talking about the ethics of eating pokémons? If you take an egg out of a Chansey’s bag and fry it while she watches, what’s the point of that? This project certainly doesn’t want to come close to addressing that, even though the flavor of these eggs is discussed extensively in various Pokédex entries. At most, we will address whether humans in the Pokémon world find it regionally accepted to eat certain pokémon, as in the case of Farfetch’d, which in Galar are not appreciated as delicacies, unlike the rest of the world that loves a Farfetch’d breast prepared with the leek he carries.
To do a Deep Learning analysis, we want a vector with relevant data from various parts of the main Pokémon franchise games, such as the pokédex and lines in the anime and manga of the series.
Speaking of Pokédex, using its entries, we can analyze whether some pokémon serve as food for humans and other pokémon. For an investigation of these entries, we’ll do a data scrape from Bulbapedia, a powerful wiki about the pocket monsters. Details of this scraping are here.
After the proper treatment of this data, visible here, we will do a sentiment analysis using Natural Language Processing (NLP), where the sentiment in question does not go so far as to say whether a fin can be consumed to the point where the pokémon is a victim of overfishing. (Sharpedo entries in Pokémon Moon), but it’s good enough to say if the pokémon is fit for consumption.
In order for a substance to be edible, in short, several factors are taken into account. As a first point, said substance cannot be toxic or harmful. On the other hand, it must satisfy nutritional needs (providing energy to the body), social (being part of the culture) and psychological needs (its consumption provides gratification), since certain substances can be nutritious, but negative on a social or psychological level. There we have our first four coordinates of the vector.
Through NLP, we will extract the keywords from each set of pokémon entries, give a score for each of these words using the Frequency of the Term-Inverse of Frequency in Documents method, the TF-IDF.
After making word clouds for each pokémon, we will make a manual list of terms relevant to each factor (toxicity, nutritiveness, culture and psychology), we take note what TF-IDF generates and we add it, thus forming the four Edibility Indexes, which determine how much the Pokédex talks about edibility factors. Details of this processing are here.
But that alone is not enough to determine which Pokemon will leave your PC and go to the frying pan. We need more coordinates for the vector. And a clue to this information comes from Chansey herself laying eggs so delicious they are ravenously devoured, even by people who have lost their appetite (Pokemon Emerald). Pokémon are oviparous, without exception. And they’re classified into 15 well-defined groups, which give direction on the appearance and biology of each pokémon in each group. With this classification, we have two more variables for our vector, as pokémons have one or two egg groups.
We’re also going to include technical game data. The friendship base, a variable that determines how friendly the pokémon is to their trainer, the HP base, which correlates with how much protein the pokémon have and its weight, an indication that the pokémon can produce a lot or little food, and last but not least, Pokemon types.
Thus, our vector will have 11 coordinates and will be formed as follows:
(Toxicity Index, Nutritiveness Index, Culture Index, Psychology Index, Egg Group 1, Egg Group 2, Friendship Base, HP Base, Weight, Type 1, Type 2)
Now we have everything for the machine to do its magic! We will use the Keras API from the Tensorflow platform.
In order for the machine to learn, it needs to know some Pokémon that we already know are edible or not. The articles “Pokémon food” and “15 Confirmed Pokemon That Humans Eat” provide valuable information on this quest. The list of edibles comes directly from these articles, plus pre and post evolutions. To assemble the list of inedible pokémons, I chose obviously inorganic pokémons, such as rocks and ghosts, super intelligent pokémons and pokémons confirmed by the articles above as inedible.
So we have the following lists:
Edibles:
Shuckle, Krabby, Kingler, Arrokuda, Barraskewda, Gabite, Garchomp, Appletun, Flapple, Slowpoke, Chansey, Blissey, Farfetch’d, Cherubi, Cherrim, Carvanha, Sharpedo, Crabrawler , Crabominable, Mareep, Flaaffy, Ampharos, Clauncher, Crawdaunt, Basculin, Seadra, Miltank, Grotle , Tauros, Snover, Tropius, Paras, Parasect, Skiddo, Combee, Vespiquen, Octillery, Ribombee, Goldeen , Seaking.
Inedibles:
Porygon, Porygon2, Porygon-Z, Abra, Kadabra, Alakazam, Geodude, Graveler, Golem, Grimer, Muk, Gastly, Haunter, Gengar, Mr. Mime, Mime Jr., Mr. Rime, Ditto, Houndour, Houndoom, Suicune, Arceus, Trubbish, Garbodor, Slugma, Magcargo, Rotom, Toxel, Toxtricity, Magikarp, Gyarados, Meowth, Persian, Perrserker, Slowking.
Conclusions
With the 75 Pokemon on this list in hand, we can train and test our model, which is all detailed here.
Defining the edibility of only 8.3% of pokémons up to the eighth generation, we were able to predict well which ones are juicy and without poison to make a feast, with the accuracy of our model reaching 70%.
And so voila! With you the 898 pokémon separated by edibility, using deep learning.
Edibles:
Bulbasaur, Ivysaur, Venusaur, Charmander, Charmeleon, Charizard, Squirtle, Wartortle, Blastoise, Caterpie, Metapod, Butterfree, Weedle, Kakuna, Beedrill, Pidgey, Pidgeotto, Pidgeot, Rattata, Raticate, Spearow, Fearow, Ekans, Arbok, Pikachu, Raichu, Sandshrew, Nidoran♀, Nidorina, Nidoqueen, Nidoran♂, Nidorino, Nidoking, Clefairy, Clefable, Vulpix, Ninetales, Jigglypuff, Wigglytuff, Zubat, Golbat, Oddish, Gloom, Vileplume, Paras, Parasect, Venonat, Venomoth, Psyduck, Golduck, Growlithe, Arcanine, Poliwag, Poliwhirl, Poliwrath, Machoke, Machamp, Bellsprout, Weepinbell, Victreebel, Tentacruel, Ponyta, Rapidash, Slowpoke, Slowbro, Magnemite, Farfetch’d, Doduo, Dodrio, Seel, Dewgong, Shellder, Hypno, Krabby, Kingler, Electrode, Exeggcute, Exeggutor, Cubone, Marowak, Lickitung, Koffing, Rhyhorn, Rhydon, Chansey, Tangela, Kangaskhan, Horsea, Seadra, Goldeen, Seaking, Starmie, Scyther, Magmar, Pinsir, Tauros, Lapras, Eevee, Vaporeon, Jolteon, Flareon, Omastar, Aerodactyl, Zapdos, Moltres, Mew, Chikorita, Bayleef, Meganium, Cyndaquil, Quilava, Typhlosion, Totodile, Croconaw, Feraligatr, Sentret, Furret, Hoothoot, Noctowl, Ledyba, Ledian, Spinarak, Ariados, Crobat, Chinchou, Lanturn, Igglybuff, Togetic, Natu, Xatu, Mareep, Flaaffy, Ampharos, Bellossom, Marill, Azumarill, Politoed, Hoppip, Skiploom, Jumpluff, Aipom, Sunkern, Sunflora, Yanma, Wooper, Quagsire, Wobbuffet, Girafarig, Pineco, Forretress, Dunsparce, Gligar, Snubbull, Granbull, Qwilfish, Scizor, Shuckle, Heracross, Teddiursa, Ursaring, Corsola, Remoraid, Octillery, Delibird, Kingdra, Donphan, Stantler, Smeargle, Magby, Miltank, Blissey, Entei, Larvitar, Celebi, Treecko, Grovyle, Sceptile, Torchic, Combusken, Blaziken, Mudkip, Marshtomp, Swampert, Zigzagoon, Linoone, Wurmple, Silcoon, Beautifly, Cascoon, Dustox, Lotad, Lombre, Ludicolo, Seedot, Nuzleaf, Shiftry, Taillow, Swellow, Wingull, Pelipper, Surskit, Masquerain, Shroomish, Breloom, Slakoth, Vigoroth, Slaking, Nincada, Ninjask, Whismur, Loudred, Exploud, Makuhita, Hariyama, Azurill, Skitty, Delcatty, Electrike, Plusle, Minun, Volbeat, Illumise, Roselia, Gulpin, Swalot, Carvanha, Sharpedo, Wailmer, Numel, Torkoal, Grumpig, Spinda, Trapinch, Vibrava, Flygon, Cacnea, Cacturne, Swablu, Altaria, Zangoose, Seviper, Lunatone, Solrock, Barboach, Whiscash, Corphish, Crawdaunt, Claydol, Milotic, Castform, Kecleon, Tropius, Snorunt, Sealeo, Walrein, Huntail, Gorebyss, Relicanth, Luvdisc, Shelgon, Salamence, Latias, Jirachi, Turtwig, Grotle, Chimchar, Monferno, Infernape, Piplup, Prinplup, Empoleon, Starly, Staravia, Staraptor, Bidoof, Bibarel, Kricketot, Kricketune, Shinx, Luxio, Luxray, Budew, Roserade, Rampardos, Burmy, Wormadam, Mothim, Combee, Vespiquen, Pachirisu, Buizel, Floatzel, Cherubi, Cherrim, Shellos, Gastrodon, Ambipom, Drifloon, Drifblim, Buneary, Lopunny, Glameow, Purugly, Stunky, Skuntank, Happiny, Chatot, Gabite, Garchomp, Munchlax, Lucario, Hippopotas, Skorupi, Drapion, Croagunk, Toxicroak, Carnivine, Finneon, Lumineon, Mantyke, Snover, Abomasnow, Lickilicky, Tangrowth, Electivire, Magmortar, Togekiss, Yanmega, Leafeon, Gliscor, Gallade, Froslass, Uxie, Mesprit, Azelf, Cresselia, Phione, Manaphy, Shaymin, Victini, Snivy, Servine, Serperior, Tepig, Pignite, Emboar, Oshawott, Dewott, Samurott, Patrat, Watchog, Lillipup, Herdier, Stoutland, Pansage, Simisage, Pansear, Simisear, Panpour, Simipour, Pidove, Tranquill, Unfezant, Blitzle, Zebstrika, Boldore, Woobat, Swoobat, Drilbur, Excadrill, Audino, Timburr, Conkeldurr, Tympole, Palpitoad, Seismitoad, Sewaddle, Swadloon, Leavanny, Venipede, Whirlipede, Cottonee, Whimsicott, Petilil, Lilligant, Basculin, Sandile, Krokorok, Krookodile, Darumaka, Darmanitan, Maractus, Dwebble, Sigilyph, Tirtouga, Carracosta, Archen, Archeops, Minccino, Cinccino, Ducklett, Swanna, Deerling, Sawsbuck, Emolga, Karrablast, Escavalier, Foongus, Amoonguss, Frillish, Jellicent, Alomomola, Joltik, Galvantula, Ferroseed, Ferrothorn, Eelektross, Haxorus, Shelmet, Accelgor, Stunfisk, Mienfoo, Mienshao, Druddigon, Golett, Bouffalant, Rufflet, Braviary, Heatmor, Durant, Hydreigon, Larvesta, Volcarona, Thundurus, Landorus, Keldeo, Meloetta, Genesect, Chespin, Quilladin, Chesnaught, Fennekin, Braixen, Delphox, Froakie, Frogadier, Greninja, Bunnelby, Diggersby, Fletchling, Fletchinder, Talonflame, Scatterbug, Spewpa, Vivillon, Litleo, Pyroar, Flabébé, Floette, Florges, Skiddo, Gogoat, Pancham, Pangoro, Furfrou, Espurr, Meowstic, Spritzee, Aromatisse, Swirlix, Slurpuff, Inkay, Malamar, Barbaracle, Skrelp, Dragalge, Clauncher, Clawitzer, Helioptile, Heliolisk, Tyrunt, Amaura, Aurorus, Sylveon, Hawlucha, Dedenne, Carbink, Goodra, Noivern, Hoopa, Volcanion, Rowlet, Dartrix, Decidueye, Litten, Torracat, Incineroar, Popplio, Brionne, Primarina, Pikipek, Trumbeak, Toucannon, Yungoos, Gumshoos, Grubbin, Charjabug, Vikavolt, Crabrawler, Crabominable, Oricorio, Cutiefly, Ribombee, Wishiwashi, Mareanie, Toxapex, Mudbray, Dewpider, Araquanid, Fomantis, Lurantis, Morelull, Shiinotic, Salandit, Salazzle, Stufful, Bewear, Bounsweet, Steenee, Tsareena, Comfey, Oranguru, Passimian, Wimpod, Golisopod, Pyukumuku, Silvally, Komala, Togedemaru, Bruxish, Kommo-o, Tapu Koko, Tapu Bulu, Tapu Fini, Lunala, Pheromosa, Kartana, Blacephalon, Grookey, Thwackey, Rillaboom, Scorbunny, Raboot, Cinderace, Sobble, Drizzile, Inteleon, Skwovet, Greedent, Blipbug, Dottler, Orbeetle, Gossifleur, Eldegoss, Wooloo, Dubwool, Chewtle, Drednaw, Yamper, Carkol, Applin, Flapple, Appletun, Silicobra, Sandaconda, Arrokuda, Barraskewda, Sizzlipede, Centiskorch, Clobbopus, Grapploct, Polteageist, Morgrem, Grimmsnarl, Cursola, Sirfetch’d, Runerigus, Milcery, Alcremie, Falinks, Pincurchin, Eiscue, Indeedee, Morpeko, Cufant, Dracozolt, Arctozolt, Arctovish, Duraludon, Urshifu, Regieleki, Regidrago, Calyrex.
Inedibles:
Sandslash, Diglett, Dugtrio, Meowth, Persian, Mankey, Primeape, Abra, Kadabra, Alakazam, Machop, Tentacool, Geodude, Graveler, Golem, Magneton, Grimer, Muk, Cloyster, Gastly, Haunter, Gengar, Onix, Drowzee, Voltorb, Hitmonlee, Hitmonchan, Weezing, Staryu, Mr. Mime, Jynx, Electabuzz, Magikarp, Gyarados, Ditto, Porygon, Omanyte, Kabuto, Kabutops, Snorlax, Articuno, Dratini, Dragonair, Dragonite, Mewtwo, Pichu, Cleffa, Togepi, Sudowoodo, Espeon, Umbreon, Murkrow, Slowking, Misdreavus, Unown, Steelix, Sneasel, Slugma, Magcargo, Swinub, Piloswine, Mantine, Skarmory, Houndour, Houndoom, Phanpy, Porygon2, Tyrogue, Hitmontop, Smoochum, Elekid, Raikou, Suicune, Pupitar, Tyranitar, Lugia, Ho-Oh, Poochyena, Mightyena, Ralts, Kirlia, Gardevoir, Shedinja, Nosepass, Sableye, Mawile, Aron, Lairon, Aggron, Meditite, Medicham, Manectric, Wailord, Camerupt, Spoink, Baltoy, Lileep, Cradily, Anorith, Armaldo, Feebas, Shuppet, Banette, Duskull, Dusclops, Chimecho, Absol, Wynaut, Glalie, Spheal, Clamperl, Bagon, Beldum, Metang, Metagross, Regirock, Regice, Registeel, Latios, Kyogre, Groudon, Rayquaza, Deoxys, Torterra, Cranidos, Shieldon, Bastiodon, Mismagius, Honchkrow, Chingling, Bronzor, Bronzong, Bonsly, Mime Jr., Spiritomb, Gible, Riolu, Hippowdon, Weavile, Magnezone, Rhyperior, Glaceon, Mamoswine, Porygon-Z, Probopass, Dusknoir, Rotom, Dialga, Palkia, Heatran, Regigigas, Giratina, Darkrai, Arceus, Purrloin, Liepard, Munna, Musharna, Roggenrola, Gigalith, Gurdurr, Throh, Sawk, Scolipede, Crustle, Scraggy, Scrafty, Yamask, Cofagrigus, Trubbish, Garbodor, Zorua, Zoroark, Gothita, Gothorita, Gothitelle, Solosis, Duosion, Reuniclus, Vanillite, Vanillish, Vanilluxe, Klink, Klang, Klinklang, Tynamo, Eelektrik, Elgyem, Beheeyem, Litwick, Lampent, Chandelure, Axew, Fraxure, Cubchoo, Beartic, Cryogonal, Golurk, Pawniard, Bisharp, Vullaby, Mandibuzz, Deino, Zweilous, Cobalion, Terrakion, Virizion, Tornadus, Reshiram, Zekrom, Kyurem, Honedge, Doublade, Aegislash, Binacle, Tyrantrum, Goomy, Sliggoo, Klefki, Phantump, Trevenant, Pumpkaboo, Gourgeist, Bergmite, Avalugg, Noibat, Xerneas, Yveltal, Zygarde, Diancie, Rockruff, Lycanroc, Mudsdale, Sandygast, Palossand, Type: Null, Minior, Turtonator, Mimikyu, Drampa, Dhelmise, Jangmo-o, Hakamo-o, Tapu Lele, Cosmog, Cosmoem, Solgaleo, Nihilego, Buzzwole, Xurkitree, Celesteela, Guzzlord, Necrozma, Magearna, Marshadow, Poipole, Naganadel, Stakataka, Zeraora, Meltan, Melmetal, Rookidee, Corvisquire, Corviknight, Nickit, Thievul, Boltund, Rolycoly, Coalossal, Cramorant, Toxel, Toxtricity, Sinistea, Hatenna, Hattrem, Hatterene, Impidimp, Obstagoon, Perrserker, Mr. Rime, Snom, Frosmoth, Stonjourner, Copperajah, Dracovish, Dreepy, Drakloak, Dragapult, Zacian, Zamazenta, Eternatus, Kubfu, Zarude, Glastrier, Spectrier.
References
- https://m.bulbapedia.bulbagarden.net
- https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_food
- https://conceito.de/comestivel
- https://www.thegamer.com/pokemon-humans-eat-confirmed/
- https://www.polygon.com/videos/2020/12/28/22195388/pokemon-edibility-unraveled
- https://modernfarmer.com/2014/05/food-politics-pokemon/
- https://www.kaggle.com/mariotormo/complete-pokemon-dataset-updated-090420/discussion/195347
- https://www.gamespot.com/gallery/do-people-eat-pokemon-13-examples-from-the-anime-o/2900-2769/#1
Find me in more places! My linktree.