Git Product home page Git Product logo

pysensors's Introduction

PySensors

Build Documentation Status PyPI Binder

PySensors is a Scikit-learn style Python package for the sparse placement of sensors, either for reconstruction or classification tasks.

Table of contents

Sparse sensor placement

Sparse sensor placement concerns the problem of selecting a small subset of sensor or measurement locations in a way that allows one to perform some task nearly as well as if one had access to measurements at every location.

PySensors provides objects designed for the tasks of reconstruction and classification.

Reconstruction

Reconstruction deals with predicting the values of a quantity of interest at different locations other than those where sensors are located. For example, one might predict the temperature at a point in the middle of a lake based on temperature readings taken at various other positions in the lake.

PySensors provides the SensorSelector class to aid in the solution of reconstruction problems.

Take representative examples of the types of data to be reconstructed (in this case polynomials)

and feed them into a SensorSelector

Use the predict method to reconstruct a new function sampled at the chosen sensor locations:

Classification

Classification is the problem of predicting which category an example belongs to, given a set of training data (e.g. determining whether digital photos are of dogs or cats). The SSPOC class is used to solve classification problems. Users familiar with Scikit-learn will find it intuitive:

See our set of classification examples for more information.

Bases

The basis in which measurement data are represented can have a dramatic effect on performance. PySensors implements the three bases most commonly used for sparse sensor placement: raw measurements, SVD/POD/PCA modes, and random projections. Bases can be easily incorporated into SensorSelector and SSPOC classes:

See this example for further discussion of these options.

Installation

Installing with pip

If you are using Linux or macOS you can install PySensors with pip:

Note: the name you type in here is python-sensors and is not pysensors.

Installing from source

First clone this repository:

Then, to install the package, run

If you do not have pip you can instead use

If you do not have root access, you should add the --user option to the install commands above.

Features

The primary PySensors object is the SensorSelector class, which is used to choose sensor locations optimized for reconstruction tasks. Other implemented objects include

  • SSPOC - a class for sparse sensor selection for classification problems
  • basis - submodule implementing different bases in which to represent data
    • Identity - use raw measurement data
    • SVD - efficiently compute first k left singular vectors
    • RandomProjection - Gaussian random projections of measurements
  • Convenience functions to aid in the analysis of error as number of sensors or basis modes are varied

Documentation

PySensors has a documentation site hosted by readthedocs. Examples are available online, as static Jupyter notebooks and as interactive notebooks.

Community guidelines

Contributing examples

If you have used PySensors to solve an interesting problem, please consider submitting an example Jupyter notebook showcasing your work!

Contributing code

We welcome contributions to PySensors. To contribute a new feature please submit a pull request. To get started we recommend installing the packages in requirements-dev.txt via

This will allow you to run unit tests and automatically format your code. To be accepted your code should conform to PEP8 and pass all unit tests. Code can be tested by invoking

We recommend using pre-commit to format your code. Once you have staged changes to commit

you can run the following to automatically reformat your staged code

Note that you will then need to re-stage any changes pre-commit made to your code.

Reporting issues or bugs

If you find a bug in the code or want to request a new feature, please open an issue.

References

  • Manohar, Krithika, Bingni W. Brunton, J. Nathan Kutz, and Steven L. Brunton. "Data-driven sparse sensor placement for reconstruction: Demonstrating the benefits of exploiting known patterns." IEEE Control Systems Magazine 38, no. 3 (2018): 63-86. [DOI]
  • Clark, Emily, Travis Askham, Steven L. Brunton, and J. Nathan Kutz. "Greedy sensor placement with cost constraints." IEEE Sensors Journal 19, no. 7 (2018): 2642-2656. [DOI]
  • Brunton, Bingni W., Steven L. Brunton, Joshua L. Proctor, and J Nathan Kutz.

    "Sparse sensor placement optimization for classification." SIAM Journal on Applied Mathematics 76.5 (2016): 2099-2122. [DOI]

pysensors's People

Contributors

briandesilva avatar emilyclark012 avatar kmanohar 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.