Nearest Better Features#

The Nearest-Better Features — also called Nearest-Better Clustering (NBC) Features — are based on a heuristic, which recognizes single peaks in a multimodal landscape [1]. In general, the features are computed on two sets of distances: the distances from each point to its nearest neighbor and the distances from each point to its nearest-better neighbor. Here, the latter one is the closest observation (w.r.t. the reference point) with a better objective value than the reference point.

Based on these two distance sets, this feature set computes five NBC features. A further motivation of these features can be found, amongst others, in Kerschke et al. (2015) [2] as well as in the technical documentation of pflacco.classical_ela_features.calculate_nbc(). Below you find a code example.

from pflacco.sampling import create_initial_sample
from pflacco.classical_ela_features import calculate_nbc

# Arbitrary objective function
def objective_function(x):
   return sum(x**2)

dim = 3
# Create inital sample using latin hyper cube sampling
X = create_initial_sample(dim, sample_type = 'lhs')
# Calculate the objective values of the initial sample
# using an arbitrary objective function
y = X.apply(lambda x: objective_function(x), axis = 1)

# Compute nbc feature set from the convential ELA features
ic = calculate_nbc(X, y)

Literature Reference