ddop.datasets.load_bakery
- ddop.datasets.load_bakery(include_date=False, one_hot_encoding=False, label_encoding=False, return_X_y=False)
Load and return the bakery dataset
The bakery dataset contains the demand for a number of products from different stores. Moreover, it stores a number of demand features. A description of targets and features is given below.
Dataset Characteristics:
- Number of Instances
127575
- Number of Targets
1
- Number of Features
13
- Target Information
‘demand’ the corresponding demand observation
- Feature Information
‘date’ the date
‘weekday’ the day of the week,
‘month’ the month of the year,
‘year’ the year,
‘is_holiday’ whether or not it is a national holiday,
‘is_holiday_next2days’ whether or not it is a national holiday in the next two days,
‘is_schoolholiday’ whether or not it is a school holiday,
‘store’ the store id,
‘product’ the product id,
‘rain’ the amount of rain,
‘temperature’ the average temperature in °C,
‘promotion_currentweek’ whether or not there is a promotion this week
‘promotion_lastweek’ whether there was a promotion last week
- Parameters
include_date (bool, default=False) – Whether to include the demand date
one_hot_encoding (bool, default=False) – Whether to one hot encode categorical features
label_encoding (bool, default=False) – Whether to convert categorical columns (weekday, month, year) to continuous. Will only be applied if one_hot_encoding=False
return_X_y (bool, default=False.) – If True, returns
(data, target)
instead of a Bunch object. See below for more information about the data and target object.
- Returns
data (sklearn Bunch) – Dictionary-like object, with the following attributes.
- dataPandas DataFrame of shape (127575, n_features)
The data matrix.
- target: Pandas DataFrame of shape (127575, n_targets)
The target values.
- n_features: int
The number of features included
- n_targets: int
The number of target variables included
- DESCR: str
The full description of the dataset.
- data_filename: str
The path to the location of the data.
- target_filename: str
The path to the location of the target.
(data, target) (tuple if
return_X_y
is True)
Examples
>>> from ddop.datasets import load_bakery >>> X, y = load_bakery(return_X_y=True) >>> print(X.shape) (127575, 12)