satwik77 / pyDPP

A python package for sampling from determinantal point processes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyDPP

PyPI version shields.io Build Status PyPI license

A python package for sampling from determinantal point processes. Below are instances of sampling from a bicluster and from a random set of points using pyDPP. Refer to examples and references for more information.

Usage:

>>> from pydpp.dpp import DPP
>>> import numpy as np
>>> X = np.random.random((10,10))
>>> dpp = DPP(X)
>>> dpp.compute_kernel(kernel_type = 'rbf', sigma= 0.4)   # use 'cos-sim' for cosine similarity
>>> samples = dpp.samples()                   # samples := [1,7,2,5]
>>> ksamlpes = dpp.sample_k(3)                # ksamples := [5,8,0]

Refer to examples/test-dpp.ipynb for more on usage.

Installation:

Stable:

$ pip install -U pydpp

Dev:

To get the project's source code, clone the github repository:

$ git clone https://github.com/satwik77/pyDPP.git
$ cd pyDPP

Install VirtualEnv using the following (optional):

$ [sudo] pip install virtualenv

Create and activate your virtual environment (optional):

$ virtualenv venv
$ source venv/bin/activate

Install all the required packages:

$ pip install -r requirements.txt

Install the package by running the following command from the root directory of the repository:

$ python setup.py install	

Requirements

  • Numpy
  • Scipy

Compatibility

The package has been tested with python 2.7 and python 3.5.2

References

  • Kulesza, A. and Taskar, B., 2011. k-DPPs: Fixed-size determinantal point processes. In Proceedings of the 28th International Conference on Machine Learning (ICML-11) (pp. 1193-1200). [paper]

  • Kulesza, A. and Taskar, B., 2012. Determinantal point processes for machine learning. Foundations and Trends® in Machine Learning, 5(2–3), pp.123-286. [paper]

About

A python package for sampling from determinantal point processes

License:MIT License


Languages

Language:Jupyter Notebook 77.4%Language:Python 22.6%