American-Soccer-Analysis/itscalledsoccer

[Feature Request]: Goals+ By Game

Closed this issue · 2 comments

What feature would you like to see?

Similar to how we can use get_team_xgoals() to pull xgoal data by team, season, and game, it would be awesome to see goals+ split out by those same fields.

I think it would be helpful for overall analysis- I'm working on building out a prediction model currently based on xgoals and would love to see if goals+ would improve accuracy or any underlying metrics.

No worries on time especially with the season ending somewhat soon - goals+ is a wishlist metric and thought I would at least ask! Thanks again for the great work on this package and overall data

bgrnwd commented

Hey @nielsenz, sorry it's taken so long to respond to this. This would be a great feature to have but we'd most likely have to implement this on the API first and then propagate it to itscalledsoccer. We'll add it to our backlog and let you know when it's available

bgrnwd commented

@nielsenz Actually, we do have this available already for player and goalkeeper goals added. You just need to specify the split_by_games argument like so:

from itscalledsoccer.client import AmericanSoccerAnalysis

asa_client = AmericanSoccerAnalysis()
goals_added_by_game = asa_client.get_player_goals_added(league="mls", season_name="2023", split_by_games=True)