Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the generalize function, generalize the Age and Zip columns of the adult dataset in order to achieve k-Anonymity for k = 5. Your


imageimage

Using the generalize function, generalize the Age and Zip columns of the adult dataset in order to achieve k-Anonymity for k = 5. Your result should drop other columns besides these two. In [ ]: def generalize_adult_age_zip(): depths = { # YOUR CODE HERE In [ ]: In []: H In [ ]: H raise NotImplementedError() } return generalize(adult[['Age', 'Zip']], depths) assert is_k_anonymous (5, ['Age', 'Zip'], generalize_adult_age_zip()) In []: #Load the data and Libraries import pandas as pd. import numpy as np. pd.read_csv('https://github.com/jnear/cs211-data-privacy/raw/master/homework/adult_with_pii.csv) adult = adult pii adult_deid = adult [['Name', 'DOB', 'SSN', 'Zip', 'Age']] = adult.drop(columns=['Name', 'SSN'])

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Operations Management Creating Value Along the Supply Chain

Authors: Roberta S. Russell, Bernard W. Taylor

7th Edition

9781118139523, 0470525908, 1118139526, 978-0470525906

More Books

Students also viewed these Programming questions

Question

Calculate the account balance for each of the following:

Answered: 1 week ago