python - How to maximize non-analytic function over space of variables -
i have simple question thought there might solution online couldn't find 1 yet.
i have (non-mathematical i.e. non-analytical) function computes value f based on set of variables a,b,c,d come set of files/databases/online crawling , want find set of variables a,b,c,d maximizes f. searching whole space of a,b,c,d not feasible, , using differentials / derivatives not possible since f not analytical. appreciate pointer packages/algorithms use please, or how started. of i've seen online python optimization seems analytical/math functions (f(x) = x^2 + ...) , not more non-analytical problems.
for example:
def f(a,b,c,d): ... lot of computations databases, etc using a,b,c,d different float values ... returns output # output float
now, values of a,b,c,d each has possible values let's [0, 0.1, 0.2, ... 1.0]. values discrete , don't need extreme precision in optimization.
now, want find set of values a,b,c,d gives me highest f.
oh, , have no maximization constraints on either f, a, b, c, d..
for non-analytic function explore parameter space genetic algorithm or similar evolutionary computation. maxima or "hills" within resultant space find solution maximizes function. suggest using library rather writing yourself; deap looks quite promising.
Comments
Post a Comment