Package park :: Package optim :: Module snobfit

Source Code for Module park.optim.snobfit

 1  from snobfit.snobfit import snobfit 
 2   
 3   
4 -class Snobfit(object):
5 """ 6 Response surface optimizer 7 8 This implements `park.fit.Fitter`. 9 """ 10 11 p=0.5 12 dn=5 # Extra 13 maxiter=1000 14 maxfun=1000 15 nstop=50 16
17 - def __init__(self, **kw):
18 """ 19 20 """ 21 for k,v in kw.items(): 22 if not hasattr(self, k): 23 raise KeyError("Snobfit has no attribute "+k) 24 setattr(self,k,v)
25
26 - def fit(self, objective, handler):
27 """ 28 Run a monte carlo fit. 29 30 This procedure maps a local optimizer across a set of initial points. 31 """ 32 pars = fitness.fit_parameters() 33 bounds = numpy.array([p.range for p in pars]).T 34 x0 = [p.value for p in pars] 35 snobfit(objective, x0, bounds, fglob=0)
36