@@ -966,8 +966,12 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
966966 The class labels
967967 Xt : array-like, shape (n_target_samples, n_features)
968968 The training input samples.
969- yt : array-like, shape (n_labeled_target_samples,)
970- The class labels
969+ yt : array-like, shape (n_target_samples,)
970+ The class labels. If some target samples are unlabeled, fill the
971+ yt's elements with -1.
972+
973+ Warning: Note that, due to this convention -1 cannot be used as a
974+ class label
971975
972976 Returns
973977 -------
@@ -989,7 +993,7 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
989993
990994 # assumes labeled source samples occupy the first rows
991995 # and labeled target samples occupy the first columns
992- classes = np .unique (ys )
996+ classes = [ c for c in np .unique (ys ) if c != - 1 ]
993997 for c in classes :
994998 idx_s = np .where ((ys != c ) & (ys != - 1 ))
995999 idx_t = np .where (yt == c )
@@ -1023,8 +1027,12 @@ def fit_transform(self, Xs=None, ys=None, Xt=None, yt=None):
10231027 The class labels
10241028 Xt : array-like, shape (n_target_samples, n_features)
10251029 The training input samples.
1026- yt : array-like, shape (n_labeled_target_samples,)
1027- The class labels
1030+ yt : array-like, shape (n_target_samples,)
1031+ The class labels. If some target samples are unlabeled, fill the
1032+ yt's elements with -1.
1033+
1034+ Warning: Note that, due to this convention -1 cannot be used as a
1035+ class label
10281036
10291037 Returns
10301038 -------
@@ -1045,8 +1053,12 @@ def transform(self, Xs=None, ys=None, Xt=None, yt=None, batch_size=128):
10451053 The class labels
10461054 Xt : array-like, shape (n_target_samples, n_features)
10471055 The training input samples.
1048- yt : array-like, shape (n_labeled_target_samples,)
1049- The class labels
1056+ yt : array-like, shape (n_target_samples,)
1057+ The class labels. If some target samples are unlabeled, fill the
1058+ yt's elements with -1.
1059+
1060+ Warning: Note that, due to this convention -1 cannot be used as a
1061+ class label
10501062 batch_size : int, optional (default=128)
10511063 The batch size for out of sample inverse transform
10521064
@@ -1110,8 +1122,12 @@ def inverse_transform(self, Xs=None, ys=None, Xt=None, yt=None,
11101122 The class labels
11111123 Xt : array-like, shape (n_target_samples, n_features)
11121124 The training input samples.
1113- yt : array-like, shape (n_labeled_target_samples,)
1114- The class labels
1125+ yt : array-like, shape (n_target_samples,)
1126+ The class labels. If some target samples are unlabeled, fill the
1127+ yt's elements with -1.
1128+
1129+ Warning: Note that, due to this convention -1 cannot be used as a
1130+ class label
11151131 batch_size : int, optional (default=128)
11161132 The batch size for out of sample inverse transform
11171133
@@ -1241,8 +1257,12 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
12411257 The class labels
12421258 Xt : array-like, shape (n_target_samples, n_features)
12431259 The training input samples.
1244- yt : array-like, shape (n_labeled_target_samples,)
1245- The class labels
1260+ yt : array-like, shape (n_target_samples,)
1261+ The class labels. If some target samples are unlabeled, fill the
1262+ yt's elements with -1.
1263+
1264+ Warning: Note that, due to this convention -1 cannot be used as a
1265+ class label
12461266
12471267 Returns
12481268 -------
@@ -1333,8 +1353,12 @@ def fit(self, Xs, ys=None, Xt=None, yt=None):
13331353 The class labels
13341354 Xt : array-like, shape (n_target_samples, n_features)
13351355 The training input samples.
1336- yt : array-like, shape (n_labeled_target_samples,)
1337- The class labels
1356+ yt : array-like, shape (n_target_samples,)
1357+ The class labels. If some target samples are unlabeled, fill the
1358+ yt's elements with -1.
1359+
1360+ Warning: Note that, due to this convention -1 cannot be used as a
1361+ class label
13381362
13391363 Returns
13401364 -------
@@ -1434,8 +1458,12 @@ def fit(self, Xs, ys=None, Xt=None, yt=None):
14341458 The class labels
14351459 Xt : array-like, shape (n_target_samples, n_features)
14361460 The training input samples.
1437- yt : array-like, shape (n_labeled_target_samples,)
1438- The class labels
1461+ yt : array-like, shape (n_target_samples,)
1462+ The class labels. If some target samples are unlabeled, fill the
1463+ yt's elements with -1.
1464+
1465+ Warning: Note that, due to this convention -1 cannot be used as a
1466+ class label
14391467
14401468 Returns
14411469 -------
@@ -1545,8 +1573,12 @@ def fit(self, Xs, ys=None, Xt=None, yt=None):
15451573 The class labels
15461574 Xt : array-like, shape (n_target_samples, n_features)
15471575 The training input samples.
1548- yt : array-like, shape (n_labeled_target_samples,)
1549- The class labels
1576+ yt : array-like, shape (n_target_samples,)
1577+ The class labels. If some target samples are unlabeled, fill the
1578+ yt's elements with -1.
1579+
1580+ Warning: Note that, due to this convention -1 cannot be used as a
1581+ class label
15501582
15511583 Returns
15521584 -------
@@ -1662,8 +1694,12 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
16621694 The class labels
16631695 Xt : array-like, shape (n_target_samples, n_features)
16641696 The training input samples.
1665- yt : array-like, shape (n_labeled_target_samples,)
1666- The class labels
1697+ yt : array-like, shape (n_target_samples,)
1698+ The class labels. If some target samples are unlabeled, fill the
1699+ yt's elements with -1.
1700+
1701+ Warning: Note that, due to this convention -1 cannot be used as a
1702+ class label
16671703
16681704 Returns
16691705 -------
0 commit comments