snipsco / snips-nlu

Snips Python library to extract meaning from text
https://snips-nlu.readthedocs.io
Apache License 2.0
3.89k stars 513 forks source link

Pass a seeding value to the fit method #816

Closed Shotgun167 closed 5 years ago

Shotgun167 commented 5 years ago

To get a deterministic model, you can pass in a value for the random seed to the fit method; however, there is no way to pass that in from the command line. Could we add an optional parameter to the train function of the CLI?

Also, it would be interesting if the value could be printed when a random value IS chosen.

We're retraining the engine every time we build. Pass rate is about 25% right now, because sometimes the engine is accurate and sometime it isn't. It's be cool to know if a particular range of values correlates with success.

adrienball commented 5 years ago

Hey @Shotgun167 , I have done a bit of work to revamp the snips-nlu CLI, and I took the opportunity to add a random_seed parameter to the training CLI:

$ snips-nlu train --random_seed 42 sample_datasets/beverage_dataset.json nlu_engine

However, it is not possible in general to print the random_state used as it is an instance of numpy.random.RandomState which cannot be serialized easily.

Shotgun167 commented 5 years ago

Oh, well. I guy can't have everything. Now, can he? :-)