Closed ProcuratorTitan closed 1 month ago
My guess is that using a VPN that masks your IP as a greek one would provide access to the website, thus making the script work.
If this is not possible the script continues and produces the figures without including the bookmaker data. I would help anyone willing to make a web-scraper for their county's bookmaker in order to support the existing pipeline. I would also listen to any other suggestions!
the program does not work if it does not have the quotas, making predictions I remain stuck at 09/15/2024 it does not go forward so I assume that the VPN is needed
Can you please paste the error?
@MacBook-Pro-di EuropeanFootballLeaguePredictor % /Users/Downloads/aaa/bin/py thon /Users/Downloads/aaa/ciro/ciro/EuropeanFootballLeaguePredictor/run_predictions.py 2024-09-30 13:52:59.449 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:38 - Successfully loaded the config.yaml 2024-09-30 13:52:59.452 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/Serie_A/dictionaries/bookmaker.yaml 2024-09-30 13:52:59.453 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/Serie_A/dictionaries/data_co_uk.yaml 2024-09-30 13:52:59.457 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/Serie_A/dictionaries/fixture_download.yaml 2024-09-30 13:52:59.458 | INFO | main:main:37 - Configuration(league='Serie_A', regressor=<class 'sklearn.linear_model._glm.glm.PoissonRegressor'>, bettor_bank=60, bettor_kelly_cap=0.05, evaluation_output='europeanfootballleaguepredictor/data/leagues/Serie_A/evaluation/', months_of_form_list=[None, 3], database='europeanfootballleaguepredictor/data/database/Serie_A_database.db', seasons_to_gather=['2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'], current_season='2024', data_co_uk_path='europeanfootballleaguepredictor/data/leagues/Serie_A/DataCoUkFiles/', bookmaker_url='https://en.stoiximan.gr/sport/soccer/italy/serie-a/1635/', bookmaker_dictionary={'US Lecce': 'Lecce', 'AC Milan': 'AC Milan', 'Juventus FC': 'Juventus', 'Cagliari Calcio': 'Cagliari', 'AC Monza': 'Monza', 'Torino FC': 'Torino', 'SSC Napoli': 'Napoli', 'Empoli FC': 'Empoli', 'Udinese Calcio': 'Udinese', 'Atalanta': 'Atalanta', 'AC Fiorentina': 'Fiorentina', 'Bologna FC': 'Bologna', 'SS Lazio': 'Lazio', 'AS Roma': 'Roma', 'Inter Milan': 'Inter', 'Frosinone': 'Frosinone', 'US Salernitana 1919': 'Salernitana', 'US Sassuolo Calcio': 'Sassuolo', 'Genoa CFC': 'Genoa', 'Hellas Verona': 'Verona'}, data_co_uk_url='https://www.football-data.co.uk/mmz4281/2425/I1.csv', data_co_uk_dictionary={'Milan': 'AC Milan', 'Spal': 'SPAL 2013', 'Parma': 'Parma Calcio 1913'}, fixture_download_url='https://fixturedownload.com/download/serie-a-2024-UTC.csv', fixture_download_dictionary={'Empoli': 'Empoli', 'Frosinone': 'Frosinone', 'Genoa': 'Genoa', 'Inter': 'Inter', 'Roma': 'Roma', 'Sassuolo': 'Sassuolo', 'Lecce': 'Lecce', 'Udinese': 'Udinese', 'Torino': 'Torino', 'Bologna': 'Bologna', 'Monza': 'Monza', 'Milan': 'AC Milan', 'Hellas Verona': 'Verona', 'Fiorentina': 'Fiorentina', 'Juventus': 'Juventus', 'Lazio': 'Lazio', 'Napoli': 'Napoli', 'Salernitana': 'Salernitana', 'Cagliari': 'Cagliari', 'Atalanta': 'Atalanta'}, voting_dict={'long_term': 0.6, 'short_term': 0.4}, matchdays_to_drop=10) 2024-09-30 13:52:59.528 | INFO | europeanfootballleaguepredictor.data.database_handler:get_data:50 - Data fetched for table: Preprocessed_ShortTermForm 2024-09-30 13:52:59.586 | INFO | europeanfootballleaguepredictor.data.database_handler:get_data:50 - Data fetched for table: Preprocessed_LongTermForm 2024-09-30 13:52:59.590 | INFO | europeanfootballleaguepredictor.data.database_handler:get_data:50 - Data fetched for table: Preprocessed_UpcomingShortTerm 2024-09-30 13:52:59.595 | INFO | europeanfootballleaguepredictor.data.database_handler:get_data:50 - Data fetched for table: Preprocessed_UpcomingLongTerm 2024-09-30 13:53:00.028 | INFO | main:main:48 - Match_id Date HomeTeam ... Under1.5Probability GGProbability NGProbability 0 07f0ba49-a096-5240-a0ce-7261eb836eed 15/09/2024 Atalanta ... 0.22 0.57 0.43 1 78b38eb0-570a-5964-b75b-51b0d983f733 15/09/2024 Monza ... 0.34 0.44 0.56 2 b4497a07-8072-5d45-ab62-ef70afc48f2c 15/09/2024 Empoli ... 0.35 0.41 0.59 3 12c712c6-88b5-591a-b288-599eecec3d9b 15/09/2024 Torino ... 0.24 0.51 0.49 4 691bde2a-40bb-56f8-8a4e-9bf6c622a9d7 15/09/2024 Cagliari ... 0.24 0.56 0.44 5 05ba4bbe-f87a-510c-9479-97856f159581 15/09/2024 Genoa ... 0.34 0.45 0.55 6 3dc6c8fb-5910-52cd-86ce-ca3c251e319e 15/09/2024 Lazio ... 0.30 0.45 0.55
[7 rows x 26 columns] Index(['Match_id', 'Date', 'HomeTeam', 'AwayTeam', 'HomeWinOdds', 'DrawOdds', 'AwayWinOdds', 'Line', 'OverLineOdds', 'UnderLineOdds', 'Yes', 'No', 'ScorelineProbability', 'HomeWinProbability', 'DrawProbability', 'AwayWinProbability', 'Over2.5Probability', 'Under2.5Probability', 'Over3.5Probability', 'Under3.5Probability', 'Over4.5Probability', 'Under4.5Probability', 'Over1.5Probability', 'Under1.5Probability', 'GGProbability', 'NGProbability'], dtype='object')it's not a mistake he doesn't go forward in the dates as the prediction always remains at 09/15
I have examined the above and it seems to work as expected. I explain below the steps you should take:
Run the updates script to gather the upcoming matches and update teams' statistics:
python run_updates.py
Run the predictions script to predict the now updated upcoming matches:
python run_predictions.py
The prediction figure and table for the league specified in the configuration file should be updated with the upcoming match predictions.
Please follow the above steps and let me know!
MBP-di EuropeanFootballLeaguePredictor % /Users/Downloads/aaa/bin/python /Users/Downl
oads/aaa/EuropeanFootballLeaguePredictor/run_updates.py
2024-10-03 05:51:45.647 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:38 - Successfully loaded the config.yaml
2024-10-03 05:51:45.650 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/Serie_A/dictionaries/bookmaker.yaml
2024-10-03 05:51:45.651 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/Serie_A/dictionaries/data_co_uk.yaml
2024-10-03 05:51:45.661 | SUCCESS | europeanfootballleaguepredictor.common.config_parser:load_and_extract_yaml_section:47 - Successfully loaded europeanfootballleaguepredictor/data/leagues/Serie_A/dictionaries/fixture_download.yaml
2024-10-03 05:51:45.664 | INFO | main:main:35 - Configuration(league='Serie_A', regressor=<class 'sklearn.linear_model._glm.glm.PoissonRegressor'>, bettor_bank=60, bettor_kelly_cap=0.05, evaluation_output='europeanfootballleaguepredictor/data/leagues/Serie_A/evaluation/', months_of_form_list=[None, 3], database='europeanfootballleaguepredictor/data/database/Serie_A_database.db', seasons_to_gather=['2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024'], current_season='2024', data_co_uk_path='europeanfootballleaguepredictor/data/leagues/Serie_A/DataCoUkFiles/', bookmaker_url='https://en.stoiximan.gr/sport/soccer/italy/serie-a/1635/', bookmaker_dictionary={'US Lecce': 'Lecce', 'AC Milan': 'AC Milan', 'Juventus FC': 'Juventus', 'Cagliari Calcio': 'Cagliari', 'AC Monza': 'Monza', 'Torino FC': 'Torino', 'SSC Napoli': 'Napoli', 'Empoli FC': 'Empoli', 'Udinese Calcio': 'Udinese', 'Atalanta': 'Atalanta', 'AC Fiorentina': 'Fiorentina', 'Bologna FC': 'Bologna', 'SS Lazio': 'Lazio', 'AS Roma': 'Roma', 'Inter Milan': 'Inter', 'Frosinone': 'Frosinone', 'US Salernitana 1919': 'Salernitana', 'US Sassuolo Calcio': 'Sassuolo', 'Genoa CFC': 'Genoa', 'Hellas Verona': 'Verona'}, data_co_uk_url='https://www.football-data.co.uk/mmz4281/2425/I1.csv', data_co_uk_dictionary={'Milan': 'AC Milan', 'Spal': 'SPAL 2013', 'Parma': 'Parma Calcio 1913'}, fixture_download_url='https://fixturedownload.com/download/serie-a-2024-UTC.csv', fixture_download_dictionary={'Empoli': 'Empoli', 'Frosinone': 'Frosinone', 'Genoa': 'Genoa', 'Inter': 'Inter', 'Roma': 'Roma', 'Sassuolo': 'Sassuolo', 'Lecce': 'Lecce', 'Udinese': 'Udinese', 'Torino': 'Torino', 'Bologna': 'Bologna', 'Monza': 'Monza', 'Milan': 'AC Milan', 'Hellas Verona': 'Verona', 'Fiorentina': 'Fiorentina', 'Juventus': 'Juventus', 'Lazio': 'Lazio', 'Napoli': 'Napoli', 'Salernitana': 'Salernitana', 'Cagliari': 'Cagliari', 'Atalanta': 'Atalanta'}, voting_dict={'long_term': 0.6, 'short_term': 0.4}, matchdays_to_drop=10)
Traceback (most recent call last):
File "/Users/Downloads/aaa/EuropeanFootballLeaguePredictor/run_updates.py", line 81, in
[7 rows x 26 columns] Index(['Match_id', 'Date', 'HomeTeam', 'AwayTeam', 'HomeWinOdds', 'DrawOdds', 'AwayWinOdds', 'Line', 'OverLineOdds', 'UnderLineOdds', 'Yes', 'No', 'ScorelineProbability', 'HomeWinProbability', 'DrawProbability', 'AwayWinProbability', 'Over2.5Probability', 'Under2.5Probability', 'Over3.5Probability', 'Under3.5Probability', 'Over4.5Probability', 'Under4.5Probability', 'Over1.5Probability', 'Under1.5Probability', 'GGProbability', 'NGProbability'], dtype='object') this is the python file run_predictions.py anyway you did a great job, honor to you
The limitations of the en.stoiximan.gr website are too great, and it requires a Greek address. You might consider switching to www.soccer-rating.com instead. :)
@ProcuratorTitan I have updated the script as it seemed to be catching a browser version issue. I think following these steps will fix the problem:
Pull the changes:
git pull
Run updates:
python run_updates.py
Run predictions:
python run_predictions.py
Please let me know if it is fixed, as I think this was the issue.
do I download the entire master file again?
If you: git pull
it should be fine.
If you want to make sure you can do it from scratch.
If it still does not update you can refer in #81 an issue with the upcoming matches not updating. But this is separate of scraping the bookmaker. The upcoming matches should update anyways.
if you are not connected in greece https://en.stoiximan.gr/sport/soccer/ this site does not work how can it be solved?