sportsbet.datasets.FTESoccerDataLoader

class sportsbet.datasets.FTESoccerDataLoader(param_grid=None)[source]

Dataloader for FiveThirtyEight data.

Read more in the user guide.

Parameters:
param_grid : dict of str to sequence, or sequence of such parameter, default=None

The parameter grid to explore, as a dictionary mapping data parameters to sequences of allowed values. An empty dict signifies default parameters. A sequence of dicts signifies a sequence of grids to search, and is useful to avoid exploring parameter combinations that do not exist. The default value corresponds to all parameters.

Examples

>>> from sportsbet.datasets import FTESoccerDataLoader
>>> dataloader = FTESoccerDataLoader()
>>> X_train, Y_train, O_train = dataloader.extract_train_data()
>>> X_fix, Y_fix, O_fix = dataloader.extract_fixtures_data()
__init__(param_grid=None)

Initialize self. See help(type(self)) for accurate signature.

extract_fixtures_data()

Extract fixtures data.

Returns:
fixtures data : (X, None, O) tuple

A tuple of ‘X’, None and ‘O’, as pandas DataFrames, that represent the training input data, the multi-output targets (None for fixtures) and the selected odds, respectively.

extract_train_data(drop_na_thres=None, odds_type=None)

Extract train data.

Parameters:
drop_na_thres : float, default=None

The threshold of input columns to drop. It is a float in the [0.0, 1.0] range. The default value None corresponds to 0.0 i.e. all columns are kept while the maximum value 1.0 keeps only columns with non missing values.

odds_type : str, default=None

The selected odds type. It should be one of the available odds columns prefixes returned by the method get_odds_types(). If None then no odds are returned.

Returns:
A tuple of ‘X’, ‘Y’ and ‘O’, as pandas

DataFrames, that represent the training input data, the multi-output targets and the corresponding odds, respectively.

classmethod get_all_params()

Get the available parameters.

Returns:
param_grid: object

An object of the ParameterGrid class.

classmethod get_odds_types()

Get the available odds types.

Returns:
odds_types: list of str

A list of available odds types.

save(path)

Save the dataloader object.

Parameters:
path : str

The path to save the object.

Returns:
self: object

The dataloader object.

Examples using sportsbet.datasets.FTESoccerDataLoader