Reference 〉 Hook

terminate( Helipad model, pandas.DataFrame data )

Runs when a model terminates.

Required Parameters

  • model Helipad

    The model object.

  • data pandas.DataFrame

    The final model data.

Notes and Examples

  1. charwick

    Mar 26, 2020 at 18:12

    The terminate hook is a good place to do any post-model analysis, as the data will be finalized by that point. This example runs an OLS regression on two columns of model data.

    def terminate(model, data):
    	import statsmodels.api as sm
    	reg = sm.OLS(data['M0'], data['price-level']).fit()
    	predictions = reg.predict(data['M0'])
    	# Print out the statistics
  2. Contribute a Note

    Your email address will not be published.

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.