Implements a desirability function for maximization.
The desirability function assigns a value of 0 for inputs below the low threshold, a value of 1 for inputs above the high threshold, and scales the desirability between 0 and 1 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 DMaximport numpy as npimport matplotlib.pyplot as plt# Create a DMax objectdmax = DMax(low=0, high=10, scale=1)# Predict desirability for a range of inputsinputs = np.array([-5, 0, 5, 10, 15])desirability = dmax.predict(inputs)print(desirability)# [0. 0. 0.5 1. 1.]# Plot the desirability functiondmax.plot()
[0. 0. 0.5 1. 1. ]
Methods
Name
Description
predict
Predicts the desirability values for the given input data.