# Maximize response for input params clusters from a blackbox function

I have a blackbox function which takes finite number of integers V1, V2, Vn parameters and based on time series variable produce a scalar response. I would like to find parameters which maximize the response. I'm not seeking the single maximum response but more a group of parameter similarities (like their ratio V1/V2, etc.) which results into well maximized response. I was reading about various techniques but cannot find the right one. Not sure if I should calculate the ratio (V1/V2, etc.) and include them in clustering together with V1...Vn? or I can apply some machine learning which tests those combinations for me.
The following code is just an illustration of the data structure, the actual number of rows is from 10K to 10M.

df = data.frame(V1=c(11L,15L,15L,16L),
V2=c(20L,20L,25L,14L),
V3=c(20L,15L,24L,50L),
V4=c(18L,22L,30L,60L),
reponse=c(1.04,1.21,0.97,1.00))
df
#  V1 V2 V3 V4 reponse
#1 11 20 20 18    1.04
#2 15 20 15 22    1.21
#3 15 25 24 30    0.97
#4 16 14 50 60    1.00


Expected output could be list clusters of parameters, or their relationships, that produce well maximized response.

You could run a global optimization package such as bayesopt to get some good parameters. This optimization package is especially suited for black box functions which are costly to evaluate. It might however be problematic to use so many parameters (10K!), however you could at least try it ;). Maybe there is a way to reduce the number of parameters? For example, you could create a vector of length 100 and then upsample it to the desired length.

• Thanks, will look at it. I can reduce dimensionality by using cut on each, this won't be issue, when I get "better" clusters I can just go back to old data and subset to better cluster and not use cut for better precision of arguments. – jangorecki Aug 6 '16 at 21:01

Genetic search algorithm should be able to help you. You will have to write maximization function for your response though.

http://www.r-bloggers.com/genetic-algorithms-a-simple-r-example/

http://topepo.github.io/caret/GA.html

http://www.r-bloggers.com/feature-selection-with-carets-genetic-algorithm-option/

I have used it for feature selection on 4k variables for a predictive classification problem & results were acceptable.

Hope this helps.

A simplex method for function minimization by J. Nelder and R. Mead is a classical reference. In our restoration applications, we aim at minimizing results of an objective function which has several hyper-parameters. The find the best parameters, we use, with happiness, the state-machine simplex method coded in Matlab by F. Sigworth.

• I'm not looking for best parameters but for a cluster of best parameters – jangorecki Jul 10 '16 at 1:24