nlptest.transform.fairness.BaseFairness#

class BaseFairness#

Bases: ABC

Abstract base class for implementing accuracy measures.

alias_name#

A name or list of names that identify the accuracy measure.

Type:

str

transform(data

List[Sample]) -> Any: Transforms the input data into an

output based on the implemented accuracy measure.
__init__()#

Methods

__init__()

async_run(sample_list, model, **kwargs)

Creates a task for the run method.

run(sample_list, model, **kwargs)

transform(data, model, params)

Abstract method that implements the accuracy measure.

Attributes

alias_name

async classmethod async_run(sample_list: List[Sample], model: ModelFactory, **kwargs)#

Creates a task for the run method.

Parameters:
  • sample_list (List[Sample]) – The input data to be transformed.

  • model (ModelFactory) – The model to be used for the computation.

Returns:

The task for the run method.

Return type:

asyncio.Task

abstract static transform(data, model, params)#

Abstract method that implements the accuracy measure.

Parameters:

data (List[Sample]) – The input data to be transformed.

Returns:

The transformed data based on the implemented accuracy measure.

Return type:

Any