Python : optional arguments for function calling lower level functions
问题 I have a function def weights(vector, loss_function, clipping, max_iterations=100, tolerance=1e-5) which needs to call a lower level loss function which can be any of these with the vector and clipping passed in argument : huber_loss(vector, clipping=2.38) cauchy_loss(vector, clipping=3.27) bisquare_loss(vector, clipping=1.04) Each loss function has a special proper default clipping value so we can call them either huber_loss(vector) or huber_loss(vector,2) for example. I want to make the