online-ml / chantilly

🍦 Deployment tool for online machine learning models
BSD 3-Clause "New" or "Revised" License
97 stars 17 forks source link

Question on fit_one function #20

Closed lzg65 closed 3 years ago

lzg65 commented 3 years ago

Thanks for your great work, I was attracted by the incremental learning property of your work. You use the fit_one function to update the deployed model given the new data, but I did not find the actual method you use to update the model. The fit_one function only has one line to return self, maybe I didn't find the correct position. Can you please share your thoughts on this?

raphaelsty commented 3 years ago

Hi @lzg65, Chantilly was created to be compatible with creme. The models in creme all have a fit_one method. This method updates the internal state of the model, for example the weights of a linear regression or a logistic regression. In the case of creme's linear regression, the fit_one method evaluates the gradient, updates the weights of the model with the optimizer associated with the model and returns self. So, you just have to upload the cream model via the API and it will update it.

lzg65 commented 3 years ago

Hi @lzg65, Chantilly was created to be compatible with creme. The models in creme all have a fit_one method. This method updates the internal state of the model, for example the weights of a linear regression or a logistic regression. In the case of creme's linear regression, the fit_one method evaluates the gradient, updates the weights of the model with the optimizer associated with the model and returns self. So, you just have to upload the cream model via the API and it will update it.

Got it, I looked into the example you mentioned in creme, thanks for your quick explanation.