Coder Social home page Coder Social logo

pae's Introduction

Pixel Approximate Entropy

This repository shares implementations of Pixel Approximate Entropy, a visual complexity measure for estimating how easy line charts are to read. A detailed description of our research is presented in our recent IEEE InfoVIS 2018 paper At a Glance: Pixel Approximate Entropy as a Measure of Line Chart Complexity.

For an example of PAE, considering the two following charts.

Alt Alt

The first chart, an increasing line, is intuitively simpler and easier to read. PAE can be used to determine this analytically: the first chart has a PAE of 0.003, while the second chart has a PAE of 0.913.

We see PAE as a potentially useful tool in line chart recommendations and automatic simplification. For example, the second chart can smoothed to reduce its PAE to 0.253:

Alt

We provide implementations of PAE in python and javascript.

Python Usage

The python pae package can be installed with pip:

pip install pae

Once installed, the PAEMeasure class can be instantiated with the width and height of the chart in pixels. There are also parameters for the m and r parameters of ApEn that default to values in the paper of 2 and 20.0.

from pae import PAEMeasure

pae_meas = PAEMeasure(300, 200) # equivalent to: PAEMeasure(300, 200, m=2, r=20.0)

The PAEMeasure class can then be used to evaluate the PAE of any one dimensional python list or numpy array with its given parameters.

import numpy as np

x = np.linspace(0,2,300)
linear_chart = x*0.5 - 0.5

print('PAE of chart is {}'.format(pae_meas.pae(linear_chart)))

Javascript Usage

The javascript package can be installed with npm:

npm i pae

Optionally use the --save option to add to package.json dependencies.

The package can then be included in your index.html with:

<script src="node_modules/pae/lib/pae.js"></script>

Alternately, you can just include pae from jsdelivr cdn:

<script src="https://cdn.jsdelivr.net/npm/pae/lib/pae.js"></script>

Once you have included pae in your webpage, it can be used as follows:

var pae_meas = new pae.PAE(300, 200);
console.log(pae_meas.pae(data)); // data is javascript array of numbers

pae's People

Contributors

gryan11 avatar

Stargazers

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

Watchers

 avatar  avatar  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.