Evaluation Class
- class floatcsep.evaluation.Evaluation(name, func, func_kwargs=None, ref_model=None, plot_func=None, plot_args=None, plot_kwargs=None, markdown='')[source]
Bases:
objectClass representing a Scoring Test, which wraps the evaluation function, its arguments, parameters and hyperparameters.
- Parameters:
name (str) – Name of the Test.
func_kwargs (dict) – Keyword arguments of the test function.
ref_model (str) – String of the reference model, if any.
plot_args (list,dict) – Positional arguments of the plotting function.
plot_kwargs (list,dict) – Keyword arguments of the plotting function.
markdown (str) – The caption to be placed beneath the result figure.
- as_dict()[source]
Represents an Evaluation instance as a dictionary, which can be serialized and then parsed
- Return type:
- compute(timewindow, model, ref_model=None, region=None)[source]
Runs the test, structuring the arguments according to the test-typology/function-signature
- Parameters:
- Return type:
None
Returns:
- get_catalog(timewindow, forecast)[source]
Reads the catalog(s) from the given path(s). References the catalog region to the forecast region.
- Parameters:
timewindow (str) – Time window of the testing catalog
forecast (
GriddedForecast) – Forecast object, onto which the catalog will be confronted for testing.
- Return type:
Returns:
- parse_plots(plot_func, plot_args, plot_kwargs)[source]
It parses the plot function(s) and its(their) arguments from the test configuration file. The plot function can belong to
csep.utils.plotsor a custom function. Each plotting function is parsed by using the functionparse_csep_function(), and assigned to its respective args and kwargs
- prepare_args(timewindow, model, ref_model=None, region=None)[source]
Prepares the positional argument for the Evaluation function.
- Parameters:
timewindow (str, list) – Time window string (or list of str) formatted from
floatcsep.utils.timewindow2str()model (
floatcsep:model.Model) – Model to be evaluatedref_model (
floatcsep:model.Model, list) – Reference model (or models) reference for the evaluation.region (
csep:core.regions.CartesianGrid2D) – Experiment region
- Returns:
A tuple of the positional arguments required by the evaluation function
Evaluation.func().- Return type:
- read_results(window, models)[source]
Reads an Evaluation result for a given time window and returns a list of the results for all tested models.
- property type
Returns the type of the test, mapped from the class attribute Evaluation._TYPES.