Skip to content

Commit

Permalink
remove tests and prints
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-sofia committed Oct 13, 2023
1 parent d0c44d4 commit 50ee766
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 58 deletions.
Binary file added foo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 0 additions & 24 deletions tests/test_pc_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,6 @@


class PCTestTestCase(unittest.TestCase):
def test_full_graph(self):
test_data = []

n = 100000
sample_size = 5

samples = {}

for i in range(sample_size):
x = [random.normalvariate(mu=0.0, sigma=1.0) for _ in range(n)]
noise_y = [random.normalvariate(mu=0.0, sigma=1.0) for _ in range(n)]
samples[str(i)] = sum_lists([5 * x_val for x_val in x], noise_y)

for i in range(n):
entry = {}
for key in samples.keys():
entry[key] = samples[key][i]
test_data.append(entry)

tst = PCGraph()
tst.create_graph_from_data(test_data)
tst.create_all_possible_edges()
tst.execute_pipeline_steps()
show_edges(tst.graph)

def test_with_rki_data(self):
with open("./tests/fixtures/rki-data.csv") as f:
Expand Down
37 changes: 3 additions & 34 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@
from utils import (
backward_substituion,
get_regression_coefficients,
get_residuals,
extended_partial_correlation_2_test,
get_residuals
)


class UtilsTestCase(unittest.TestCase):
def test_QR_decomposition(self):
x = [1, 2, 3]
Z = [[12, -51], [6, 167], [-4, 21]]
n = len(x)
Z = [[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]]
M = Matrix(Z)
Q, R = M.QRdecomposition()
print(f"Q shape = {Q.shape}")
print(f"R shape = {R.shape}")
# print(f"R ist {R}")
self.assertTrue(False)
self.assertAlmostEqual(R, Matrix([[2, 3, 2], [0, 5, -2], [0, 0, 4]]))

def test_backward_substitution(self):
R = Matrix([[1, 2, 3], [0, 4, 5], [0, 0, 6]])
Expand All @@ -30,30 +24,5 @@ def test_backward_substitution(self):
backward_substituion(R, b, n), Matrix([[-7 / 2], [-5 / 4], [4]])
)

def test_regression_coefficients(self):
x = [1, 2, 3]
Z = [[12, -51], [6, 167], [-4, 21]]
print(get_regression_coefficients(x, Z))
self.assertTrue(False)

def test_regression_coefficients_2(self):
x = [1, 2, 3, 4, 5]
Z = [[2, 3, 5], [3, 2, 2], [-16, 3, 1], [4, 3, 12], [5, 7, 120]]
print(get_regression_coefficients(x, Z))
self.assertTrue(False)

def test_get_residuals(self):
x = [1, 2, 3, 4, 5]
Z = [[2, 3, 5], [3, 2, 2], [-16, 3, 1], [4, 3, 12], [5, 7, 120]]
print(f"residuals are {get_residuals(x, Z)}")
self.assertTrue(False)

def test_shapes(self):
x = [1, 2, 3, 4, 5]
y = [-3, 2, 4, -6, 1]
Z = [[2, 3, 5], [3, 2, 2], [-16, 3, 1], [4, 3, 12], [5, 7, 120]]
print(extended_partial_correlation_2_test(x, y, Z))


if __name__ == "__main__":
unittest.main()

0 comments on commit 50ee766

Please sign in to comment.