Skip to content

Commit

Permalink
Update privbayes-nonnegativity.py
Browse files Browse the repository at this point in the history
  • Loading branch information
0hex7 authored Feb 11, 2024
1 parent 7a7ca9d commit 18db0f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions privbayes-synthesizer/code/privbayes-nonnegativity.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def preprocess_dataset(input_data, bins=10):
print(f"\n[+] {column} is numerical. Bucketized values:")
# print(bucketized_values.value_counts().sort_index())
print(f"-- Domain size for {column}: {len(bucketized_values.unique())}")

print("\n")
# Check if all values in the column are the same
unique_values = input_data[column].unique()
if len(unique_values) == 1:
Expand All @@ -809,7 +809,7 @@ def preprocess_dataset(input_data, bins=10):
# Remove columns with the same value for all records
input_data.drop(columns=list(columns_to_remove.keys()), inplace=True)

print("\n-- Columns removed: ",columns_to_remove)
print("-- Columns removed: ",columns_to_remove)

return input_data, bucket_mappings, columns_to_remove

Expand Down Expand Up @@ -868,7 +868,7 @@ def postprocess_dataset(data, bucket_mappings, columns_removed):

data_original = pd.read_csv(data_path, engine='python')
data,bucketized_columns,removed_columns = preprocess_dataset(data_original, bucket)
# print(bucketized_columns,"\nbucketized_columns")
print(bucketized_columns,"\nbucketized_columns")
print("\n[+] Head of the 'original' preprocessed dataset is: ")
print(data.head())
rows = data.shape[0]
Expand Down

0 comments on commit 18db0f4

Please sign in to comment.