Can I use something like scipy.stats, in Python, to create a fitness function responds like a distribution -


i need create normalised fitness function positive values 0→∞. want experiment, starting (input→output) 0→0, 1→1, ∞→0. maths bit weak , expect not hard, if no how.

so output of function should heavily skewed towards 0 , need able change input value produces maximum output, 1.

i make linear function, triangular distribution, need set maximum value @ input distinguished (above value looks same.) merge 2 simple expressions this:

from matplotlib import pyplot plt import numpy np math import exp  def frankenfunc(x, mu):      longtail = lambda x, mu: 1 / exp((x - mu))     shortail = lambda x, mu: pow(x / mu, 2)     if x < mu:         return shortail(x, mu)     else:         return longtail(x, mu)  x = np.linspace(0, 10, 300) y = [frankenfunc(i, 1) in x] plt.plot(x, y) plt.show() 

franken function output

this ok , should work, actual values returns don't matter used in binary tournament. still it's ugly , i'd flexibility use statistical distributions scipy or similar if possible.

so want probability dustribution pdf of form? need to:

alternatively, browse list of distributions implemented in scipy.stats. there several pdf shapes of general form you're sketching.


Comments

Popular posts from this blog

How to use SUM() in MySQL for calculated values -

loops - Spock: How to use test data with @Stepwise -