langtest.augmentation.base.AugmentRobustness#
- class AugmentRobustness(task: TaskManager, h_report: DataFrame, config: Dict, custom_proportions: List | Dict | None = None, max_prop=0.5)#
Bases:
BaseAugmentaion
A class for performing a specified task with historical results.
- task#
A string indicating the task being performed.
- Type:
str
- config#
A dictionary containing configuration parameters for the task.
- Type:
dict
- h_report#
A DataFrame containing a report of historical results for the task.
- Type:
pandas.DataFrame
- max_prop#
The maximum proportion of improvement that can be suggested by the class methods. Defaults to 0.5.
- Type:
float
- __init__(self, task, h_report, config, max_prop=0.5) None #
Initializes an instance of MyClass with the specified parameters.
- fix(self) List[Sample] #
.
- suggestions(self, prop) pandas.DataFrame #
Calculates suggestions for improving test performance based on a given report.
- __init__(task: TaskManager, h_report: DataFrame, config: Dict, custom_proportions: List | Dict | None = None, max_prop=0.5) None #
Initializes an instance of MyClass with the specified parameters.
- Parameters:
task (str) – A string indicating the task being performed.
h_report (pandas.DataFrame) – A DataFrame containing a report of historical results for the task.
config (dict) – A dictionary containing configuration parameters for the task.
custom_proportions –
max_prop (float) – The maximum proportion of improvement that can be suggested by the class methods. Defaults to 0.5.
- Returns:
None
Methods
__init__
(task, h_report, config[, ...])Initializes an instance of MyClass with the specified parameters.
fix
(training_data, output_path[, export_mode])Applies perturbations to the input data based on the recommendations from harness reports.
suggestions
(report)Calculates suggestions for improving test performance based on a given report.
- fix(training_data: dict, output_path: str, export_mode: str = 'add')#
Applies perturbations to the input data based on the recommendations from harness reports.
- Parameters:
training_data (dict) – A dictionary containing the input data for augmentation.
output_path (str) – The path to save the augmented data file.
export_mode (str, optional) – Determines how the samples are modified or exported. - ‘inplace’: Modifies the list of samples in place. - ‘add’: Adds new samples to the input data. - ‘transformed’: Exports only the transformed data, excluding untransformed samples. Defaults to ‘add’.
- Returns:
A list of augmented data samples.
- Return type:
List[Dict[str, Any]]
- suggestions(report: DataFrame) DataFrame #
Calculates suggestions for improving test performance based on a given report.
- Parameters:
report (pandas.DataFrame) – A DataFrame containing test results by category and test type, including pass rates and minimum pass rates.
- Returns:
- A DataFrame containing the following columns for each suggestion:
category: the test category
test_type: the type of test
ratio: the pass rate divided by the minimum pass rate for the test
- proportion_increase: a proportion indicating how much the pass rate
should increase to reach the minimum pass rate
- Return type:
pandas.DataFrame