Skip to main content

Defines search spaces for scikit-lean estimators

Project description

sksearchspace

.github/workflows/ci.yml codecov

Scikit-learn Search Space Configurations with curated search spaces for scikit-learn estimators.

Usage

from sksearchspace import SearchSpace
from sklearn.tree import DecisionTreeClassifier

estimator_space = SearchSpace.for_sklearn_estimator(DecisionTreeClassifier, seed=42)
estimator_space.sample()
# {'criterion': 'entropy','min_samples_leaf': 15, 'min_samples_split': 11}

estimator_space.sample()
# {'criterion': 'entropy', 'min_samples_leaf': 12, 'min_samples_split': 4}

sksearchspace uses ConfigSpace for sampling. The ConfigSpace configuration can be accessed through an attribute:

estimator_space.configuration
# Configuration space object:
# Hyperparameters:
#   criterion, Type: Categorical, Choices: {gini, entropy}, Default: gini
#   min_samples_leaf, Type: UniformInteger, Range: [1, 20], Default: 1
#   min_samples_split, Type: UniformInteger, Range: [2, 20], Default: 2

A json file can be loaded as follows:

with open("search_space.json", "r") as f:
    estimator_space = SearchSpace(f.read())

License

Copyright (c) 2020 Thomas J. Fan

Distributed under the terms of the MIT license, pytest is free and open source software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sksearchspace-2020.8.0.0.23.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

sksearchspace-2020.8.0.0.23.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file sksearchspace-2020.8.0.0.23.1.tar.gz.

File metadata

  • Download URL: sksearchspace-2020.8.0.0.23.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for sksearchspace-2020.8.0.0.23.1.tar.gz
Algorithm Hash digest
SHA256 3dca4985d19fbadee1daf949501ff85d851e3b2aa78a828f10d4f6b1c8aea3ed
MD5 ee6dcef1b3fa6cada4007a26a9c1c542
BLAKE2b-256 6e473e4ed2555cb9c271377a11d13d052b2466d9b03c60b3645b2530b1839712

See more details on using hashes here.

File details

Details for the file sksearchspace-2020.8.0.0.23.1-py3-none-any.whl.

File metadata

  • Download URL: sksearchspace-2020.8.0.0.23.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for sksearchspace-2020.8.0.0.23.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01ac11389773c7f79fec5ff7cc24427c2a5e3744cc06ba4d69652cb9cf3046da
MD5 68bd4593d41c625f6063eb1aedab0993
BLAKE2b-256 d52c82aa6c240fbbbfd9b4ab82cd58b4204a6db9168ba7cd1f378ebf204198fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page