sorbetto.tile package

class sorbetto.tile.BestTile(parameterization: AbstractParameterization, flavor: BestFlavor, name: str = 'Best Tile', resolution: int = 1001)[source]

Bases: NumericTile

Example of Best Tile: the SOTA Tile.

property flavor: BestFlavor
getExplanation() str[source]
property performances: FiniteSetOfTwoClassClassificationPerformances
class sorbetto.tile.CorrelationTile(parameterization: AbstractParameterization, flavor: CorrelationFlavor, name: str = 'Correlation Tile', resolution: int = 1001, disable_colorbar: bool = False)[source]

Bases: NumericTile

property flavor: CorrelationFlavor
getExplanation() str[source]
maximize(precision: float = 1e-08)[source]

Tries to maximize the value. There is no guarantee to find the maximum with the implemented algorithm. As described in Section A.7.2 of the supplementary material for Piérard et al. [17], this method implements a custom coarse-to-fine grid-based direct search Conn et al. [6]: we compute the value on a coarse grid over the Tile, locate the maximum on the grid, center a smaller region of interrest and a finer grid around that point, and iterate until the region of interrest is small enough.

Parameters:

precision (float, optional) – the desired precision for the coordinates of the point on the Tile. Defaults to 1e-8.

Returns:

the first coordinate of the point on the Tile where the largest value has been found. float: the second coordinate of the point on the Tile where the largest value has been found. float: the largest value that has been found.

Return type:

float

minimize(precision: float = 1e-08)[source]

Tries to minimize the value. There is no guarantee to find the minimum with the implemented algorithm. As described in Section A.7.2 of the supplementary material for Piérard et al. [17], this method implements a custom coarse-to-fine grid-based direct search Conn et al. [6]: we compute the value on a coarse grid over the Tile, locate the minimum on the grid, center a smaller region of interrest and a finer grid around that point, and iterate until the region of interrest is small enough.

Parameters:

precision (float, optional) – the desired precision for the coordinates of the point on the Tile. Defaults to 1e-8.

Returns:

the first coordinate of the point on the Tile where the smallest value has been found. float: the second coordinate of the point on the Tile where the smallest value has been found. float: the smallest value that has been found.

Return type:

float

class sorbetto.tile.EntityTile(parameterization: AbstractParameterization, flavor: EntityFlavor, name: str = 'Entity Tile', resolution: int = 1001, disable_colorbar: bool = False)[source]

Bases: SymbolicTile

property colormap: ndarray
draw(fig: Figure | None = None, ax: Axes | None = None) tuple[Figure, Axes][source]

Draws the Tile in the given figure and axes.

Parameters:
  • fig (Figure | None, optional) – The figure to draw in. If None, a new figure is created. Defaults to None.

  • ax (Axes | None, optional) – The axes to draw in. If None, a new axis is created. Defaults to None. Note that this argument is ignored if fig is None.

Returns:

The figure and axes used for drawing.

property entities
property flavor: EntityFlavor
getExplanation()[source]
property performance: FiniteSetOfTwoClassClassificationPerformances
property rank: int
class sorbetto.tile.NumericTile(parameterization: AbstractParameterization, flavor: AbstractNumericFlavor, name: str = 'Numeric Tile', resolution: int = 1001, disable_colorbar: bool = False)[source]

Bases: Tile

draw(fig: Figure | None = None, ax: Axes | None = None) tuple[Figure, Axes][source]

Draws the Tile in the given figure and axes.

Parameters:
  • fig (Figure | None, optional) – The figure to draw in. If None, a new figure is created. Defaults to None.

  • ax (Axes | None, optional) – The axes to draw in. If None, a new axis is created. Defaults to None. Note that this argument is ignored if fig is None.

Returns:

The figure and axes used for drawing.

property flavor: AbstractNumericFlavor
getExplanation() str[source]
property max: float | int
property min: float | int
class sorbetto.tile.RankingTile(parameterization: AbstractParameterization, flavor: RankingFlavor, name: str = 'Ranking Tile', resolution: int = 1001, disable_colorbar: bool = False)[source]

Bases: NumericTile

property colormap: ndarray
draw(fig: Figure | None = None, ax: Axes | None = None) tuple[Figure, Axes][source]

Draws the Tile in the given figure and axes.

Parameters:
  • fig (Figure | None, optional) – The figure to draw in. If None, a new figure is created. Defaults to None.

  • ax (Axes | None, optional) – The axes to draw in. If None, a new axis is created. Defaults to None. Note that this argument is ignored if fig is None.

Returns:

The figure and axes used for drawing.

property entities
property flavor: RankingFlavor
getExplanation()[source]
property performance: FiniteSetOfTwoClassClassificationPerformances
property rank: int
class sorbetto.tile.SymbolicTile(parameterization: AbstractParameterization, flavor: AbstractSymbolicFlavor, name: str = 'Symbolic Tile', resolution: int = 1001, disable_colorbar: bool = False)[source]

Bases: Tile

draw(fig: Figure | None = None, ax: Axes | None = None) tuple[Figure, Axes][source]

Draws the Tile in the given figure and axes.

Parameters:
  • fig (Figure | None, optional) – The figure to draw in. If None, a new figure is created. Defaults to None.

  • ax (Axes | None, optional) – The axes to draw in. If None, a new axis is created. Defaults to None. Note that this argument is ignored if fig is None.

Returns:

The figure and axes used for drawing.

property flavor: AbstractSymbolicFlavor
getExplanation() str[source]
class sorbetto.tile.Tile(parameterization: AbstractParameterization, flavor: AbstractFlavor | None = None, name: str = 'Tile', resolution: int = 1001, disable_colorbar: bool = True)[source]

Bases: object

This is the base class for all Tiles. A Tile is a graphical representation (of what ????) with: - a parameterization; - a flavor; # TDOO: not always because of EmptyTile - and some annotations.

Tiles with the default parameterization are studied in detail in Piérard et al. [16]. Various flavors of Tiles are described in Halin et al. [12] and Piérard et al. [15].

appendAnnotation(annotation)[source]
clearAnnotations()[source]
property disable_colorbar: bool
draw(fig: Figure | None = None, ax: Axes | None = None) tuple[Figure, Axes][source]

Draws the Tile in the given figure and axes.

Parameters:
  • fig (Figure | None, optional) – The figure to draw in. If None, a new figure is created. Defaults to None.

  • ax (Axes | None, optional) – The axes to draw in. If None, a new axis is created. Defaults to None. Note that this argument is ignored if fig is None.

Returns:

The figure and axes used for drawing.

property flavor: AbstractFlavor | None
genAnnotations() Iterator[AbstractAnnotation][source]
getExplanation() str[source]
property importances
property mat_value: ndarray
property name: str
property parameterization: AbstractParameterization
popAnnotation(index: SupportsIndex = -1) AbstractAnnotation[source]

Remove and return an annotation at index (default last).

Parameters:

index (SupportsIndex, optional) – index of the annotation to pop. Defaults to -1.

Returns:

the annotation at the specified index.

Return type:

AbstractAnnotation

Raises:

IndexError – if the index is out of range.

removeAnnotation(annotation)[source]
property resolution: int
property zoom: Extent
class sorbetto.tile.ValueTile(parameterization: AbstractParameterization, flavor: ValueFlavor, name: str = 'Value Tile', resolution: int = 1001, disable_colorbar: bool = False)[source]

Bases: NumericTile

property flavor: ValueFlavor
getExplanation() str[source]
getLineForValue(value) Line[source]
getPencil() PencilOfLines[source]
getVUT() float[source]

Computes the volume

See Piérard et al. [16], Section 3.1. (with default parameterization)

property performance: TwoClassClassificationPerformance
class sorbetto.tile.WorstTile(parameterization: AbstractParameterization, flavor: WorstFlavor, name: str = 'Worst Tile', resolution: int = 1001)[source]

Bases: NumericTile

Example of Worst Tile: the Baseline Tile.

property flavor: WorstFlavor
getExplanation() str[source]
property performances: TwoClassClassificationPerformance

Submodules