Skip to main content

Meta heuristic optimization techniques for scikit-learn models

Project description

Hyperactive

A Python package for meta-heuristic hyperparameter optimization of scikit-learn models for supervised learning. Hyperactive automates the search for hyperparameters by utilizing metaheuristics to efficiently explore the search space and provide a sufficiently good solution. Its API is similar to scikit-learn and allows for parallel computation. Hyperactive offers a small collection of the following meta-heuristic optimization techniques:

  • Random search
  • Simulated annealing
  • Particle swarm optimization

The multiprocessing will start n_jobs separate searches. These can operate independent of one another, which makes the workload perfectly parallel. In the current implementation the actual number of searches in each process is n_searches divided by n_jobs and rounded down to the next integer.

Installation

pip install hyperactive

Example

from sklearn.datasets import load_iris
from hyperactive import SimulatedAnnealing_Optimizer

iris_data = load_iris()
X_train = iris_data.data
y_train = iris_data.target

search_dict = {
    'sklearn.ensemble.RandomForestClassifier': {
        'n_estimators': [100],
        'criterion': ["gini", "entropy"],
        'min_samples_split': range(2, 21),
        'min_samples_leaf':  range(2, 21),
      }
}

Optimizer = SimulatedAnnealing_Optimizer(search_dict, n_searches=1000, scoring='accuracy', n_jobs=2)
Optimizer.fit(X_train, y_train)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hyperactive-0.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file hyperactive-0.1-py3-none-any.whl.

File metadata

  • Download URL: hyperactive-0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.8

File hashes

Hashes for hyperactive-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f34d123b8a033878325d7b3b12d0171bd89f370d583d2f2214cc809c9a86f01b
MD5 828f9f5e2a5f58e331bf72bbdb920a4e
BLAKE2b-256 165fe10f123d26ee748d229be9d55d3ce81cc5d68e7a2a64ac609ba72b29e4d7

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