Skip to content

Commit

Permalink
Auroc (#27)
Browse files Browse the repository at this point in the history
* added auroc

* readme
  • Loading branch information
WillHWThompson authored Feb 28, 2024
1 parent e50b98b commit fb43f63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
* The package is referenced as `lcs` (Learning complex structure) when accessing the functionality.
7 changes: 7 additions & 0 deletions lcs/measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions lcs/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb43f63

Please sign in to comment.