Exemplo n.º 1
0
 def test_soft_conv_10(self):
     # Difference between two arrays equals tolerance,
     # (would not be enough to reach convergence by itself)
     # but amount of observations must also be taken into account!
     labels = [0.99, 0.99, 0.1, 0.1, 0.005]
     pre_labels = [0.99, 0.99, 0.1, 0.1, 0.01]
     tol = 5e-3
     converged = corrmut.has_converged(labels, pre_labels, "soft", tol=tol)
     assert converged
Exemplo n.º 2
0
 def test_hard_conv_2(self):
     labels = [0] * 10
     pre_labels = [0] * 10
     converged = corrmut.has_converged(labels, pre_labels, "hard")
     assert converged
Exemplo n.º 3
0
 def test_soft_conv_9(self):
     labels = [0.99, 0.95, 0.90, 0.95, 0.1, 0.1, 0.001, 1e-3]
     pre_labels = [[0.99, 0.95, 0.90, 0.95, 0.1, 0.1, 0.001, 1e-32]]
     tol = 5e-3
     converged = corrmut.has_converged(labels, pre_labels, "soft", tol=tol)
     assert converged
Exemplo n.º 4
0
 def test_soft_conv_7(self):
     labels = [1, 1, 1, 0, 0, 0]
     pre_labels = [1, 1, 1, 0, 0, 0]
     converged = corrmut.has_converged(labels, pre_labels, "soft")
     assert converged
Exemplo n.º 5
0
 def test_soft_conv_4(self):
     labels = [0] * 10
     pre_labels = [1] * 10
     converged = corrmut.has_converged(labels, pre_labels, "soft")
     assert not converged
Exemplo n.º 6
0
 def test_hard_conv_7(self):
     labels = [1, 1, 1, 0, 0, 0]
     pre_labels = [1, 1, 1, 0, 0, 0]
     converged = corrmut.has_converged(labels, pre_labels, "hard")
     assert converged