larch icon indicating copy to clipboard operation
larch copied to clipboard

Scoring new data

Open supreetr opened this issue 7 years ago • 2 comments

I am trying to use a previously estimated model to score new data. Is there an equivalent of sklearn's predict function in Larch? Any help is much appreciated.

supreetr avatar Sep 12 '18 08:09 supreetr

Hello, I faced the same issue some time ago. As I could not find any built-in function that would do that, I figured out the following with the existing functions: – estimate model m on the train data; – run m.unprovision() to be able to change the data linked to m; – change the data linked to m using _change_data_fountain(df), where df is your new data; – run m.setUp(). After that, you should be able to get what you want by running m.loglike() or m.probability()! It looks kind of unnecessarily complex, but it does work in my case. Hope this helps!

nortelli avatar Jan 15 '19 14:01 nortelli

As you might notice from the source code here, I am also in the process of bringing Larch version 5 online, which provides explicit compatibility directly with fit and predict interface of sklearn. An example will be posted soon(-ish).

jpn-- avatar Jan 15 '19 15:01 jpn--