|
@@ -83,7 +83,6 @@ class ILSSurrogate(Algorithm):
|
|
|
surrogate = WalshSurrogate(order=2, size=problem.size, model=model)
|
|
|
analysis = FitterAnalysis(logfile="train_surrogate.log", problem=problem)
|
|
|
algo = FitterAlgo(problem=problem, surrogate=surrogate, analysis=analysis, seed=problem.seed)
|
|
|
- self.analysis = analysis
|
|
|
|
|
|
# dynamic number of samples based on dataset real evaluations
|
|
|
nsamples = None
|
|
@@ -227,7 +226,7 @@ class ILSSurrogate(Algorithm):
|
|
|
self.progress()
|
|
|
|
|
|
# check using specific dynamic criteria based on r^2
|
|
|
- r_squared = self.analysis.coefficient_of_determination(self.surrogate)
|
|
|
+ r_squared = self.surrogate.analysis.coefficient_of_determination(self.surrogate.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")
|
|
|
|