Callbacks¶
-
class
pygam.callbacks.CallBack(name=None)¶ Bases:
pygam.core.CoreCallBack class
-
class
pygam.callbacks.Accuracy¶ Bases:
pygam.callbacks.CallBack-
on_loop_start(y, mu)¶ runs the method at start of each optimization loop
Parameters: - y (array-like of length n) – target data
- mu (array-like of length n) – expected value data
Returns: accuracy
Return type: np.array of length n
-
-
class
pygam.callbacks.Coef¶ Bases:
pygam.callbacks.CallBack
-
class
pygam.callbacks.Deviance¶ Bases:
pygam.callbacks.CallBackDeviance CallBack class
-
on_loop_start(gam, y, mu)¶ runs the method at loop start
Parameters: - gam (GAM instance) –
- y (array-like of length n) – target data
- mu (array-like of length n) – expected value data
Returns: deviance
Return type: np.array of length n
-
-
class
pygam.callbacks.Diffs¶ Bases:
pygam.callbacks.CallBack
-
pygam.callbacks.validate_callback(callback)¶ validates a callback’s on_loop_start and on_loop_end methods
Parameters: callback (Callback object) – Returns: Return type: validated callback
-
pygam.callbacks.validate_callback_data(method)¶ wraps a callback’s method to pull the desired arguments from the vars dict also checks to ensure the method’s arguments are in the vars dict
Parameters: method (callable) – Returns: Return type: validated callable