Giter Club home page Giter Club logo

weissman-score's Introduction

Weissman score calculator

This repository contains a Python module to compute the Weissman Score of a compression algorithm.

The Weissman Score is a fictional perfomance score for lossless data compression algorithms devised by Tsachy Weissman and Vinith Misra at Stanford University and used in the HBO comedy series Silicon Valley.

The Weissman score W is computed as:

W = alpha * r/rb * log(Tb)/log(T)

where r and T refer to the compression ratio and time-to-compress of the target algorithm, rb and Tb refer to same quantities for a standard universal compressor (this implementation uses gzip) and alpha is a scaling constant.

Further information here and here.

Usage

You can run the script as follows:

python weissman.py -c <command> -i <input> -o <output> -a <alpha> -r <reps>

Where:

  • command is the command to launch the target compression algorithm and compress a specific input file into the output file. This command must keep the original (uncompressed) file
  • input is the path to the uncompressed file used in the test
  • output is the path to the compressed file generated by command
  • alpha is the scaling parameter of the Weissman score
  • reps is the number of times the experiment needs to be repeated (mean values are taken to compute the score)

A trivial usage example to compute bzip score is:

python weissman.py -c "bzip2 --keep README.md" -i README.md -o README.md.bz2 -a 1.0 -r 5

This code can also be used within a Python program:

>>> import weissman
>>> weissman.weissman("bzip2 --keep README.md", "README.md", "README.md.bz2", alpha=1.0, reps=5)

weissman-score's People

Contributors

lorenzosaino avatar

Watchers

James Cloos avatar eChris 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.