Code Monkey home page Code Monkey logo

k-anonymity's People

Contributors

nuclearstar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

k-anonymity's Issues

error when running cell 777


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'

Tried converting this python code to pyspark

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.

erreur résolu

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.