diff options
author | Slasnista <stan.chambon@gmail.com> | 2017-09-04 09:17:59 +0200 |
---|---|---|
committer | Slasnista <stan.chambon@gmail.com> | 2017-09-04 09:17:59 +0200 |
commit | 669a6bee4200f6a2f1f6bbf597712684ff7272a8 (patch) | |
tree | 7bf85ee24b88d3dd7f403d38ce35ff4ce5193e48 /examples/da | |
parent | 363c5f92a4865527320edcff97036e62a7ca28c9 (diff) |
commenting the example
Diffstat (limited to 'examples/da')
-rw-r--r-- | examples/da/plot_otda_semi_supervised.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/da/plot_otda_semi_supervised.py b/examples/da/plot_otda_semi_supervised.py index 6e6296b..8095c4d 100644 --- a/examples/da/plot_otda_semi_supervised.py +++ b/examples/da/plot_otda_semi_supervised.py @@ -32,9 +32,6 @@ n_samples_target = 150 Xs, ys = ot.datasets.get_data_classif('3gauss', n_samples_source) Xt, yt = ot.datasets.get_data_classif('3gauss2', n_samples_target) -# Cost matrix -M = ot.dist(Xs, Xt, metric='sqeuclidean') - ############################################################################## # Transport source samples onto target samples @@ -55,6 +52,13 @@ transp_Xs_sinkhorn_semi = ot_sinkhorn_semi.transform(Xs=Xs) # of class A onto a target sample of class B != A is set to infinite, or a # very large value +# note that in the present case we consider that all the target samples are +# labeled. For daily applications, some target sample might not have labels, +# in this case the element of yt corresponding to these samples should be +# filled with -1. + +# Warning: we recall that -1 cannot be used as a class label + ############################################################################## # Fig 1 : plots source and target samples + matrix of pairwise distance @@ -92,6 +96,7 @@ pl.tight_layout() # the optimal coupling in the semi-supervised DA case will exhibit " shape # similar" to the cost matrix, (block diagonal matrix) + ############################################################################## # Fig 2 : plots optimal couplings for the different methods ############################################################################## |