river icon indicating copy to clipboard operation
river copied to clipboard

predict_one to allow multiple predictions

Open kevinsteger opened this issue 6 years ago • 1 comments

Today the predict_one can only make a prediction for a single value. (unless that is hiding somewhere and has not been documented).

e.g. model.predict_one(x)

I would like to make multiple predictions in a single method call. My primary interest for this is to reduce round-tripping in chantilly.

e.g.

model.predict_one( { { "var1": x1 }, { "var2": x2} } )

returns a dict of predictions for x1 and x2

{ { "var1": //prediction for x1// }, {"var2": //prediction for x2// } }

kevinsteger avatar Mar 28 '20 14:03 kevinsteger

We really want to keep creme's API as it is and focus on single observations. I think that the best way to solve this is implement @/api/learn-many and @/api/predict-many routes in chantilly. This won't take long to do and eliminates the round-trip cost. In the future we're also going to add some bidirectional routes so that you can stream updates and predictions with a single HTTP connection.

MaxHalford avatar Mar 28 '20 14:03 MaxHalford