Deb’s Feasibility Rule Ranking Distribution (distr_Deb)¶
import math
from pyxla import distr_Deb
from pyxla.util import load_data
from pyxla.sampling import HilbertCurveSampler
sphere_sample = {
"name": "Sphere",
"X": HilbertCurveSampler(sample_size=100, dim=1, l_bound=-5, u_bound=5, seed=42),
"F": lambda x: x**2,
"V": [lambda x: x**2 - 2, lambda x: 8 * math.sin(20 * x)]
}
deceptive_sample = {
"name": "Deceptive",
"X": HilbertCurveSampler(sample_size=100, dim=1, l_bound=0, u_bound=6),
"F": lambda x: (0.4 * x - 2) ** 2 if x > 0.625 else (10 * x - 4) ** 2 - 2,
"V": lambda x: ((0.4 * x - 2) ** 2 if x > 0.625 else (10 * x - 4) ** 2 - 2) - 1
}
load_data(sphere_sample)
load_data(deceptive_sample)
WARNING:root:The Hilbert curve with dimension 1 is just a number line. You are sampling around points on a number line.
WARNING:root:The Hilbert curve with dimension 1 is just a number line. You are sampling around points on a number line.
distr_Deb(sphere_sample)
({'Deb_min': 1,
'Deb_max': 100,
'Deb_mean': 50.5,
'Deb_med': 50.5,
'Deb_q1': 25.25,
'Deb_q3': 75.75,
'Deb_sd': 29.011491975882016,
'Deb_skew': 0.0,
'Deb_kurt': -1.2002400240024003},
<seaborn.axisgrid.FacetGrid at 0x7f8c02a41f40>)
distr_Deb(deceptive_sample)
({'Deb_min': 1,
'Deb_max': 100,
'Deb_mean': 50.5,
'Deb_med': 50.5,
'Deb_q1': 25.25,
'Deb_q3': 75.75,
'Deb_sd': 29.011491975882016,
'Deb_skew': 0.0,
'Deb_kurt': -1.2002400240024003},
<seaborn.axisgrid.FacetGrid at 0x7f8c02a42000>)