Skip to content

Bug : Parallel Model Fitting Example #23

@AlABarazi

Description

@AlABarazi

Hi,
I am getting error in cookbook example Parallel Model Fitting

TypeError: ("run() got an unexpected keyword argument 'rtol'", 'occurred at index 0')

When I run the code


param_names = ['dec_%i_loss_rate'%i for i in range(1,10)]

def error(param_vals, measurements):
    predictions = model.run(params=dict(zip(param_names, param_vals)),
                            initial_condition=(2000,measurements['2000']),
                            return_timestamps=2010, rtol=1).loc[2010]

    errors = predictions - measurements['2010']
    return sum(errors.values[1:]**2) #ignore first decade: no birth info

def fit(row):
    res = scipy.optimize.minimize(error, args=row,
                                  x0=[.05]*9,
                                  method='L-BFGS-B');
    return pd.Series(index=['dec_%i_loss_rate'%i for i in range(1,10)], data=res['x'])

%%capture
county_params = data.apply(fit, axis=1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions