This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from sklearn.linear import LogisticRegression | |
| from sklearn.metrics import hamming_loss | |
| def c2st(X, y, clf=LogisticRegression(), loss=hamming_loss, bootstraps=300): | |
| """ | |
| Perform Classifier Two Sample Test (C2ST) [1]. | |
| This test estimates if a target is predictable from features by comparing the loss of a classifier learning | |
| the true target with the distribution of losses of classifiers learning a random target with the same average. |
OlderNewer