Time picker
Submodules
Time picker base class
- class fleetrl.utils.time_picker.time_picker.TimePicker[source]
Bases:
object- choose_time(db, freq, end_cutoff)[source]
Parent class for time picker objects :type db:
Series:param db: dataframe from env :type freq:str:param freq: frequency specification string for pandas :type end_cutoff:int:param end_cutoff: amount of days cut off at the end to allow some buffer. In the eval time picker case, the end cutoff specifies the size of the validation set. :rtype:Timestamp:return: A chosen time stamp
Eval time picker
- class fleetrl.utils.time_picker.eval_time_picker.EvalTimePicker(ep_len)[source]
Bases:
TimePickerTime picker for validation set. The amount of days and thus the train/validation split is set in time config.
- choose_time(db, freq, end_cutoff)[source]
Randomly chooses a start time from the validation set.
- Parameters:
db (
Series) – Databasefreq (
str) – Time frequencyend_cutoff (
int) – This is the size of the validation window. By default, the end_cutoff is 2 months, so Nov and Dec are the validation set.
- Return type:
Timestamp- Returns:
start time, pd.TimeStamp
Random time picker
- class fleetrl.utils.time_picker.random_time_picker.RandomTimePicker[source]
Bases:
TimePickerPicks a random time from the training set.
Static time picker
- class fleetrl.utils.time_picker.static_time_picker.StaticTimePicker(start_time='01/02/2021 19:00')[source]
Bases:
TimePickerPicks a static / always the same starting time.
- choose_time(db, freq, end_cutoff)[source]
Parent class for time picker objects :type db:
Series:param db: dataframe from env :type freq:str:param freq: frequency specification string for pandas :type end_cutoff:int:param end_cutoff: amount of days cut off at the end to allow some buffer. In the eval time picker case, the end cutoff specifies the size of the validation set. :rtype:Timestamp:return: A chosen time stamp