Skip to content

Implements the frequent directions algorithm for approximating matrices in streams

Notifications You must be signed in to change notification settings

edoliberty/frequent-directions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frequent-directions

This repo was created by Edo Liberty and Mina Ghashami. It contains the simplest version of the frequent directions algorithm for matrix sketching in Python. It is developed for academic use only and for reproducibility of the results in the following papers:

Creating an example matrix

Run this command to create a matrix to work with

$ ./syntheticDataMaker.py -n=1000 -d=50 > matrix.csv

This will create a csv file containing a matrix with n rows and d columns.

Running FD

You can use the file created above or any other csv file containing a matrix

cat matrix.csv | ./frequentDirections.py -d=50 -ell=15 > sketch.csv

The main in frequentDirections.py will only use rows in matrix.csv that contain exactly -d=50 comma separated floats.
The file sketch.csv will contain a sketch matrix in csv format. It will consist of -ell=15 rows of dimension -d=50 as comma separated floats.

You can also look at exampleUsage.py for an example on how to import and use frequent directions.

About

Implements the frequent directions algorithm for approximating matrices in streams

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages