Pareto Rank Distribution (distr_Par)¶
import math
from pyxla import distr_Par
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_Par(sphere_sample)
({'paretoV_min': 1,
'paretoV_max': 40,
'paretoV_mean': 16.5,
'paretoV_med': 14.0,
'paretoV_q1': 6.0,
'paretoV_q3': 26.75,
'paretoV_sd': 12.132683965307107,
'paretoV_skew': 0.36083900012368475,
'paretoV_kurt': -1.092331393135496,
'paretoFV_min': 1,
'paretoFV_max': 54,
'paretoFV_mean': 27.33,
'paretoFV_med': 26.5,
'paretoFV_q1': 14.0,
'paretoFV_q3': 40.75,
'paretoFV_sd': 15.446914634229442,
'paretoFV_skew': 0.04168327649182093,
'paretoFV_kurt': -1.1827672534307703},
<Figure size 600x300 with 2 Axes>)
distr_Par(deceptive_sample)
({'paretoFV_min': 1,
'paretoFV_max': 100,
'paretoFV_mean': 50.5,
'paretoFV_med': 50.5,
'paretoFV_q1': 25.25,
'paretoFV_q3': 75.75,
'paretoFV_sd': 29.011491975882016,
'paretoFV_skew': 0.0,
'paretoFV_kurt': -1.2002400240024003},
<Figure size 300x300 with 1 Axes>)