MauroAndretta / AIFootballPredictions

AIFootballPredictions is an ML-based system to predict if a football match will have over 2.5 goals. Using historical data from top European leagues (Serie A, EPL, Bundesliga, La Liga, Ligue 1), it employs advanced feature engineering and model training techniques to provide accurate predictions. Perfect for sports analytics enthusiasts.
https://t.me/AISoccercast
BSD 3-Clause "New" or "Revised" License
11 stars 2 forks source link

Handle Ambiguity in Matchday Retrieval #3

Open MauroAndretta opened 1 month ago

MauroAndretta commented 1 month ago

Currently, the acquire_next_matches.py script fetches the next matchday data based on the current matchday provided by the API. However, the behavior of the script is ambiguous depending on the day and time it is executed:

This inconsistency can lead to confusion and incorrect predictions.

Expected Behavior

The script should consistently fetch the upcoming matches, regardless of whether some matches in the current matchday have already been played. The user should be able to configure whether they want to:

Proposed Solution

  1. Add a Configuration Option: Introduce a flag or parameter (e.g., --include-ongoing-matches) that allows the user to specify whether they want to include ongoing matches from the current matchday or skip to the next matchday.

  2. Implement Logic Based on the Configuration:

    • If --include-ongoing-matches is set to True, include the remaining matches of the current matchday.
    • If --include-ongoing-matches is set to False, check if any matches have already been played in the current matchday. If they have, skip to the next matchday.
  3. Improve Matchday Management: Implement a robust method to handle matchdays, ensuring that the script correctly identifies the upcoming matches based on the user's preference.

Steps to Reproduce

  1. Execute the acquire_next_matches.py script during a matchday when some matches have already been played.
  2. Observe that the script fetches the remaining matches of the current matchday as the "next matches".
  3. Execute the script before any matches of a matchday have started.
  4. Observe that the script correctly identifies all matches of the current matchday as the "next matches".
MauroAndretta commented 3 weeks ago

Added logic to predict only matches that need to be played. Using a check with the current date in which the script is executed and the date time of the match.