Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b2f91f2
full coveragre utils
rflamary Jul 24, 2017
c6e648f
test parmap python 3.5
rflamary Jul 24, 2017
a31d3c2
map to list
rflamary Jul 24, 2017
f8e822c
test sinkhorn with empty marginals
rflamary Jul 24, 2017
7d9c5e7
add test optim
rflamary Jul 24, 2017
709d8cb
add dr tests
rflamary Jul 24, 2017
83ecc6d
bregman coverage
rflamary Jul 24, 2017
64cf2fc
tets barycenter
rflamary Jul 24, 2017
33f3d30
clean pep8
rflamary Jul 24, 2017
bd705ed
add test yunmlix and bary
rflamary Jul 24, 2017
f204e98
add test da 58% coverage
rflamary Jul 24, 2017
5aad08a
add test plot
rflamary Jul 24, 2017
a8d7301
add test plot and dataset
rflamary Jul 24, 2017
e11b1d1
test plot with no X
rflamary Jul 24, 2017
11f0652
matplotlib travis
rflamary Jul 24, 2017
46f297f
import nmpy before ot
rflamary Jul 26, 2017
68d7490
numpy assert + n_bins
rflamary Jul 26, 2017
67b011a
numpy assert test_da
rflamary Jul 26, 2017
347e628
n to n_samples
rflamary Jul 26, 2017
4a45135
dr +gpu numpy assert
rflamary Jul 26, 2017
2bc41ad
rng gpu
rflamary Jul 26, 2017
6a02db0
test_optim
rflamary Jul 26, 2017
86418eb
test_optim allclose
rflamary Jul 26, 2017
286de0a
clean test_ot
rflamary Jul 26, 2017
0e06129
Merge branch 'pytest' of github.com:rflamary/POT into pytest
rflamary Jul 26, 2017
81118f2
test_ot random state
rflamary Jul 26, 2017
109fc2a
flake8
rflamary Jul 26, 2017
e0fa14b
flake8
rflamary Jul 26, 2017
d101e08
nearly all review done
rflamary Jul 26, 2017
77037cc
gitignore
rflamary Jul 26, 2017
fac003d
author and license for tets files
rflamary Jul 26, 2017
0097017
add license and authors on all modules
rflamary Jul 26, 2017
251af8e
add author to all examples
rflamary Jul 26, 2017
84aa318
pep8
rflamary Jul 26, 2017
96f8b96
valid flake8
rflamary Jul 26, 2017
838550e
last stuff
rflamary Jul 26, 2017
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
n to n_samples
  • Loading branch information
rflamary committed Jul 26, 2017
commit 347e6288b87cbeef9b8fbc1a08cd130b96de1d61
11 changes: 4 additions & 7 deletions test/test_da.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
import ot


# import pytest


def test_otda():

n = 150 # nb samples
n_samples = 150 # nb samples
np.random.seed(0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RandomState

the get_data_classif function should take the rng in param and use it instead of np.random.randn

see the check_random_state function in sklearn


xs, ys = ot.datasets.get_data_classif('3gauss', n)
xt, yt = ot.datasets.get_data_classif('3gauss2', n)
xs, ys = ot.datasets.get_data_classif('3gauss', n_samples)
xt, yt = ot.datasets.get_data_classif('3gauss2', n_samples)

a, b = ot.unif(n), ot.unif(n)
a, b = ot.unif(n_samples), ot.unif(n_samples)

# LP problem
da_emd = ot.da.OTDA() # init class
Expand Down
25 changes: 10 additions & 15 deletions test/test_dr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
@pytest.mark.skipif(nogo, reason="Missing modules (autograd or pymanopt)")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it says autograd and pymanopt :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected the comment top of the test file.

def test_fda():

n = 90 # nb samples in source and target datasets
n_samples = 90 # nb samples in source and target datasets
np.random.seed(0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use RandomState


# generate circle dataset
xs, ys = ot.datasets.get_data_classif('gaussrot', n)
# generate gaussian dataset
xs, ys = ot.datasets.get_data_classif('gaussrot', n_samples)

nbnoise = 8
n_features_noise = 8

xs = np.hstack((xs, np.random.randn(n, nbnoise)))
xs = np.hstack((xs, np.random.randn(n_samples, n_features_noise)))

p = 1

Expand All @@ -35,20 +35,15 @@ def test_fda():
@pytest.mark.skipif(nogo, reason="Missing modules (autograd or pymanopt)")
def test_wda():

n = 100 # nb samples in source and target datasets
nz = 0.2
n_samples = 100 # nb samples in source and target datasets
np.random.seed(0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RandomState


# generate circle dataset
t = np.random.rand(n) * 2 * np.pi
ys = np.floor((np.arange(n) * 1.0 / n * 3)) + 1
xs = np.concatenate(
(np.cos(t).reshape((-1, 1)), np.sin(t).reshape((-1, 1))), 1)
xs = xs * ys.reshape(-1, 1) + nz * np.random.randn(n, 2)
# generate gaussian dataset
xs, ys = ot.datasets.get_data_classif('gaussrot', n_samples)

nbnoise = 8
n_features_noise = 8

xs = np.hstack((xs, np.random.randn(n, nbnoise)))
xs = np.hstack((xs, np.random.randn(n_samples, n_features_noise)))

p = 2

Expand Down