adapt.metrics.neg_j_score
- adapt.metrics.neg_j_score(Xs, Xt, max_centers=100, sigma=None)[source]
Compute the negative J-score between Xs and Xt.
\[\Delta = -\int_{\mathcal{X}} P(X_T) \log(P(X_T) / P(X_S))\]Where:
\(P(X_S), P(X_T)\) are the probability density functions of Xs and Xt.
The source and target probability density functions are approximated with a mixture of gaussian kernels of bandwith
sigma
and centered inmax_centers
random points of Xt. The coefficient of the mixture are determined by solving a convex optimization (see [1])- Parameters
- Xsarray
Source array
- Xtarray
Target array
- max_centersint (default=100)
Maximum number of centers from Xt
- sigmafloat (default=None)
Kernel bandwidth. If
None
, the mean of pairwise distances between data from Xt is used.
- Returns
- scorefloat
See also
KLIEP
References
- 1
[1] M. Sugiyama, S. Nakajima, H. Kashima, P. von Bünau and M. Kawanabe. “Direct importance estimation with model selection and its application to covariateshift adaptation”. In NIPS 2007