sorbetto.flavor package

class sorbetto.flavor.AbstractFlavor(name: str = 'Unnamed Flavor', colormap: Any = None)[source]

Bases: ABC

A flavor is a function that gives something to show on a Tile for any given importance values.

property colormap: Any
abstract getDefaultColormap() Any[source]
property name: str
class sorbetto.flavor.AbstractNumericFlavor(name: str = 'Unnamed Numeric Flavor', colormap: Any = None)[source]

Bases: AbstractFlavor

A numeric flavor is a function that gives a real number to show on a Tile for any given importance values.

abstract getLowerBound() Any[source]
abstract getUpperBound() Any[source]
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: AbstractNumericFlavor

TODO actual description

Example of Best Flavor: the SOTA Flavor.

property entity_list: list[Entity]
getDefaultColormap()[source]
getLowerBound()[source]
getUpperBound()[source]
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: AbstractNumericFlavor

For 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
getDefaultColormap()[source]
getLowerBound()[source]
getUpperBound()[source]
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\).

property entity_set: set[Entity]
getCodomain()[source]

Returns the co-domain of the flavor. In Entity flavor, the co-domain is the set of all possible ranks.

getDefaultColormap()[source]
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: AbstractNumericFlavor

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\).

property entity: Entity
property entity_list: list[Entity]
getDefaultColormap()[source]
getLowerBound()[source]
getUpperBound()[source]
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: AbstractNumericFlavor

For 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.

getDefaultColormap()[source]
getLowerBound()[source]
getUpperBound()[source]
property performance: TwoClassClassificationPerformance
class sorbetto.flavor.WorstFlavor(performances: FiniteSetOfTwoClassClassificationPerformances, entity_list: list[Entity], name: str = 'Unnamed Baseline Flavor', colormap: Any = None)[source]

Bases: AbstractNumericFlavor

TODO actual description

Example of Worst Flavor: the Baseline Flavor.

property entity_list: list[Entity]
getDefaultColormap()[source]
getLowerBound()[source]
getUpperBound()[source]
property nb_entities: int
property performances: FiniteSetOfTwoClassClassificationPerformances

Submodules