Skip to content

Commit d2ce34b

Browse files
authored
Fix checks
Checks were done badly and failed if the returned object was an empty container or 0.
1 parent 0bb084d commit d2ce34b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

skdatasets/utils/experiment.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,19 @@ def _benchmark_from_data(
213213
_append_info(experiment, "fitted_estimator", estimator)
214214

215215
best_params = getattr(estimator, "best_params_", None)
216-
if best_params:
216+
if best_params is not None:
217217
_append_info(experiment, "search_best_params", best_params)
218218

219219
best_index = getattr(estimator, "best_index_", None)
220-
if best_index:
220+
if best_index is not None:
221221
_append_info(experiment, "search_best_index", best_index)
222222

223223
cv_results = getattr(estimator, "cv_results_", None)
224-
if cv_results:
224+
if cv_results is not None:
225225
_append_info(experiment, "search_cv_results", cv_results)
226226

227227
best_score = getattr(estimator, "best_score_", None)
228-
if best_params:
228+
if best_score is not None:
229229
_append_info(experiment, "search_best_score", best_score)
230230

231231
with _add_timing(experiment, "score_time"):

0 commit comments

Comments
 (0)