Skip to content

Commit 1b00740

Browse files
committed
first pass with adding pydocstyle in makefile
1 parent 952503e commit 1b00740

File tree

4 files changed

+221
-217
lines changed

4 files changed

+221
-217
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,7 @@ autopep8 :
7474
aautopep8 :
7575
autopep8 -air test ot examples --jobs -1
7676

77+
pydocstyle :
78+
pydocstyle ot
79+
7780
FORCE :

ot/dr.py

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,25 @@ def split_classes(X, y):
4949

5050

5151
def fda(X, y, p=2, reg=1e-16):
52-
"""
53-
Fisher Discriminant Analysis
54-
52+
"""Fisher Discriminant Analysis
5553
5654
Parameters
5755
----------
58-
X : numpy.ndarray (n,d)
59-
Training samples
60-
y : np.ndarray (n,)
61-
labels for training samples
56+
X : ndarray, shape (n, d)
57+
Training samples.
58+
y : ndarray, shape (n,)
59+
Labels for training samples.
6260
p : int, optional
63-
size of dimensionnality reduction
61+
Size of dimensionnality reduction.
6462
reg : float, optional
6563
Regularization term >0 (ridge regularization)
6664
67-
6865
Returns
6966
-------
70-
P : (d x p) ndarray
67+
P : ndarray, shape (d, p)
7168
Optimal transportation matrix for the given parameters
72-
proj : fun
69+
proj : callable
7370
projection function including mean centering
74-
75-
7671
"""
7772

7873
mx = np.mean(X)
@@ -130,37 +125,33 @@ def wda(X, y, p=2, reg=1, k=10, solver=None, maxiter=100, verbose=0, P0=None):
130125
131126
Parameters
132127
----------
133-
X : numpy.ndarray (n,d)
134-
Training samples
135-
y : np.ndarray (n,)
136-
labels for training samples
128+
X : ndarray, shape (n, d)
129+
Training samples.
130+
y : ndarray, shape (n,)
131+
Labels for training samples.
137132
p : int, optional
138-
size of dimensionnality reduction
133+
Size of dimensionnality reduction.
139134
reg : float, optional
140135
Regularization term >0 (entropic regularization)
141-
solver : str, optional
142-
None for steepest decsent or 'TrustRegions' for trust regions algorithm
143-
else shoudl be a pymanopt.solvers
144-
P0 : numpy.ndarray (d,p)
145-
Initial starting point for projection
136+
solver : None | str, optional
137+
None for steepest descent or 'TrustRegions' for trust regions algorithm
138+
else should be a pymanopt.solvers
139+
P0 : ndarray, shape (d, p)
140+
Initial starting point for projection.
146141
verbose : int, optional
147-
Print information along iterations
148-
149-
142+
Print information along iterations.
150143
151144
Returns
152145
-------
153-
P : (d x p) ndarray
146+
P : ndarray, shape (d, p)
154147
Optimal transportation matrix for the given parameters
155-
proj : fun
156-
projection function including mean centering
157-
148+
proj : callable
149+
Projection function including mean centering.
158150
159151
References
160152
----------
161-
162-
.. [11] Flamary, R., Cuturi, M., Courty, N., & Rakotomamonjy, A. (2016). Wasserstein Discriminant Analysis. arXiv preprint arXiv:1608.08063.
163-
153+
.. [11] Flamary, R., Cuturi, M., Courty, N., & Rakotomamonjy, A. (2016).
154+
Wasserstein Discriminant Analysis. arXiv preprint arXiv:1608.08063.
164155
""" # noqa
165156

166157
mx = np.mean(X)

0 commit comments

Comments
 (0)