8000 ENH Add get_feature_names_out for ensemble module by MaxwellLZH · Pull Request #21459 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

ENH Add get_feature_names_out for ensemble module #21459

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ jobs:

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9' # update once build dependencies are available

- name: Build and test wheels
env:
Expand Down
17 changes: 13 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
# Custom environment variables for the ARM wheel builder
- CIBW_BUILD_VERBOSITY=1
- CIBW_TEST_COMMAND="bash {project}/build_tools/travis/test_wheels.sh"
- CIBW_ENVIRONMENT="CPU_COUNT=6
- CIBW_ENVIRONMENT="CPU_COUNT=2
OMP_NUM_THREADS=2
OPENBLAS_NUM_THREADS=2
SKLEARN_BUILD_PARALLEL=10
Expand All @@ -39,23 +39,32 @@ jobs:
# fast.
- python: 3.7
os: linux
arch: arm64
arch: arm64-graviton2
dist: focal
virt: lxd
group: edge
if: type = cron or commit_message =~ /\[cd build\]/
env:
- BUILD_WHEEL=true
- CIBW_BUILD=cp37-manylinux_aarch64

- python: 3.8
os: linux
arch: arm64
arch: arm64-graviton2
dist: focal
virt: lxd
group: edge
if: type = cron or commit_message =~ /\[cd build\]/
env:
- BUILD_WHEEL=true
- CIBW_BUILD=cp38-manylinux_aarch64

- python: 3.9
os: linux
arch: arm64
arch: arm64-graviton2
dist: focal
virt: lxd
group: edge
if: type = cron or commit_message =~ /\[cd build\]/
env:
- BUILD_WHEEL=true
Expand Down
9 changes: 5 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=main
.. _Azure: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=main

.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/main.svg?style=shield&circle-token=:circle-token
.. _CircleCI: https://circleci.com/gh/scikit-learn/scikit-learn

.. |Travis| image:: https://api.travis-ci.com/scikit-learn/scikit-learn.svg?branch=main
.. _Travis: https://travis-ci.com/scikit-learn/scikit-learn
.. _Travis: https://app.travis-ci.com/github/scikit-learn/scikit-learn

.. |Codecov| image:: https://codecov.io/gh/scikit-learn/scikit-learn/branch/main/graph/badge.svg?token=Pk8G9gg3y9
.. _Codecov: https://codecov.io/gh/scikit-learn/scikit-learn

.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/main.svg?style=shield&circle-token=:circle-token
.. _CircleCI: https://circleci.com/gh/scikit-learn/scikit-learn

.. |Nightly wheels| image:: https://github.com/scikit-learn/scikit-learn/workflows/Wheel%20builder/badge.svg?event=schedule
.. _`Nightly wheels`: https://github.com/scikit-learn/scikit-learn/actions?query=workflow%3A%22Wheel+builder%22+event%3Aschedule

Expand Down Expand Up @@ -186,6 +186,7 @@ Communication
- Stack Overflow: https://stackoverflow.com/questions/tagged/scikit-learn
- Github Discussions: https://github.com/scikit-learn/scikit-learn/discussions
- Website: https://scikit-learn.org
- LinkedIn: https://www.linkedin.com/company/scikit-learn

Citation
~~~~~~~~
Expand Down
17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Security Policy

## Supported Versions

| Version | Supported |
| --------- | ------------------ |
| 1.0.1 | :white_check_mark: |
| < 1.0.1 | :x: |

## Reporting a Vulnerability

Please report security vulnerabilities by email to `security@scikit-learn.org`.
This email is an alias to a subset of the scikit-learn maintainers' team.

If the security vulnerability is accepted, a patch will be crafted privately
in order to prepare a dedicated bugfix release as timely as possible (depending
on the complexity of the fix).
33 changes: 26 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
pip install pytest flake8 mypy==0.782 black==21.6b0
displayName: Install linters
- bash: |
black --check .
black --check --diff .
displayName: Run black
- bash: |
./build_tools/circle/linting.sh
Expand Down Expand Up @@ -81,6 +81,7 @@ jobs:
# Tests that require large downloads over the networks are skipped in CI.
# Here we make sure, that they are still run on a regular basis.
SKLEARN_SKIP_NETWORK_TESTS: '0'
CREATE_ISSUE_ON_TRACKER: 'true'

# Check compilation with intel C++ compiler (ICC)
- template: build_tools/azure/posix.yml
Expand All @@ -105,6 +106,28 @@ jobs:
COVERAGE: 'false'
BUILD_WITH_ICC: 'true'

- template: build_tools/azure/posix-docker.yml
parameters:
name: Linux_Nightly_PyPy
vmImage: ubuntu-20.04
dependsOn: [linting, git_commit]
condition: |
and(
succeeded(),
not(contains(dependencies['git_commit']['outputs']['commit.message'], '[ci skip]')),
or(
eq(variables['Build.Reason'], 'Schedule'),
contains(dependencies['git_commit']['outputs']['commit.message'], '[pypy]')
)
)
matrix:
pypy3:
DISTRIB: 'conda-mamba-pypy3'
DOCKER_CONTAINER: 'condaforge/mambaforge-pypy3:4.10.3-5'
PILLOW_VERSION: 'none'
PANDAS_VERSION: 'none'
CREATE_ISSUE_ON_TRACKER: 'true'

# Will run all the time regardless of linting outcome.
- template: build_tools/azure/posix.yml
parameters:
Expand All @@ -123,6 +146,7 @@ jobs:
PYTHON_VERSION: '*'
BLAS: 'mkl'
COVERAGE: 'true'
SHOW_SHORT_SUMMARY: 'true'

# Check compilation with Ubuntu bionic 18.04 LTS and scipy from conda-forge
- template: build_tools/azure/posix.yml
Expand Down Expand Up @@ -198,11 +222,6 @@ jobs:
ne(variables['Build.Reason'], 'Schedule')
)
matrix:
pypy3:
DISTRIB: 'conda-mamba-pypy3'
DOCKER_CONTAINER: 'condaforge/mambaforge-pypy3:4.10.3-5'
PILLOW_VERSION: 'none'
PANDAS_VERSION: 'none'
debian_atlas_32bit:
DISTRIB: 'debian-32'
DOCKER_CONTAINER: 'i386/debian:10.9'
Expand Down Expand Up @@ -237,7 +256,7 @@ jobs:
- template: build_tools/azure/windows.yml
parameters:
name: Windows
vmImage: vs2017-win2016
vmImage: windows-latest
dependsOn: [linting, git_commit]
condition: |
and(
Expand Down
1 change: 1 addition & 0 deletions build_tools/azure/posix-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
# Set in azure-pipelines.yml
DISTRIB: ''
DOCKER_CONTAINER: ''
SHOW_SHORT_SUMMARY: 'false'
strategy:
matrix:
${{ insert }}: ${{ parameters.matrix }}
Expand Down
26 changes: 26 additions & 0 deletions build_tools/azure/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
THREADPOOLCTL_VERSION: 'latest'
COVERAGE: 'true'
TEST_DOCSTRINGS: 'false'
CREATE_ISSUE_ON_TRACKER: 'false'
SHOW_SHORT_SUMMARY: 'false'
strategy:
matrix:
${{ insert }}: ${{ parameters.matrix }}
Expand Down Expand Up @@ -72,6 +74,30 @@ jobs:
testRunTitle: ${{ format('{0}-$(Agent.JobName)', parameters.name) }}
displayName: 'Publish Test Results'
condition: succeededOrFailed()
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
displayName: Place Python into path to update issue tracker
condition: and(succeededOrFailed(), eq(variables['CREATE_ISSUE_ON_TRACKER'], 'true'),
eq(variables['Build.Reason'], 'Schedule'))
- bash: |
set -ex
if [[ $(BOT_GITHUB_TOKEN) == "" ]]; then
echo "GitHub Token is not set. Issue tracker will not be updated."
exit
fi

LINK_TO_RUN="https://dev.azure.com/$BUILD_REPOSITORY_NAME/_build/results?buildId=$BUILD_BUILDID&view=logs&j=$SYSTEM_JOBID"
CI_NAME="$SYSTEM_JOBIDENTIFIER"
ISSUE_REPO="$BUILD_REPOSITORY_NAME"

pip install defusedxml PyGithub
python maint_tools/create_issue_from_juint.py $(BOT_GITHUB_TOKEN) $CI_NAME $ISSUE_REPO $LINK_TO_RUN $JUNIT_FILE
displayName: 'Update issue tracker'
env:
JUNIT_FILE: $(TEST_DIR)/$(JUNITXML)
condition: and(succeededOrFailed(), eq(variables['CREATE_ISSUE_ON_TRACKER'], 'true'),
eq(variables['Build.Reason'], 'Schedule'))
- script: |
build_tools/azure/upload_codecov.sh
condition: and(succeeded(), eq(variables['COVERAGE'], 'true'))
Expand Down
15 changes: 12 additions & 3 deletions build_tools/azure/test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ cp setup.cfg $TEST_DIR
cd $TEST_DIR

python -c "import sklearn; sklearn.show_versions()"
python -m threadpoolctl -i sklearn

if ! command -v conda &> /dev/null
then
Expand All @@ -36,18 +35,28 @@ if [[ "$COVERAGE" == "true" ]]; then
# report that otherwise hides the test failures and forces long scrolls in
# the CI logs.
export COVERAGE_PROCESS_START="$BUILD_SOURCESDIRECTORY/.coveragerc"
TEST_CMD="$TEST_CMD --cov-config=$COVERAGE_PROCESS_START --cov sklearn --cov-report="
TEST_CMD="$TEST_CMD --cov-config='$COVERAGE_PROCESS_START' --cov sklearn --cov-report="
fi

if [[ -n "$CHECK_WARNINGS" ]]; then
# numpy's 1.19.0's tostring() deprecation is ignored until scipy and joblib removes its usage
TEST_CMD="$TEST_CMD -Werror::DeprecationWarning -Werror::FutureWarning -Wignore:tostring:DeprecationWarning"

# Python 3.10 deprecates disutils and is imported by numpy interally during import time
TEST_CMD="$TEST_CMD -Wignore:The\ distutils:DeprecationWarning"

# Workaround for https://github.com/pypa/setuptools/issues/2885
TEST_CMD="$TEST_CMD -Wignore:Creating\ a\ LegacyVersion:DeprecationWarning"
fi

if [[ "$PYTEST_XDIST_VERSION" != "none" ]]; then
TEST_CMD="$TEST_CMD -n2"
fi

if [[ "$SHOW_SHORT_SUMMARY" == "true" ]]; then
TEST_CMD="$TEST_CMD -ra"
fi

set -x
$TEST_CMD --pyargs sklearn
eval "$TEST_CMD --pyargs sklearn"
set +x
1 change: 1 addition & 0 deletions build_tools/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
PYTEST_XDIST: 'true'
PYTEST_XDIST_VERSION: 'latest'
TEST_DIR: '$(Agent.WorkFolder)/tmp_folder'
SHOW_SHORT_SUMMARY: 'false'
strategy:
matrix:
${{ insert }}: ${{ parameters.matrix }}
Expand Down
11 changes: 8 additions & 3 deletions build_tools/circle/build_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ fi

MINICONDA_PATH=$HOME/miniconda
# Install dependencies with miniconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
-O miniconda.sh
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh \
-O miniconda.sh
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH
export PATH="/usr/lib/ccache:$MINICONDA_PATH/bin:$PATH"

Expand All @@ -165,7 +165,7 @@ fi
source build_tools/shared.sh

# packaging won't be needed once setuptools starts shipping packaging>=17.0
conda create -n $CONDA_ENV_NAME --yes --quiet \
mamba create -n $CONDA_ENV_NAME --yes --quiet \
python="${PYTHON_VERSION:-*}" \
"$(get_dep numpy $NUMPY_VERSION)" \
"$(get_dep scipy $SCIPY_VERSION)" \
Expand All @@ -176,6 +176,11 @@ conda create -n $CONDA_ENV_NAME --yes --quiet \
joblib memory_profiler packaging seaborn pillow pytest coverage

source activate testenv
# Pin PyWavelet to 1.1.1 that is the latest version that support our minumum
# NumPy version required. If PyWavelets 1.2+ is installed, it would require
# NumPy 1.17+ that trigger a bug with Pandas 0.25:
# https://github.com/numpy/numpy/issues/18355#issuecomment-774610226
pip install PyWavelets==1.1.1
pip install "$(get_dep scikit-image $SCIKIT_IMAGE_VERSION)"
pip install "$(get_dep sphinx-gallery $SPHINX_GALLERY_VERSION)"
pip install "$(get_dep numpydoc $NUMPYDOC_VERSION)"
Expand Down
6 changes: 3 additions & 3 deletions build_tools/github/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$OSTYPE" != "linux-gnu" ]]; then
cp $CONFTEST_PATH $CONFTEST_NAME
fi

# Test that there are no links to system libraries in the
# threadpoolctl output section of the show_versions output:
python -c "import sklearn; sklearn.show_versions()"
pytest --pyargs sklearn

# Test that there are no links to system libraries
python -m threadpoolctl -i sklearn
18 changes: 10 additions & 8 deletions build_tools/github/test_windows_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ if [[ "$BITNESS" == "32" ]]; then
# 32-bit architectures use the regular
# test command (outside of the minimal Docker container)
cp $CONFTEST_PATH $CONFTEST_NAME
python -c "import sklearn; sklearn.show_versions()"
pytest --pyargs sklearn
python -m threadpoolctl -i sklearn
else
docker container run -e SKLEARN_SKIP_NETWORK_TESTS=1 \
-e OMP_NUM_THREADS=2 \
-e OPENBLAS_NUM_THREADS=2 \
--rm scikit-learn/minimal-windows \
powershell -Command "pytest --pyargs sklearn"
docker container run \
--rm scikit-learn/minimal-windows \
powershell -Command "python -c 'import sklearn; sklearn.show_versions()'"

docker container run --rm scikit-learn/minimal-windows \
powershell -Command "python -m threadpoolctl -i sklearn"
docker container run \
-e SKLEARN_SKIP_NETWORK_TESTS=1 \
-e OMP_NUM_THREADS=2 \
-e OPENBLAS_NUM_THREADS=2 \
--rm scikit-learn/minimal-windows \
powershell -Command "pytest --pyargs sklearn"
fi
6 changes: 3 additions & 3 deletions build_tools/travis/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pip install --upgrade pip || travis_terminate $?
pip install pytest pytest-xdist || travis_terminate $?

# Test that there are no links to system libraries in the threadpoolctl
# section of the show_versions output.
python -c "import sklearn; sklearn.show_versions()" || travis_terminate $?
python -m pytest -n $CPU_COUNT --pyargs sklearn || travis_terminate $?

# Test that there are no links to system libraries
python -m threadpoolctl -i sklearn || travis_terminate $?
4 changes: 4 additions & 0 deletions doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
<p>Adrin Jalali</p>
</div>
<div>
<a href='https://github.com/jjerphan'><img src='https://avatars.githubusercontent.com/u/13029839?v=4' class='avatar' /></a> <br />
<p>Julien Jerphanion</p>
</div>
<div>
<a href='https://github.com/glemaitre'><img src='https://avatars.githubusercontent.com/u/7454015?v=4' class='avatar' /></a> <br />
<p>Guillaume Lemaitre</p>
</div>
Expand Down
Loading
0