Skip to content

Commit

Permalink
Update pytest for hypergeometric distribution ROC and PR values
Browse files Browse the repository at this point in the history
  • Loading branch information
amnorman committed Jun 11, 2024
1 parent 2d64db4 commit 37e9e39
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .ipynb_checkpoints/main-checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from classes.hypergeometric_distribution_class_V2 import HypergeometricDistributionV2
from classes.hypergeometric_distribution_class_V3 import HypergeometricDistributionV3
from classes.hypergeometric_distribution_class_V4 import HypergeometricDistributionV4

import matplotlib.pyplot as plt
from random import sample
from pathlib import Path
Expand Down Expand Up @@ -45,6 +46,11 @@ def main():
graph_file_path = Path(dataset_directory_path, "graph.pickle")
sample_size = 1000

testing_output_data_path = Path("./output/data/")
testing_output_image_path = Path("./output/images/")
testing_input_directory_path = Path("./tests/testing-dataset/")
testing_graph_file_path = Path(testing_input_directory_path, "graph.pickle")

interactome_columns = [0, 1, 4, 5]
interactome = read_specific_columns(interactome_path, interactome_columns, "\t")

Expand Down Expand Up @@ -81,10 +87,10 @@ def main():

results = run_workflow(
algorithm_classes,
dataset_directory_path,
graph_file_path,
output_data_path,
output_image_path,
testing_input_directory_path,
testing_graph_file_path,
testing_output_data_path,
testing_output_image_path,
True,
True,
)
Expand Down
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from classes.hypergeometric_distribution_class_V2 import HypergeometricDistributionV2
from classes.hypergeometric_distribution_class_V3 import HypergeometricDistributionV3
from classes.hypergeometric_distribution_class_V4 import HypergeometricDistributionV4

import matplotlib.pyplot as plt
from random import sample
from pathlib import Path
Expand Down Expand Up @@ -49,7 +50,7 @@ def main():
testing_output_image_path = Path("./output/images/")
testing_input_directory_path = Path("./tests/testing-dataset/")
testing_graph_file_path = Path(testing_input_directory_path, "graph.pickle")

interactome_columns = [0, 1, 4, 5]
interactome = read_specific_columns(interactome_path, interactome_columns, "\t")

Expand Down
8 changes: 8 additions & 0 deletions tests/test_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def test_algorithm_workflow():
"ProteinDegree": 0.825,
"ProteinDegreeV2": 0.675,
"ProteinDegreeV3": 0.89,
"HypergeometricDistribution": 0.78,
"HypergeometricDistributionV2": 0.89,
"HypergeometricDistributionV3": 0.675,
"HypergeometricDistributionV4": 0.6
}

pr_results = {
Expand All @@ -87,6 +91,10 @@ def test_algorithm_workflow():
"ProteinDegreeV2": 0.6367757242757243,
"OverlappingNeighbors": 0.5329058916229968,
"SampleAlgorithm": 0.4093791854859966,
"HypergeometricDistribution": 0.7899246806,
"HypergeometricDistributionV2": 0.8519169719,
"HypergeometricDistributionV3": 0.7142573629,
"HypergeometricDistributionV4": 0.6967847007,
}

for algorithm, metrics in results.items():
Expand Down

0 comments on commit 37e9e39

Please sign in to comment.