88from classes .protein_degree_v3_class import ProteinDegreeV3
99from classes .sample_algorithm import SampleAlgorithm
1010from classes .base_algorithm_class import BaseAlgorithm
11+ from classes .hypergeometric_distribution_class import HypergeometricDistribution
12+ from classes .hypergeometric_distribution_class_V2 import HypergeometricDistributionV2
13+
1114from 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
1716import os
1817
1918
20-
2119def test_algorithm_attributes ():
2220 algorithm_classes = {
2321 "OverlappingNeighbors" : OverlappingNeighbors ,
@@ -26,7 +24,8 @@ def test_algorithm_attributes():
2624 "ProteinDegree" : ProteinDegree ,
2725 "ProteinDegreeV2" : ProteinDegreeV2 ,
2826 "ProteinDegreeV3" : ProteinDegreeV3 ,
29- "SampleAlgorithm" : SampleAlgorithm ,
27+ "HypergeometricDistribution" : HypergeometricDistribution ,
28+ "HypergeometricDistributionV2" : HypergeometricDistributionV2 ,
3029 }
3130 for algorithm in algorithm_classes :
3231 assert hasattr (algorithm_classes [algorithm ](), "y_score" )
@@ -41,14 +40,15 @@ def test_algorithm_inherits_class():
4140 "ProteinDegree" : ProteinDegree ,
4241 "ProteinDegreeV2" : ProteinDegreeV2 ,
4342 "ProteinDegreeV3" : ProteinDegreeV3 ,
44- "SampleAlgorithm" : SampleAlgorithm ,
43+ "HypergeometricDistribution" : HypergeometricDistribution ,
44+ "HypergeometricDistributionV2" : HypergeometricDistributionV2 ,
4545 }
4646
4747 for algorithm in algorithm_classes :
4848 assert issubclass (algorithm_classes [algorithm ], BaseAlgorithm )
4949
5050
51- def test_algorithm_workflow ():
51+ def test_algorithm_experiment ():
5252 if not os .path .exists ("output" ):
5353 os .makedirs ("output" )
5454 if not os .path .exists ("output/dataset" ):
@@ -70,9 +70,11 @@ def test_algorithm_workflow():
7070 "ProteinDegree" : ProteinDegree ,
7171 "ProteinDegreeV2" : ProteinDegreeV2 ,
7272 "ProteinDegreeV3" : ProteinDegreeV3 ,
73+ "HypergeometricDistribution" : HypergeometricDistribution ,
74+ "HypergeometricDistributionV2" : HypergeometricDistributionV2 ,
7375 }
7476
75- results = run_workflow (
77+ results = run_experiement (
7678 algorithm_classes ,
7779 input_directory_path ,
7880 graph_file_path ,
@@ -88,10 +90,8 @@ def test_algorithm_workflow():
8890 "ProteinDegree" : 0.825 ,
8991 "ProteinDegreeV2" : 0.675 ,
9092 "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 ,
9595 }
9696
9797 pr_results = {
@@ -101,11 +101,8 @@ def test_algorithm_workflow():
101101 "OverlappingNeighborsV2" : 0.7467907092907092 ,
102102 "ProteinDegreeV2" : 0.6367757242757243 ,
103103 "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 ,
109106 }
110107
111108 for algorithm , metrics in results .items ():
0 commit comments