Implements a desirability function for minimization.
The desirability function assigns a value of 1 for inputs below the low threshold, a value of 0 for inputs above the high threshold, and scales the desirability between 1 and 0 for inputs within the range [low, high] using a specified scale factor.
The value to use for missing inputs. Defaults to a non-informative value.
Functions
Predicts the desirability values for the given input data.
Plots the desirability function.
References
Many thanks to Max Kuhn for his implementation of the ‘desirability’ package in R. This class is based on the ‘desirability’ package in R, see: https://cran.r-project.org/package=desirability
Examples
from spotdesirability import DMinimport numpy as npimport matplotlib.pyplot as plt# Create a DMin objectdmin = DMin(low=0, high=10, scale=1)# Predict desirability for a range of inputsinputs = np.array([-5, 0, 5, 10, 15])desirability = dmin.predict(inputs)print(desirability)# [1. 1. 0.5 0. 0.]# Plot the desirability functiondmin.plot()
[ 1. 1. 0.5 -0. 0. ]
Methods
Name
Description
predict
Predicts the desirability values for the given input data.