Parcourir la source

Use of squared into wsao

Jérôme BUISINE il y a 3 ans
Parent
commit
efe3746b19
2 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 3 1
      optimization/ILSSurrogate.py
  2. 1 1
      wsao

+ 3 - 1
optimization/ILSSurrogate.py

@@ -227,7 +227,9 @@ class ILSSurrogate(Algorithm):
                 self.progress()
 
             # check using specific dynamic criteria based on r^2
-            training_surrogate_every = int(self.analysis.coefficient_of_determination(self.surrogate) * self.ls_train_surrogate)
+            r_squared = self.analysis.coefficient_of_determination(self.surrogate)
+            training_surrogate_every = int(r_squared * self.ls_train_surrogate)
+            print(f"=> R^2 of surrogate is of {r_squared}. Retraining model every {training_surrogate_every} LS")
 
             # check if necessary or not to train again surrogate
             if self.n_local_search % training_surrogate_every == 0 and self.start_train_surrogate <= self.getGlobalEvaluation():

+ 1 - 1
wsao

@@ -1 +1 @@
-Subproject commit 875bbdcee600f911958dbc47e319afbb8796f49d
+Subproject commit c6c158fad943f0a816dc08b5f6b1063c6223e8f1