Closed joaomcalves closed 2 months ago
See https://github.com/ML-KULeuven/soccer_xg/tree/master/soccer_xg/models. The README explains how you can load them.
Thanks @probberechts! I should have read it more carefully.
Sorry for bothering you again @probberechts ..
Is there an easy way to compute the xg when having a df in the spadl_format? I am downloading data from whoscored using soccerdata package.
I was trying something like:
xg_model = XGModel.load_model('openplay_xgboost_advanced') xg_model.estimate(spadl_df)
But it seems that it is only prepared for DataAPI objects
I am trying to use the repos that you created to have a rating like whoscored or flashscore has and I am trying to have something as complete as possible.
The input of the estimate
function can also be a dataframe with features. You can use this function to compute the features for a single game: https://github.com/ML-KULeuven/soccer_xg/blob/b9489d929e0fa34771267d429256366d0fda27ad/soccer_xg/xg.py#L601
Thanks @probberechts for being always so helpful!
Hi @probberechts , you mentioned in a previous issue that there are pretrained xG models. I was trying to find one but wasn't able. Do you have any link from where I can download a pretrained model to apply to an event df with the spadl format.