langtest.transform.accuracy.BaseAccuracy#

class BaseAccuracy#

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, y_true, y_pred, **kwargs)

Creates a task to run the accuracy measure.

run(sample_list, y_true, y_pred, **kwargs)

Computes the accuracy score for the given data.

transform(params)

Abstract method that implements the accuracy measure.

Attributes

alias_name

supported_tasks

test_types

async classmethod async_run(sample_list: List[MinScoreSample], y_true: List[Any], y_pred: List[Any], **kwargs)#

Creates a task to run the accuracy measure.

Parameters:
  • sample_list (List[MinScoreSample]) – List of samples to be transformed.

  • y_true (List[Any]) – True values

  • y_pred (List[Any]) – Predicted values

abstract async static run(sample_list: List[MinScoreSample], y_true: List[Any], y_pred: List[Any], **kwargs) List[MinScoreSample]#

Computes the accuracy score for the given data.

Parameters:
  • sample_list (List[MinScoreSample]) – List of samples to be transformed.

  • y_true (List[Any]) – True values

  • y_pred (List[Any]) – Predicted values

abstract classmethod transform(params: Dict) List[MinScoreSample]#

Abstract method that implements the accuracy measure.

Parameters:
  • y_true (List[Any]) – True values

  • params (Dict) – parameters for tests configuration

Returns:

The transformed data based on the implemented accuracy measure.

Return type:

List[MinScoreSample]