InfluenceDiffusion 0.0.3__tar.gz → 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- InfluenceDiffusion-0.0.5/InfluenceDiffusion/__init__.py +4 -0
- InfluenceDiffusion-0.0.5/InfluenceDiffusion/estimation_models/__init__.py +3 -0
- InfluenceDiffusion-0.0.5/InfluenceDiffusion/utils.py +16 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion.egg-info/PKG-INFO +1 -1
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion.egg-info/requires.txt +0 -1
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/PKG-INFO +1 -1
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/setup.py +2 -3
- InfluenceDiffusion-0.0.3/InfluenceDiffusion/__init__.py +0 -4
- InfluenceDiffusion-0.0.3/InfluenceDiffusion/estimation_models/__init__.py +0 -3
- InfluenceDiffusion-0.0.3/InfluenceDiffusion/utils.py +0 -29
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion/Graph.py +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion/Trace.py +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion/estimation_models/BaseWeightEstimator.py +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion/estimation_models/EMEstimation.py +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion/estimation_models/OptimEstimation.py +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion/influence_models.py +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion.egg-info/SOURCES.txt +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion.egg-info/dependency_links.txt +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion.egg-info/top_level.txt +0 -0
- {InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/setup.cfg +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from typing import Iterable, Set
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def multiple_union(set_list: Iterable[Set]):
|
|
6
|
+
final_set = set()
|
|
7
|
+
for cur_set in set_list:
|
|
8
|
+
final_set = final_set.union(cur_set)
|
|
9
|
+
return final_set
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def invert_non_zeros(array):
|
|
13
|
+
out = np.array(array, dtype=float)
|
|
14
|
+
non_zero_mask = array != 0
|
|
15
|
+
out[non_zero_mask] = 1. / out[non_zero_mask]
|
|
16
|
+
return out
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
2
|
|
|
3
|
-
VERSION = '0.0.
|
|
3
|
+
VERSION = '0.0.5'
|
|
4
4
|
DESCRIPTION = 'InfluenceDiffusion package'
|
|
5
5
|
LONG_DESCRIPTION = 'in this package, we implement popular network diffusion models and methods for their estimation.'
|
|
6
6
|
|
|
@@ -16,8 +16,7 @@ setup(
|
|
|
16
16
|
"scipy",
|
|
17
17
|
"networkx",
|
|
18
18
|
"typing",
|
|
19
|
-
"joblib",
|
|
20
|
-
"os"],
|
|
19
|
+
"joblib"],
|
|
21
20
|
|
|
22
21
|
keywords=['python', 'Influence Maximization', "Network diffusion models",
|
|
23
22
|
"General Linear Threshold model", "Social Networks", "Independent Cascade model"],
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
from typing import Iterable, Set, List
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def multiple_union(set_list: Iterable[Set]):
|
|
6
|
-
final_set = set()
|
|
7
|
-
for cur_set in set_list:
|
|
8
|
-
final_set = final_set.union(cur_set)
|
|
9
|
-
return final_set
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def invert_non_zeros(array):
|
|
13
|
-
out = np.array(array, dtype=float)
|
|
14
|
-
non_zero_mask = array != 0
|
|
15
|
-
out[non_zero_mask] = 1. / out[non_zero_mask]
|
|
16
|
-
return out
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def random_vector_inside_simplex(dim, ub=1):
|
|
20
|
-
U = np.random.uniform(low=0, high=ub, size=dim)
|
|
21
|
-
U_sorted = np.sort(U)
|
|
22
|
-
U_sorted = np.concatenate(([0], U_sorted))
|
|
23
|
-
x = np.diff(U_sorted)
|
|
24
|
-
return x
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def random_vector_on_simplex(dim, ub=1):
|
|
28
|
-
X = random_vector_inside_simplex(dim=dim, ub=1)
|
|
29
|
-
return X / np.sum(X) * ub
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion/influence_models.py
RENAMED
|
File without changes
|
{InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{InfluenceDiffusion-0.0.3 → InfluenceDiffusion-0.0.5}/InfluenceDiffusion.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|