GithubHelp home page GithubHelp logo

jayeshchoudhari / fair-k-means-clustering Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fairkmeans/fair-k-means-clustering

0.0 1.0 0.0 221 KB

Code of the paper Fair k-Means Clustering

MATLAB 99.66% M 0.34%

fair-k-means-clustering's Introduction

Fair-Lloyd algorithm

Matlab implementation of the Fair-Lloyd algorithm. Description of the files:

Folder: Fair-Lloyd

a. load and pre-rpocess the data

• loadData: load the working dataset • preProcessEductaionVector: only for the credit dataset. Outputs the sensitive feature vector indicating higher-educated and lower-educated • normalizeData : make the mean 0 and variance one for each feature • projectData: project the data using PCA or Fair-PCA • fairPCA: project the data using the Fair-PCA algorithm of Samadi et al. 2018 (look below for subroutines) • mw (subroutine for fairPCA): multiplicative weight update • optApprox (subroutine for mw): finds the optimal rank-d approximation of a given matrix • re (subroutine for mw): calculates reconstruction error of a matrix

b. Fair-Lloyd

• lloyd: implementation of lloyd’s and Fair-Lloyd algorithm (look below for subroutines) • giveRandCenters: generate initial random centres • findCenters: given a clustering, find the centers • findClustering: given a set of centers, find the clustering • compCost: given a clustering of the data, computing (fair) cost • kmeansCost_S_C (subroutine for compCost): given a clustering and a set of centers, calculate the k-means cost. • bSearch: binary search procedure to find the fair centers

c. evaluate the results using lloyd’s and Fair-Lloyd

• maink: main file for running the experiments Folder: plotsCode

• plotting the results using the output data by Fair-Lloyd and Lloyd’s You can download the resultsData folder from https://drive.google.com/file/d/1d2ChCuUHRpTFjPeAvHnsiw0mkP359WI3/view?usp=sharing

fair-k-means-clustering's People

Contributors

fairkmeans avatar

Watchers

 avatar

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.