langtest.transform.accuracy.MinMacroF1Score#

class MinMacroF1Score#

Bases: BaseAccuracy

Subclass of BaseAccuracy that implements the minimum macro score.

alias_name#

The name for config.

Type:

str

transform(y_true, params) Any#

Creates accuracy test results.

__init__()#

Methods

__init__()

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

Creates a task to run the accuracy measure.

run(y_true, y_pred, **kwargs)

Computes the minimum F1 score for the given data.

transform(test, y_true, params)

Computes the minimum macro F1 score for the given data.

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

async run(y_true: List[Any], y_pred: List[Any], **kwargs)#

Computes the minimum F1 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

classmethod transform(test: str, y_true: List[Any], params: Dict) List[MinScoreSample]#

Computes the minimum macro F1 score for the given data.

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

  • params (Dict) – parameters for tests configuration

Returns:

The transformed data based on the minimum macro F1 score.

Return type:

List[MinScoreSample]