InfluenceDiffusion 0.0.10__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.
Files changed (22) hide show
  1. influencediffusion-0.0.12/InfluenceDiffusion.egg-info/PKG-INFO +96 -0
  2. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/SOURCES.txt +1 -1
  3. influencediffusion-0.0.12/PKG-INFO +96 -0
  4. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/README.md +23 -4
  5. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/setup.py +5 -2
  6. influencediffusion-0.0.10/InfluenceDiffusion.egg-info/PKG-INFO +0 -21
  7. influencediffusion-0.0.10/PKG-INFO +0 -21
  8. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/Graph.py +0 -0
  9. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/Trace.py +0 -0
  10. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/__init__.py +0 -0
  11. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/BaseWeightEstimator.py +0 -0
  12. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/EMEstimation.py +0 -0
  13. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/OptimEstimation.py +0 -0
  14. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/estimation_models/__init__.py +0 -0
  15. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/influence_models.py +0 -0
  16. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/utils.py +0 -0
  17. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion/weight_samplers.py +0 -0
  18. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/dependency_links.txt +0 -0
  19. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/requires.txt +0 -0
  20. {influencediffusion-0.0.10 → influencediffusion-0.0.12}/InfluenceDiffusion.egg-info/top_level.txt +0 -0
  21. /influencediffusion-0.0.10/LICENSE.txt → /influencediffusion-0.0.12/LICENSE +0 -0
  22. {influencediffusion-0.0.10 → 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.
@@ -1,4 +1,4 @@
1
- LICENSE.txt
1
+ LICENSE
2
2
  README.md
3
3
  setup.cfg
4
4
  setup.py
@@ -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,7 +1,7 @@
1
- 
1
+
2
2
  # InfluenceDiffusion
3
3
 
4
- InfluenceDiffusion is a Python library that provides instruments for working with influence diffusion models on graphs. In particualr, it contains implementations of
4
+ InfluenceDiffusion is a Python library that provides instruments for working with influence diffusion models on graphs. In particular, it contains implementations of
5
5
  - Popular diffusion models such as Independent Cascade, (General) Linear Threshold, etc.
6
6
  - Methods for estimating parameters of these models
7
7
 
@@ -50,7 +50,26 @@ plt.ylabel("Predicted weights")
50
50
  plt.show()
51
51
  ```
52
52
 
53
-
54
53
  ## License
55
54
 
56
- [MIT](https://choosealicense.com/licenses/mit/)
55
+ MIT License
56
+
57
+ Copyright (c) 2024 Alexander Kagan
58
+
59
+ Permission is hereby granted, free of charge, to any person obtaining a copy
60
+ of this software and associated documentation files (the "Software"), to deal
61
+ in the Software without restriction, including without limitation the rights
62
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
63
+ copies of the Software, and to permit persons to whom the Software is
64
+ furnished to do so, subject to the following conditions:
65
+
66
+ The above copyright notice and this permission notice shall be included in all
67
+ copies or substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75
+ 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.10'
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",
@@ -10,6 +12,7 @@ setup(
10
12
  author="Alexander Kagan",
11
13
  author_email="<amkagan@umich.edu>",
12
14
  description=DESCRIPTION,
15
+ long_description_content_type="text/markdown",
13
16
  long_description=LONG_DESCRIPTION,
14
17
  packages=find_packages(),
15
18
  install_requires=["numpy",
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: InfluenceDiffusion
3
- Version: 0.0.10
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
- License-File: LICENSE.txt
15
- Requires-Dist: numpy
16
- Requires-Dist: scipy
17
- Requires-Dist: networkx
18
- Requires-Dist: typing
19
- Requires-Dist: joblib
20
-
21
- in this package, we implement popular network diffusion models and methods for their estimation.
@@ -1,21 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: InfluenceDiffusion
3
- Version: 0.0.10
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
- License-File: LICENSE.txt
15
- Requires-Dist: numpy
16
- Requires-Dist: scipy
17
- Requires-Dist: networkx
18
- Requires-Dist: typing
19
- Requires-Dist: joblib
20
-
21
- in this package, we implement popular network diffusion models and methods for their estimation.