Predicting the Winning Team with Machine Learning

Can we predict the outcome of a football game given a dataset of past games? That’s the question that we’ll answer in this episode by using the scikit-learn machine learning library as our predictive tool.

Code for this video:

Please Subscribe! And like. And comment.

More learning resources:

Join us in the Wizards Slack channel:

And please support me on Patreon:


  1. shivam singhal says:

    Hey guys use tpot library for hyper parameters and model selection through genetic algorithms.

  2. Toussaint Behaghel says:

    Hi Siraj, at 27:36 when u show the performance of the best estimator u got out of grid search, the accuracy on your training set is far worse than the one on your testing set. That seems weird, can you explain it? Thanks for your vids, they’re great!

  3. Ammar Malik says:

    This is one of the topics that always intrigued me. Please do make further videos related to Sports Analytics 🙂 and thanks for this one by the way 🙂

  4. MalSatori says:

    SVC was the best classifier for a set of data that I used. Can anyone point me in the direction of a resource I can use to tune the hyperparameters it uses?

  5. jj olla says:

    Is LogisticRegression the only method that outputs probabilities? How can I use XGBoost to output the prob of the selection being correct?

  6. Himujjal Upadhyaya says:

    Siraj, I appreciate your effort. But this is Barclays Premier League, where teams like Leicester City wins the title. You can’t predict anything. Yeah, the algorithm proves quite useful.

  7. billel says:

    Lol predicting the result of a game based on the actual stats of the
    game… Of course that you’re getting a model that accurate.

  8. Belisario Montesinos says:

    Arsenal will finish below 4th place and I don’t need machine learning for this educated guess.

  9. MrDonald911 says:

    Siraj I have a question related to this kind of problems, can we build an adversarial neural network like the following :

    A F
    X Y
    B O E
    X Y
    C D

    A,B, and C would be the last 3 scores of Team1, F, E, and D would be the last 3 cores of Team 2, and O would be the output ( -1 , 0 or 1 ). Neurons X and Y are in hidden layers. Would it be worth the trying ? Also, what are machine learning frameworks which allow the creation of custom neural networks ? Thanks :p

  10. F LB says:

    Google did the same thing in the 2014 world cup. I’m pretty sure their code is on Github.

    Also, carry on with this Siraj, love it!

  11. John Whitmore says:

    Whilst this is a very interesting topic I’m not sure making any money out of it is possible. Big companies with big budgets, and computers to match, are already predicting the outcomes of a match in order to assign odds. As money is placed on the match those odds will change accordingly. The best you can hope for is to generate the predicted probability distribution which confirms the book maker’s odds. I do hope I’m wrong about that!

Comments are closed.