Skip to content

Commit

Permalink
adding plot
Browse files Browse the repository at this point in the history
  • Loading branch information
manandraj20 committed Nov 1, 2024
1 parent 5de61c2 commit 2e9bde4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Binary file modified docs/requirements.txt
Binary file not shown.
12 changes: 12 additions & 0 deletions src/DP_epidemiology/contact_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from datetime import datetime
import opendp.prelude as dp
import matplotlib.pyplot as plt

dp.enable_features("contrib", "floating-point", "honest-but-curious")

Expand Down Expand Up @@ -119,3 +120,14 @@ def get_pearson_similarity(contact_matrix, Ground_truth_contact_matrix):
Ground_truth_contact_matrix).flatten(), np.array(contact_matrix).flatten())[0, 1]
return pearson_similarity

def plot_difference(A, B):
difference = A - B

plt.figure(figsize=(10, 8))
plt.imshow(difference, cmap='coolwarm', interpolation='none')
plt.colorbar(label='Difference')
plt.title('Difference between estimated_C and contact_others')
plt.xlabel('Index i2')
plt.ylabel('Index i1')
plt.show()

0 comments on commit 2e9bde4

Please sign in to comment.