langtest.transform.accuracy.AccuracyTestFactory#
- class AccuracyTestFactory(data_handler: List[Sample], tests: Dict, **kwargs)#
Bases:
ITestsA class for performing accuracy tests on a given dataset.
Methods
__init__(data_handler, tests, **kwargs)Get a dictionary of all available tests, with their names as keys and their corresponding classes as values.
run(sample_list, model, raw_data, **kwargs)Runs the accuracy tests on the given model and dataset.
Runs the accuracy test and returns the resulting Sample objects.
Attributes
alias_namemodel_resultsupported_tasks- static available_tests() DefaultDict[str, Type[BaseAccuracy]]#
Get a dictionary of all available tests, with their names as keys and their corresponding classes as values.
- Returns:
A dictionary of test names and classes.
- Return type:
dict
- classmethod run(sample_list: Dict[str, List[Sample]], model: ModelAPI, raw_data: List[Sample], **kwargs)#
Runs the accuracy tests on the given model and dataset.
- Parameters:
sample_list (Dict[str, List[Sample]]) – A dictionary of test names and corresponding Sample objects.
model (ModelAPI) – The model to be tested.
raw_data (List[Sample]) – The raw dataset.
- transform() List[Sample]#
Runs the accuracy test and returns the resulting Sample objects.
- Returns:
A list of Sample objects representing the resulting dataset after running the accuracy test.
- Return type:
List[Sample]