For each cell of the initial design, select the closest observation to its center and use it as a representative for that cell.

findNearestPrototype(feat.object, dist_meth, mink_p, fast_k, ...)

Arguments

feat.object

[FeatureObject] A feature object as created by createFeatureObject.

dist_meth

[character(1)] Which distance method should be used for computing the distance between two observations? All methods of dist are possible options with "euclidean" being the default.

mink_p

[integer(1)] Value of p in case dist_meth is "minkowski". The default is 2, i.e. the euclidean distance.

fast_k

[numeric(1)] Percentage of elements that should be considered within the nearest neighbour computation. The default is 0.05.

...

[any] Further arguments, which might be used within the distance computation (dist).

Value

[data.frame]. A data.frame containing one prototype (i.e. a representative observation) per cell. Each prototype consists of its values from the decision space, the corresponding objective value, its own cell ID and the cell ID of the cell, which it represents.

Examples

# (1) create the initial sample and feature object: X = createInitialSample(n.obs = 1000, dim = 2, control = list(init_sample.lower = -10, init_sample.upper = 10)) feat.object = createFeatureObject(X = X, fun = function(x) sum(x^2), blocks = 10) # (2) find the nearest prototypes of all cells: findNearestPrototype(feat.object)
#> x1 x2 y represented.cell #> 1 -9.1921242 -9.0064189 165.610730 1 #> 2 -7.1728049 -9.0344815 133.070986 2 #> 3 -4.9291467 -8.8116848 101.942277 3 #> 4 -2.8179450 -9.1780557 92.177520 4 #> 5 -1.2579016 -8.9989387 82.563214 5 #> 6 1.2783302 -8.8338316 79.670709 6 #> 7 2.6060323 -9.0667223 88.996858 7 #> 8 5.2873017 -9.4685650 117.609283 8 #> 9 6.8866042 -9.3072216 134.049691 9 #> 10 8.9597678 -9.0438228 162.068169 10 #> 11 -9.1560979 -7.1865540 135.480688 11 #> 12 -7.2181069 -7.3401710 105.979177 12 #> 13 -5.1582342 -6.8413816 73.411882 13 #> 14 -3.1509529 -6.8770223 57.221940 14 #> 15 -1.1481608 -6.9400791 49.482971 15 #> 16 1.3538582 -7.2911361 54.993597 16 #> 17 2.7582979 -7.3372707 61.443748 17 #> 18 5.1805693 -6.6796386 71.455869 18 #> 19 6.7567192 -7.2748574 98.576806 19 #> 20 8.7042268 -7.2155466 127.827677 20 #> 21 -9.3526419 -4.6569856 109.159426 21 #> 22 -7.0354358 -4.7532352 72.090601 22 #> 23 -4.6237401 -5.0273736 46.653457 23 #> 24 -2.8798218 -4.8106064 31.435308 24 #> 25 -0.8883363 -5.0430549 26.221544 25 #> 26 1.1772573 -4.7113757 23.582995 26 #> 27 2.6474628 -5.2596226 34.672689 27 #> 28 4.7561758 -4.6949086 44.663375 28 #> 29 6.7692689 -5.3448123 74.390020 29 #> 30 9.1173688 -5.5301953 113.709473 30 #> 31 -9.2865841 -3.1344369 96.065339 31 #> 32 -7.3761409 -2.8409292 62.478333 32 #> 33 -4.9584027 -2.7435960 32.113076 33 #> 34 -2.8769355 -2.8315567 16.294471 34 #> 35 -1.1061446 -3.6034843 14.208655 35 #> 36 1.0298377 -3.3927091 12.571040 36 #> 37 3.0203645 -3.1171306 18.839105 37 #> 38 4.8452362 -2.9414676 32.128545 38 #> 39 6.8538322 -3.3439898 58.157283 39 #> 40 8.6737800 -2.9304546 83.822023 40 #> 41 -8.9807381 -0.8735919 81.416820 41 #> 42 -6.7399571 -0.9872939 46.401771 42 #> 43 -4.9934631 -0.9899817 25.914737 43 #> 44 -3.2087881 -1.1622347 11.647110 44 #> 45 -0.9642806 -1.0294432 1.989590 45 #> 46 0.7948449 -1.3727095 2.516110 46 #> 47 2.5546988 -1.0679051 7.666907 47 #> 48 4.8974826 -1.0442423 25.075778 48 #> 49 6.9355689 -0.9464955 48.997970 49 #> 50 8.8099773 -1.1556138 78.951143 50 #> 51 -9.2071037 0.6173514 85.151881 51 #> 52 -7.1421628 1.2324811 52.529499 52 #> 53 -5.2130738 1.2112080 28.643163 53 #> 54 -3.0927940 1.1235515 10.827743 54 #> 55 -1.0263273 0.8444377 1.766423 55 #> 56 1.2476648 1.2671013 3.162213 56 #> 57 3.2890426 0.5365956 11.105736 57 #> 58 4.9764422 1.4293942 26.808145 58 #> 59 6.9522675 1.0167873 49.367880 59 #> 60 8.7059876 1.0241248 76.843052 60 #> 61 -8.6122848 3.3521173 85.408141 61 #> 62 -6.4571504 3.2691593 52.382194 62 #> 63 -5.0956086 2.7621242 33.594557 63 #> 64 -2.9409717 3.0983526 18.249103 64 #> 65 -1.0804413 3.0380443 10.397067 65 #> 66 1.1194335 2.8570833 9.416056 66 #> 67 2.9813953 2.8463173 16.990240 67 #> 68 5.1964850 3.0001566 36.004396 68 #> 69 7.0591262 3.2525331 60.410235 69 #> 70 9.1917454 3.0379458 93.717297 70 #> 71 -8.7293257 5.1197232 102.412692 71 #> 72 -6.9400338 4.5483678 68.851719 72 #> 73 -4.8131894 4.8619119 46.804980 73 #> 74 -2.7002896 4.9576950 31.870303 74 #> 75 -1.0944309 5.0999447 27.207215 75 #> 76 0.9636309 5.1122874 27.064067 76 #> 77 2.5148636 5.2089940 33.458157 77 #> 78 5.2399549 5.0695548 53.157513 78 #> 79 6.7238033 5.1265384 71.490927 79 #> 80 9.4176845 4.7285192 111.051674 80 #> 81 -8.9131934 6.9972659 128.406747 81 #> 82 -6.9526341 6.3917991 89.194216 82 #> 83 -4.9089749 7.3465482 78.069804 83 #> 84 -3.2090377 6.3406450 50.501702 84 #> 85 -0.1554294 6.2578979 39.185444 85 #> 86 0.9683665 7.1415053 51.938831 86 #> 87 3.2453445 6.9610383 58.988315 87 #> 88 5.0278344 6.9520946 73.610737 88 #> 89 7.1009889 7.1871096 102.078587 89 #> 90 9.2667380 7.1208039 136.578282 90 #> 91 -9.7349008 8.9697131 175.224046 91 #> 92 -6.7410766 8.7702326 122.359093 92 #> 93 -5.0130338 9.3732866 112.989009 93 #> 94 -2.6195803 9.3074199 93.490267 94 #> 95 -0.9794622 8.6101272 75.093637 95 #> 96 0.6615546 8.5392975 73.357257 96 #> 97 3.5038290 9.1084557 95.240784 97 #> 98 4.9951494 9.3496554 112.367573 98 #> 99 7.1593201 9.3944086 139.510777 99 #> 100 8.8262868 9.0277691 159.403954 100