kwargs - Key words arguments in python function
This is a tutorial of how to use *args and **kwargs For defining the default value of arguments that is not assigned in key words when calling the function: def func(**keywargs): if 'my_word' not in keywargs: word = 'default_msg' print(word) else: word = keywargs['my_word'] print(word) call this by: func() func(my_word='love') you’ll get: default_msg love read more about *args and **kwargs in python: https://www.digitalocean.com/community/tutorials/how-to-use-args-and-kwargs-in-python-3 Add more about default value if arg key is not assigned: def make_hastie_10_2(n_samples=12000, random_state=None): """Generates data for binary classification used in Hastie et al.
…