Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
37cd702
Update 'sparse' parameter for OHE for sklearn >= 1.4
PGijsbers Jul 2, 2024
2343203
Add compatability or skips for sklearn >= 1.4
PGijsbers Jul 2, 2024
667529e
Change 'auto' to 'sqrt' for sklearn>1.3 as 'auto' is deprecated
PGijsbers Jul 3, 2024
7b088c4
Skip flaky test
PGijsbers Jul 3, 2024
875a05a
Fix typo
PGijsbers Jul 3, 2024
87cf0b3
Ignore description comparison for newer scikit-learn
PGijsbers Jul 3, 2024
7b826e0
Adjust for scikit-learn 1.3
PGijsbers Jul 3, 2024
280a972
Remove timeout and reruns to better investigate CI failures
PGijsbers Jul 3, 2024
72a8765
Fix typo in parametername
PGijsbers Jul 3, 2024
363724a
Add jobs for more recent scikit-learns
PGijsbers Jul 3, 2024
d664a34
Expand the matrix with all scikit-learn 1.x versions
PGijsbers Jul 3, 2024
9af2f62
Fix for numpy2.0 compatibility (#1341)
PGijsbers Jul 3, 2024
5d1da88
Rewrite matrix and update numpy compatibility
PGijsbers Jul 3, 2024
9bd7b2f
Move comment in-line
PGijsbers Jul 3, 2024
7ce5b89
Stringify name of new step to see if that prevented the action
PGijsbers Jul 3, 2024
91f6dee
Fix unspecified os for included jobs
PGijsbers Jul 3, 2024
670a76b
Fix typo in version pinning for numpy
PGijsbers Jul 3, 2024
412a193
Fix version specification for sklearn skips
PGijsbers Jul 4, 2024
35206bb
Output final list of installed packages for debugging purposes
PGijsbers Jul 4, 2024
f19897e
Cap scipy version for older versions of scikit-learn
PGijsbers Jul 4, 2024
dd11f5d
Update parameter base_estimator to estimator for sklearn>=1.4
PGijsbers Jul 4, 2024
9372054
Account for changes to sklearn interface in 1.4 and 1.5
PGijsbers Jul 4, 2024
72a2fb1
Non-strict reinstantiation requires different scikit-learn version
PGijsbers Jul 4, 2024
6830681
Parameters were already changed in 1.4
PGijsbers Jul 4, 2024
369f5c0
Fix race condition (I think)
PGijsbers Jul 4, 2024
a2e7022
Use latest patch version of each minor release
PGijsbers Jul 4, 2024
828a7a4
Convert numpy types back to builtin types
PGijsbers Jul 4, 2024
e98019c
Specify versions with * instead to allow for specific patches
PGijsbers Jul 4, 2024
c7f93c8
Flow_exists does not return None but False is the flow does not exist
PGijsbers Jul 4, 2024
68481cf
Update new version definitions also installation step
PGijsbers Jul 4, 2024
a6b5ddd
Fix bug introduced in refactoring for np.generic support
PGijsbers Jul 4, 2024
9e8217f
Add back the single-test timeout of 600s
PGijsbers Jul 4, 2024
eda2b23
[skip ci] Add note to changelog
PGijsbers Jul 4, 2024
6d0cb41
Check that evaluations are present with None-check instead
PGijsbers Jul 4, 2024
2c161e4
Remove timeouts again
PGijsbers Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert numpy types back to builtin types
Scikit-learn or numpy changed the typing of the parameters
(seen in a masked array, not sure if also outside of that).
Convert these values back to Python builtins.
  • Loading branch information
PGijsbers committed Jul 4, 2024
commit 828a7a4d67ed08b99490f2b1ebfebbf1de5a00e1
11 changes: 10 additions & 1 deletion openml/extensions/sklearn/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,14 @@ def _extract_trace_data(self, model, rep_no, fold_no):
for key in model.cv_results_:
if key.startswith("param_"):
value = model.cv_results_[key][itt_no]
serialized_value = json.dumps(value) if value is not np.ma.masked else np.nan
# Built-in serializer does not convert all numpy types,
# these methods convert them to built-in types instead.
if value is np.ma.masked:
value = np.nan
if isinstance(value, np.generic):
# For scalars it actually returns scalars, not a list
value = value.tolist()
serialized_value = json.dumps(value)
arff_line.append(serialized_value)
arff_tracecontent.append(arff_line)
return arff_tracecontent
Expand Down Expand Up @@ -2215,6 +2222,8 @@ def _obtain_arff_trace(
# int float
supported_basic_types = (bool, int, float, str)
for param_value in model.cv_results_[key]:
if isinstance(param_value, np.generic):
param_value = param_value.tolist() # noqa: PLW2901
if (
isinstance(param_value, supported_basic_types)
or param_value is None
Expand Down