CADETProcess.comparison.DifferenceBase#
- class CADETProcess.comparison.DifferenceBase(reference: ReferenceBase, components: dict[str, list] | None = None, use_total_concentration: bool = False, use_total_concentration_components: bool = True, start: float | None = None, end: float | None = None, transform: Callable | None = None, only_transforms_array: bool = True, resample: bool = True, smooth: bool = False, normalize: bool = False)[source]#
Base class for difference metric evaluation between a reference and a solution.
- Parameters:
- referenceReferenceBase
Reference used for calculating difference metric.
- components{str, list}, optional
Solution components to be considered. If None, all components are considered. The default is None.
- use_total_concentrationbool, optional
If True, use sum of all components. The default is False.
- use_total_concentration_componentsbool, optional
If True, sum concentration of species. The default is True.
- startfloat, optional
End time of solution slice to be considered. The default is None.
- endfloat, optional
End time of solution slice to be considered. The default is None.
- transformcallable, optional
Function to transform solution. The default is None.
- resamplebool, optional
If True, resample data. The default is True.
- smoothbool, optional
If True, smooth data. The default is False.
- normalizebool, optional
If True, normalize data. The default is False.
- Attributes:
bad_metricslist: Worst case values for each metric.
n_metricsint: Number of metrics.
referenceSolutionBase: The reference solution.
Methods
__call__(solution)Compute the difference between the reference solution and the input solution.
Wrap method automatically check reference and solution dimensions.
evaluate(solution)Compute the difference between the reference solution and the input solution.
Wrap method to automatically resample, normalize, and smooth solution.
slice_and_transform(solution)Slice the solution and applies the transform callable (if defined).
Wrap method to automatically slice solution.
Wrap method s.t.