@@ -49,30 +49,25 @@ def split_classes(X, y):
49
49
50
50
51
51
def fda (X , y , p = 2 , reg = 1e-16 ):
52
- """
53
- Fisher Discriminant Analysis
54
-
52
+ """Fisher Discriminant Analysis
55
53
56
54
Parameters
57
55
----------
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.
62
60
p : int, optional
63
- size of dimensionnality reduction
61
+ Size of dimensionnality reduction.
64
62
reg : float, optional
65
63
Regularization term >0 (ridge regularization)
66
64
67
-
68
65
Returns
69
66
-------
70
- P : (d x p) ndarray
67
+ P : ndarray, shape (d, p)
71
68
Optimal transportation matrix for the given parameters
72
- proj : fun
69
+ proj : callable
73
70
projection function including mean centering
74
-
75
-
76
71
"""
77
72
78
73
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):
130
125
131
126
Parameters
132
127
----------
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.
137
132
p : int, optional
138
- size of dimensionnality reduction
133
+ Size of dimensionnality reduction.
139
134
reg : float, optional
140
135
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.
146
141
verbose : int, optional
147
- Print information along iterations
148
-
149
-
142
+ Print information along iterations.
150
143
151
144
Returns
152
145
-------
153
- P : (d x p) ndarray
146
+ P : ndarray, shape (d, p)
154
147
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.
158
150
159
151
References
160
152
----------
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.
164
155
""" # noqa
165
156
166
157
mx = np .mean (X )
0 commit comments