@@ -50,19 +50,19 @@ def test_de_bounds():
5050 Test if the bounds for the DE algorithm are set correctly.
5151 """
5252 S = Kriging (name = "kriging" , seed = 124 )
53- S .set_de_bounds ()
53+ S ._set_de_bounds ()
5454 assert S .de_bounds == [[- 3 , 2 ]]
5555 n = 10
5656 S = Kriging (name = "kriging" , seed = 124 , n_theta = n )
57- S .set_de_bounds ()
57+ S ._set_de_bounds ()
5858 assert len (S .de_bounds ) == n
5959 n = 2
6060 p = 4
6161 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True )
62- S .set_de_bounds ()
62+ S ._set_de_bounds ()
6363 assert len (S .de_bounds ) == n + p
6464 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = False )
65- S .set_de_bounds ()
65+ S ._set_de_bounds ()
6666 assert len (S .de_bounds ) == n
6767
6868
@@ -81,19 +81,19 @@ def test_optimize_model():
8181 p = 2
8282 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
8383 S ._initialize_variables (nat_X , nat_y )
84- S .set_variable_types ()
85- S .set_theta_values ()
86- S .initialize_matrices ()
87- S .set_de_bounds ()
84+ S ._set_variable_types ()
85+ S ._set_theta_values ()
86+ S ._initialize_matrices ()
87+ S ._set_de_bounds ()
8888 new_theta_p_Lambda = S .optimize_model ()
8989 assert len (new_theta_p_Lambda ) == n + p + 1
9090 # no noise, so Lambda is not considered
9191 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = False )
9292 S ._initialize_variables (nat_X , nat_y )
93- S .set_variable_types ()
94- S .set_theta_values ()
95- S .initialize_matrices ()
96- S .set_de_bounds ()
93+ S ._set_variable_types ()
94+ S ._set_theta_values ()
95+ S ._initialize_matrices ()
96+ S ._set_de_bounds ()
9797 new_theta_p_Lambda = S .optimize_model ()
9898 assert len (new_theta_p_Lambda ) == n + p
9999
@@ -105,10 +105,10 @@ def test_update_log():
105105 p = 2
106106 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
107107 S ._initialize_variables (nat_X , nat_y )
108- S .set_variable_types ()
109- S .set_theta_values ()
110- S .initialize_matrices ()
111- S .set_de_bounds ()
108+ S ._set_variable_types ()
109+ S ._set_theta_values ()
110+ S ._initialize_matrices ()
111+ S ._set_de_bounds ()
112112 _ = S .optimize_model ()
113113 S .update_log ()
114114 assert len (S .log ["negLnLike" ]) == 1
@@ -150,7 +150,7 @@ def test_set_variable_types():
150150 p = 2
151151 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
152152 S ._initialize_variables (nat_X , nat_y )
153- S .set_variable_types ()
153+ S ._set_variable_types ()
154154 assert S .var_type == ["num" , "num" ]
155155 assert S .var_type == ["num" , "num" ]
156156 assert S .num_mask .all ()
@@ -163,7 +163,7 @@ def test_set_variable_types():
163163 p = 1
164164 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
165165 S ._initialize_variables (nat_X , nat_y )
166- S .set_variable_types ()
166+ S ._set_variable_types ()
167167 S .var_type
168168 assert S .var_type == ["num" , "num" , "num" ]
169169
@@ -175,8 +175,8 @@ def set_theta_values():
175175 p = 2
176176 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
177177 S ._initialize_variables (nat_X , nat_y )
178- S .set_variable_types ()
179- S .set_theta_values ()
178+ S ._set_variable_types ()
179+ S ._set_theta_values ()
180180 assert S .theta .all () == np .array ([0.0 , 0.0 ]).all ()
181181 nat_X = np .array ([[1 , 2 ], [3 , 4 ]])
182182 nat_y = np .array ([1 , 2 ])
@@ -185,9 +185,9 @@ def set_theta_values():
185185 p = 2
186186 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
187187 S ._initialize_variables (nat_X , nat_y )
188- S .set_variable_types ()
188+ S ._set_variable_types ()
189189 snt = S .n_theta
190- S .set_theta_values ()
190+ S ._set_theta_values ()
191191 # since snt == 3, it is not equal to S.n_theta, which is 2 because
192192 # of the correction in the set_theta_values method
193193 assert S .n_theta != snt
@@ -200,9 +200,9 @@ def test_initialize_matrices():
200200 p = 1
201201 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
202202 S ._initialize_variables (nat_X , nat_y )
203- S .set_variable_types ()
204- S .set_theta_values ()
205- S .initialize_matrices ()
203+ S ._set_variable_types ()
204+ S ._set_theta_values ()
205+ S ._initialize_matrices ()
206206 # if var(self.nat_y) is > 0, then self.pen_val = self.n * log(var(self.nat_y)) + 1e4
207207 # else self.pen_val = self.n * var(self.nat_y) + 1e4
208208 assert S .pen_val == nat_X .shape [0 ] * log (var (S .nat_y )) + 1e4
@@ -214,9 +214,9 @@ def test_initialize_matrices():
214214 p = 1
215215 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = True )
216216 S ._initialize_variables (nat_X , nat_y )
217- S .set_variable_types ()
218- S .set_theta_values ()
219- S .initialize_matrices ()
217+ S ._set_variable_types ()
218+ S ._set_theta_values ()
219+ S ._initialize_matrices ()
220220 # if var(self.nat_y) is > 0, then self.pen_val = self.n * log(var(self.nat_y)) + 1e4
221221 # else self.pen_val = self.n * var(self.nat_y) + 1e4
222222 assert S .pen_val == nat_X .shape [0 ] * (var (S .nat_y )) + 1e4
@@ -233,10 +233,10 @@ def test_fun_likelihood():
233233 p = 1
234234 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = False )
235235 S ._initialize_variables (nat_X , nat_y )
236- S .set_variable_types ()
237- S .set_theta_values ()
238- S .initialize_matrices ()
239- S .set_de_bounds ()
236+ S ._set_variable_types ()
237+ S ._set_theta_values ()
238+ S ._initialize_matrices ()
239+ S ._set_de_bounds ()
240240 new_theta_p_Lambda = S .optimize_model ()
241241 S .extract_from_bounds (new_theta_p_Lambda )
242242 S .build_Psi ()
@@ -251,9 +251,9 @@ def test_likelihood():
251251 p = 1
252252 S = Kriging (name = "kriging" , seed = 124 , n_theta = n , n_p = p , optim_p = True , noise = False , theta_init_zero = True )
253253 S ._initialize_variables (nat_X , nat_y )
254- S .set_variable_types ()
255- S .set_theta_values ()
256- S .initialize_matrices ()
254+ S ._set_variable_types ()
255+ S ._set_theta_values ()
256+ S ._initialize_matrices ()
257257 S .build_Psi ()
258258 S .build_U ()
259259 S .likelihood ()
0 commit comments