PySport / kloppy

kloppy: standardizing soccer tracking- and event data
https://kloppy.pysport.org
BSD 3-Clause "New" or "Revised" License
328 stars 55 forks source link

Create OWN_TEAM Orientation #253

Open DriesDeprest opened 7 months ago

DriesDeprest commented 7 months ago

I was thinking about adding support for an OWN_TEAM Orientation which in the case for an EventDataset would behave the same as the ACTION_EXECUTING_TEAM Orientation, but in the case of a TrackingDataset it would orient the coordinates of each player with respect to its own side. Implying that e.g. both goalkeepers would have a starting position of +- (0, 50).

What do you think @koenvo @JanVanHaaren ?

koenvo commented 7 months ago

Sounds interesting. I'm planning to merge https://github.com/PySport/kloppy/pull/190 first.

Curious what @probberechts thinks about your suggestions.

probberechts commented 7 months ago

That sounds like a valuable feature! However, I would categorize it more as a symmetry transformation rather than an orientation change. In my conceptualization, orientation transforms merely switch perspectives without altering the underlying data, similar to changing the camera angle. On the other hand, symmetry transforms modify the relationships between data points.

So maybe we should create a different kind of transformation for this. There would be two such symmetry transformations: each team plays towards the same goal, and each action starts on the right side of the pitch. Combining both could be particularly useful, for instance, when analyzing corners it is common to aggregate them at a common point, like (0,0).

JanVanHaaren commented 7 months ago

Although I don't have much experience with orientations in kloppy, I like the proposal of @probberechts.