Coverage for src/scicom/utilities/statistics.py: 0%

1 import os

2 from tqdm import tqdm

3 import pandas as pd

4

5 from semanticlayertools.metric.prune import PruneNetwork

6

7 def prune(

8 modelparameters: dict,

9 network: tuple,

10 columns: list,

11 iterations=10,

12 delAmounts=(0.1, 0.25, 0.5, 0.75, 0.9),

13 delTypes=("degree", "unif")

14):

15 """Generate pruned networks from input.

16

17 Assumes existence of columns "sender", "receiver", and "step".

18 """

19 runDf = pd.DataFrame(network, columns = columns)

20 pruning = PruneNetwork(runDf)

21 result = pruning.deleteFromNetwork(

22 iterations=iterations,

23 delAmounts=delAmounts,

24 delTypes=delTypes

25 )

26 result = result.assign(**modelparameters)

27 return result

28