0
$\begingroup$

I want to predict if there will be a goal in the next 10 minutes of a football game given current match stats. The dataset is unbalanced so I tried to undersample the most popular class with RandomUnderSampler().

Code

pipe = make_pipeline(StandardScaler(), RandomUnderSampler(), SVC())
scores = cross_validate(pipe,
                        X_train, y_train, cv=10,
                        scoring=('roc_auc', 'average_precision'), return_train_score=True)

scores['test_roc_auc'].mean()
0.5136772983613753
scores['test_average_precision'].mean()
0.27482998332620007

pipe.fit(X_train, y_train)
plot_roc_curve(pipe, X_test, y_test)

enter image description here

Every match has different minutes so for each match I have stats for 15,25,35,45,55,65,75,85 minute, this correlation may create problems to the model? Is this model something reliable, if not how can I improve it? Is this approach good or should I consider another one?

$\endgroup$
3
  • $\begingroup$ Welcome to DataScienceSE. Your model doesn't predict better than chance, and this is expected: why do you think that the current score could help predict a goal in the next 10 minutes? If you know a score during a game, can you know whether there will be a goal soon? Probably not, and ML cannot do any magic. $\endgroup$
    – Erwan
    Sep 22 at 15:31
  • $\begingroup$ @Erwan Thanks for your reply. I also use relevant stats as features, like shots, corners, attacks etc., to try predict if will be or not a goal. $\endgroup$
    – luka
    Sep 22 at 16:49
  • $\begingroup$ ok but even with this it will very hard to predict what you want: can a football expert who knows all this info predict a goal? No, because a lot depends on chance and other hidden factors. It's like trying to predict the lottery number, no input information can help. $\endgroup$
    – Erwan
    Sep 23 at 9:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy