Skip to main content

A Python API for Intelligent Data Discovery

Project description

A Python API for Intelligent Visual Discovery

Build Status PyPI version Documentation Status

Lux is a Python library that makes data science easier by automating certain aspects of the data exploration process. Lux is designed to facilitate faster experimentation with data, even when the user does not have a clear idea of what they are looking for.

Features

Lux capabilities

Lux provides a suite of capabilities as outlined in the hierarchy above from the most basic (automatic encoding) to the most complex (predictive recommendations).

Automatic Encoding:

Lux is built on the principle that users should always be able to visualize anything they specify, without having to think about how the visualization should look like. Lux automatically determines the mark and channel mappings based on a set of best practices from Tableau. The visualizations are rendered via Altair into Vega-Lite specifications.

    import lux
    # Load a dataset into Lux
    dataset = lux.Dataset("data/car.csv")

    dobj = lux.DataObj(dataset,[lux.Column("Acceleration"),
                                lux.Column("Horsepower")])

Specified Visualization

Search Space Enumeration:

Lux implements a set of enumeration logic that generates a visualization collection based on a partially specified query. Users can provide a list or a wildcard to iterate over combinations of filter or attribute values and quickly browse through large numbers of visualizations. The partial specification is inspired by existing work on query languages for visualization languages, including ZQL and CompassQL.

Here, we want to look at how the attributes Weight and Displacement depend on all other dimension variables.

dobj = lux.DataObj(dataset,[lux.Column(["Weight","Displacement"]),lux.Column("?",dataModel="dimension")])

Specified Visualization

Analytics Modules:

Lux comes with a set of analytics capabilities. We can compose multiple DataObjects or DataObjectCollections to perform a specified task.

For example, we can ask which car brands have a time series of Displacement similar to that of Pontiac cars.

    query = lux.DataObj(dataset,[lux.Column("Year",channel="x"),
                            lux.Column("Displacement",channel="y"),
                            lux.Row("Brand","pontiac")])

    dobj = lux.DataObj(dataset,[lux.Column("Year",channel="x"),
                                lux.Column("Displacement",channel="y"),
                                lux.Row("Brand","?")])

    result = dobj.similarPattern(query,topK=5)

Similar Patterns

Predictive Recommendation:

Lux has an extensible logic that determines the appropriate analytics modules to call based on the user’s current state (i.e., the attributes and values they’re interested in). By calling the showMore command, Lux guides users to potential next-steps in their exploration.

In this example, the user is interested in Acceleration and Horsepower, Lux generates three sets of recommendations, organized as separate tabs on the widget.

    dobj = lux.DataObj(dataset,[lux.Column("Acceleration",dataModel="measure"),
                                lux.Column("Horsepower",dataModel="measure")])
    result = dobj.showMore()

Show More Recommendations

The left-hand side of the widget shows the Current View, which corresponds to the attributes that have been selected. On the right, Lux recommends:

  • Enhance: Adds an additional attribute to the current selection
  • Filter: Adds a filter to the current selection, while keeping X and Y fixed
  • Generalize: Removes an attribute to display a more general trend

Quick Start Installation

Install the Python Lux API through PyPI:

pip install lux-api

Install the Lux Jupyter widget through npm:

npm i lux-widget

Manual Installation (dev)

There are two components of Lux: 1) Python Lux API (inside lux/)and 2) the jupyter widget frontend (inside widget/).

To install the Python Lux API:

pip install --user -r requirements.txt
cd lux/
python setup.py install

To install the widget, we need to install webpack:

npm install --save-dev webpack webpack-cli

Then, we can install the jupyter widget using the custom installation script:

cd widget/
npm install
sh install.sh

For more detailed examples of how to use Lux, check out this demo notebook.

Lux is undergoing active development. Please report any bugs, issues, or requests through Github Issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lux-api, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size lux_api-0.1.2-py3-none-any.whl (58.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size lux-api-0.1.2.tar.gz (25.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page