Created
September 2, 2023 23:23
-
-
Save elijahbenizzy/4078a64af84d19eb4f22b211d55f08a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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