8
8
from classes .protein_degree_v3_class import ProteinDegreeV3
9
9
from classes .sample_algorithm import SampleAlgorithm
10
10
from classes .base_algorithm_class import BaseAlgorithm
11
+ from classes .hypergeometric_distribution_class import HypergeometricDistribution
12
+ from classes .hypergeometric_distribution_class_V2 import HypergeometricDistributionV2
13
+
11
14
from pathlib import Path
12
- from tools .helper import (
13
- read_specific_columns ,
14
- import_graph_from_pickle ,
15
- )
16
- from tools .workflow import run_workflow
15
+ from tools .workflow import run_experiement
17
16
import os
18
17
19
18
20
-
21
19
def test_algorithm_attributes ():
22
20
algorithm_classes = {
23
21
"OverlappingNeighbors" : OverlappingNeighbors ,
@@ -26,7 +24,8 @@ def test_algorithm_attributes():
26
24
"ProteinDegree" : ProteinDegree ,
27
25
"ProteinDegreeV2" : ProteinDegreeV2 ,
28
26
"ProteinDegreeV3" : ProteinDegreeV3 ,
29
- "SampleAlgorithm" : SampleAlgorithm ,
27
+ "HypergeometricDistribution" : HypergeometricDistribution ,
28
+ "HypergeometricDistributionV2" : HypergeometricDistributionV2 ,
30
29
}
31
30
for algorithm in algorithm_classes :
32
31
assert hasattr (algorithm_classes [algorithm ](), "y_score" )
@@ -41,14 +40,15 @@ def test_algorithm_inherits_class():
41
40
"ProteinDegree" : ProteinDegree ,
42
41
"ProteinDegreeV2" : ProteinDegreeV2 ,
43
42
"ProteinDegreeV3" : ProteinDegreeV3 ,
44
- "SampleAlgorithm" : SampleAlgorithm ,
43
+ "HypergeometricDistribution" : HypergeometricDistribution ,
44
+ "HypergeometricDistributionV2" : HypergeometricDistributionV2 ,
45
45
}
46
46
47
47
for algorithm in algorithm_classes :
48
48
assert issubclass (algorithm_classes [algorithm ], BaseAlgorithm )
49
49
50
50
51
- def test_algorithm_workflow ():
51
+ def test_algorithm_experiment ():
52
52
if not os .path .exists ("output" ):
53
53
os .makedirs ("output" )
54
54
if not os .path .exists ("output/dataset" ):
@@ -70,9 +70,11 @@ def test_algorithm_workflow():
70
70
"ProteinDegree" : ProteinDegree ,
71
71
"ProteinDegreeV2" : ProteinDegreeV2 ,
72
72
"ProteinDegreeV3" : ProteinDegreeV3 ,
73
+ "HypergeometricDistribution" : HypergeometricDistribution ,
74
+ "HypergeometricDistributionV2" : HypergeometricDistributionV2 ,
73
75
}
74
76
75
- results = run_workflow (
77
+ results = run_experiement (
76
78
algorithm_classes ,
77
79
input_directory_path ,
78
80
graph_file_path ,
@@ -88,10 +90,8 @@ def test_algorithm_workflow():
88
90
"ProteinDegree" : 0.825 ,
89
91
"ProteinDegreeV2" : 0.675 ,
90
92
"ProteinDegreeV3" : 0.89 ,
91
- "HypergeometricDistribution" : 0.78 ,
92
- "HypergeometricDistributionV2" : 0.89 ,
93
- "HypergeometricDistributionV3" : 0.675 ,
94
- "HypergeometricDistributionV4" : 0.6
93
+ "HypergeometricDistribution" : 0.76 ,
94
+ "HypergeometricDistributionV2" : 0.86 ,
95
95
}
96
96
97
97
pr_results = {
@@ -101,11 +101,8 @@ def test_algorithm_workflow():
101
101
"OverlappingNeighborsV2" : 0.7467907092907092 ,
102
102
"ProteinDegreeV2" : 0.6367757242757243 ,
103
103
"OverlappingNeighbors" : 0.5329058916229968 ,
104
- "SampleAlgorithm" : 0.4093791854859966 ,
105
- "HypergeometricDistribution" : 0.7899246806 ,
106
- "HypergeometricDistributionV2" : 0.8519169719 ,
107
- "HypergeometricDistributionV3" : 0.7142573629 ,
108
- "HypergeometricDistributionV4" : 0.6967847007 ,
104
+ "HypergeometricDistribution" : 0.7899246805825753 ,
105
+ "HypergeometricDistributionV2" : 0.8519169719169718 ,
109
106
}
110
107
111
108
for algorithm , metrics in results .items ():
0 commit comments