InfluenceDiffusion 0.0.11__tar.gz → 0.0.12__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.12/InfluenceDiffusion.egg-info/PKG-INFO +96 -0
- influencediffusion-0.0.12/PKG-INFO +96 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/setup.py +4 -2
- influencediffusion-0.0.11/InfluenceDiffusion.egg-info/PKG-INFO +0 -22
- influencediffusion-0.0.11/PKG-INFO +0 -22
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/Graph.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/Trace.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/__init__.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/BaseWeightEstimator.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/EMEstimation.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/OptimEstimation.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/__init__.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/influence_models.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/utils.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/weight_samplers.py +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/SOURCES.txt +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/dependency_links.txt +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/requires.txt +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/top_level.txt +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/LICENSE +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/README.md +0 -0
- {influencediffusion-0.0.11 → influencediffusion-0.0.12}/setup.cfg +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: InfluenceDiffusion
|
|
3
|
+
Version: 0.0.12
|
|
4
|
+
Summary: InfluenceDiffusion package
|
|
5
|
+
Author: Alexander Kagan
|
|
6
|
+
Author-email: <amkagan@umich.edu>
|
|
7
|
+
Keywords: python,Influence Maximization,Network diffusion models,General Linear Threshold model,Social Networks,Independent Cascade model
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Education
|
|
10
|
+
Classifier: Programming Language :: Python :: 2
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: scipy
|
|
18
|
+
Requires-Dist: networkx
|
|
19
|
+
Requires-Dist: typing
|
|
20
|
+
Requires-Dist: joblib
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# InfluenceDiffusion
|
|
24
|
+
|
|
25
|
+
InfluenceDiffusion is a Python library that provides instruments for working with influence diffusion models on graphs. In particular, it contains implementations of
|
|
26
|
+
- Popular diffusion models such as Independent Cascade, (General) Linear Threshold, etc.
|
|
27
|
+
- Methods for estimating parameters of these models
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install InfluenceDiffusion.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install InfluenceDiffusion
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
# Imports
|
|
42
|
+
import matplotlib.pyplot as plt
|
|
43
|
+
from networkx import erdos_renyi_graph
|
|
44
|
+
|
|
45
|
+
from InfluenceDiffusion.Graph import Graph # class inheriting from nx.DiGraph
|
|
46
|
+
from InfluenceDiffusion.influence_models import LTM
|
|
47
|
+
from InfluenceDiffusion.estimation_models.EMEstimation import LTWeightEstimatorEM
|
|
48
|
+
from InfluenceDiffusion.weight_samplers import make_random_weights_with_indeg_constraint
|
|
49
|
+
|
|
50
|
+
# Sample an Erdos-Renyi graph
|
|
51
|
+
g_nx = erdos_renyi_graph(50, p=0.1, directed=True)
|
|
52
|
+
g = Graph(edge_list=g_nx.edges)
|
|
53
|
+
|
|
54
|
+
# Set ground-truth LT model edge weights (in-degree of each node is at most 1)
|
|
55
|
+
weights = make_random_weights_with_indeg_constraint(g, indeg_ub=1)
|
|
56
|
+
g.set_weights(weights)
|
|
57
|
+
|
|
58
|
+
# Sample traces from an LT model on this graph
|
|
59
|
+
ltm = LTM(g)
|
|
60
|
+
traces = ltm.sample_traces(1000)
|
|
61
|
+
|
|
62
|
+
# Estimate the weights using the traces
|
|
63
|
+
ltm_estimator = LTWeightEstimatorEM(g)
|
|
64
|
+
pred_weights = ltm_estimator.fit(traces)
|
|
65
|
+
|
|
66
|
+
# Compare with the ground-truth weights
|
|
67
|
+
plt.scatter(weights, pred_weights)
|
|
68
|
+
plt.plot([0, 1], [0, 1], linestyle='--', c='black')
|
|
69
|
+
plt.xlabel("True weights")
|
|
70
|
+
plt.ylabel("Predicted weights")
|
|
71
|
+
plt.show()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT License
|
|
77
|
+
|
|
78
|
+
Copyright (c) 2024 Alexander Kagan
|
|
79
|
+
|
|
80
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
81
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
82
|
+
in the Software without restriction, including without limitation the rights
|
|
83
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
84
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
85
|
+
furnished to do so, subject to the following conditions:
|
|
86
|
+
|
|
87
|
+
The above copyright notice and this permission notice shall be included in all
|
|
88
|
+
copies or substantial portions of the Software.
|
|
89
|
+
|
|
90
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
91
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
92
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
93
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
94
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
95
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
96
|
+
SOFTWARE.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: InfluenceDiffusion
|
|
3
|
+
Version: 0.0.12
|
|
4
|
+
Summary: InfluenceDiffusion package
|
|
5
|
+
Author: Alexander Kagan
|
|
6
|
+
Author-email: <amkagan@umich.edu>
|
|
7
|
+
Keywords: python,Influence Maximization,Network diffusion models,General Linear Threshold model,Social Networks,Independent Cascade model
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Education
|
|
10
|
+
Classifier: Programming Language :: Python :: 2
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Requires-Dist: numpy
|
|
17
|
+
Requires-Dist: scipy
|
|
18
|
+
Requires-Dist: networkx
|
|
19
|
+
Requires-Dist: typing
|
|
20
|
+
Requires-Dist: joblib
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# InfluenceDiffusion
|
|
24
|
+
|
|
25
|
+
InfluenceDiffusion is a Python library that provides instruments for working with influence diffusion models on graphs. In particular, it contains implementations of
|
|
26
|
+
- Popular diffusion models such as Independent Cascade, (General) Linear Threshold, etc.
|
|
27
|
+
- Methods for estimating parameters of these models
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install InfluenceDiffusion.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install InfluenceDiffusion
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
# Imports
|
|
42
|
+
import matplotlib.pyplot as plt
|
|
43
|
+
from networkx import erdos_renyi_graph
|
|
44
|
+
|
|
45
|
+
from InfluenceDiffusion.Graph import Graph # class inheriting from nx.DiGraph
|
|
46
|
+
from InfluenceDiffusion.influence_models import LTM
|
|
47
|
+
from InfluenceDiffusion.estimation_models.EMEstimation import LTWeightEstimatorEM
|
|
48
|
+
from InfluenceDiffusion.weight_samplers import make_random_weights_with_indeg_constraint
|
|
49
|
+
|
|
50
|
+
# Sample an Erdos-Renyi graph
|
|
51
|
+
g_nx = erdos_renyi_graph(50, p=0.1, directed=True)
|
|
52
|
+
g = Graph(edge_list=g_nx.edges)
|
|
53
|
+
|
|
54
|
+
# Set ground-truth LT model edge weights (in-degree of each node is at most 1)
|
|
55
|
+
weights = make_random_weights_with_indeg_constraint(g, indeg_ub=1)
|
|
56
|
+
g.set_weights(weights)
|
|
57
|
+
|
|
58
|
+
# Sample traces from an LT model on this graph
|
|
59
|
+
ltm = LTM(g)
|
|
60
|
+
traces = ltm.sample_traces(1000)
|
|
61
|
+
|
|
62
|
+
# Estimate the weights using the traces
|
|
63
|
+
ltm_estimator = LTWeightEstimatorEM(g)
|
|
64
|
+
pred_weights = ltm_estimator.fit(traces)
|
|
65
|
+
|
|
66
|
+
# Compare with the ground-truth weights
|
|
67
|
+
plt.scatter(weights, pred_weights)
|
|
68
|
+
plt.plot([0, 1], [0, 1], linestyle='--', c='black')
|
|
69
|
+
plt.xlabel("True weights")
|
|
70
|
+
plt.ylabel("Predicted weights")
|
|
71
|
+
plt.show()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT License
|
|
77
|
+
|
|
78
|
+
Copyright (c) 2024 Alexander Kagan
|
|
79
|
+
|
|
80
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
81
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
82
|
+
in the Software without restriction, including without limitation the rights
|
|
83
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
84
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
85
|
+
furnished to do so, subject to the following conditions:
|
|
86
|
+
|
|
87
|
+
The above copyright notice and this permission notice shall be included in all
|
|
88
|
+
copies or substantial portions of the Software.
|
|
89
|
+
|
|
90
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
91
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
92
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
93
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
94
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
95
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
96
|
+
SOFTWARE.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
this_directory = Path(__file__).parent
|
|
4
|
+
LONG_DESCRIPTION = (this_directory / "README.md").read_text()
|
|
2
5
|
|
|
3
|
-
VERSION = '0.0.
|
|
6
|
+
VERSION = '0.0.12'
|
|
4
7
|
DESCRIPTION = 'InfluenceDiffusion package'
|
|
5
|
-
LONG_DESCRIPTION = 'In this package, we implement popular network diffusion models and methods for their estimation.'
|
|
6
8
|
|
|
7
9
|
setup(
|
|
8
10
|
name="InfluenceDiffusion",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: InfluenceDiffusion
|
|
3
|
-
Version: 0.0.11
|
|
4
|
-
Summary: InfluenceDiffusion package
|
|
5
|
-
Author: Alexander Kagan
|
|
6
|
-
Author-email: <amkagan@umich.edu>
|
|
7
|
-
Keywords: python,Influence Maximization,Network diffusion models,General Linear Threshold model,Social Networks,Independent Cascade model
|
|
8
|
-
Classifier: Development Status :: 3 - Alpha
|
|
9
|
-
Classifier: Intended Audience :: Education
|
|
10
|
-
Classifier: Programming Language :: Python :: 2
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Operating System :: MacOS :: MacOS X
|
|
13
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: numpy
|
|
17
|
-
Requires-Dist: scipy
|
|
18
|
-
Requires-Dist: networkx
|
|
19
|
-
Requires-Dist: typing
|
|
20
|
-
Requires-Dist: joblib
|
|
21
|
-
|
|
22
|
-
In this package, we implement popular network diffusion models and methods for their estimation.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: InfluenceDiffusion
|
|
3
|
-
Version: 0.0.11
|
|
4
|
-
Summary: InfluenceDiffusion package
|
|
5
|
-
Author: Alexander Kagan
|
|
6
|
-
Author-email: <amkagan@umich.edu>
|
|
7
|
-
Keywords: python,Influence Maximization,Network diffusion models,General Linear Threshold model,Social Networks,Independent Cascade model
|
|
8
|
-
Classifier: Development Status :: 3 - Alpha
|
|
9
|
-
Classifier: Intended Audience :: Education
|
|
10
|
-
Classifier: Programming Language :: Python :: 2
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Operating System :: MacOS :: MacOS X
|
|
13
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: numpy
|
|
17
|
-
Requires-Dist: scipy
|
|
18
|
-
Requires-Dist: networkx
|
|
19
|
-
Requires-Dist: typing
|
|
20
|
-
Requires-Dist: joblib
|
|
21
|
-
|
|
22
|
-
In this package, we implement popular network diffusion models and methods for their estimation.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/influence_models.py
RENAMED
|
File without changes
|
|
File without changes
|
{influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion/weight_samplers.py
RENAMED
|
File without changes
|
{influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/requires.txt
RENAMED
|
File without changes
|
{influencediffusion-0.0.11 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|