Spadl: Translating raw data to SPADL representation

Description Details Public fields Methods

Description

Translating raw data to SPADL representation

Translating raw data to SPADL representation

Details

We use SPADL common language (see details in the paper) to represent raw data regardless of the data provider used. Every data provider has his own implement class inheriting from the mother class.

Public fields

data

data.table :: the SPADL values stored as data.table

metadata

tibble :: metadata such as team name, game-date, ... should have the same number of rows as 'data' and same game-ids.

Methods

Public methods


Method new()

Creates the 2 tibble(s) from mongo connections. Given that the fixture collection is similar for all data providers, the 'metadata' field can be initialised here. Must be implemented in each subclass (for each data provider).

Usage
Spadl$new(game_ids, fixture_con)
Arguments
game_ids

integer

fixture_con

mongo-connection :: fixture collection connection


Method sanity_check()

Runs some sanity checks on the created instance Regardless of the data provider (and the subclass used to initialise the object), we expect the fields values to be the same and hence sanity checks can be implemented here.

Usage
Spadl$sanity_check()
Returns

logical :: 'TRUE' if all tests are passed otherwise 'FALSE' with an informative error message


Method insert()

Insert the instance in the mongo database if sanity-checks are successful

Usage
Spadl$insert(mongo_con)
Arguments
mongo_con

'mongo-connection' :: where the object should be inserted

Returns

logical :: insertion status


Method get_model_data()

Create model training data from Spadl or atomic Spadl

Usage
Spadl$get_model_data(
  nb_prev_actions = 3L,
  nr_actions = 10L,
  labels = TRUE,
  add_predictions = TRUE
)
Returns

populates the training_data slot. Handles the insertion in mongo


Method clone()

The objects of this class are cloneable with this method.

Usage
Spadl$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


salembsk/playeraction documentation built on Nov. 10, 2020, 8:03 p.m.