Created
July 30, 2019 18:35
-
-
Save BenoitDoyon/0fac2aa840d6ae80eb112a65f81418b3 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
def main(req: func.HttpRequest) -> func.HttpResponse: | |
req_body = req.get_json() | |
df = pd.DataFrame(req_body["data"]) | |
prophet = Prophet(seasonality_mode='multiplicative') | |
prophet.fit(df) | |
periods = 2 | |
future = prophet.make_future_dataframe(periods=periods, freq='M') | |
forecast = prophet.predict(future) | |
response = forecast['yhat'].tolist()[-periods:] | |
return func.HttpResponse(json.dumps(response)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment