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