Time Model

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

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.

__init__(model_base: str, training_data: str, validation_data: str, test_data: str, params: Dict)[source]
abstract load_model(model_base: str, model_params: Dict, weight_path=None) object[source]

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

abstract make_data_load(data_path, params: Dict, 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.

abstract 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)[source]
__init__(model_base: str, training_data, validation_data, test_data, params_dict: Dict)[source]
load_model(model_base: str, model_params: Dict, weight_path: Optional[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

make_data_load(data_path: str, dataset_params: Dict, 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.

flood_forecast.time_model.scaling_function(start_end_params, dataset_params)[source]