MCPcopy Create free account
hub / github.com/PythonOT/POT / transform

Method transform

ot/da.py:976–1007  ·  view source on GitHub ↗

r"""Transports source samples :math:`\mathbf{X_s}` onto target ones :math:`\mathbf{X_t}` Parameters ---------- Xs : array-like, shape (n_source_samples, n_features) The training input samples. ys : array-like, shape (n_source_samples,) The cla

(self, Xs=None, ys=None, Xt=None, yt=None, batch_size=128)

Source from the content-addressed store, hash-verified

974 return self
975
976 def transform(self, Xs=None, ys=None, Xt=None, yt=None, batch_size=128):
977 r"""Transports source samples :math:`\mathbf{X_s}` onto target ones :math:`\mathbf{X_t}`
978
979 Parameters
980 ----------
981 Xs : array-like, shape (n_source_samples, n_features)
982 The training input samples.
983 ys : array-like, shape (n_source_samples,)
984 The class labels
985 Xt : array-like, shape (n_target_samples, n_features)
986 The training input samples.
987 yt : array-like, shape (n_target_samples,)
988 The class labels. If some target samples are unlabelled, fill the
989 :math:`\mathbf{y_t}`'s elements with -1.
990
991 Warning: Note that, due to this convention -1 cannot be used as a
992 class label
993 batch_size : int, optional (default=128)
994 The batch size for out of sample inverse transform
995
996 Returns
997 -------
998 transp_Xs : array-like, shape (n_source_samples, n_features)
999 The transport source samples.
1000 """
1001 nx = self.nx
1002
1003 # check the necessary inputs parameters are here
1004 if check_params(Xs=Xs):
1005 transp_Xs = nx.dot(Xs, self.A_) + self.B_
1006
1007 return transp_Xs
1008
1009 def inverse_transform(self, Xs=None, ys=None, Xt=None, yt=None, batch_size=128):
1010 r"""Transports target samples :math:`\mathbf{X_t}` onto source samples :math:`\mathbf{X_s}`

Callers 1

Calls 2

check_paramsFunction · 0.85
dotMethod · 0.45

Tested by 1