Skip to content

Commit 669a6be

Browse files
committed
commenting the example
1 parent 363c5f9 commit 669a6be

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

examples/da/plot_otda_semi_supervised.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
Xs, ys = ot.datasets.get_data_classif('3gauss', n_samples_source)
3333
Xt, yt = ot.datasets.get_data_classif('3gauss2', n_samples_target)
3434

35-
# Cost matrix
36-
M = ot.dist(Xs, Xt, metric='sqeuclidean')
37-
3835

3936
##############################################################################
4037
# Transport source samples onto target samples
@@ -55,6 +52,13 @@
5552
# of class A onto a target sample of class B != A is set to infinite, or a
5653
# very large value
5754

55+
# note that in the present case we consider that all the target samples are
56+
# labeled. For daily applications, some target sample might not have labels,
57+
# in this case the element of yt corresponding to these samples should be
58+
# filled with -1.
59+
60+
# Warning: we recall that -1 cannot be used as a class label
61+
5862

5963
##############################################################################
6064
# Fig 1 : plots source and target samples + matrix of pairwise distance
@@ -92,6 +96,7 @@
9296
# the optimal coupling in the semi-supervised DA case will exhibit " shape
9397
# similar" to the cost matrix, (block diagonal matrix)
9498

99+
95100
##############################################################################
96101
# Fig 2 : plots optimal couplings for the different methods
97102
##############################################################################

0 commit comments

Comments
 (0)