SkillAgentSearch skills...

Game2vec

TensorFlow implementation of word2vec applied on https://www.kaggle.com/tamber/steam-video-games dataset, using both CBOW and Skip-gram.

Install / Use

/learn @warchildmd/Game2vec
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

game2vec - games embeddings

TensorFlow implementation of word2vec applied on https://www.kaggle.com/tamber/steam-video-games dataset, using both CBOW and Skip-gram.

Context for each game is extracted from the other games that the user owns. For example if a user has three games: Dota 2, CS: GO, and Rocket League, this (input -> label) pairs can be generated:

  • CBOW: ((Dota 2, CS: GO) -> Rocket League), ((Dota 2, Rocket League) -> CS: GO), ((CS: GO, Rocket League) -> Dota 2)
  • Skip-gram: (Rocket League -> (Dota 2, CS: GO)), (CS: GO -> (Dota 2, Rocket League)), (Dota 2 -> (CS: GO, Rocket League))

For more reference, please have a look at this papers:

There are three training scripts:

  • train_cbow.py - training using CBOW, using both purchase and play actions into account as user context.
  • train_cbow_weighted.py - same as above, but, only play actions are taken into consideration, and the label is selected based on time played (more time played the game - higher the probability of being selected).
  • train_skipgram.py - training using Skip-gram, using both purchase and play actions into account as user context.

Each script outputs an image with the game embeddings visualised using t-SNE, and a .npy file containing embeddings, dictionary, and reverse dictionary:

{
    'embeddings': final_embeddings,
    'idx_to_game': idx_to_game,
    'game_to_idx': game_to_idx
}

There are three notebooks that load the embeddings + some examples:

  • player_cbow.py - loads embeddings_cbow.npy + example usage.
  • player_cbow_weighted.py - loads embeddings_cbow_weighted.npy + example usage.
  • player_skipgram.py - loads embeddings_skipgram.npy + example usage.

Visualisations are found in .png files.

Example training output:

There are 3600 unique games in the data set.
[(24, 9.9), (109, 2.9), (9, 1.3), (273, 0.7), (237, 6.2), (234, 58.0), (307, 10.8), (120, 10.6), (77, 0.5)]
["Garry's Mod", 'Half-Life 2 Episode One', 'Team Fortress 2', 'Counter-Strike', 'Day of Defeat Source', 'Counter-Strike Source', 'Audiosurf', 'Portal', 'Half-Life 2']
[(238, 316.0)]
['Empire Total War']
[(241, 2.2), (234, 304.0), (9, 0.1), (580, 4.7), (237, 0.9)]
['Alien Swarm', 'Counter-Strike Source', 'Team Fortress 2', 'Half-Life 2 Deathmatch', 'Day of Defeat Source']
[(1983, 0.4)]
['Snuggle Truck']
240 -> [1457]
Unturned -> Smashmuck Champions
9 -> [1457]
Team Fortress 2 -> Smashmuck Champions
240 -> [1457]
Unturned -> Smashmuck Champions
819 -> [1457]
Trove -> Smashmuck Champions
9 -> [1457]
Team Fortress 2 -> Smashmuck Champions
240 -> [1457]
Unturned -> Smashmuck Champions
9 -> [1457]
Team Fortress 2 -> Smashmuck Champions
819 -> [1457]
Trove -> Smashmuck Champions
[ 0  0  1  1  2  2  3  3  4  4  5  5  6  6  7  7  8  8  9  9 10 10 11 11 12
 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24
 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37
 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49
 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 62
 62 63 63]
weights: [3600, 128]
biases: [3600]
final_embed: [None, 128]
Initialised
Average loss at step 0 : 104.436584473
Nearest to Company of Heroes: Gods Will Be Watching, Cloud Chamber, Oil Rush, Stealth Inc 2, Mordheim City of the Damned, FINAL FANTASY XIII-2, Amazing World, Perpetuum,
Nearest to Deus Ex Human Revolution: Duke Nukem Forever, Tom Clancy's H.A.W.X. 2, Full Mojo Rampage, Freight Tycoon Inc., GRID Autosport, 100% Orange Juice, Gunscape, Deus Ex Game of the Year Edition,
Nearest to Mirror's Edge: Critter Crunch, Lost Planet Extreme Condition - Colonies Edition, Tom Clancy's Splinter Cell Chaos Theory, Operation Flashpoint Red River, Year Walk, Ys I, Petz Horsez 2, Third Eye Crime,
Nearest to Counter-Strike Global Offensive: Majesty 2, Nancy Drew Danger on Deception Island , Amazing Adventures Around the World, X2 The Threat, Pirates, Vikings, & Knights II, Stargate Resistance, Heroes Over Europe, Duck Dynasty,
Nearest to Far Cry 3: Ubersoldier II, BookWorm Deluxe, Bridge Constructor Medieval, Nimble Writer, Fieldrunners 2, Carpe Diem, Dark Void, Sacred Gold,
Nearest to Team Fortress 2: Stronghold 2, Nexus The Jupiter Incident, Larva Mortus, Cossacks II Napoleonic Wars, Edge of Space, Don Bradman Cricket 14, Samantha Swift and the Golden Touch, Worms Crazy Golf,
Nearest to Fallout 4: Kinetic Void, Viscera Cleanup Detail Shadow Warrior, Alice Madness Returns, Gratuitous Space Battles, Desktop Dungeons, Peggle Extreme, Star Wars - Battlefront II, The Misadventures of P.B. Winterbottom,
Nearest to Batman Arkham Asylum GOTY Edition: WRC Powerslide, Bridge Constructor, World of Guns Gun Disassembly, the static speaks my name, The Curious Expedition, Fate of the World, Dead Mountaineer's Hotel, Undead Overlord,
Nearest to Half-Life 2: Railroad Pioneer, The Book of Unwritten Tales, Torchlight II, Endless Sky, One Way Heroics, Cabela's Big Game Hunter Pro Hunts, Resident Evil 5 / Biohazard 5, Medal of Honor(TM) Single Player,
Nearest to Orcs Must Die!: Gauntlet , Altitude, Polarity, Lume, Captain Forever Remix, TRI Of Friendship and Madness, Nightmares from the Deep 2 The Siren`s Call, Anno 2205,
Nearest to Space Pirates and Zombies: Doctor Who The Eternity Clock, Montague's Mount, Back to the Future Ep 2 - Get Tannen!, Twin Sector, Medieval II Total War Kingdoms, 100% Orange Juice, Alien Breed 2 Assault, Eternal Silence,
Nearest to FINAL FANTASY VII: Industry Giant 2, Anomaly 2, Escape Goat, Pirates of Black Cove, Nuclear Dawn, Insanely Twisted Shadow Planet, Desperados - Wanted Dead or Alive, Movie Studio 13 Platinum - Steam Powered,
Nearest to Saints Row IV: Arms Dealer, CroNix, Echelon, Sid Meier's Ace Patrol Pacific Skies, GunWorld, Wildlife Park 2, Intrusion 2, Avadon The Black Fortress,
Nearest to Fallout 3 - Game of the Year Edition: Project AURA, Guild of Dungeoneering, Child of Light, Defy Gravity, Minimon, SC2VN - The eSports Visual Novel, Nancy Drew Ghost of Thornton Hall, Thief Deadly Shadows,
Nearest to Dragon Age Origins - Ultimate Edition: Castlevania Lords of Shadow  Mirror of Fate HD, Vertiginous Golf, Sonic Adventure 2 , Patrician IV Steam Special Edition, bit Dungeon II, Swarm Arena, Zuma's Revenge! - Adventure, Fall of the New Age Premium Edition,
Nearest to PROTOTYPE 2: Football Tactics, DARK SOULS II Scholar of the First Sin, The Night of the Rabbit, Mutant Mudds Deluxe, Dungeon Defenders Eternity, Sam & Max 301 The Penal Zone, Crusader Kings II, Duke Nukem Forever ,
Average loss at step 2000 : 34.399090982
Average loss at step 4000 : 17.6512645052
Average loss at step 6000 : 14.1487481684
Average loss at step 8000 : 12.3442589823
Average loss at step 10000 : 11.3791581116
Nearest to Company of Heroes: Star Wars Dark Forces, Weather Lord The Successor's Path, Cloud Chamber, Freedom Planet, VVVVVV, Secret Of Magia, Dungeon Defenders, Habitat,
Nearest to Deus Ex Human Revolution: Homefront, Infinifactory, Fable - The Lost Chapters, War Thunder, 15 Days, Written in the Sky, Edge of Space, Faerie Solitaire,
Nearest to Mirror's Edge: Fingered, Canyon Capers, Floating Point, Resident Evil 5 / Biohazard 5, Slender The Arrival, Viscera Cleanup Detail Shadow Warrior, Always Sometimes Monsters, Grand Theft Auto V,
Nearest to Counter-Strike Global Offensive: Team Fortress 2, Fallout 4, Bus-Simulator 2012, SpeedRunners, Lunar Flight, Nosgoth, Left 4 Dead 2, Garry's Mod,
Nearest to Far Cry 3: Call of Duty Ghosts - Multiplayer, Shift 2 Unleashed, The Repopulation, Steel Storm Burning Retribution, RollerCoaster Tycoon 3 Platinum!, Third Eye Crime, Intergalactic Bubbles, Far Cry 4,
Nearest to Team Fortress 2: Counter-Strike Global Offensive, Unturned, Contrast, Fable - The Lost Chapters, Abducted, Driftmoon, Cultures - Northland, Football Manager 2015,
Nearest to Fallout 4: Counter-Strike Global Offensive, Devils Share, Unturned, Bob Came in Pieces, Galactic Civilizations I Ultimate Edition, The Clans - Saga of the Twins, Indigo Prophecy, Deadlings - Rotten Edition,
Nearest to Batman Arkham Asylum GOTY Edition: Mars Colony Challenger, Blockstorm, Rome Total War - Alexander, Deathmatch Classic, Fritz Chess 14, Cabela's African Adventures, LEGO Batman 2, Hatred,
Nearest to Half-Life 2: Intrusion 2, ORION Prelude, TDP5 Arena 3D, Runaway A Road Adventure, Far Cry, Avernum 4, Bloodbath Kavkaz, Mortal Kombat X,
Nearest to Orcs Must Die!: GUILTY GEAR XX ACCENT CORE PLUS R, Call of Duty Modern Warfare 2 - Multiplayer, Obscure 2, DOOM 3 BFG Edition, Max The Curse of Brotherhood, Monday Night Combat, Hyper Fighters, Secrets of Rtikon,
Nearest to Space Pirates and Zombies: DiRT 3 Complete Edition, Darkest Dungeon, Millie, Snapshot, Deathtrap, It came from space, and ate our brains, Else Heart.Break(), Quake Mission Pack 1 Scourge of Armagon,
Nearest to FINAL FANTASY VII: South Park The Stick of Truth, The Flame in the Flood, Eufloria HD, Ice Age Continental Drift Arctic Games, Bus-Simulator 2012, Ghostbusters Sanctum of Slime, Singularity, Amazing Adventures Around the World,
Nearest to Saints Row IV: Verdun, Cities Skylines, RollerCoaster Tycoon 3 Platinum!, The Expendabros, Hegemony Philip of Macedon, Blitzkrieg Anthology, TRI Of Friendship and Madness, The Sims(TM) 3,
Nearest to Fallout 3 - Game of the Year Edition: Prince of Persia The Two Thrones, Dust An Elysian Tail, Fieldrunners, Prison Tycoon 3 Lockdown, Incredipede, Nihilumbra, State of Decay Year-One, War of Beach,
Nearest to Dragon Age Origins - Ultimate Edition: Antichamber, NBA 2K15, Car M

Related Skills

View on GitHub
GitHub Stars72
CategoryContent
Updated6mo ago
Forks6

Languages

Jupyter Notebook

Security Score

77/100

Audited on Sep 17, 2025

No findings