adapt.metrics.domain_classifier

adapt.metrics.domain_classifier(Xs, Xt, classifier=None, **fit_params)[source]

Return 1 minus the mean square error of a classifer disciminating between Xs and Xt.

\[\Delta = 1 - \min_{h \in H} || h(X_S) - 1 ||^2 + || h(X_T) ||^2\]

Where:

  • \(H\) is a class of classifier.

Parameters
Xsarray

Source array

Xtarray

Target array

classifiersklearn estimator or tensorflow Model instance

Classifier

fit_paramskey, value arguments

Parameters for the fit method of the classifier.

Returns
scorefloat

See also

reverse_validation
DANN

References

1

[1] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky. “Domain-adversarial training of neural networks”. In JMLR, 2016.