Deb’s Feasibility Rule Ranking Distribution (distr_Deb)

import math

from pyxla import distr_Deb, distr_Par, distr_f, distr_v 
from pyxla.util import load_data, load_sample
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},
 <Axes: title={'center': "Deb's feasibility rule ranking distribution Sphere"}, xlabel='Deb', ylabel='Count'>)
../../_images/e0f2e57b4ea0ee5f1547ddd77d44fc47bb246ce566d80edf3cfd1d895d239033.png
distr_f(sphere_sample)
({'f0_min': 0.001489075887394326,
  'f0_max': 25.0,
  'f0_mean': 8.306602377756104,
  'f0_med': 5.810982892827974,
  'f0_q1': 1.4835743521448939,
  'f0_q3': 13.953228429920058,
  'f0_sd': 7.631777799225109,
  'f0_skew': 0.6779687948562939,
  'f0_kurt': -0.79031951272523,
  'f0_rank_min': 1,
  'f0_rank_max': 99,
  'f0_rank_mean': 49.51,
  'f0_rank_med': 49.5,
  'f0_rank_q1': 24.25,
  'f0_rank_q3': 74.75,
  'f0_rank_sd': 28.99442475143569,
  'f0_rank_skew': 0.0019601813945263774,
  'f0_rank_kurt': -1.2027967085759266},
 <Figure size 300x600 with 2 Axes>)
../../_images/f34b756de506d2402c2f5d817b470354e258057663a574bfdaf842cec0c01e36.png
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>)
../../_images/72d7c11df4e0c9e5dd8e0dfaf3717c00ddca81370dfe7f999f111372279578fd.png
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},
 <Axes: title={'center': "Deb's feasibility rule ranking distribution Deceptive"}, xlabel='Deb', ylabel='Count'>)
../../_images/10dcbc5c349f20e8f8d24c0b7eaa60c891e9bff80ecbc8a3e86a1ad790ad9c28.png

Knapsack instances

%cd ../../..
/home/toni/Projects/pyxla-wg/docs
easy_kp = load_sample('easy_kp')
hard_kp = load_sample('hard_kp')
feat, plot = distr_f(easy_kp, title=False)
../../_images/e7dc4446b451edaab4ecad0caf18430286e6175e18ae0ea5342160962bb46d5c.png
feat, plot = distr_v(easy_kp, title=False)
../../_images/382501a099564b405d662e4aec6fa960afa4c146b71dd6615855655303edbb8c.png
feat, plot = distr_Par(easy_kp, title=False)
../../_images/58544e3a9fb707240bd4e5775552097eb78dbd794f56ff4fd783463d6cfa0f88.png
feat, plot = distr_Deb(easy_kp, title=False)
../../_images/e841e135029fc0f5809722117df44db4dd73e97d2eea8caebbd9e81cf4e4501f.png
feat, plot = distr_f(hard_kp, title=False)
../../_images/e7dc4446b451edaab4ecad0caf18430286e6175e18ae0ea5342160962bb46d5c.png
feat, plot = distr_v(hard_kp, title=False)
../../_images/b85a9731f10a865f003b7625085dcdb8ca111773c16f437d1ea81d3527e0eaec.png
feat, plot = distr_Par(hard_kp, title=False)
../../_images/82c7593a46a09f17fdf01250619d2ed87981795fdd85eee6372d2670d90e3403.png
feat, plot = distr_Deb(hard_kp, title=False)
../../_images/29eed80e70e4c25ea72b22de6d4fd1324adc8efb78401955ce1cee44d493e4e9.png