diff --git a/README.md b/README.md index a1fd385..5fcae69 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # modeling-and-inferring-higher-order-contagion-spread +THIS IS A RAD PROJECT! + Some things: * To run the unit tests, you need to pip install the package locally. Navigate to the local folder on your computer and run "pip install -e ." * To run the unit tests, run "pytest" in the command line. -* The package is referenced as `lcs` (Learning complex structure) when accessing the functionality. \ No newline at end of file +* The package is referenced as `lcs` (Learning complex structure) when accessing the functionality. diff --git a/lcs/measures.py b/lcs/measures.py index fd928b5..2fcfc10 100644 --- a/lcs/measures.py +++ b/lcs/measures.py @@ -76,3 +76,10 @@ def density(A): def hamming_distance(A1, A2): return np.sum(np.abs(A1 - A2)) / 2 + + +def auroc(samples,A): + Q = samples.mean(axis=0) + A = A.flatten() + Q = Q.flatten() + return roc_auc_score(A,Q) diff --git a/lcs/utilities.py b/lcs/utilities.py index d28d020..0248333 100644 --- a/lcs/utilities.py +++ b/lcs/utilities.py @@ -5,6 +5,7 @@ from scipy.sparse import csr_array from scipy.sparse.csgraph import reverse_cuthill_mckee from scipy.stats import rv_discrete +from sklearn.metrics import roc_auc_score from .contagion import * from .generative import erdos_renyi