tests.metrics.utility#

tests.metrics.utility.test_univariate#

tests.metrics.utility.test_univariate.test_distance_divergence(distance_function)[source]#

Test the distance and divergence functions.

Parameters:

distance_function (Callable) – the function to test

Return type:

None

Returns:

None

tests.metrics.utility.test_univariate.univariate_metrics_results(request, df_wbcd, df_mock_wbcd, metadata_wbcd)[source]#

Compute the univariate metrics in different settings.

Parameters:
  • request – the number of continuous and categorical columns to test

  • df_wbcd (dict[str, DataFrame]) – the real Wisconsin Breast Cancer Dataset fixture, split into train and test sets

  • df_mock_wbcd (dict[str, DataFrame]) – the mock wbcd dataset fixture, split into train and test sets

  • metadata_wbcd (dict) – the wbcd metadata fixture

Return type:

Tuple[Type[Metric], str, dict]

Returns:

a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

tests.metrics.utility.test_univariate.test_univariate_metrics_summary(univariate_metrics_results)[source]#

Test the univariate metrics average scores.

Parameters:

univariate_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_univariate.test_univariate_metrics_detailed(univariate_metrics_results)[source]#

Test the univariate metrics detailed scores.

Parameters:

univariate_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_bivariate#

tests.metrics.utility.test_bivariate.bivariate_metrics_results(request, df_wbcd, df_mock_wbcd, metadata_wbcd)[source]#

Compute the bivariate metrics in different settings.

Parameters:
  • request – the number of continuous and categorical columns to test

  • df_wbcd (dict[str, DataFrame]) – the real Wisconsin Breast Cancer Dataset fixture, split into train and test sets

  • df_mock_wbcd (dict[str, DataFrame]) – the mock wbcd dataset fixture, split into train and test sets

  • metadata_wbcd (dict) – the wbcd metadata fixture

Return type:

Tuple[Type[Metric], str, dict]

Returns:

a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

tests.metrics.utility.test_bivariate.test_bivariate_metrics_summary(bivariate_metrics_results)[source]#

Test the bivariate metrics average scores.

Parameters:

bivariate_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_bivariate.test_bivariate_metrics_detailed(bivariate_metrics_results)[source]#

Test the bivariate metrics detailed scores.

Parameters:

bivariate_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_population#

tests.metrics.utility.test_population.test_propensity_score()[source]#

Test the propensity score function.

Return type:

None

Returns:

None

tests.metrics.utility.test_population.population_metrics_results(request, df_wbcd, df_mock_wbcd, metadata_wbcd)[source]#

Compute the population metrics in different settings.

Parameters:
  • request – the number of continuous and categorical columns to test

  • df_wbcd (dict[str, DataFrame]) – the real Wisconsin Breast Cancer Dataset fixture, split into train and test sets

  • df_mock_wbcd (dict[str, DataFrame]) – the mock wbcd dataset fixture, split into train and test sets

  • metadata_wbcd (dict) – the wbcd metadata fixture

Return type:

Tuple[Type[Metric], str, dict]

Returns:

a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

tests.metrics.utility.test_population.test_population_metrics_summary(population_metrics_results)[source]#

Test the population metrics average scores.

Parameters:

population_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_population.test_population_metrics_detailed(population_metrics_results)[source]#

Test the population metrics detailed scores.

Parameters:

population_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_application#

tests.metrics.utility.test_application.test_fscore()[source]#

Test the F-score function.

Return type:

None

Returns:

None

tests.metrics.utility.test_application.application_metrics_results(request, df_wbcd, df_mock_wbcd, metadata_wbcd)[source]#

Compute the application metrics in different settings.

Parameters:
  • request – the number of continuous and categorical columns to test

  • df_wbcd (dict[str, DataFrame]) – the real Wisconsin Breast Cancer Dataset fixture, split into train and test sets

  • df_mock_wbcd (dict[str, DataFrame]) – the mock wbcd dataset fixture, contains train and test sets

  • metadata_wbcd (dict) – the wbcd metadata fixture

Return type:

Tuple[Type[Metric], str, dict]

Returns:

a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

tests.metrics.utility.test_application.test_application_metrics_summary(application_metrics_results)[source]#

Test the application metrics average scores.

Parameters:

application_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_application.test_application_metrics_detailed(application_metrics_results)[source]#

Test the application metrics detailed scores.

Parameters:

application_metrics_results (Tuple[Type[Metric], str, dict]) – a tuple containing the metric class, the dataset type and a dictionary containing the average scores of the metric and the detailed scores

Return type:

None

Returns:

None

tests.metrics.utility.test_report#

tests.metrics.utility.test_report.utility_report(request, df_wbcd, df_mock_wbcd)[source]#

Compute the utility report in different settings.

Parameters:
  • request – the number of continuous and categorical columns to test

  • df_wbcd (dict[str, DataFrame]) – the real Wisconsin Breast Cancer Dataset fixture, split into train and test sets

  • df_mock_wbcd (dict[str, DataFrame]) – the mock wbcd dataset fixture, split into train and test sets

Return type:

UtilityReport

Returns:

an instance of the report

tests.metrics.utility.test_report.test_summary_report(utility_report)[source]#

Test the summary report.

Parameters:

utility_report (UtilityReport) – the computed report fixture

Return type:

None

Returns:

None

tests.metrics.utility.test_report.test_detailed_report(utility_report)[source]#

Test the detailed report.

Parameters:

utility_report (UtilityReport) – the computed report fixture

Return type:

None

Returns:

None

tests.metrics.utility.test_report.test_save_load_report(utility_report)[source]#

Test the save/load operations for the utility report.

Parameters:

utility_report (UtilityReport) – the computed report fixture

Return type:

None

Returns:

None