lm_polygraph.stat_calculators.stat_calculator module
- class lm_polygraph.stat_calculators.stat_calculator.StatCalculator(**kwargs)[source]
Bases:
ABCAbstract class for some particular statistics calculation. Used to re-use same statistics across different uncertainty estimators at lm_polygraph.estimators. See the list of available calculators at lm_polygraph/stat_calculators/__init__.py.
While estimators specify stats_dependencies to re-use these StatCalculator calculations, calculators can also specify dependencies on other calculators.
UEManager at lm_polygraph.utils.manager will order all the needed calculators and estimators to be called in the correct order. Any cycle dependencies among calculators will be spotted by UEManager and end with an exception.
Each new StatCalculator needs to be registered at lm_polygraph/stat_calculators/__init__.py to be seen be UEManager.
- static meta_info() Tuple[List[str], List[str]][source]
Placeholder method to return the list of statistics and dependencies for the calculator.
- property stat_dependencies: List[str]
- Returns:
List[str]: Names of statistics dependencies which this class needs at __call__.
- property stats: List[str]
- Returns:
List[str]: Names of statistics which can be calculated by this class.