nuclearstar / k-anonymity Goto Github PK
View Code? Open in Web Editor NEWAnonymization methods for network security.
License: MIT License
Anonymization methods for network security.
License: MIT License
Hiya! I just came across this looking for k-anonymity implementations, I saw that you used our notebook from the EuroPython 2018 (https://github.com/KIProtect/data-privacy-for-data-scientists). It would be nice if you could add a backlink to it and put the proper license in your code (our code was licensed under MIT). Thank you! If you have questions regarding the implementation I'm happy to help.
AttributeError Traceback (most recent call last)
in
----> 1 dfn = build_anonymized_dataset(df, finished_partitions, feature_columns, sensitive_column)
in build_anonymized_dataset(df, partitions, feature_columns, sensitive_column, max_partitions)
14 grouped_columns = df.loc[partition].agg(aggregations, squeeze=False)
15 sensitive_counts = df.loc[partition].groupby(sensitive_column).agg({sensitive_column : 'count'})
---> 16 values = grouped_columns.iloc[0].to_dict()
17 for sensitive_value, count in sensitive_counts[sensitive_column].items():
18 if count == 0:
AttributeError: 'list' object has no attribute 'to_dict'
I tried converting this python code to pyspark code. I am running the same dataset with pyspark code in AWS EMR cluster.
For 200 records it was taking 9 minutes of time. For the 30,000 records it was taking 22.5 hours of time. Is there any way to optimise the code? Please help me.
Thanks in Advance.
replace line 173 with : values = {'age' : grouped_columns[0], 'education-num' : grouped_columns[0]}
now we no longer have the error list object has no attribute 'to_dict()'
then while printing your base you get the error " unhashable type: 'list' "
you just need to replace all the prints of your k-anonyme,l-diverse and t-close databases that are named dfn , dfl and dft by print(dfn.head())...
then the code works perfectly
grouped_columns = df.loc[partition].agg(aggregations, squeeze=False)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.