My apologies, but since we’re back to bikeshedding… How about the package name?
- LearnAPI
- LearnInterface
0 voters
My apologies, but since we’re back to bikeshedding… How about the package name?
0 voters
If you see the source code check_is_fitted
the string name of model attributes is used to determine if a model is fitted. Technically, this is not an interface but one can see that the naming convention is key to tell if a new method added by developers is fitted or not (hence the method to tell if a method is fitted is indirecly defined by the naming convention of learned parameters). One can get learned parameters of any model or transformer with get_learned_parameters = lambda x: [attr for attr in vars(x) if attr.endswith('_')]
I think it is actually kind of clean, model objects do not need to store an iterable to tell users the ‘learned parameters’ (such as learned_params = ['bias_', 'weights_']
), they can be inferred by the string name. As long as new code follows the naming convention check_is_fitted
will work and the same get_learned_parameters
method would work.
Such naming conventions are super useful for users. When using the package, if you see a variable that starts with n_
, such as n_neighbors
you already see it’s meant to be an integer.