Closed CameronBieganek closed 1 week ago
Thanks for the suggestion. I have thought about it and I decided using one structure (functor) for keeping parameters, training and predicting. Other frameworks already use fit!( )
mutating function. It has its own pros of course but I just like calling one structure for everything. In fact I like multiple dispatch and functors in Julia and using them wherever I can :)
I don't want to do too much bikeshedding, but it seems to me that
model(X, y)
andmodel(X)
do very different things and they deserve a separate syntax. I likemodel(X)
for prediction, since models are just function approximators. But for fitting I would recommend this syntax:This syntax makes it more clear that
model
is being mutated during the fitting process, since we are using the standard Julia convention that mutation is indicated by function names with an exclamation point. With themodel(X, y)
syntax it's not very obvious that fitting and mutation are occurring.