summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2017-07-05 17:11:17 +0200
committerRémi Flamary <remi.flamary@gmail.com>2017-07-05 17:11:17 +0200
commit05765e26dec18697d9eb60ac5f3a7610af6ae8d2 (patch)
tree9e429f1a984171f3b899b60ce740a419d9811bef /examples
parent315d812b18fcb1170b4b84907b87aeaadaa9a196 (diff)
add FDA for comparison
Diffstat (limited to 'examples')
-rw-r--r--examples/plot_WDA.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/plot_WDA.py b/examples/plot_WDA.py
index bbe3888..d2eaf6d 100644
--- a/examples/plot_WDA.py
+++ b/examples/plot_WDA.py
@@ -11,7 +11,7 @@ import numpy as np
import matplotlib.pylab as pl
import ot
from ot.datasets import get_1D_gauss as gauss
-from ot.dr import wda
+from ot.dr import wda, fda
#%% parameters
@@ -36,7 +36,12 @@ pl.legend(loc=0)
pl.title('Discriminant dimensions')
-#%% plot distributions and loss matrix
+#%% Comlpute FDA
+p=2
+
+Pfda,projfda = fda(xs,ys,p)
+
+#%% Compute WDA
p=2
reg=1
k=10
@@ -46,8 +51,8 @@ P,proj = wda(xs,ys,p,reg,k,maxiter=maxiter)
#%% plot samples
-xsp=proj(xs)
-xtp=proj(xt)
+xsp=projfda(xs)
+xtp=projfda(xt)
pl.figure(1,(10,5))