Git Product home page Git Product logo

wpca's Introduction

Weighted Principal Component Analysis in Python

Author: Jake VanderPlas

version status downloads build status license

This repository contains several implementations of Weighted Principal Component Analysis, using a very similar interface to scikit-learn's sklearn.decomposition.PCA:

  • wpca.WPCA uses a direct decomposition of a weighted covariance matrix to compute principal vectors, and then a weighted least squares optimization to compute principal components. It is based on the algorithm presented in Delchambre (2014)

  • wpca.EMPCA uses an iterative expectation-maximization approach to solve simultaneously for the principal vectors and principal components of weighted data. It is based on the algorithm presented in Bailey (2012).

  • wpca.PCA is a standard non-weighted PCA implemented using the singular value decomposition. It is mainly included for the sake of testing.

Examples and Documentation

For an example application of a weighted PCA approach, See WPCA-Example.ipynb.

Installation & Dependencies

This package has the following requirements:

  • Python versions 2.7, or 3.4+
  • numpy (tested with version 1.10)
  • scipy (tested with version 0.16)
  • scikit-learn (tested with version 0.17)
  • nose (optional) to run unit tests.

With these requirements satisfied, you can install this package by running

$ pip install wpca

or to install from the source tree, run

$ python setup.py install

To run the suite of unit tests, make sure nose is installed and run

$ nosetests wpca

wpca's People

Contributors

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