David Skarbrevik - 2018
We will be getting all data from Riot's API. Their API allows us to query a Summoner's name (player username) to get match history from the last 3 years. Ultimately our goal is to build a model that predicts yes/no (1/0) will a player stop playing the game (based on some previous data) or not.
Let's first make sure we have a clear vision of what kind of data we can (and want) to get.
Individual player data about how many kills, assists, at what time and location, what champion they chose, how long the match lasted, etc.
Not really at the moment. Might think more about this in the future
Creating a random database may be difficult unless I can figure out how to get a list of random summoner IDs... see "Step 3" of this notebook for more info.
I think maybe 1000 players would be a good start. I'll just take the first match of each player to start but if this doesn't seem to be enough to build an accurate model I'll consider taking more. I think the biggest challenge for data collection right now will be finding enough players that fit my specifications (see "Step 3" of this notebook).
I'm planning to use either logistic regression or a simple feed-forward neural network. For these models I want each row of my dataset to represent all the data for a single player. By looking at just the first match for each player it should be easy to make sure the number of features in each row is the same. Later, if I wanted a more general model for churn that works for any player with any number of matches, an RNN might be worth looking into considering the sequential, non-equal length of input vectors in that case.
Advantages of using Cassiopeia instead of making the API calls ourselves:
MatchParticipant.stats.to_dict()
gets a LOT of features at once)Import needed libraries
import numpy as np
import re
import json
import pandas as pd
from collections import defaultdict, Counter
import arrow
import ipywidgets as widgets # for progress bar
import jupyternotify # gives desktop notifications when cell blocks complete
ip = get_ipython()
ip.register_magics(jupyternotify.JupyterNotifyMagics(ip, require_interaction=True))
import cassiopeia as cass # Riot API wrapper
from cassiopeia import Summoner
Set global parameters for Riot API
no_print_calls = cass.get_default_config()
no_print_calls['logging']['print_calls'] = False
cass.apply_settings(no_print_calls)
cass.set_riot_api_key("RGAPI-975f0783-9b2f-4f69-adb0-000b71a0d9f2") # API key that you get from your account
cass.set_default_region("NA")
Let's try to get the summoner ids of some players (the best players)
challenger_league = cass.get_challenger_league(queue=cass.Queue.ranked_solo_fives)
for challenger in challenger_league:
print(challenger.summoner.id)
Making call: https://na1.api.riotgames.com/lol/league/v3/challengerleagues/by-queue/RANKED_SOLO_5x5 34402943 24705131 21103810 47212115 20598223 93809082 20823651 21124626 21623482 20429469 20202108 29557073 24449785 28725693 24671130 30645632 70132282 21371454 42133105 41233933 34225884 49899264 35097344 22670229 45186258 19285521 48193601 19839806 401063 56901374 30266347 37532228 19804632 27251616 79249642 52371378 22478427 83339123 60469878 21542029 30972130 40661961 93269094 36119978 19920510 51580106 77269277 20947579 30255016 19787999 20476893 77520973 21652056 50877721 90331209 82962549 32252808 40279866 36782900 45079499 19587365 24823450 20636732 51949451 32705024 77720407 71229345 91419117 22638316 20389591 52559520 51075422 88109144 37481045 20962399 76609200 19577112 45038172 35592112 83089575 43839117 94819093 20130821 22403576 71715 35570736 77489438 40710913 65389099 77211704 24326160 32556358 21276764 19338315 43079579 20248040 26065445 19698094 91636261 21260950 20414291 24877618 73543081 41885666 20877255 51680686 20056332 19296564 76602920 22654107 20902946 88490180 24777351 19906739 30366254 77251686 47401142 21193669 85889107 23245665 20132258 37343071 61542283 19470447 2648 47836799 21806931 27470522 91429131 49159160 48318695 89909122 25888946 34925733 91729099 40540196 67419639 84509505 19623941 87330006 25848742 38375098 36111109 38880034 579475 21701239 22292020 91729110 49290688 75900909 91419120 19061980 41292075 35703236 21498922 20112175 92949232 19843806 22079480 24069119 25851366 20156599 54986862 46069412 23552941 91429100 46052203 21202019 20270876 29533033 23965783 44317220 63668454 42060215 21014987 74731419 22350178 87119170 20024227 72409957 25232745 22417049 27222755 19770082 87912976 19757901 25108893 38869932 68401488 19887289 94189199 19812679 38091945 22946266 23934806 89599264 59991269 30045762 57029179 51405
That's cool but these are the ids of the best of the best... we want the newest of the new (unranked players) so we'll have to work a bit harder.
How to access a single user
summoner = Summoner(name="Msendak", region="NA")
print("{name} ({id}) is a level {level} summoner on the {region} server.".format(name=summoner.name,
level=summoner.level,
id=summoner.id,
region=summoner.region))
Msendak (37709821) is a level 55 summoner on the Region.north_america server.
We can also access the user with their summoner id
It is my understanding that new summoner names can be bought but that summoner ids may be more permenant so for the sake of stability we'll be associating players by their id when gathering data later.
summoner = Summoner(id=37709821, region="NA")
print("{name} ({id}) is a level {level} summoner on the {region} server.".format(name=summoner.name,
level=summoner.level,
id=summoner.id,
region=summoner.region))
MSendak (37709821) is a level 49 summoner on the Region.north_america server.
Get all the matches that user played
matches = summoner.match_history
print("Total matches = {}".format(len(matches)))
Total matches = 2779
Time of most recent and oldest match (in the last three years)
first_match = matches[-1]
latest_match = matches[0]
time_first_match = re.search("\d+-\d+-\d+",str(first_match.creation))[0]
time_latest_match = re.search("\d+-\d+-\d+",str(latest_match.creation))[0]
print("{name}'s Oldest Match stored in the API: {date}".format(name=summoner.name, date=time_first_match))
print("{name}'s Most Recent Match: {date}".format(name=summoner.name, date=time_latest_match))
MSendak's Oldest Match stored in the API: 2015-05-01 MSendak's Most Recent Match: 2018-04-22
Get stats from any player in that specific match
players = first_match.participants
player = players[1] # selecting a specific player
player_stats = player.stats.to_dict()
player_stats
{'assists': 19, 'champLevel': 14, 'combatPlayerScore': 0, 'damageDealtToObjectives': 0, 'damageDealtToTurrets': 0, 'damageSelfMitigated': 0, 'deaths': 11, 'doubleKills': 3, 'firstBloodAssist': False, 'firstBloodKill': False, 'firstInhibitorAssist': True, 'firstInhibitorKill': False, 'firstTowerAssist': False, 'firstTowerKill': False, 'goldEarned': 8496, 'goldSpent': 7050, 'inhibitorKills': 0, 'item0': 3087, 'item1': 3006, 'item2': 2003, 'item3': 3153, 'item4': 0, 'item5': 0, 'item6': 2052, 'killingSprees': 3, 'kills': 9, 'largestCriticalStrike': 388, 'largestKillingSpree': 3, 'largestMultiKill': 3, 'longestTimeSpentLiving': 136, 'magicDamageDealt': 9021, 'magicDamageDealtToChampions': 3439, 'magicalDamageTaken': 1794, 'neutralMinionsKilled': 0, 'objectivePlayerScore': 0, 'participantId': 2, 'pentaKills': 0, 'physicalDamageDealt': 20675, 'physicalDamageDealtToChampions': 8278, 'physicalDamageTaken': 12276, 'playerScore0': 0, 'playerScore1': 0, 'playerScore2': 0, 'playerScore3': 0, 'playerScore4': 0, 'playerScore5': 0, 'playerScore6': 0, 'playerScore7': 0, 'playerScore8': 0, 'playerScore9': 0, 'quadraKills': 0, 'sightWardsBoughtInGame': 0, 'timeCCingOthers': 0, 'totalDamageDealt': 31406, 'totalDamageDealtToChampions': 13298, 'totalDamageTaken': 15399, 'totalHeal': 1222, 'totalMinionsKilled': 21, 'totalPlayerScore': 0, 'totalScoreRank': 0, 'totalTimeCrowdControlDealt': 25, 'totalUnitsHealed': 1, 'tripleKills': 1, 'trueDamageDealt': 1710, 'trueDamageDealtToChampions': 1580, 'trueDamageTaken': 1328, 'turretKills': 1, 'unrealKills': 0, 'visionScore': 0, 'visionWardsBoughtInGame': 0, 'wardsKilled': 0, 'wardsPlaced': 0, 'win': True}
player_timeline = player.timeline.to_dict()
player_timeline
{'creepsPerMinDeltas': {'0-10': 1.5}, 'csDiffPerMinDeltas': {'0-10': 0.1599999999999998}, 'damageTakenDiffPerMinDeltas': {'0-10': -53.019999999999925}, 'damageTakenPerMinDeltas': {'0-10': 964.6999999999999}, 'goldPerMinDeltas': {'0-10': 467.29999999999995}, 'id': 2, 'lane': 'MIDDLE', 'role': 'NONE', 'xpDiffPerMinDeltas': {'0-10': 36.0800000000001}, 'xpPerMinDeltas': {'0-10': 672.8}}
The "stats" and "timeline" attributes we see here are where to bulk of data from a match come from.
Now that we're familiar with how the Cassiopeia library works, let's get the data we really want.
I specifically want players that are new to the game (low level / few matches), but there is no way to directly access a list of players that meet that criteria through the API (at least not that I know of). So instead, I made a new account (summoner: 'OldTimeCandyBowl') and played a match. I then queried the API about the match to get the summoner ids of my teammates in that match (knowing they'd likely be low level players). My plan is to branch out from them, by taking the players in other matches they've had and then the other players those players have played with, and so on and so forth until I've branched deep enough that I'm happy with the number of low level summoners I've gathered. Initially I'll aim for 1,000 summoners.
Targeted summoner for database I'm building:
Data to collect from target summoner:
Possible prediction tasks:
(all predictions based on summoner's gameplay data from first match)
We are interested in a very specific type of player so this function filters out players that don't fit our specifications.
# limits the type of player we want in our database
def is_candidate_player(summoner, first_match, level_cap):
# NOTE: (int,int,int) that is output with True/False is a counter check to understand how many players are rejected from db.
entry_game_types = ['BOT_5X5_INTRO', 'BOT_5X5_BEGINNER', 'BOT_5X5_INTERMEDIATE']
time_now = arrow.now()
# level cap restriction
if summoner.level > level_cap:
return False, (1,0,0)
# must not be newer than this
if first_match.creation.shift(months=1) > time_now:
return False, (0,1,0)
# must not be older than this
if first_match.creation.year < 2018:
return False, (0,0,1)
return True, (0,0,0)
This function actually gathers the game data from a player's first match.
# gather all player data from a single match
def get_player_game_data(summoner, player_history):
first_match = player_history[-1]
recent_match = player_history[0]
first_match_participant = first_match.participants[summoner]
time_now = arrow.now()
# we need to un-nest the timeline dict and standardize the format of this data
timeline_dict = {}
try:
for key,val in first_match_participant.timeline.to_dict().items():
if isinstance(val, dict):
timeline_dict['{0}_0-10'.format(key)] = val.get('0-10',0)
timeline_dict['{0}_10-20'.format(key)] = val.get('10-20',0)
timeline_dict['{0}_20-30'.format(key)] = val.get('20-30',0)
timeline_dict['{0}_30-end'.format(key)] = val.get('30-end',0)
else:
timeline_dict[key] = val
except:
print("Problem getting timeline data")
try:
# stats data is already in good shape!
stats_dict = first_match_participant.stats.to_dict()
except:
print("Problem getting stats data")
try:
# get basic summoner info
summoner_dict = {"summoner_id": summoner.id, "summoner_name": summoner.name, "summoner_level": summoner.level}
except:
print("Problem getting summoner info.")
try:
# there is some other info we want that's not captured by the 'stats' or 'timeline
extra_tid_bits = {'first_match_id': first_match.id, 'first_match_duration': first_match.duration,
'first_match_time': first_match.creation, 'latest_match_time': recent_match.creation,
'total_matches': len(player_history)}
except:
print("Problem getting extra info about player match.")
return {**extra_tid_bits, **timeline_dict, **stats_dict, **summoner_dict}
This function takes in a list of summoner ids and produces a dataset of first match data from it.
Only really necessary if I'm in a situation where I have built a good list of summoner ids but I've lost my dataset for some reason.
##############################
# WE WILL CALL THIS DIRECTLY #
##############################
# given a list of summoner ids, will return dataframe with game data for each player
# this is a backup, "just in case" function that I would only use if I lost my database but still had my list of summoners.
def db_from_ids(summoner_ids: list):
master_game_data_list = []
issue_ids = []
for i in range(len(summoner_ids)):
if i % 10 == 0:
print("Currently processing player {}".format(i+1))
try:
summoner = Summoner(id=summoner_ids[i], region="NA")
summoner_history = summoner.match_history
except Exception as inst:
issue_ids.append(player)
print("Problem getting player {}".format(player))
print(type(inst))
print(inst)
try:
game_data = get_player_game_data(summoner, summoner_history)
master_game_data_db.append(game_data)
except Exception as inst:
print("Problem getting game_data")
print(type(inst))
print(inst)
if issue_ids:
print("Could not collect data on these players:")
print(issue_ids)
master_df = pd.DataFrame([*master_game_data_db])
return master_df
After each round of data collection this saves lists and data to files.
##############################
# WE WILL CALL THIS DIRECTLY #
##############################
# this ties the data from the end of a round to all the data collected to that point and saves it to disk
def end_of_round_housekeeping(master_db, round_db: list, master_id_list: list, round_list: list):
if isinstance(master_db, pd.core.frame.DataFrame):
master_db = master_db.append(round_db)
master_id_list += round_list # running list of all ids already in database
# save the current seed list
with open("./data/current_seed_list.txt", "w") as file1:
for summoner in round_list:
file1.write(str(summoner)+"\n")
# save all summoner ids that have been added to database already
with open("./data/summoners_in_db.txt", "a") as file2:
for summoner in round_list:
file2.write(str(summoner)+"\n")
# save dataset to csv
master_db.to_csv("./data/riot_master_df2.csv", index=False)
return master_db, master_id_list
If we need to restart the notebook or the kernel crashes for some reason, this will read our lists/data from disk.
##############################
# WE WILL CALL THIS DIRECTLY #
##############################
# if kernel crashes, call this to get most current lists and dataframe back
def recover_lists():
current_seed_list = []
summoners_in_db = []
with open('./data/current_seed_list.txt', 'r') as file1:
lines = file1.readlines()
for line in lines:
current_seed_list.append(int(line.rstrip('\n')))
with open('./data/summoners_in_db.txt', 'r') as file2:
lines = file2.readlines()
for line in lines:
summoners_in_db.append(int(line.rstrip('\n')))
data_df = pd.read_csv("./data/riot_master_df.csv", encoding="ISO-8859-1")
print("Summoners in current seed list = {}".format(len(current_seed_list)))
print("All summoners gathered so far = {}".format(len(summoners_in_db)))
return data_df, current_seed_list, summoners_in_db
This will be the conductor of the orchestra. We'll call this to get new ids and data.
##############################
# WE WILL CALL THIS DIRECTLY #
##############################
# collect gameplay data from players
def get_new_players(seed_list_of_summoners, summoners_already_in_db = None, cut_off = None, level_cap = 10):
# PARAMETER(S) #
# seed_list_of_summoners : (list) of summoner ids to branch from to find new players
# cutt_off : (int) stops data mining if cut_off number of players get added to db
# initialization for data we want to collect
gameplay_database = [] # list of dictionaries containing player match data
new_seeders = [] # new list of seeders for next call to this function
back_up_seeders = [] # if there are less than 5 good candidates then return all players considered instead
# tracking to troubleshoot issues and help validate data collection
player_added_count = 0 # track how many players added to database
considered_count = 0 # track how many players entered "is_candidate_player"
denied_level_cap = 0 # track how many players denied b/c level too high
denied_too_young = 0 # track how many players denied b/c account too new
denied_too_old = 0 # track how many players denied b/c account too old
if cut_off != None:
if not isinstance(cut_off, int):
cut_off = None
print("Warning: cut_off must be type 'int'... cut_off was reset to none.")
# avoid unnecessary duplicate data mining
if summoners_already_in_db == None:
summoners_already_in_db = seed_list_of_summoners
total_seeders = len(seed_list_of_summoners)
# progress bar to make to track... progress
interval = 100/total_seeders # for incrementing progress bar
progress = widgets.FloatProgress(value=0.0, min=0.0, max=100.0, description='0%', bar_style='info')
display(progress)
# cycle through ids in "seeder list" to get new summoner ids and data
for player in seed_list_of_summoners:
try:
seed_summoner = Summoner(id=player, region="NA")
seeder_history = seed_summoner.match_history
seeder_total_matches = len(seeder_history)
for i in range(seeder_total_matches):
total_players = len(seeder_history[i].participants)
for j in range(total_players):
player = seeder_history[i].participants[j]
# avoid bots and duplicates
try:
if player.is_bot == True:
continue
except:
pass # not great practice but this occurs frequently and is meaningless for me
try:
if player.summoner.id in summoners_already_in_db:
continue
except Exception as inst:
print("Issue checking if summoner in seed_list")
print(type(inst))
print(inst)
player_history = player.summoner.match_history
first_match = player_history[-1]
try:
put_in_db, denied_checks = is_candidate_player(player.summoner, first_match, level_cap)
except Exception as inst:
print("Problem checking if candidate player.")
print(type(inst))
print(inst)
considered_count += 1
denied_level_cap += denied_checks[0]
denied_too_young += denied_checks[1]
denied_too_old += denied_checks[2]
back_up_seeders.append(player.summoner.id)
if put_in_db == True:
try:
game_data = get_player_game_data(player.summoner, player_history)
except:
print("Problem getting game_data")
# throw our new valuable data into the treasure chest!
gameplay_database.append(game_data)
new_seeders.append(player.summoner.id)
summoners_already_in_db.append(player.summoner.id)
player_added_count += 1
if player_added_count % 100 == 0:
print("Currently {} players in database.".format(player_added_count))
if cut_off:
if player_count >= cut_off:
return gameplay_database
# update progress bar (end of seeder player history)
progress.value += interval
progress.description = "{}%".format(round(progress.value,1))
except Exception as inst:
print("ERROR while processing player: {0} ({1}).".format(seed_summoner.name, seed_summoner.id))
print(type(inst))
print(inst)
# made it to the end!!! Let's summarize what happened during collection.
progress.bar_style = 'success'
print("DONE! \n")
print("Players that were considered for database = {}".format(considered_count))
print("Players that were added to database = {}".format(player_added_count))
print("Players denied b/c of level cap = {}".format(denied_level_cap))
print("Players denied b/c account too young = {}".format(denied_too_young))
print("Players denied b/c account too old = {}".format(denied_too_old))
if len(new_seeders) >= 5:
return gameplay_database, new_seeders
else:
print("\033[1;31m" + "WARNING:" + "\033[0m" + " There weren't many good candidate players :( so look carefully at seed list that was returned.")
return gameplay_database, back_up_seeders
Note about Step 4: You'll notice as you look through Step 4 that I gather data in "Rounds". I'm essentially manually looping over a call to my function above until I have enough data. I'm doing this manually for now so that I can validate the data I get out of each loop. If I want to use this more in the future I'll probably write a loop in to the functions above.
Now that we have our functions ready, we just need a seed list of summoner ids to start from.
We'll use this new account that I played just a few games on to try and get new player ids.
summoner = Summoner(name="OldTimeCandyBowl", region="NA")
print(summoner.name, summoner.level)
Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/by-name/OldTimeCandyBowl OldTimeCandyBowl 3
match_history = summoner.match_history
seed_match = match_history[0]
players = seed_match.participants
seed_list = []
for i in range(len(players)):
if players[i].summoner.level < 10 and (players[i].summoner.match_history[-1].creation.year > 2017):
seed_list.append(players[i].summoner.id)
print("{0} ({1}) is level {2}".format(players[i].summoner.name,
players[i].summoner.id,
players[i].summoner.level))
Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/247157416?beginIndex=0&endIndex=100 Making call: https://ddragon.leagueoflegends.com/realms/na.json Making call: https://na1.api.riotgames.com/lol/match/v3/matches/2768433833 Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/by-account/247157416 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/247157416?beginIndex=0&endIndex=100 OldTimeCandyBowl (94643101) is level 3 [94643101] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/76772327 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/233648039?beginIndex=0&endIndex=100 FrozenVettel (76772327) is level 9 [94643101] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/93799945 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246057408?beginIndex=0&endIndex=100 INFO: Unexpected service rate limit, backing off for 35 seconds (from headers). Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246057408?beginIndex=0&endIndex=100 LittyMcLitSauce (93799945) is level 8 [94643101, 93799945] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/94533010 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/247155417?beginIndex=0&endIndex=100 téétó (94533010) is level 6 [94643101, 93799945, 94533010] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/90193433 Y Z K E L (90193433) is level 11 [94643101, 93799945, 94533010] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/90563962 RioNad (90563962) is level 10 [94643101, 93799945, 94533010] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/95079317 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/247179978?beginIndex=0&endIndex=100 yawa akong lolo (95079317) is level 3 [94643101, 93799945, 94533010, 95079317] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/94909450 YesImFOB (94909450) is level 10 [94643101, 93799945, 94533010, 95079317] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/95049679 F1Na4lf3 (95049679) is level 10 [94643101, 93799945, 94533010, 95079317] Making call: https://na1.api.riotgames.com/lol/summoner/v3/summoners/94859763 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/247219318?beginIndex=0&endIndex=100 Accountnumber21 (94859763) is level 4 [94643101, 93799945, 94533010, 95079317, 94859763]
print("Seed list of summoner ids: {}".format(seed_list))
Seed list of summoner ids: [94643101, 93799945, 94533010, 95079317, 94859763]
Let's use our seed list to try and get more new players.
game_data_dict, new_seed_list = get_new_players(seed_list)
Awesome! We found some new ids that fit our specifications! Let's verify that they seem right for our database.
for id in new_seed_list:
summoner = Summoner(id=id, region="NA")
print("{0} ({1}) is level {2} with {3} matches. First match was {4}".format(summoner.name,
summoner.id,
summoner.level,
len(summoner.match_history),
summoner.match_history[-1].creation.format("MM-DD-YYYY")))
Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244707853?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244707853?beginIndex=0&endIndex=100 Juanochi (92091071) is level 7 with 8 matches. First match was 01-16-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246050296?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246050296?beginIndex=0&endIndex=100 BigDaddyMiles (93659918) is level 3 with 4 matches. First match was 03-10-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244444992?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244444992?beginIndex=0&endIndex=100 ritowhy1 (93589089) is level 8 with 16 matches. First match was 03-09-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246049176?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246049176?beginIndex=0&endIndex=100 Yanora (93759868) is level 10 with 21 matches. First match was 03-10-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246058398?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246058398?beginIndex=0&endIndex=100 Catastrophz (93859982) is level 10 with 21 matches. First match was 03-10-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246038766?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246038766?beginIndex=0&endIndex=100 roselovemoon (93769822) is level 8 with 21 matches. First match was 03-10-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244707853?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244707853?beginIndex=0&endIndex=100 Juanochi (92091071) is level 7 with 8 matches. First match was 01-16-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245821906?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245821906?beginIndex=0&endIndex=100 FeedzCx (93399527) is level 10 with 23 matches. First match was 03-02-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244410558?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244410558?beginIndex=0&endIndex=100 Xeptorik (91508675) is level 6 with 11 matches. First match was 01-06-2018 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246226008?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246226008?beginIndex=0&endIndex=100 mlxg is best (93641866) is level 4 with 4 matches. First match was 03-15-2018
It looks like only two of the ten players are under level 5.
Since we want to have a lot of examples of players that didn't get to level 3 (or maybe at least not to level 5), we're going to just use the lowest level players from our new list to try and get more new players.
game_data_dict2, new_seed_list2 = get_new_players(new_seed_list, level_cap=5) # specifying level cap to be lower (default = 10)
Yes! Looks like we may have found 21 players that are new (but at least a month old still) and low level!
Let's double check to see their info:
match_count = 0
for id in new_seed_list2:
summoner = Summoner(id=id, region="NA")
print("{0} ({1}) is level {2} with {3} matches. First match was {4}".format(summoner.name,
summoner.id,
summoner.level,
len(summoner.match_history),
summoner.match_history[-1].creation.format("MM-DD-YYYY")))
match_count += len(summoner.match_history)
print("\n")
print("TOTAL MATCHES BETWEEN ALL NEW PLAYERS = {}".format(match_count))
So we have a total of 21 people in our dataset and with their combined 98 matches to search from, that's close to 1,000 possible new summoner ids we can get. Ultimately we'll want at least 1,000 so we'll need to rerun our data gathering functions at least once more (probably two more times).
Also note that with our level cap of 5 most of the players in our dataset are level 5 or 4... but very few are 3 or 2 or 1. Because one possible prediction task we'd like to do is decided if a players will get to level 3 (out of tutorial mode) or not, we'd like more cases where a player did not get out (still level 1 or 2). To accomplish this we could get a lot more data than 1,000 players or change our level_cap to 3 or 4. I'm going to opt to just collect more data for now and see how it goes.
This may take a while, so I'm going to use a cell magic command to notify me when this finishes.
%%notify
game_data_dict23, new_seed_list3 = get_new_players(new_seed_list2, level_cap=5) # specifying level cap to be lower (default = 10)
Another successful run! We considered 564 players (not 1,000 like I estimated but still good!). This time with 48 summoners meeting our criteria. Our momentum is building!!
Let's take a quick look at some info from these players:
# some quick checks
match_count = 0
below_level_3_count = 0
level_3_count = 0
above_level_3_count = 0
for id in new_seed_list3:
summoner = Summoner(id=id, region="NA")
print("{0} ({1}) is level {2} with {3} matches. First match was {4}".format(summoner.name,
summoner.id,
summoner.level,
len(summoner.match_history),
summoner.match_history[-1].creation.format("MM-DD-YYYY")))
match_count += len(summoner.match_history)
if summoner.level < 3:
below_level_3_count += 1
elif summoner.level == 3:
level_3_count += 1
elif summoner.level > 3:
above_level_3_count += 1
print("\n")
print("TOTAL MATCHES BETWEEN ALL NEW PLAYERS = {}".format(match_count))
print("NUMBER OF PLAYERS BELOW LEVEL 3 = {}".format(below_level_3_count))
print("NUMBER OF PLAYERS AT LEVEL 3 = {}".format(level_3_count))
print("NUMBER OF PLAYERS ABOVE LEVEL 3 = {}".format(above_level_3_count))
We see that we're starting to find players that didn't make it past level 3 but they are a relatively small percentage of the players we're collecting. This makes sense since low level players play fewer matches they will be harder for us to stumble upon.
Before we start Round 4, let's get together all the summoners already in our database:
print("Round 2 seed list had {} ids".format(len(new_seed_list2)))
print("Round 3 seed list had {} ids".format(len(new_seed_list3)))
summoners_in_db = new_seed_list2 + new_seed_list3
seed_list3 = new_seed_list3 # just want to change naming convention here
Round 2 seed list had 21 ids Round 3 seed list had 48 ids
Also because we've worked so hard to mine these summoner ids, let's save those to a file after each round just in case:
with open("current_seed_lists.txt", "w") as file1:
for summoner in seed_list3:
file1.write(str(summoner)+"\n")
with open("summoners_in_db.txt", "w") as file2:
for summoner in summoners_in_db:
file2.write(str(summoner)+"\n")
Let's also combine our databases for convenience:
game_data_list_master = game_data_dict2 + game_data_dict23 # accidentally named game_data_dict3, "game_data_dict23"...
note: In this new round we're adding a summoners_already_in_db
to avoid summoners we've already seen. Since we're starting to actually build momentum this will hopefully save us a lot of time in needless API calls.
%%notify -m "Round 4 of Riot data collection complete!"
game_data_list4, seed_list4 = get_new_players(seed_list3, summoners_already_in_db = summoners_in_db, level_cap=5)
Another successful run! Again let's take a look at the specific level breakdowns for these new players:
# some quick checks
match_count = 0
below_level_3_count = 0
level_3_count = 0
above_level_3_count = 0
for id in seed_list4:
summoner = Summoner(id=id, region="NA")
match_count += len(summoner.match_history)
if summoner.level < 3:
below_level_3_count += 1
elif summoner.level == 3:
level_3_count += 1
elif summoner.level > 3:
above_level_3_count += 1
print("\n")
print("TOTAL MATCHES BETWEEN ALL NEW PLAYERS = {}".format(match_count))
print("NUMBER OF PLAYERS BELOW LEVEL 3 = {}".format(below_level_3_count))
print("NUMBER OF PLAYERS AT LEVEL 3 = {}".format(level_3_count))
print("NUMBER OF PLAYERS ABOVE LEVEL 3 = {}".format(above_level_3_count))
Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244731542?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244704257?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244709001?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244708495?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244695549?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244676229?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244536171?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244676333?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244717994?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244707908?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246093994?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246331376?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246045381?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246039182?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246065394?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246036433?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246029981?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246063185?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246061249?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246052604?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246056397?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246058341?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246387338?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245257817?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246258521?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246228318?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246245769?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245232142?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245518637?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245986928?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246191991?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245971143?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245889024?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245972254?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246055070?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244929966?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245922268?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245789771?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245891572?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/242694162?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245866591?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246032536?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246048534?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246044738?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245981030?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246099272?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245949280?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246334958?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246314209?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246328496?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246305035?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246257381?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246182370?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246268548?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245992292?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246069209?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246053903?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/205968369?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246068857?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246036709?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246058520?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245994013?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245814118?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245885713?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245766781?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245899084?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245874946?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245897769?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245833976?beginIndex=0&endIndex=100 TOTAL MATCHES BETWEEN ALL NEW PLAYERS = 281 NUMBER OF PLAYERS BELOW LEVEL 3 = 24 NUMBER OF PLAYERS AT LEVEL 3 = 12 NUMBER OF PLAYERS ABOVE LEVEL 3 = 33
Great! There are actually quite a few new players below level 3. But I'm aiming for a dataset of at least 1,000 players with at least 500 examples of a player below level 3 so this is about 0.5% of the data I need. Let's hope the next round is even better!
Again, we'll do a bit of housekeeping before we're ready to move on to the next round of data collection:
game_data_list_master += game_data_list4 # current dataset... slowly building
summoners_in_db += seed_list4 # running list of all ids already in database
# save the current seed list
with open("current_seed_lists.txt", "w") as file1:
for summoner in seed_list4:
file1.write(str(summoner)+"\n")
# save all summoner ids that have been added to database already
with open("summoners_in_db.txt", "w") as file2:
for summoner in summoners_in_db:
file2.write(str(summoner)+"\n")
%%notify -m "Round 5 of Riot data collection complete!"
game_data_list5, seed_list5 = get_new_players(seed_list4, summoners_already_in_db = summoners_in_db, level_cap=5)
Good News! It's still working! We are still gaining momentum in building our database. Let's do another in-depth check to see how this is breaking down:
# some quick checks
match_count = 0
below_level_3_count = 0
level_3_count = 0
above_level_3_count = 0
for id in seed_list5:
summoner = Summoner(id=id, region="NA")
match_count += len(summoner.match_history)
if summoner.level < 3:
below_level_3_count += 1
elif summoner.level == 3:
level_3_count += 1
elif summoner.level > 3:
above_level_3_count += 1
print("\n")
print("TOTAL MATCHES BETWEEN ALL NEW PLAYERS = {}".format(match_count))
print("NUMBER OF PLAYERS BELOW LEVEL 3 = {}".format(below_level_3_count))
print("NUMBER OF PLAYERS AT LEVEL 3 = {}".format(level_3_count))
print("NUMBER OF PLAYERS ABOVE LEVEL 3 = {}".format(above_level_3_count))
Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244730607?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244459338?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244603216?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/43573836?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244701400?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244704305?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244696435?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244714535?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246380132?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246374331?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246263152?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246063419?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245649347?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246061298?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245980711?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246012127?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246064583?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246037706?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245845772?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246024781?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/230828308?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245856386?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246361887?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246036931?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246059795?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246061647?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245533882?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246287990?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246303426?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245279370?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245277350?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246261196?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245469580?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246230027?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246260166?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244648410?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246067006?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246257836?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246237341?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246129748?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246061814?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246054826?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245840057?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245821638?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245750505?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245514719?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245476039?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245517765?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/51417249?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246217391?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246252579?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246016918?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246049808?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246128718?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245864736?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245997428?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245972797?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246075260?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246075110?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245802444?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246047483?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246040218?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246047796?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246128446?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246350386?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/42357163?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246334229?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246332967?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246334270?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/242250205?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246412066?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246325259?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246122362?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245891544?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245143305?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246266881?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246258616?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246252665?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/241647014?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245998237?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246051784?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246055818?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245427878?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246056248?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/242773764?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/226837530?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246057129?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246042464?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246036854?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246105997?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246161410?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246114669?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246089285?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245990617?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246061668?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246055205?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246015745?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244696640?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245993387?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245995875?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245994298?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245909610?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245712837?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246005637?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246034414?beginIndex=0&endIndex=100 TOTAL MATCHES BETWEEN ALL NEW PLAYERS = 428 NUMBER OF PLAYERS BELOW LEVEL 3 = 33 NUMBER OF PLAYERS AT LEVEL 3 = 12 NUMBER OF PLAYERS ABOVE LEVEL 3 = 60
We see similar results as last round. Most players are level 4 or 5 but there are still a good amount of lower level players in this set. We've about doubled the amount of new ids from the last round to get a total of around 300. I should also note that this round took 2-3 hours to complete. At this rate I expect to go 2-3 more rounds of data collection. Each round should take significantly longer than the last (perhaps doubling each time?). So the last round might take the better part of a day. Because the Riot API keys I'm getting are only good for a day, I'll need to be mindful of when my key will expire before I start another round (maybe this is another good reason for not automating these rounds of collection).
Once again we have a few housekeeping steps. We seem to have streamlined the process of housekeeping enough and we may have to do a few more rounds of data collection, so this time lets package it into a function to make it easier next time. The function will be put up in "Step 3".
def end_of_round_housekeeping(master_db: list, round_db: list, master_id_list: list, round_list: list):
master_db += round_db # current dataset... slowly building
master_id_list += round_list # running list of all ids already in database
# save the current seed list
with open("current_seed_lists.txt", "w") as file1:
for summoner in round_list:
file1.write(str(summoner)+"\n")
# save all summoner ids that have been added to database already
with open("summoners_in_db.txt", "a") as file2:
for summoner in round_list:
file2.write(str(summoner)+"\n")
# save last round's data to the other rounds as json
with open("master_db.json", 'a') as file3:
json.dump(round_db, file3)
return master_db, master_id_list
game_data_list_master, summoners_in_db = end_of_round_housekeeping(master_db = game_data_list_master,
round_db = game_data_list5,
master_id_list = summoners_in_db,
round_list = seed_list5)
%%notify -m "Round 6 of Riot data collection complete!"
game_data_list6, seed_list6 = get_new_players(seed_list_of_summoners = seed_list5,
summoners_already_in_db = summoners_in_db,
level_cap=5)
This round went smoothly, let's check out the breakdown:
# some quick checks
match_count = 0
below_level_3_count = 0
level_3_count = 0
above_level_3_count = 0
for id in seed_list6:
summoner = Summoner(id=id, region="NA")
match_count += len(summoner.match_history)
if summoner.level < 3:
below_level_3_count += 1
elif summoner.level == 3:
level_3_count += 1
elif summoner.level > 3:
above_level_3_count += 1
print("\n")
print("TOTAL MATCHES BETWEEN ALL NEW PLAYERS = {}".format(match_count))
print("NUMBER OF PLAYERS BELOW LEVEL 3 = {}".format(below_level_3_count))
print("NUMBER OF PLAYERS AT LEVEL 3 = {}".format(level_3_count))
print("NUMBER OF PLAYERS ABOVE LEVEL 3 = {}".format(above_level_3_count))
Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244626375?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244733460?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244464208?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244696963?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244704126?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244694447?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244661686?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244649651?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244707576?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244709609?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244710004?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244661418?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244706964?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244708157?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244651490?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244705240?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/243761357?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244591508?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244717872?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244717825?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244690674?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246419450?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246331656?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246332255?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/241233461?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245303081?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246036196?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245297873?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245981808?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246054467?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/219460977?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246063688?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246037332?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246036172?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246063549?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246080248?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245645517?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246057614?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245957087?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246258290?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246147544?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246044885?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246038118?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246057534?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245580868?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245585202?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245326708?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246261019?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246219472?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244646078?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244371364?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246312132?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246293646?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245907026?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245592552?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/243138582?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246231678?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246291216?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245634142?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246239082?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/230649037?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/243486628?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245982218?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246003547?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246050944?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245803596?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245847624?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245849861?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245809003?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245742752?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245624790?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245498115?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245803463?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245825894?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245493143?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245414477?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245490646?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245411930?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245539968?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245527418?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245222406?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245507747?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245286277?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245723264?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246227477?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246250902?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246070812?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246044740?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246017689?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245944264?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245945584?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245896056?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245627187?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246088749?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246049310?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245898732?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246132862?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246129554?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246071308?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245561261?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246081762?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246077623?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246077722?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246076998?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245381798?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246090640?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246086897?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245997569?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246088057?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246177001?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246350232?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246179707?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246344472?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246359378?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246394274?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/227889574?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246102506?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246172324?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246151347?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246149046?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246145609?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246120738?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246123911?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244643649?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245950134?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244753036?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/243869397?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/244641116?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245047979?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245142768?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246255442?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246281270?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246282075?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246317094?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246318419?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246314558?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246292920?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245948391?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246169422?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246263571?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246278208?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246112150?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246124694?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245893181?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246075111?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246075137?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246072477?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246014729?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246037095?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245432969?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245561240?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246057496?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/228114156?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245996591?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246057311?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246077324?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245551932?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246069494?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/240866542?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246005795?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246004575?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246019051?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/240769920?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245978553?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245742301?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246161048?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246156612?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246107332?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/211662479?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246121849?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246004429?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246117559?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246116610?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246118639?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246105282?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246074924?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246119337?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246106162?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246043235?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246027253?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246014862?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245993496?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246046224?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245718362?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245830782?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245933189?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245904468?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245868126?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/245715834?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246020366?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246034734?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246037724?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246030056?beginIndex=0&endIndex=100 Making call: https://na1.api.riotgames.com/lol/match/v3/matchlists/by-account/246035500?beginIndex=0&endIndex=100 TOTAL MATCHES BETWEEN ALL NEW PLAYERS = 920 NUMBER OF PLAYERS BELOW LEVEL 3 = 49 NUMBER OF PLAYERS AT LEVEL 3 = 32 NUMBER OF PLAYERS ABOVE LEVEL 3 = 113
Looks good, let's do some housekeeping and move on to round 7.
game_data_list_master, summoners_in_db = end_of_round_housekeeping(master_db = game_data_list_master,
round_db = game_data_list6,
master_id_list = summoners_in_db,
round_list = seed_list6)
Quick update:
I had an issue that forced me to restart the kernel (this is why we've been backing up our data!). So We're going to quickly read in the current seed list and complete list of summoners in db before starting round 7.
ALSO, note how from this point on there are no printed output when a call is made to the Riot API... I realized that with so many calls being made/printed it was starting to slow down the notebook visually (scrolling and typing had slower response rates), I'm not sure if this was impacting the actual computational speed of the kernel but at any rate, we're not going to show those anymore. There are print statements built into my functions that will help us get a sense for how the data collection process is progressing instead.
current_seed_list = []
summoners_in_db = []
with open('current_seed_lists.txt', 'r') as file1:
lines = file1.readlines()
for line in lines:
current_seed_list.append(int(line.rstrip('\n')))
with open('summoners_in_db.txt', 'r') as file2:
lines = file2.readlines()
for line in lines:
summoners_in_db.append(int(line.rstrip('\n')))
print("Summoners in current seed list = {}".format(len(current_seed_list)))
print("All summoners gathered so far = {}".format(len(summoners_in_db)))
Summoners in current seed list = 194 All summoners gathered so far = 506
OK great, we're back on track and ready for round 7.
%%notify -m "Round 7 of Riot data collection complete!"
game_data_list7, seed_list7 = get_new_players(seed_list_of_summoners = current_seed_list,
summoners_already_in_db = summoners_in_db,
level_cap=5)
Great, another round done! And looks like we're still building momentum which is awesome. Let's be sure:
# some quick checks
below_level_3_count = 0
level_3_count = 0
above_level_3_count = 0
for id in seed_list7:
summoner = Summoner(id=id, region="NA")
if summoner.level < 3:
below_level_3_count += 1
elif summoner.level == 3:
level_3_count += 1
elif summoner.level > 3:
above_level_3_count += 1
print("NUMBER OF PLAYERS BELOW LEVEL 3 = {}".format(below_level_3_count))
print("NUMBER OF PLAYERS AT LEVEL 3 = {}".format(level_3_count))
print("NUMBER OF PLAYERS ABOVE LEVEL 3 = {}".format(above_level_3_count))
NUMBER OF PLAYERS BELOW LEVEL 3 = 81 NUMBER OF PLAYERS AT LEVEL 3 = 76 NUMBER OF PLAYERS ABOVE LEVEL 3 = 224
Perfect, we're still getting a good amount of all types of levels... let's do our housekeeping (saving and appending lists/data) before we move on.
master_db, summoners_in_db = end_of_round_housekeeping(master_db = master_db,
round_db = game_data_list7,
master_id_list = summoners_in_db,
round_list = seed_list7)
Now we're ready for round 8, but before that let's just see how big our database is right now:
print("{} rows in our database with {} columns each.".format(master_db.shape[0],master_db.shape[1]))
887 rows in our database with 116 columns each.
So far it's looking like smooth sailing!... well... accept for the setbacks... and the slow, hackish building of our data collection functions... but otherwise compleeetely smooth!... let's just start round 8.
Just kidding, slight hiccup... had to restart. So I put another function up in Step 3 so that I can quickly get back the most recent lists if the kernel ever crashes again.
master_df, current_seed_list, summoners_in_db = recover_lists()
Summoners in current seed list = 381 All summoners gathered so far = 887
Now we're ready!
%%notify -m "Round 8 of Riot data collection complete!"
%%time
game_data_list8, seed_list8 = get_new_players(seed_list_of_summoners = current_seed_list,
summoners_already_in_db = summoners_in_db,
level_cap=5)
We did it! Over 8,000 players considered in this round. Unfortunately the vast majority of those were rejected due to being too high level, but we still got over 700. Let's see the level breakdown:
# some quick checks
below_level_3_count = 0
level_3_count = 0
above_level_3_count = 0
for id in seed_list8:
summoner = Summoner(id=id, region="NA")
if summoner.level < 3:
below_level_3_count += 1
elif summoner.level == 3:
level_3_count += 1
elif summoner.level > 3:
above_level_3_count += 1
print("NUMBER OF PLAYERS BELOW LEVEL 3 = {}".format(below_level_3_count))
print("NUMBER OF PLAYERS AT LEVEL 3 = {}".format(level_3_count))
print("NUMBER OF PLAYERS ABOVE LEVEL 3 = {}".format(above_level_3_count))
NUMBER OF PLAYERS BELOW LEVEL 3 = 189 NUMBER OF PLAYERS AT LEVEL 3 = 142 NUMBER OF PLAYERS ABOVE LEVEL 3 = 380
Last housekeeping step:
master_df, summoners_in_db = end_of_round_housekeeping(master_db = master_df,
round_db = game_data_list8,
master_id_list = summoners_in_db,
round_list = seed_list8)
Quick peak at what we collected:
master_df.head()
assists | champLevel | combatPlayerScore | creepsPerMinDeltas_0-10 | creepsPerMinDeltas_10-20 | creepsPerMinDeltas_20-30 | creepsPerMinDeltas_30-end | csDiffPerMinDeltas_0-10 | csDiffPerMinDeltas_10-20 | csDiffPerMinDeltas_20-30 | ... | wardsPlaced | win | xpDiffPerMinDeltas_0-10 | xpDiffPerMinDeltas_10-20 | xpDiffPerMinDeltas_20-30 | xpDiffPerMinDeltas_30-end | xpPerMinDeltas_0-10 | xpPerMinDeltas_10-20 | xpPerMinDeltas_20-30 | xpPerMinDeltas_30-end | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 16.0 | 12.0 | 0.0 | 5.1 | 0.0 | 0.0 | 0.0 | 4.80 | 0.0 | 0.0 | ... | 0.0 | True | 371.20 | 0.0 | 0.0 | 0.0 | 583.9 | 0.0 | 0.0 | 0.0 |
1 | 4.0 | 11.0 | 0.0 | 3.5 | 0.0 | 0.0 | 0.0 | 1.72 | 0.0 | 0.0 | ... | 3.0 | True | 84.66 | 0.0 | 0.0 | 0.0 | 363.9 | 0.0 | 0.0 | 0.0 |
2 | 10.0 | 13.0 | 0.0 | 0.8 | 3.6 | 0.0 | 0.0 | NaN | NaN | NaN | ... | 0.0 | True | NaN | NaN | NaN | NaN | 331.8 | 464.2 | 0.0 | 0.0 |
3 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | NaN | NaN | NaN | ... | 0.0 | True | NaN | NaN | NaN | NaN | 0.0 | 0.0 | 0.0 | 0.0 |
4 | 7.0 | 17.0 | 0.0 | 4.1 | 4.0 | 3.1 | 0.0 | 4.10 | 4.0 | 3.0 | ... | 1.0 | True | 538.60 | 429.1 | 783.3 | 0.0 | 538.6 | 429.1 | 806.5 | 0.0 |
5 rows × 116 columns
print("Number of summoners in dataset = {}".format(master_df.shape[0]))
print("Number of features from each summoner = {}".format(master_df.shape[1]))
print("Average summoner level in dataset = {}".format(round(np.average(master_df['summoner_level']),1)))
Number of summoners in dataset = 1598 Number of features from each summoner = 116 Average summoner level in dataset = 3.5
After cleaning the data, performing analysis on the dataset, and building models with the dataset... I decided I want more data :)
So here we are, back at the source to take a stab at round 9. Right now we have a little over a 1,000 players in the dataset, let's see how much we can gain in round 9!
master_df, current_seed_list, summoners_in_db = recover_lists()
Summoners in current seed list = 711 All summoners gathered so far = 1598
%%notify -m "Round 9 of Riot data collection complete!"
%%time
game_data_list9, seed_list9 = get_new_players(seed_list_of_summoners = current_seed_list,
summoners_already_in_db = summoners_in_db,
level_cap=5)
FloatProgress(value=0.0, bar_style='info', description='0%')
Currently 10 players in database. Currently 20 players in database. Currently 30 players in database. Currently 40 players in database. Currently 50 players in database. ERROR while processing player: saiuheadasirl (92681756). <class 'merakicommons.container.SearchError'> -1 Currently 60 players in database. Currently 70 players in database. Currently 80 players in database. Currently 90 players in database. Currently 100 players in database. Currently 110 players in database. Currently 120 players in database. Currently 130 players in database. Currently 140 players in database. ERROR while processing player: Evanisugly (92300802). <class 'merakicommons.container.SearchError'> -1 Currently 150 players in database. Currently 160 players in database. Currently 170 players in database. Currently 180 players in database. Currently 190 players in database. Currently 200 players in database. Currently 210 players in database. Currently 220 players in database. Currently 230 players in database. Currently 240 players in database. Currently 250 players in database. Currently 260 players in database. ERROR while processing player: Platinum Feed (93782806). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 500: "Internal server error" ERROR while processing player: ninaa1562 (93782025). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 500: "Internal server error" Currently 270 players in database. Currently 280 players in database. ERROR while processing player: Olion09 (93869427). <class 'merakicommons.container.SearchError'> -1 Currently 290 players in database. Currently 300 players in database. Currently 310 players in database. Currently 320 players in database. ERROR while processing player: behnam1234 (93819607). <class 'merakicommons.container.SearchError'> -1 Currently 330 players in database. ERROR while processing player: DeepShadow11 (93690000). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" Currently 340 players in database. Currently 350 players in database. Problem checking if candidate player. <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 500: "Internal server error" Currently 360 players in database. Currently 370 players in database. Currently 380 players in database. Currently 390 players in database. Currently 400 players in database. Currently 410 players in database. Currently 420 players in database. Currently 430 players in database. ERROR while processing player: DeezNutz209 (93802265). <class 'merakicommons.container.SearchError'> -1 Currently 440 players in database. Currently 450 players in database. ERROR while processing player: supermarto (93642100). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" ERROR while processing player: GaZ3rN185 (93612133). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" Currently 460 players in database. Currently 470 players in database. Currently 480 players in database. Currently 490 players in database. Currently 500 players in database. Currently 510 players in database. Problem checking if candidate player. <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 500: "Internal server error" Currently 520 players in database. Currently 530 players in database. Currently 540 players in database. Currently 550 players in database. ERROR while processing player: Sslasherr (93649850). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 500: "Internal server error" Currently 560 players in database. ERROR while processing player: FucciSlot1 (93289688). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" ERROR while processing player: ThePugLord95 (93340465). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" Currently 570 players in database. ERROR while processing player: JCaulley7 (93311088). <class 'merakicommons.container.SearchError'> -1 Currently 580 players in database. Currently 590 players in database. Currently 600 players in database. Currently 610 players in database. Currently 620 players in database. Currently 630 players in database. Currently 640 players in database. Currently 650 players in database. Currently 660 players in database. Currently 670 players in database. Currently 680 players in database. Currently 690 players in database. Currently 700 players in database. Currently 710 players in database. Currently 720 players in database. Currently 730 players in database. Currently 740 players in database. Currently 750 players in database. Currently 760 players in database. Currently 770 players in database. Currently 780 players in database. Currently 790 players in database. Currently 800 players in database. Currently 810 players in database. Currently 820 players in database. Currently 830 players in database. Currently 840 players in database. Currently 850 players in database. ERROR while processing player: NabeogreA (93660604). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" ERROR while processing player: FauxThunder7603 (93760271). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" Currently 860 players in database. Currently 870 players in database. Currently 880 players in database. Currently 890 players in database. Currently 900 players in database. Currently 910 players in database. Currently 920 players in database. Currently 930 players in database. Currently 940 players in database. Currently 950 players in database. Currently 960 players in database. Currently 970 players in database. Currently 980 players in database. Currently 990 players in database. ERROR while processing player: FauacakLoL (93802499). <class 'merakicommons.container.SearchError'> -1 Currently 1000 players in database. Currently 1010 players in database. Currently 1020 players in database. Currently 1030 players in database. Currently 1040 players in database. Currently 1050 players in database. Currently 1060 players in database. Currently 1070 players in database. Currently 1080 players in database. Currently 1090 players in database. Currently 1100 players in database. Currently 1110 players in database. ERROR while processing player: TaraNoodlez (93839565). <class 'merakicommons.container.SearchError'> -1 Currently 1120 players in database. Currently 1130 players in database. Currently 1140 players in database. Currently 1150 players in database. Currently 1160 players in database. Currently 1170 players in database. Currently 1180 players in database. Currently 1190 players in database. ERROR while processing player: BenDurDonDat (93060028). <class 'merakicommons.container.SearchError'> -1 Currently 1200 players in database. Currently 1210 players in database. Currently 1220 players in database. ERROR while processing player: BigDaddyMeats (92110852). <class 'merakicommons.container.SearchError'> -1 Currently 1230 players in database. Currently 1240 players in database. Currently 1250 players in database. ERROR while processing player: sindysus (93350379). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" ERROR while processing player: CorporalChemDawg (93029816). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" ERROR while processing player: LilninjaKilla619 (93230852). <class 'cassiopeia.datastores.riotapi.common.APIError'> The Riot API experienced an internal error on the request. You may want to retry the request after a short wait or continue without the result. The received error was 503: "Service unavailable" Currently 1260 players in database. DONE! Players that were considered for database = 15227 Players that were added to database = 1265 Players denied b/c of level cap = 13796 Players denied b/c account too young = 47 Players denied b/c account too old = 119 Wall time: 19h 36s
# some quick checks
below_level_3_count = 0
level_3_count = 0
above_level_3_count = 0
for id in seed_list8:
summoner = Summoner(id=id, region="NA")
if summoner.level < 3:
below_level_3_count += 1
elif summoner.level == 3:
level_3_count += 1
elif summoner.level > 3:
above_level_3_count += 1
print("NUMBER OF PLAYERS BELOW LEVEL 3 = {}".format(below_level_3_count))
print("NUMBER OF PLAYERS AT LEVEL 3 = {}".format(level_3_count))
print("NUMBER OF PLAYERS ABOVE LEVEL 3 = {}".format(above_level_3_count))
NUMBER OF PLAYERS BELOW LEVEL 3 = 335 NUMBER OF PLAYERS AT LEVEL 3 = 253 NUMBER OF PLAYERS ABOVE LEVEL 3 = 677
master_df, summoners_in_db = end_of_round_housekeeping(master_db = master_df,
round_db = game_data_list9,
master_id_list = summoners_in_db,
round_list = seed_list9)
Terrific! With this new round of data collection we've almost doubled the size of our previous dataset. Now we'll go send it through cleaning and see how it does on our models.