Giter Site home page Giter Site logo

pyphi's Introduction

Modules

pyphi

Phi toolbox for multivariate analysis by Sal Garcia ([email protected], [email protected])

Version 2.0 includes: Batch Analysis

Version 1.0 includes: Principal Components Analysis (PCA), Projection to Latent Structures (PLS), Locally Weighted PLS (LWPLS), Savitzy-Golay derivative and Standard Normal Variate pre-processing for spectra.

pyphi_plots

A variety of plotting tools for models created with pyphi.

Getting Started

Pyphi requires the following python packages: numpy, scipy, pandas, xlrd, bokeh, matplotlib, pyomo. These can be installed via setup.py below or manually using pip/conda and the requirements.txt file.

Installation

  1. Ensure you have Python 3 installed and accessible via your terminal ("python" command).
    • It's strongly encouraged you create a virtual environment using anaconda (conda create -n your_pyphienv python) or venv (pip -m venv your_pyphienv). You can then activate your environment conda activate your_pyphienv or venv Windows yourenv\Scripts\activate.bat or venv Linux/mac source yourenv/bin/activate ) and then install everything into a sandboxed environment.
  2. Download this repository via git clone or manually using the download zip button at the top of the page.
  3. Install the pyphi and pyphi_plots modules by opening a terminal window, navigating to the root of this repository, and typing pip install -r requirements.txt.

To confirm you have a working installation, navigate to the Examples folder and copy the Example_Script_testing_MD_by_NLP.py to the directory of your choice. Run python Example_Script_testing_MD_by_NLP.py, verifying there are no errors logged to the console.

Optional External Dependencies

  • IPOPT as an executable in your system path or GAMS python module or GAMS executable in yoru system path.
    • Windows: conda install -c conda-forge IPOPT=3.11.1 or download from IPOPT releases page, extract and add the IPOPT\bin folder to your system path or add all files to your working directory.
    • Mac/Linux: conda install -c conda-forge IPOPT, download from IPOPT releases page, or Compile using coinbrew.
  • libhsl with ma57 within library loading path or in the same directory as IPOPT executable.
    • Speeds up IPOPT for large problems but requires a free academic or paid industrial license and a local IPOPT installation.
    • Must request in advance and building the source code is nontrivial. Expert use only.
  • If IPOPT is not detected, pyphi will submit the pyomo models to the NEOS server to solve them remotely.
    • To use the NEOS server, the environment variable "NEOS_EMAIL" must be assigned a valid email. This can be done outside of python using set/set/export or use import os os.environ["NEOS_EMAIL"] = [email protected] in your code.

Adding a folder to your system path:

  • Windows: temporary set PATH=C:\Path\To\ipopt\bin;%PATH% or persistent setx PATH=C:\Path\To\ipopt\bin;%PATH%.
  • Mac/Linux: export PATH=/path/to/ipopt:$PATH, add to .profile/.*rc file to make persistent.
  • Both via Conda: after activating your environment, use conda env config vars set and your OS-specific set or export command.

What is New

Aug 22 2022

  • Added batch predict and data replicator to phi
  • I realize I had not updated this section in a long while (sorry)

Jan 15, 2021

  • Added routine cat_2_matrix to conver categorical classifiers to matrices
  • Added Multi-block PLS model

Nov 16, 2020

  • Fixed small bug un clean_low_variances routine

Sep 26 2020

  • Added rotation of loadings so that var(t) for ti>=0 is always larger than var(t) for ti<0

May 28th

  • Enhanced clean_low_variances function to return a list with columns removed from dataframe.

May 27th

  • PLS model estimation using Non-linear programming as described in Journal of Chemometrics, 28(7), pp.575-584.

March 30th

  • PCA model estimation using Non-linear programming as described in Lopez-Negrete et al. J. Chemometrics 2010; 24: 301โ€“311.

pyphi's People

Contributors

bradjcheme avatar salvadorgarciamunoz avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyphi's Issues

AttributeError due to latest release of Bokeh 3.0.0

Hi Salvador,

I recently installed pyphi and attempted to run example files. However, I encountered the following attribute error messages: AttributeError: unexpected attribute 'plot_width' to figure and AttributeError: unexpected attribute 'plot_width' to figure.

I realized that the cause might be due to the recent release of Bokeh 3.0.0, which removed several attributes/properties. For example, plot_width and plot_height have been removed. Instead, the standard width and height should be used for all layout-able models. Also, render_mode was removed from all annotations, with the default being canvas rendering which is what you currently specify in pyphi_plots.py file. After making these changes, the issues were fixed.

I just wanted to bring this to your attention. Perhaps you could incorporate some of these changes in the future. Thank you!

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.