sorbetto.flavor package
- class sorbetto.flavor.AbstractFlavor(name: str = 'Unnamed Flavor', colormap: Any = None)[source]
Bases:
ABCA flavor is a function that gives something to show on a Tile for any given importance values.
- property colormap: Any
- property name: str
- class sorbetto.flavor.AbstractNumericFlavor(name: str = 'Unnamed Numeric Flavor', colormap: Any = None)[source]
Bases:
AbstractFlavorA numeric flavor is a function that gives a real number to show on a Tile for any given importance values.
- property lowerBound
- property upperBound
- class sorbetto.flavor.AbstractSymbolicFlavor(name: str = 'Unnamed Symbolic Flavor', colormap: Any = None)[source]
Bases:
AbstractFlavor,Generic[T]A symbolic flavor is a function that gives something to show on a Tile for any given importance values.
- abstract getCodomain() set[T][source]
Returns the codomain of the flavor. See https://en.wikipedia.org/wiki/Codomain
- Returns:
The codomain of the flavor.
- mapper(value: T) int[source]
Maps a value in the codomain to an integer in [1, n], where n is the size of the codomain.
This is stable as long as the codomain does not change.
- Parameters:
value (T) – A value in the codomain.
- Returns:
An integer in [1, n], where n is the size of the codomain.
- Return type:
int
- reverse_mapper(index: int) T[source]
Maps an integer in [1, n], where n is the size of the codomain, to a value in the codomain.
This is stable as long as the codomain does not change.
- Parameters:
index (int) – An integer in [1, n], where n is the size of the codomain.
- Returns:
A value in the codomain.
- Return type:
T
- class sorbetto.flavor.BestFlavor(performances: FiniteSetOfTwoClassClassificationPerformances, entity_list: list[Entity], name: str = 'Unnamed SOTA Flavor', colormap: Any = None)[source]
Bases:
AbstractNumericFlavorTODO actual description
Example of Best Flavor: the SOTA Flavor.
- property nb_entities: int
- property performances: FiniteSetOfTwoClassClassificationPerformances
- class sorbetto.flavor.CorrelationFlavor(performances: FiniteSetOfTwoClassClassificationPerformances, score: Callable[[TwoClassClassificationPerformance | FiniteSetOfTwoClassClassificationPerformances], ndarray], correlation_coefficient: Literal['pearson_r', 'spearman_rho', 'kendall_tau'] = 'pearson_r', name: str = 'Correlation Flavor', colormap: Any = None)[source]
Bases:
AbstractNumericFlavorFor a given performance, the Correlation Flavor is the mathematical function that gives, to any importance \(I\) (that is, some application-specific preferences), the correlation, using a defined correlation coefficient (e.g., Pearson’s r), between a score \(X\) and the Ranking Score \(R_I\) corresponding to this importance.
- property correlation_coefficient: str
- property performances: FiniteSetOfTwoClassClassificationPerformances
- property score: Callable[[TwoClassClassificationPerformance | FiniteSetOfTwoClassClassificationPerformances], ndarray]
- class sorbetto.flavor.EntityFlavor(rank: int, entity_list: list[Entity] | set[Entity], name: str = 'Unnamed Entity Flavor', colormap: Any = None)[source]
Bases:
AbstractSymbolicFlavor[Entity]For a given rank \(r\), the Entity Flavor is the mathematical function that gives, to any Importance \(I\) (that is, some application-specific preferences), the entity ranked \(r\)-th according to the ordering of performances induced by the Ranking Score \(R_I\) corresponding to the importance \(I\).
- getCodomain()[source]
Returns the co-domain of the flavor. In Entity flavor, the co-domain is the set of all possible ranks.
- property nb_entities: int
- property performances: FiniteSetOfTwoClassClassificationPerformances
- property rank: int
- class sorbetto.flavor.RankingFlavor(entity: Entity, entity_list: list[Entity], name: str = 'Unnamed Ranking Flavor', colormap: Any = None)[source]
Bases:
AbstractNumericFlavorFor a given rank \(r\), the Entity Flavor is the mathematical function that gives, to any Importance \(I\) (that is, some application-specific preferences), the entity ranked \(r\)-th according to the ordering of performances induced by the Ranking Score \(R_I\) corresponding to the importance \(I\).
- property id_entity: int
- property nb_entities: int
- property performances: FiniteSetOfTwoClassClassificationPerformances
- class sorbetto.flavor.ValueFlavor(performance: TwoClassClassificationPerformance, name: str = 'Unnamed Value Flavor', colormap: Any = None)[source]
Bases:
AbstractNumericFlavorFor a given performance, the Value Flavor is the mathematical function that gives, to any importance \(I\) (that is, some application-specific preferences), the value taken by the Ranking Score \(R_I\) corresponding to this importance.
- property performance: TwoClassClassificationPerformance
- class sorbetto.flavor.WorstFlavor(performances: FiniteSetOfTwoClassClassificationPerformances, entity_list: list[Entity], name: str = 'Unnamed Baseline Flavor', colormap: Any = None)[source]
Bases:
AbstractNumericFlavorTODO actual description
Example of Worst Flavor: the Baseline Flavor.
- property nb_entities: int
- property performances: FiniteSetOfTwoClassClassificationPerformances
Submodules
- sorbetto.flavor.abstract_flavor module
- sorbetto.flavor.abstract_numeric_flavor module
- sorbetto.flavor.abstract_symbolic_flavor module
- sorbetto.flavor.best_flavor module
- sorbetto.flavor.correlation_flavor module
- sorbetto.flavor.entity_flavor module
- sorbetto.flavor.ranking_flavor module
- sorbetto.flavor.value_flavor module
- sorbetto.flavor.worst_flavor module