pywrdrb.pre.PredictedInflowPreprocessor

pywrdrb.pre.PredictedInflowPreprocessor#

class pywrdrb.pre.PredictedInflowPreprocessor(flow_type, start_date=None, end_date=None, modes=('regression_disagg',), use_log=True, remove_zeros=False, use_const=False)#

Predicts catchment inflows at Montague and Trenton using specified modes (e.g., regression, perfect foresight).

Examples

>>> from pywrdrb.pre import PredictedInflowPreprocessor
>>> inflow_predictor = PredictedInflowPreprocessor(flow_type="nhmv10")
>>> inflow_predictor.process()
>>> inflow_predictor.save()
__init__(flow_type, start_date=None, end_date=None, modes=('regression_disagg',), use_log=True, remove_zeros=False, use_const=False)#

Initialize the PredictedInflowPreprocessor.

Parameters:
  • flow_type (str) – Label for the dataset.

  • start_date (bool, None) – Start date for the time series. If None, match the input data.

  • end_date (bool, None) – End date for the time series. If None, match the input data.

  • modes (tuple) – Modes to use for prediction. Default is (‘regression_disagg’,). Options: “regression_disagg”, “perfect_foresight”

  • use_log (bool) – Whether to use log transformation. Default is True.

  • remove_zeros (bool) – Whether to remove zero values. Default is False.

  • use_const (bool) – Whether to use a constant in regression. Default is False.

Returns:

None

Methods

__init__(flow_type[, start_date, end_date, ...])

Initialize the PredictedInflowPreprocessor.

get_prediction_node_lag_combinations()

Return dict of {column_label: [((node, lag), mode)]} across all modes.

load()

Loads catchment inflows, STARFIT releases, and water consumption data.

make_predictions(regressions)

Generate lead-time predictions using the timeseries data and trained models.

process()

Run full prediction workflow.

save()

Save predicted timeseries to CSV.

train_regressions()

Train the AR models for different node, lag combinations.