@@ -966,8 +966,12 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
966
966
The class labels
967
967
Xt : array-like, shape (n_target_samples, n_features)
968
968
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
971
975
972
976
Returns
973
977
-------
@@ -989,7 +993,7 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
989
993
990
994
# assumes labeled source samples occupy the first rows
991
995
# 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 ]
993
997
for c in classes :
994
998
idx_s = np .where ((ys != c ) & (ys != - 1 ))
995
999
idx_t = np .where (yt == c )
@@ -1023,8 +1027,12 @@ def fit_transform(self, Xs=None, ys=None, Xt=None, yt=None):
1023
1027
The class labels
1024
1028
Xt : array-like, shape (n_target_samples, n_features)
1025
1029
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
1028
1036
1029
1037
Returns
1030
1038
-------
@@ -1045,8 +1053,12 @@ def transform(self, Xs=None, ys=None, Xt=None, yt=None, batch_size=128):
1045
1053
The class labels
1046
1054
Xt : array-like, shape (n_target_samples, n_features)
1047
1055
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
1050
1062
batch_size : int, optional (default=128)
1051
1063
The batch size for out of sample inverse transform
1052
1064
@@ -1110,8 +1122,12 @@ def inverse_transform(self, Xs=None, ys=None, Xt=None, yt=None,
1110
1122
The class labels
1111
1123
Xt : array-like, shape (n_target_samples, n_features)
1112
1124
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
1115
1131
batch_size : int, optional (default=128)
1116
1132
The batch size for out of sample inverse transform
1117
1133
@@ -1241,8 +1257,12 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
1241
1257
The class labels
1242
1258
Xt : array-like, shape (n_target_samples, n_features)
1243
1259
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
1246
1266
1247
1267
Returns
1248
1268
-------
@@ -1333,8 +1353,12 @@ def fit(self, Xs, ys=None, Xt=None, yt=None):
1333
1353
The class labels
1334
1354
Xt : array-like, shape (n_target_samples, n_features)
1335
1355
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
1338
1362
1339
1363
Returns
1340
1364
-------
@@ -1434,8 +1458,12 @@ def fit(self, Xs, ys=None, Xt=None, yt=None):
1434
1458
The class labels
1435
1459
Xt : array-like, shape (n_target_samples, n_features)
1436
1460
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
1439
1467
1440
1468
Returns
1441
1469
-------
@@ -1545,8 +1573,12 @@ def fit(self, Xs, ys=None, Xt=None, yt=None):
1545
1573
The class labels
1546
1574
Xt : array-like, shape (n_target_samples, n_features)
1547
1575
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
1550
1582
1551
1583
Returns
1552
1584
-------
@@ -1662,8 +1694,12 @@ def fit(self, Xs=None, ys=None, Xt=None, yt=None):
1662
1694
The class labels
1663
1695
Xt : array-like, shape (n_target_samples, n_features)
1664
1696
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
1667
1703
1668
1704
Returns
1669
1705
-------
0 commit comments