def test_private_mean(example_private_table: PrivateTable): """check private mean implementation.""" noisy_mean = example_private_table.mean('Age', PrivacyBudget(10000.)) check_absolute_error(noisy_mean, 33.2, 1.)
def test_private_mean_petal_width(example_private_table: PrivateTable): """check private mean implementation using Petal Width in iris dataset.""" noisy_mean = example_private_table.mean('Petal Width', PrivacyBudget(10000.)) check_absolute_error(noisy_mean, 1.1986666666666672, 1.)
def test_private_mean(example_private_table: PrivateTable): """check private mean implementation using Age in adult dataset.""" noisy_mean = example_private_table.mean('Age', PrivacyBudget(10000.)) check_absolute_error(noisy_mean, 38.58164675532078, 1.)
def test_private_mean_sepal_width(example_private_table: PrivateTable): """check private mean implementation using Sepal Width in iris dataset.""" noisy_mean = example_private_table.mean('Sepal Width', PrivacyBudget(10000.)) check_absolute_error(noisy_mean, 3.0540000000000007, 1.)