Skip to main content

optuna-fast-fanova

optuna-fast-fanova provides Cython-accelerated version of FanovaImportanceEvaluator.

n_trials n_params n_trees fANOVA (Optuna) fast-fanova
1000 32 64 71.431s 2.963s (-95.9%)
1000 8 64 92.307s 2.315s (-97.5%)
1000 2 64 52.295s 1.297s (-97.5%)
100 32 64 1.668s 0.306s (-81.6%)
100 8 64 1.652s 0.138s (-91.7%)
100 2 64 1.242s 0.095s (-92.4%)

The benchmark script was run on my laptop (Macbook M1 Pro) so the times should not be taken precisely.

Installation

Supported Python versions are 3.7 or later.

$ pip install optuna-fast-fanova

Please note that this library depends on the scikit-learn's C-API (Cython pxd files). However, its ABI may contain breaking changes, even in patch releases. If you install optuna-fast-fanova with scikit-learn v1.1.1 and then upgrade scikit-learn to v1.1.2, optuna-fast-fanova will not work. Please reinstall optuna-fast-fanova if you update scikit-learn.

Usage

Usage is like this:

import optuna
from optuna_fast_fanova import FanovaImportanceEvaluator


def objective(trial):
    x = trial.suggest_float("x", -10, 10)
    y = trial.suggest_int("y", -10, 10)
    return x ** 2 + y


if __name__ == "__main__":
    study = optuna.create_study()
    study.optimize(objective, n_trials=1000)

    importance = optuna.importance.get_param_importances(
        study, evaluator=FanovaImportanceEvaluator()
    )
    print(importance)

You can use optuna-fast-fanova in only two steps.

  1. Add an import statement: from optuna_fast_fanova import FanovaImportanceEvaluator.
  2. Pass a FanovaImportanceEvaluator() object to an evaluator argument of get_param_importances() function.

How to cite fANOVA

This is a derived work of https://github.com/automl/fanova. For how to cite the original work, please refer to https://automl.github.io/fanova/cite.html.

Release files for optuna-fast-fanova 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optuna-fast-fanova 0.0.4
File Size Uploaded
optuna-fast-fanova-0.0.4.tar.gz 30.8 kB Details

Release files / optuna-fast-fanova-0.0.4.tar.gz

Download URL optuna-fast-fanova-0.0.4.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fba6f5133225903facd94f12b09c729544062b804edf0d7b7f0d521762dfe45d
BLAKE2b-256 checksum
How to use checksums
2f3e5b4bfa03413b12d6456da63d67173396c5a562b427fbc75a4ebb2efd1d31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.11

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page