diff options
-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 ############################################################################## |