How to Build An Expected Goals Model 1: Data and Model

Поділитися
Вставка
  • Опубліковано 11 вер 2024

КОМЕНТАРІ • 35

  • @dhirajjoshi9996
    @dhirajjoshi9996 3 роки тому +5

    Thank you so much, I love your videos especially with the explained code in python - it helps me learn python too and apply it in a way that I find interesting

  • @olumidebenjami4
    @olumidebenjami4 4 роки тому +10

    My question is, how do I get event and tracking of previous week's matches to analyse

  • @nicolasmassa8146
    @nicolasmassa8146 4 місяці тому

    Awesome videos!!

  • @aperipateticpt113
    @aperipateticpt113 3 роки тому +1

    I'm enjoying your presentations as a supplement to the book. Have you considered showing standard errors or a confidence interval around the points on the plots that relate theta and distance to the probability of a goal? I ask because that one outlier point you keep pointing out would clearly have a much larger SE and therefore CI which would show the problem of having a small amount of data in that range on the model.

  • @akypar
    @akypar 4 роки тому +6

    Could this weird phenomenon regarding lack of data/shots on the edge of the box be related to some sort of cognitive trend of the player to either shoot when they realise they're just about to enter the box, or conversely when they are on the edge to try and make an extra step to better their chances (a completely intuitive /subconscious decision, totally unrelated to data-driven information discussed here)? Or, to make it even wilder, could it be related to the sunconsciously uncomfortable situation for many adults when 'stepping on cracks'? These are wild guesses of course and obviously the most prominent reason to investigate would be coding-related ..

    • @ivoxozo3711
      @ivoxozo3711 3 роки тому

      @Antonio (Alfa Data) I agree 100% with your idea

  • @adamsequeira7124
    @adamsequeira7124 3 роки тому

    Awesome explanation

  • @4lex355
    @4lex355 3 роки тому

    i would say that the data error is not data error, but psychological effect of shot inside the Big Area. Additional, there in more shots in the semi circle, so it gives an hint about my assumption.

  • @spadron04
    @spadron04 3 місяці тому

    Hi! nice video. I'm having problems to import the data in json file it seems that needs to be payed. by any where can I see the data structure to see if I can build it? or any other source?

  • @renterio95
    @renterio95 2 роки тому +1

    Can you explain how you came up with a^2=x^2+(y-b/2)^2?

  • @MrGonzo-lh9bo
    @MrGonzo-lh9bo 3 роки тому +3

    Where can i find the data?

  • @viniciusmelo2907
    @viniciusmelo2907 4 роки тому +2

    Had you ever tried to calculate the opportunity conversions in this probability?
    For example: Accurated Passes -> KeyPasses -> Assists (or Accurated shots) -> Goals
    Then you could see a kind of "weighted" goals shots. So when the FW misses a shot in the small area it is a bad cross (or he could not even touch the ball) and shots off the box are just shots caused by the lack of options. Anything like that.

  • @trumanspring471
    @trumanspring471 Рік тому +1

    When you say x and y coordinates where is your origin, is it the center of the goal? If so you would have zero as your x coordinate when you are in line with the center of the goal and that makes your function go to zero even though the angle is not zero.

    • @danielgranjaconejeros6355
      @danielgranjaconejeros6355 7 місяців тому

      Im doing some math on this to try to figure it out but haven't just yet. Could you solve the reference plane for x,y?

    • @danielgranjaconejeros6355
      @danielgranjaconejeros6355 7 місяців тому

      ok got it. Wanna leave it here because it took me so damn long:
      x -> If the player is shooting to the goal on the right, this is distance on the x axis from left to right.
      y- > the distance to the shooting position on the y axis (from top to bottom)
      In my case the pitch is 120m long and 80m wide (Statsbomb convention) but will use
      PL for Pitch Length
      PW for Pitch Width
      And also remember the video is defining the goal width as b=7.32, so will use b in the formula.
      Under these definitions, the x,y coordinates the formula is using will be called capital X and capital Y:
      X = PL - x
      Y = PW/2 + b/2 - y
      These X and Y can be plugged in the formula on the video and will give you the shooting angle. If the angles are between 0 and 1 most likely you are getting them on radians so be sure to use numpy's np.rad2deg just to see nice understandable angle quantities like 20, 40 or 60 degrees. To confirm you are doing it right: a penalty shot should be 31.38 degrees approx.
      EDIT: FFS, my formula for Y is wrong since the video's reference point is the centre of the goal. I was using the opposite post to create a proper triangle. Well, the formula on the video works when:
      Y = PW/2 - y
      So I correct my previous comment since a penalty shot SHOULD ACTUALLY BE 33.92 degrees. Confirmed using a right triangle calculation for a shot from the penalty spot.

    • @danielgranjaconejeros6355
      @danielgranjaconejeros6355 7 місяців тому

      Plugging a shot exactly from the goal line (X=0) would be an edge case. You could replace a shot from the goal line as X=0.0001 lets say, so the function gives you approx 90 degrees.
      EDIT: This should give 180 degrees not 90.

    • @danielgranjaconejeros6355
      @danielgranjaconejeros6355 7 місяців тому

      EDIT: FFS, my formula for Y is wrong since the video's reference point is the centre of the goal. I was using the opposite post to create a proper triangle. Well, the formula on the video works when:
      Y = PW/2 - y
      So I correct my previous comment since a penalty shot SHOULD ACTUALLY BE 33.92 degrees. Confirmed using a right triangle calculation for a shot from the penalty spot.

  • @paulgehrhardt8815
    @paulgehrhardt8815 3 роки тому

    Hello, How can I install FCPython in Spyder ? I got this Error: "No module named 'FCPython'".
    both .py scripts are in the same directory, but i cant import FC Python. What can I do ?

  • @martinoa1467
    @martinoa1467 Рік тому

    I have only watched up to the 15th minute so maybe this gets solved later but I have a doubt.
    Shots from inside the penalty area are obviously preferrable considering Xgs. First consequence should be that we all only try to shot from inside the box. At that point defences would probably cope with that better, decreasing the Xgs for shots inside the penalty area. So maybe outside shooters are sometimes part of the reason for goals scored inside the box. Correlations get very tricky

  • @jacklovell5266
    @jacklovell5266 Рік тому

    I am unable to get the data from the link provided

  • @ardsluis2646
    @ardsluis2646 3 роки тому

    The issue with angles is that you are approaching this as every attempt is a straight shot. A leftfooted player shooting from the right needs a much smaller angle for his shot to curve into the far corner (think Arjen Robben) as opposed to a leftie shooting from the left. The probability to score if you want to put a value to it, should be much higher. Then if you were to play 4-3-3 with opposite wingers, you still need the wingback to overlap for this move to be more statistically successful.

    • @jikkh2x
      @jikkh2x 3 роки тому +2

      If looking at a single variable in isolation you should just see it as a percentage rather than a probability. The data says X percent of shots from Y angle are goals. It would be foolish to say that that alone gives you an accurate probability. But the idea behind a model is that the more variables you include the more the percentage provides an accurate probability. So, maybe what you mentioned; the player’s stronger foot, should be a variable that is added to the model.

  • @DanielGonzalez-xr1cp
    @DanielGonzalez-xr1cp 3 роки тому +1

    Hi! Does somebody know how to install FCPyhthon?

    • @PokerSpinMaster
      @PokerSpinMaster 3 роки тому

      I got the same problem...maybe you found a solution?

    • @DanielGonzalez-xr1cp
      @DanielGonzalez-xr1cp 3 роки тому

      @@PokerSpinMaster I read with Jupiter and worked.. it doesn´t works with spyder. (for me)

    • @bangkit5097
      @bangkit5097 2 роки тому

      @@DanielGonzalez-xr1cp could you explain more about this? I've the same problem here. Already try to find some resources on the internet but couldn't find it

  • @sathishprasad8365
    @sathishprasad8365 4 роки тому

    Anyone else facing error when loading the json file? "jsondecodeerror: expecting value: line 1 column 1 (char 0)". Please help me. Thanks in advance.

  • @alexdubois4920
    @alexdubois4920 Рік тому +1

    IB math IA 😁

    • @theostorey7929
      @theostorey7929 Рік тому

      same bro mail me and ill share my document with you so we can share ideas.

  • @felipefermamdes
    @felipefermamdes 2 роки тому

    Hey David, I'm really sorry about Tobias :(

  • @4lex355
    @4lex355 3 роки тому +1

    i think you guys should not use all the data but sample for the type of teams you applying off. A probability of scoring is not the same for barcelona and Granada in the same position.