GitXplorerGitXplorer
b

sinkhorn_knopp

public
33 stars
8 forks
0 issues

Commits

List of commits on branch master.
Unverified
73e9d74e7f050d0d08e00957ab3f3f2fbc2d25f2

update setup.py

committed 7 years ago
Unverified
72dd51730a711df04c53df1facad98eac2327d03

Merge branch 'Coni63-master'

committed 7 years ago
Unverified
61b68904ae7e4456cdd92c91f80fcd0dca944017

add build status

committed 7 years ago
Unverified
0a6ae71fbd2af14f3c98bd6d4059b72921b67166

fix install

committed 7 years ago
Unverified
b3de731c8aff3885cd3c712db184dc025cf33c07

automate testing

committed 7 years ago
Unverified
944d5cd3abeef7164e4d0c3da10abe07b03af89f

replace types verification by isinstance(x, type). script doesn't require types anymore

committed 7 years ago

README

The README file for this repository.

sinkhorn_knopp

Build Status

To convert non-negative square matrices with total support into doubly stochastic matrices.

    >> import numpy as np
    >> from sinkhorn_knopp import sinkhorn_knopp as skp
    >> sk = skp.SinkhornKnopp()
    >> P = [[.011, .15], [1.71, .1]]
    >> P_ds = sk.fit(P)
    >> print P_ds
        [[ 0.06102561  0.93897439]
        [ 0.93809928  0.06190072]]
    >> print np.sum(P_ds, axis=0)
        [ 0.99912489  1.00087511]
    >> print np.sum(P_ds, axis=1)
        [ 1.,  1.]

See http://msp.org/pjm/1967/21-2/pjm-v21-n2-p14-s.pdf for reference.

Install

Either:

pip install sinkhorn_knopp

or

git clone https://github.com/btaba/sinkhorn_knopp
cd sinkhorn_knopp
python setup.py install

Uninstall

Depending on the above, either:

pip uninstall sinkhorn_knopp

or

cd sinkhorn_knopp
python setup.py install --record files.txt
cat files.txt | xargs rm -rf