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.
- Add an import statement:
from optuna_fast_fanova import FanovaImportanceEvaluator. - Pass a
FanovaImportanceEvaluator()object to anevaluatorargument ofget_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.
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| optuna-fast-fanova-0.0.4.tar.gz | 30.8 kB | Without provenance | Details for optuna-fast-fanova-0.0.4.tar.gz |
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
|
Security for optuna-fast-fanova 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.