datasetsforecast.favorita
numpy_balance
*arrs
: NumPy arrays.np.ndarray
: NumPy array with balanced combinations.numpy_ffill
ffill
that fills missing values.
Fills missing values in an array by propagating the last non-missing value forward.
For example, if the array has the following values: 0 1 2 3 1 2 NaN 4
The ffill
method would fill the missing values as follows: 0 1 2 3 1 2 2 4
Args:
arr
(np.ndarray): NumPy array.np.ndarray
: NumPy array with forward-filled values.numpy_bfill
bfill
that fills missing values.
Fills missing values in an array by propagating the last non-missing value backwards.
For example, if the array has the following values: 0 1 2 3 1 2 NaN 4
The bfill
method would fill the missing values as follows: 0 1 2 3 1 2 4 4
Args:
arr
(np.ndarray): NumPy array.np.ndarray
: NumPy array with backward-filled values.one_hot_encoding
df
(pd.DataFrame): DataFrame with categorical columns.index_col
(str): The index column to avoid encoding.pd.DataFrame
: DataFrame with one hot encoded categorical columns.nested_one_hot_encoding
df
(pd.DataFrame): DataFrame with hierarchically-nested categorical columns.index_col
(str): The index column to avoid encoding.pd.DataFrame
: DataFrame with one hot encoded hierarchically-nested categorical columns.get_levels_from_S_df
S_df
(pd.DataFrame): Summing matrix of size (base, bottom), see aggregate method.list
: Hierarchical aggregation indexes, where each entry is a level.distance_to_holiday
make_holidays_distance_df
CodeTimer
__init__
Favorita200
__init__
Favorita500
__init__
FavoritaComplete
FavoritaRawData
download
directory
(str): Directory where data will be downloaded.unzip
FavoritaData
load
directory
(str): Directory where data will be downloaded and saved.group
(str): Dataset group name in ‘Favorita200’, ‘Favorita500’, ‘FavoritaComplete’.cache
(bool, optional): If True saves and loads. Defaults to True.verbose
(bool, optional): Whether or not print partial outputs. Defaults to False.tuple
: A tuple containing:
load_preprocessed
directory
(str): Directory where data will be downloaded and saved.group
(str): Dataset group name in ‘Favorita200’, ‘Favorita500’, ‘FavoritaComplete’.cache
(bool, optional): If True saves and loads. Defaults to True.verbose
(bool, optional): Whether or not print partial outputs. Defaults to False.tuple
: A tuple containing: