quantus.functions.discretise_func module

This module holds a collection of explanation discretisation functions i.e., methods to split continuous explanation spaces into discrete counterparts.

quantus.functions.discretise_func.floating_points(a: array, **kwargs) float

Rounds input to have n floating-points representation

Parameters:
a: np.ndarray

Numpy array with shape (x,).

kwargs: optional

Keyword arguments.

n: integer Number of floating point digits.

Returns:
float

Returns the hash values of the resulting array.

quantus.functions.discretise_func.rank(a: array, **kwargs) float

Calculates indices that would sort the array in order of importance.

Parameters:
a: np.ndarray

Numpy array with shape (x,).

kwargs: optional

Keyword arguments.

Returns:
float

Returns the hash values of the resulting array.

quantus.functions.discretise_func.sign(a: array, **kwargs) float

Calculates element-wise signs of the array.

Parameters:
a: np.ndarray

Numpy array with shape (x,).

kwargs: optional

Keyword arguments.

Returns:
float

Returns the hash values of the resulting array.

quantus.functions.discretise_func.top_n_sign(a: array, **kwargs) float

Calculates top n element-wise signs of the array.

Parameters:
a: np.ndarray

Numpy array with shape (x,).

kwargs: optional

Keyword arguments.

n: integer Number of floating point digits.

Returns:
float

Returns the hash values of the resulting array.