aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorericbalkanski <ericbalkanski@MACD-01953.local>2014-12-07 17:16:57 -0500
committerericbalkanski <ericbalkanski@MACD-01953.local>2014-12-07 17:16:57 -0500
commit9c2d0453e83d7a2472a02bcc09fc7b2a5c79fc6a (patch)
tree97b97530f13ab401ce4b6fc6704d0134adaad78a /src
parent6e15f30cda55b7bff805e2475f2300e63e59318e (diff)
downloadcascades-9c2d0453e83d7a2472a02bcc09fc7b2a5c79fc6a.tar.gz
Revert "Revert 566f924..4ba0141"
This reverts commit 6e15f30cda55b7bff805e2475f2300e63e59318e.
Diffstat (limited to 'src')
-rw-r--r--src/algorithms.py2
-rw-r--r--src/cascade_creation.py2
-rw-r--r--src/make_plots.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/algorithms.py b/src/algorithms.py
index 0e240c9..39bcbb2 100644
--- a/src/algorithms.py
+++ b/src/algorithms.py
@@ -60,7 +60,7 @@ def correctness_measure(G, G_hat, print_values=False):
edges_hat = set(G_hat.edges())
fp = len(edges_hat - edges)
fn = len(edges - edges_hat)
- tp = len(edges | edges_hat)
+ tp = len(edges & edges_hat)
tn = G.number_of_nodes() ** 2 - fp - fn - tp
#Other metrics
diff --git a/src/cascade_creation.py b/src/cascade_creation.py
index 9a26c03..1a71285 100644
--- a/src/cascade_creation.py
+++ b/src/cascade_creation.py
@@ -4,7 +4,7 @@ import collections
from itertools import izip
from sklearn.preprocessing import normalize
-class InfluenceGraph(nx.Graph):
+class InfluenceGraph(nx.DiGraph):
"""
networkX graph with mat and logmat attributes
"""
diff --git a/src/make_plots.py b/src/make_plots.py
index 7c8bebb..905c731 100644
--- a/src/make_plots.py
+++ b/src/make_plots.py
@@ -40,7 +40,7 @@ def compare_greedy_and_lagrange_cs284r():
"""
G = cascade_creation.InfluenceGraph(max_proba = .8)
G.import_from_file("../datasets/subset_facebook_SNAPnormalize.txt")
- A = cascade_creation.generate_cascades(G, p_init=.05, n_cascades=50)
+ A = cascade_creation.generate_cascades(G, p_init=.05, n_cascades=100)
#Greedy
G_hat = algorithms.greedy_prediction(G, A)