Correlation of Ranks (corr_ranks)¶
import math
import matplotlib.pyplot as plt
from pyxla import load_data, corr_ranks
from pyxla.sampling import HilbertCurveSampler
from matplotlib import rc_file
rc_file('../../../../src/.matplotlibrc')
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)]
}
load_data(sphere_sample)
[a for a in range(10)][:5]
corrs, plot = corr_ranks(sphere_sample, title=False)
plot.savefig('corr-ranks-sphere.pdf', bbox_inches='tight')
corrs