A tool for optimizing two inter-dependent parameters.
Project description
HyperKnee Finder
This tool will found the optimal values for two inter-dependant parameters using the well known knee/elbow method.
The method prescribe to search for the point where the curvature is at the maximum (Here an example).
A more formal definition (from Satopää, Albrecht, Irwin, and Raghavan, 2011, p.1) states that the knee/elbow point is the point after which:
relative costs to increase [or decrease, NdC] some tunable parameter is no longer worth the corresponding performance benefit
While usually this method is used for tuning one single parameter, nothing impeach to the same for multiple, inter-dependant parameters. This tool is anyway able to find the optimal value only for two parameters.
In facts, HyperKnee Finder is a 2-d generalisation of the KneeFinder tool.
Motivations for HyperKnee Finder
In many situations the parameters of an algorithm depends on each other. What you usually do is to ignore this dependency, and so you optimise the first parameter, then you use the found value to optimise the second parameter.
Acting like this, in general, does not guarantee you to land on the optimal combination for the two parameters.
Indeed, you have to evaluate all the possible combination of the two parameters, and at that point you can make your choice.
Examples
The following example show how to find the HyperKnee point in a double exponential decay.
from hyperkneefinder import HyperKneeFinder
import numpy as np
%matplotlib ipympl
#double exponential decay plus noise, clipped
X = np.arange(1, 8, 0.1)
Y = np.arange(6, 10, 0.1)
Z = np.zeros((len(X), len(Y)))
for i in range(len(X)):
for j in range(len(Y)):
Z[i, j] = np.exp(-X[i]/3) + np.exp(-(Y[j]-5)) + np.random.rand()/45
Z = np.clip(Z, a_min= 0.5, a_max=2)
hkf= HyperKneeFinder(X, Y, Z, name_x='parameter_1', name_y='parameter_2', clean_data=True, clean_threshold=0.8)
hkf.visualise_hyperknee()
Also with different pseudo-convexity:
X = np.arange(1, 8, 0.1)
Y = np.arange(6, 10, 0.1)
Z = np.zeros((len(X), len(Y)))
for i in range(len(X)):
for j in range(len(Y)):
Z[i, j] = np.exp(-2/X[i]) + np.exp(-3/(Y[j]-5)) # + np.random.rand()/15
Z = np.clip(Z, a_min= 0, a_max=1)
hkf= HyperKneeFinder(X, Y, Z, name_x='parameter_1', name_y='parameter_2', clean_data=True, clean_threshold=0.8)
hkf.visualise_hyperknee()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file HyperkneeFinder-0.0.3.tar.gz
.
File metadata
- Download URL: HyperkneeFinder-0.0.3.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f543a7c51d4ed17845b10accc452866e152154f04fa4d34d76e881de9696b1b |
|
MD5 | 1910061b049534fb5928ad2a082fddaa |
|
BLAKE2b-256 | bf4d3fa597cf8a9d7474c859718887ee1ab0f90bf6e200edd25c801cc500543e |
File details
Details for the file HyperkneeFinder-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: HyperkneeFinder-0.0.3-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02521b862ec79fe64a34492667d38792dcfd2c3b47bbe586349ec112db95e178 |
|
MD5 | d9024607bd4aa28db3d6fbffe16cd7d0 |
|
BLAKE2b-256 | 3c2c8d26c2c58fb2a4b1db9e878701a19ab349f45c7459d8746fde31e126d7c5 |