Python Active-subspaces Utility Library

Python Active-subspaces Utility Library - Published in JOSS (2016)

https://github.com/paulcon/active_subspaces

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    5 of 9 committers (55.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Physics Physical Sciences - 40% confidence
Economics Social Sciences - 40% confidence
Last synced: 4 months ago · JSON representation

Repository

Python Active-subspaces Utility Library

Basic Info
  • Host: GitHub
  • Owner: paulcon
  • License: other
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage:
  • Size: 73.9 MB
Statistics
  • Stars: 74
  • Watchers: 21
  • Forks: 51
  • Open Issues: 6
  • Releases: 1
Created about 11 years ago · Last pushed over 5 years ago
Metadata Files
Readme License

README.md

Description

DOI

Active subspaces are part of an emerging set of tools for discovering low-dimensional structure in a given function of several variables. Interesting applications arise in deterministic computer simulations of complex physical systems, where the function is the map from the physical model's input parameters to its output quantity of interest. The active subspace is the span of particular directions in the input parameter space; perturbing the inputs along these active directions changes the output more, on average, than perturbing the inputs orthogonally to the active directions. By focusing on the model's response along active directions and ignoring the relatively inactive directions, we reduce the dimension for parameter studies---such as optimization and integration---that are essential to engineering tasks such as design and uncertainty quantification.

This library contains Python tools for discovering and exploiting a given model's active subspace. The user may provide a function handle to a complex model or its gradient with respect to the input parameters. Alternatively, the user may provide a set of input/output pairs from a previously executed set of runs (e.g., a Monte Carlo or Latin hypercube study). Essential classes and methods are documented; see documentation below. We also provide a set of Jupyter notebooks that demonstrate how to apply the code to a given model.

To see active subspace in action on real science and engineering applications, see the Active Subspaces Data Sets repository, which contains several Jupyter notebooks applying the methods to study input/output relationships in complex models.

Testing

Build Status

We are using Travis CI for continuous integration testing. You can check out the current status here.

To run tests locally:

```bash

python test.py ```

Requirements and Dependencies

  • numpy
  • scipy, >= 0.15.0
  • matplotlib
  • Gurobi is an optional dependency. The same functionality is accomplished with SciPy's optimize package, albeit less accurately (particularly in the quadratic programs).

If you wish to use Gurobi, you will need to install it separately by following the instructions contained in their quick-start guides for Windows, Linux, or Mac. To test your installation of Gurobi, start a python interpreter and execute the command import gurobipy. If there is no import exception, the active subspaces library will be able to use Gurobi.

We had some initial trouble getting the Gurobi Python interface working with Enthought Python; Gurobi formally supports as subset of Python distributions, and Enthought is not one of them. However, we were able to get the interface working by following instructions in this thread.

Installation

To install the active subspaces package, open the terminal/command line and clone the repository with the command

bash git clone https://github.com/paulcon/active_subspaces.git

Navigate into the active_subspaces folder (where the setup.py file is located) and run the command

bash python setup.py install

You should now be able to import the active subspaces library in Python scripts and interpreters with the command import active_subspaces.

This method was tested on Windows 7 Professional, and Ubuntu 14.04 LTS, and Mac OSX El Capitan with the Enthought Python distribution (Python 2.7.11, NumPy 1.10.4, SciPy 0.17.0, and matplotlib 1.5.1).

Usage

For detailed examples of usage and results, see the Jupyter notebooks contained in the tutorials directory, the active subspaces website, and the Active Subspaces Data Sets repo.

The core class is the Subspaces class contained in the subspaces.py file. An instance of this class can compute the active subspace with a variety of methods that take either an array of gradients or input/output pairs. It contains the estimated eigenvalues (and bootstrap ranges), subspace errors (and bootstrap ranges), eigenvalues, and an array of the eigenvectors defining the active subspace. The utils/plotters.py file contains functions to plot these quantities and produce summary plots that show model output against the first 1 or 2 active variables. The utils/response_surfaces.py file contains classes for polynomial and radial-basis approximations that can be trained with input/output pairs. Both classes can predict the value and gradient at input points and have a coefficient of determination (R-squared) value that measures goodness-of-fit. The integrals.py and optimizers.py files contain functions for integrating and optimizing functions of the active variables; these rely on classes from the domains.py file.

Documentation

Documentation Status

Documentation can be found on ReadTheDocs.

Community Guidelines

To contribute to this project, please follow these steps. Thanks to Marco Tezzele for providing this helpful template.

Submitting a patch

  1. Open a new issue describing the bug to fix or feature to add. Even if you think it's relatively minor, it's helpful to know what people are working on.
  2. Follow the normal process of forking the project, and set up a new branch to work in. It's important that each group of changes be done in separate branches to ensure that a pull request only includes the commits related to that bug or feature.
  3. Significant changes should be accompanied by tests. The project already has good test coverage, so look at some of the existing tests if you're unsure how to go about it.
  4. Push the commits to your fork and submit a pull request. Please, remember to rebase properly in order to maintain a clean, linear git history.

If you have questions or feedback, contact Paul Constantine.

Acknowledgments

This material is based upon work supported by the U.S. Department of Energy Office of Science, Office of Advanced Scientific Computing Research, Applied Mathematics program under Award Number DE-SC-0011077.

Owner

  • Name: Paul Constantine
  • Login: paulcon
  • Kind: user
  • Location: San Francisco
  • Company: University of Colorado

JOSS Publication

Python Active-subspaces Utility Library
Published
September 29, 2016
Volume 1, Issue 5, Page 79
Authors
Paul Constantine ORCID
Colorado School of Mines, Golden, CO
Ryan Howard
Colorado School of Mines, Golden, CO
Andrew Glaws
Colorado School of Mines, Golden, CO
Zachary Grey
Colorado School of Mines, Golden, CO
Paul Diaz
University of Colorado Boulder, Boulder, CO
Leslie Fletcher
None
Editor
Kyle Niemeyer ORCID
Tags
python active subspaces dimension reduction uncertainty quantification sensitivity analysis surrogate modeling

GitHub Events

Total
  • Watch event: 6
  • Fork event: 4
Last Year
  • Watch event: 6
  • Fork event: 4

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 311
  • Total Committers: 9
  • Avg Commits per committer: 34.556
  • Development Distribution Score (DDS): 0.389
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Paul Constantine p****e@g****m 190
ryan-kelley-howard r****d@m****u 56
Les Fletcher l****r@g****m 39
zgrey z****y@m****u 7
Paul M Diaz p****z@m****u 6
Paul p****z@m****u 5
Andrew Glaws a****s@m****u 4
Marco Tezzele m****z@g****m 3
Chris Maes c****s@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 6
  • Total pull requests: 47
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 8 days
  • Total issue authors: 5
  • Total pull request authors: 13
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.34
  • Merged pull requests: 32
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • aerialhedgehog (2)
  • hmcfletch (1)
  • HARVELIN (1)
  • milesabarr (1)
  • mathematicalmichael (1)
Pull Request Authors
  • ryan-kelley-howard (19)
  • jeffrey-hokanson (4)
  • PaulMDiaz (4)
  • hmcfletch (4)
  • ConnectedSystems (3)
  • mtezzele (3)
  • aglaws (2)
  • paulcon (2)
  • zgrey (2)
  • jiweiqi (1)
  • aerialhedgehog (1)
  • mathematicalmichael (1)
  • cmaes (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 11 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 2
  • Total maintainers: 1
pypi.org: active-subspaces

Tools to apply active subspaces to analyze their models and data.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 11 Last month
Rankings
Forks count: 6.0%
Stargazers count: 8.8%
Dependent packages count: 10.1%
Dependent repos count: 21.6%
Average: 21.7%
Downloads: 61.8%
Maintainers (1)
Last synced: 4 months ago

Dependencies

requirements.txt pypi
  • matplotlib *
  • numpy *
  • scipy >=0.15.0
setup.py pypi
  • matplotlib *
  • numpy *
  • scipy *