Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Created September 2, 2023 23:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save elijahbenizzy/4078a64af84d19eb4f22b211d55f08a5 to your computer and use it in GitHub Desktop.
app = FastAPI()
dr = driver.Driver(
{"mode": "online"},
aggregations,
data_loaders,
joins,
features,
model,
adapter=base.DefaultAdapter(),
)
@app.get("/predict")
def get_prediction(client_id: int) -> float:
series_out = dr.execute(
["predictions"], inputs={"client_id": client_id, "execution_time": datetime.now()}
)["predictions"]
return series_out.values[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment