Skip to content

Commit

Permalink
feat: add dataset abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
probberechts committed Jul 27, 2024
1 parent a9a3791 commit f704641
Show file tree
Hide file tree
Showing 80 changed files with 4,316 additions and 1,889 deletions.
33 changes: 33 additions & 0 deletions docs/api/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@
socceraction.data
=================

socceraction.data.dataset
-------------------------

.. autosummary::
:toctree: generated
:nosignatures:
:template: class.rst

~socceraction.data.dataset.HDFDataset
~socceraction.data.dataset.SQLDataset


socceraction.data.transforms
----------------------------


.. autosummary::
:toctree: generated
:nosignatures:

~socceraction.data.transforms.PlayActionsLeftToRight
~socceraction.data.transforms.PlayAtomicActionsLeftToRight
~socceraction.data.transforms.StatsBombEventsToActions
~socceraction.data.transforms.OptaEventsToActions
~socceraction.data.transforms.WyscoutEventsToActions
~socceraction.data.transforms.ActionsToFeatures
~socceraction.data.transforms.StatsBombEventsToFeatures



socceraction.data.providers
---------------------------

.. list-table::
:widths: 30 70

Expand Down
6 changes: 3 additions & 3 deletions docs/api/data_base.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _api-data-base:

socceraction.data.base
======================
socceraction.data.providers.base
================================

.. automodule:: socceraction.data

Expand All @@ -13,7 +13,7 @@ Serializers
:nosignatures:
:template: class.rst

socceraction.data.base.EventDataLoader
socceraction.data.providers.base.EventDataLoader


Schema
Expand Down
18 changes: 9 additions & 9 deletions docs/api/data_opta.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. _api-data-opta:

socceraction.data.opta
======================
socceraction.data.providers.opta
================================

.. automodule:: socceraction.data.opta
.. automodule:: socceraction.data.providers.opta

Serializers
------------
Expand All @@ -13,7 +13,7 @@ Serializers
:nosignatures:
:template: class.rst

socceraction.data.opta.OptaLoader
socceraction.data.providers.opta.OptaLoader


Schema
Expand All @@ -24,8 +24,8 @@ Schema
:nosignatures:
:template: schema.rst

socceraction.data.opta.OptaCompetitionSchema
socceraction.data.opta.OptaTeamSchema
socceraction.data.opta.OptaPlayerSchema
socceraction.data.opta.OptaGameSchema
socceraction.data.opta.OptaEventSchema
socceraction.data.providers.opta.OptaCompetitionSchema
socceraction.data.providers.opta.OptaTeamSchema
socceraction.data.providers.opta.OptaPlayerSchema
socceraction.data.providers.opta.OptaGameSchema
socceraction.data.providers.opta.OptaEventSchema
18 changes: 9 additions & 9 deletions docs/api/data_statsbomb.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. _api-data-statsbomb:

socceraction.data.statsbomb
===========================
socceraction.data.providers.statsbomb
=====================================

.. automodule:: socceraction.data.statsbomb
.. automodule:: socceraction.data.providers.statsbomb

Serializers
------------
Expand All @@ -13,7 +13,7 @@ Serializers
:nosignatures:
:template: class.rst

socceraction.data.statsbomb.StatsBombLoader
socceraction.data.providers.statsbomb.StatsBombLoader

Schema
------
Expand All @@ -23,8 +23,8 @@ Schema
:nosignatures:
:template: schema.rst

socceraction.data.statsbomb.StatsBombCompetitionSchema
socceraction.data.statsbomb.StatsBombTeamSchema
socceraction.data.statsbomb.StatsBombPlayerSchema
socceraction.data.statsbomb.StatsBombGameSchema
socceraction.data.statsbomb.StatsBombEventSchema
socceraction.data.providers.statsbomb.StatsBombCompetitionSchema
socceraction.data.providers.statsbomb.StatsBombTeamSchema
socceraction.data.providers.statsbomb.StatsBombPlayerSchema
socceraction.data.providers.statsbomb.StatsBombGameSchema
socceraction.data.providers.statsbomb.StatsBombEventSchema
20 changes: 10 additions & 10 deletions docs/api/data_wyscout.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. _api-data-wyscout:

socceraction.data.wyscout
=========================
socceraction.data.providers.wyscout
===================================

.. automodule:: socceraction.data.wyscout
.. automodule:: socceraction.data.providers.wyscout

Serializers
------------
Expand All @@ -13,8 +13,8 @@ Serializers
:nosignatures:
:template: class.rst

socceraction.data.wyscout.WyscoutLoader
socceraction.data.wyscout.PublicWyscoutLoader
socceraction.data.providers.wyscout.WyscoutLoader
socceraction.data.providers.wyscout.PublicWyscoutLoader

Schema
------
Expand All @@ -24,8 +24,8 @@ Schema
:nosignatures:
:template: schema.rst

socceraction.data.wyscout.WyscoutCompetitionSchema
socceraction.data.wyscout.WyscoutTeamSchema
socceraction.data.wyscout.WyscoutPlayerSchema
socceraction.data.wyscout.WyscoutGameSchema
socceraction.data.wyscout.WyscoutEventSchema
socceraction.data.providers.wyscout.WyscoutCompetitionSchema
socceraction.data.providers.wyscout.WyscoutTeamSchema
socceraction.data.providers.wyscout.WyscoutPlayerSchema
socceraction.data.providers.wyscout.WyscoutGameSchema
socceraction.data.providers.wyscout.WyscoutEventSchema
2 changes: 1 addition & 1 deletion docs/documentation/data/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. currentmodule:: socceraction.data
.. currentmodule:: socceraction.data.providers

*************
Loading data
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/data/opta.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. currentmodule:: socceraction.data.opta
.. currentmodule:: socceraction.data.providers.opta

=========================
Loading Opta data
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/data/statsbomb.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. currentmodule:: socceraction.data.statsbomb
.. currentmodule:: socceraction.data.providers.statsbomb

=========================
Loading StatsBomb data
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/data/wyscout.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.. currentmodule:: socceraction.data.wyscout
.. currentmodule:: socceraction.data.providers.wyscout

=========================
Loading Wyscout data
Expand Down
2 changes: 1 addition & 1 deletion socceraction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SoccerAction is a Python package for objectively quantifying the impact of the
individual actions performed by soccer players using event stream data.
Full documentation is at <https://ml-kuleuven.github.io/socceraction/>.
Full documentation is at <https://socceraction.readthedocs.io>.
:copyright: (c) 2020 by DTAI KU Leuven.
:license: MIT, see LICENSE for more details.
"""
Expand Down
42 changes: 42 additions & 0 deletions socceraction/atomic/features/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""A collection of feature generators."""

from socceraction.features import (
actiontype,
bodypart,
bodypart_detailed,
bodypart_detailed_onehot,
bodypart_onehot,
player_possession_time,
speed,
team,
time,
time_delta,
)

from .spadl import (
actiontype_onehot,
direction,
goalscore,
location,
movement_polar,
polar,
)

__all__ = [
"actiontype",
"actiontype_onehot",
"bodypart",
"bodypart_detailed",
"bodypart_onehot",
"bodypart_detailed_onehot",
"team",
"time",
"time_delta",
"speed",
"location",
"polar",
"movement_polar",
"direction",
"goalscore",
"player_possession_time",
]
Loading

0 comments on commit f704641

Please sign in to comment.