Reference 〉Hook

terminate( GUI gui, pandas.DataFrame data )

Runs when a model terminates.

Required Parameters

  • gui GUI

    The GUI 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(gui, data):
    	import statsmodels.api as sm
    	reg = sm.OLS(data['M0'], data['price-level']).fit()
    	predictions = reg.predict(data['M0'])
    	# Print out the statistics
    model.addHook('terminate', terminate)
  2. Contribute a Note

    Your email address will not be published. Required fields are marked *

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