Time Model

class flood_forecast.time_model.TimeSeriesModel(model_base: str, training_data: str, validation_data: str, test_data: str, params: Dict[KT, VT])[source]

Bases: abc.ABC

An abstract class used to handle different configurations of models + hyperparams for training, test, and predict functions. This class assumes that data is already split into test train and validation at this point.

load_model(model_base: str, model_params: Dict[KT, VT], weight_path=None) → object[source]

This function should load and return the model this will vary based on the underlying framework used

make_data_load(data_path, params: Dict[KT, VT], loader_type: str) → object[source]

Intializes a data loader based on the provided data_path. This may be as simple as a pandas dataframe or as complex as a custom PyTorch data loader.

save_model(output_path: str)[source]

Saves a model to a specific path along with a configuration report of the parameters and data info.

upload_gcs(save_path: str, name: str, file_type: str, epoch=0, bucket_name=None)[source]

Function to upload model checkpoints to GCS

wandb_init()[source]
class flood_forecast.time_model.PyTorchForecast(model_base: str, training_data, validation_data, test_data, params_dict: Dict[KT, VT])[source]

Bases: flood_forecast.time_model.TimeSeriesModel

load_model(model_base: str, model_params: Dict[KT, VT], weight_path: str = None, strict=True)[source]

This function should load and return the model this will vary based on the underlying framework used

save_model(final_path: str, epoch: int) → None[source]

Function to save a model to a given file path

upload_gcs(save_path: str, name: str, file_type: str, epoch=0, bucket_name=None)

Function to upload model checkpoints to GCS

wandb_init()
make_data_load(data_path: str, dataset_params: Dict[KT, VT], loader_type: str, the_class='default')[source]

Intializes a data loader based on the provided data_path. This may be as simple as a pandas dataframe or as complex as a custom PyTorch data loader.