Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Fix properly convert cv_results_ values to numpy array #19211

Merged
merged 7 commits into from Apr 14, 2021

Conversation

@NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Jan 19, 2021

Fixes #19203

Some values in the cv_results_ attribute of the SH estimators where lists instead of numpy arrays.

CC @glemaitre as this might be release-critical?

@glemaitre
Copy link
Contributor

@glemaitre glemaitre commented Jan 19, 2021

CC @glemaitre as this might be release-critical?

We discuss with @ogrisel and it is not critical for 0.24.1 but we will include it in the upcoming 0.24.2.

@glemaitre glemaitre added this to the 0.24.2 milestone Jan 19, 2021
Copy link
Member

@thomasjpfan thomasjpfan left a comment

In general this looks like a common test for *SearchCV.cv_results_, but we can do that in a future PR.

@jnothman
Copy link
Member

@jnothman jnothman commented Jan 19, 2021

Base automatically changed from master to main Jan 22, 2021
@thomasjpfan thomasjpfan changed the title [MRG] Fix properly convert cv_results_ values to numpy array FIX Fix properly convert cv_results_ values to numpy array Apr 13, 2021
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Move the whats new to 0.24.2. LGTM on my end.

@glemaitre easy review?

for key, val in results.items():
# each value is a list (as per evaluate_candidate's convention)
# we convert it to an array for consistency with the other keys
results[key] = np.asarray(val)

This comment has been minimized.

@thomasjpfan

thomasjpfan Apr 13, 2021
Member

I updated this to use asarray so we do not make a copy if val is already an ndarray.

Copy link
Contributor

@glemaitre glemaitre left a comment

LGTM

@glemaitre glemaitre merged commit 872052b into scikit-learn:main Apr 14, 2021
27 checks passed
27 checks passed
@github-actions
check
Details
@github-actions
triage
Details
@github-actions
Check build trigger
Details
@github-actions
Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
Details
@github-actions
triage_file_extensions
Details
@github-actions
Source distribution
Details
@github-actions
Upload to Anaconda
Details
@lgtm-com
LGTM analysis: C/C++ No code changes detected
Details
@lgtm-com
LGTM analysis: JavaScript No code changes detected
Details
@lgtm-com
LGTM analysis: Python No new or fixed alerts
Details
ci/circleci: deploy Your tests passed on CircleCI!
Details
ci/circleci: doc Your tests passed on CircleCI!
Details
@circleci-artifacts-redirector
ci/circleci: doc artifact Link to 0/doc/_changed.html
Details
ci/circleci: doc-min-dependencies Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
@azure-pipelines
scikit-learn.scikit-learn Build #20210413.36 succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Get Git Commit) Get Git Commit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linting) Linting succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux py36_conda_openblas) Linux py36_conda_openblas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux py36_ubuntu_atlas) Linux py36_ubuntu_atlas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas) Linux pylatest_pip_openblas_pandas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux32 py36_ubuntu_atlas_32bit) Linux32 py36_ubuntu_atlas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux_Runs pylatest_conda_mkl) Linux_Runs pylatest_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py36_pip_openblas_32bit) Windows py36_pip_openblas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py37_conda_mkl) Windows py37_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_forge_mkl) macOS pylatest_conda_forge_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_mkl_no_openmp) macOS pylatest_conda_mkl_no_openmp succeeded
Details
thomasjpfan added a commit to thomasjpfan/scikit-learn that referenced this pull request Apr 19, 2021
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
10 of 12 tasks
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Apr 22, 2021
glemaitre added a commit that referenced this pull request Apr 28, 2021
…19211)

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants