ignore warnings

This commit is contained in:
Italo 2022-02-06 01:07:30 +00:00
parent 6a4cae1f8c
commit 6c1729e20b

View File

@ -554,6 +554,8 @@ class Hyperopt:
# Perform a cross-validation estimate of the coefficient of determination using # Perform a cross-validation estimate of the coefficient of determination using
# the cross_validation module using all CPUs available on the machine # the cross_validation module using all CPUs available on the machine
# K = 5 # folds # K = 5 # folds
with warnings.catch_warnings():
warnings.simplefilter("ignore")
R2 = cross_val_score(res.models[-1], X=res.x_iters, y=res.func_vals, cv=5, n_jobs=jobs).mean() R2 = cross_val_score(res.models[-1], X=res.x_iters, y=res.func_vals, cv=5, n_jobs=jobs).mean()
print(f'R2: {R2}') print(f'R2: {R2}')
R2 = R2 if R2 > -5 else -5 R2 = R2 if R2 > -5 else -5