Initialization of models should only be the storing of parameters
bayerj opened this issue · 0 comments
bayerj commented
Currently, when the constructor of a model is called, this triggers:
- Building of expressions
- Allocating of memory for the paramters
- Initialization of parameteres
This is not how sklearn does it, and thus we should do it differently as well. The proposal is to instead have a prepare
method and a prepared
flag. Before calling fit()
or sth similar, the model is then prepared, which means that the above tasks are performed.
If a user deems it necessary (e.g. because she wants to use a custom parameter initialization scheme) she can prepare the model explicitly.