inFairness.postprocessing.base_postprocessing module#

class inFairness.postprocessing.base_postprocessing.BasePostProcessing(distance_x, is_output_probas)[source]#

Bases: object

Base class for Post-Processing methods

Parameters:
  • distance_x (inFairness.distances.Distance) – Distance matrix in the input space

  • is_output_probas (bool) – True if the data_Y (model output) are probabilities implying that this is a classification setting, and False if the data_Y are in euclidean space implying that this is a regression setting.

add_datapoints(X: Tensor, y: Tensor)[source]#

Add datapoints to the post-processing method

Parameters:
property data#

Input and Output data used for post-processing

Returns:

data – A tuple of (X, Y) data points

Return type:

Tuple(torch.Tensor, torch.Tensor)

property distance_matrix#

Distance matrix

Returns:

distance_matrix – Matrix of distances of shape (N, N) where N is the number of data samples

Return type:

torch.Tensor

postprocess(*args, **kwargs)[source]#
reset_datapoints()[source]#

Reset datapoints store back to its initial state