adapt.metrics.linear_discrepancy
- adapt.metrics.linear_discrepancy(Xs, Xt, power_method=False, n_iter=20)[source]
Compute the linear discrepancy between Xs and Xt.
\[\Delta = \max_{u \in \mathbb{R}^p} u^T (X_S^T X_S - X_T^T X_T) u\]Where:
\(p\) is the number of features of Xs and Xt.
- Parameters
- Xsarray
Source array
- Xtarray
Target array
- power_methodbool (default=False)
Weither to use the power method approximation or not.
- n_iterint (default=20)
Number of iteration for power method
- Returns
- scorefloat
References
- 1
[1] Y. Mansour, M. Mohri, and A. Rostamizadeh. “Domain adaptation: Learning bounds and algorithms”. In COLT, 2009.