Can a function be used as a parameter of the python __init__ method?
What I'm trying to do is write a class for both the perceptron and logistic regression learning algorithms. As their training functions are very similar, and only really differ by the function used for prediction, it would be nice to be able to specify this function function at construction.
I hope this question hasn't been asked before (I've searched, haven't found anything; maybe I'm searching for the wrong topic). An example would be great. I'm not that familiar with lambda, so please provide some justification for any advanced python features. Thanks!