GAMCR.resultsanalysis.compute_statistics module#

class GAMCR.resultsanalysis.compute_statistics.ComputeStatistics[source]#

Bases: object

Class allowing to compute different statistics from the trained model.

compute_statistics(site_folder, site, nblocks=4, min_precip=1, groups_wetness=None, groups_precip=None, max_files=20, normalization_streamflow=1)[source]#

compute some statistics on the predicted transfer functions

compute_statistics(site_folder, site, nblocks=4, min_precip=1, groups_wetness=None, groups_precip=None, max_files=20, normalization_streamflow=1, save_folder=None, filtering_time_points=None)[source]#

Compute different information on the learned transfer functions, such as: - the global average NRD/RDD - the average NRF/RRD over some ensembles (you can stratify either by precipitation intensity, antecendent wetness or by both) - the area, mean, peak and peak lag of the transfer function over different ensembles for the precipitation intensity.

Parameters:
site_folder str

Path of the folder corresponding to the site

site str

Name of the site

nblocks int

If groups_wetness or groups_precip are None, then we use ‘nblocks’ ensembles to averaged the learned transfer functions (stratifting by both antecent wetness and precipitation intensity)

min_precip int

Minimum precipitation intensity considered to define an event

groups_wetness dic

Define the lower and upper values of the ensembles considered to stratify with respect to the antecedent wetness

groups_precip dic

Define the lower and upper values of the ensembles considered to stratify with respect to precipitation intensity

max_files int

Maximum number of files loaded to compute the statistics (among the ones saved when preprocessing the data using one of the “save_batch” type method

normalization_streamflow positive float

Normalization vector to apply on the loaded streamflow time series (typically to go from cubic meter per second to mm per hour).

filtering_time_points function

Takes as input a list of dates and return the position indexes that we should keep to compute the statistics. WARNING: currently, this functionality is only supported without the ground truth data (I should code a similar filtering procedure to make sure statistics from predicted and ground truth data are computed on the same dataset).