johny-c / pylmnn

Large Margin Nearest Neighbors implementation in python
BSD 3-Clause "New" or "Revised" License
48 stars 13 forks source link

Option to save the fit model? #7

Closed GeorgePearse closed 2 years ago

GeorgePearse commented 2 years ago

The training step takes a long time. Is there way to save the model after the .fit method. If not should I submit a PR to enable it?

johny-c commented 2 years ago

Have you checked the callback argument? This should be a function that is called after every iteration with the current solution.

GeorgePearse commented 2 years ago

Cheers for getting back to me (and for the package in the first place, served me much better than the alternativesI tried). I was thinking more of a model.save('') format for once the training is complete. V. common to experiment lots and only care about saving the model once you achieve good results. At least in my workflows.

johny-c commented 2 years ago

Thanks! Glad to hear this is useful. Regarding the issue, it sounds more like something solvable with an experiment tracking library. A couple of options I have personally used in the past are sacred and mlflow. If you want something simpler, you could just use pickle.