Skip to content

Player recommender#4

Merged
ritvikiscool9 merged 12 commits into
mainfrom
Player-Recommender
Dec 21, 2025
Merged

Player recommender#4
ritvikiscool9 merged 12 commits into
mainfrom
Player-Recommender

Conversation

@ritvikiscool9

Copy link
Copy Markdown
Owner

This branch contains the logic to predict the players for the upcoming game week.

@ritvikiscool9 ritvikiscool9 requested a review from Copilot November 7, 2025 00:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements a comprehensive FPL (Fantasy Premier League) AI system with complete database management, real player data integration, and optimized performance. The PR adds new database management scripts, an AI-powered team builder, and significantly improves data loading efficiency.

Key Changes

  • Database management system: New unified refresh system with 730x performance improvement, pagination support, and comprehensive verification tools
  • AI team builder: Complete implementation of FPL squad optimization using ML predictions with budget constraints and position requirements
  • Real data integration: Player performance data for 10 gameweeks (7,302 records), current pricing, and player names

Reviewed Changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/test_real_players.py New AI-powered FPL team builder with squad optimization and formation recommendations
src/fpl/player_recommender.py Player recommendation engine with ML predictions and hardcoded premium player bonuses
src/database/database_refresh.py Unified database refresh system consolidating multiple data sources
src/database/fast_performance_refresh.py Optimized performance data loader with batch processing
src/database/update_player_prices.py Current player price and ownership updater from FPL API
src/database/export_complete_data.py Data export utility with pagination support
src/database/verify_*.py Multiple verification and analysis scripts
src/database/check_*.py Database health check utilities
src/database/README.md Documentation for database management scripts
src/ai/data_loader.py Enhanced data loader with pagination and current pricing integration
src/ai/point_predictor.py Minor logging update
database_manager.py CLI utility for database operations
README.md Updated project documentation
.gitignore Added CSV file exclusion
Comments suppressed due to low confidence (1)

src/test_real_players.py:1

  • [nitpick] Filtering by ownership percentage >= 1.0 could exclude viable budget options that are legitimately good value but not yet popular. This creates a popularity bias where the system can't discover undervalued differentials. Consider making this threshold configurable or using it as a soft preference (sorting factor) rather than a hard filter, especially for budget picks in positions where requirements aren't yet met.
import sys

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fpl/player_recommender.py Outdated
Comment thread src/fpl/player_recommender.py Outdated
Comment thread src/test_real_players.py Outdated
Comment on lines +139 to +167
# Define proven premium FPL assets by name (manual override for quality)
premium_assets = {
"Haaland",
"Salah",
"M.Salah",
"Palmer",
"Saka",
"Son",
"Kane",
"Mbappé",
"De Bruyne",
"Rashford",
"Bruno Fernandes",
"Alexander-Arnold",
"Van Dijk",
"Alisson",
"Ederson",
"Raya",
"Pickford",
"Walker",
"Dias",
"Stones",
"Robertson",
"Cancelo",
"Shaw",
"James",
"Chilwell",
"Trippier",
}

Copilot AI Nov 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates the premium player list from player_recommender.py (lines 94-111) with slightly different names. The duplication creates maintenance problems - updates must be made in multiple places. Consider extracting this to a shared configuration module or importing from a single source. Also note that some players like 'Mbappé', 'Cancelo' are unlikely to be in the Premier League, suggesting the list needs validation.

Suggested change
# Define proven premium FPL assets by name (manual override for quality)
premium_assets = {
"Haaland",
"Salah",
"M.Salah",
"Palmer",
"Saka",
"Son",
"Kane",
"Mbappé",
"De Bruyne",
"Rashford",
"Bruno Fernandes",
"Alexander-Arnold",
"Van Dijk",
"Alisson",
"Ederson",
"Raya",
"Pickford",
"Walker",
"Dias",
"Stones",
"Robertson",
"Cancelo",
"Shaw",
"James",
"Chilwell",
"Trippier",
}
# Import proven premium FPL assets from shared configuration
from src.fpl.premium_players import premium_assets

Copilot uses AI. Check for mistakes.
Comment thread src/database/database_refresh.py Outdated
Comment thread src/database/fast_performance_refresh.py
Comment thread src/database/fast_performance_refresh.py
Comment thread src/database/fast_performance_refresh.py
Comment thread src/fpl/player_recommender.py
Comment thread src/test_real_players.py
Comment thread src/database/update_player_prices.py
@ritvikiscool9 ritvikiscool9 merged commit 538377f into main Dec 21, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants