prophet/python/fbprophet/models.py

27 lines
722 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
2017-09-26 00:34:27 +00:00
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absolute_import, division, print_function
import pickle
import pkg_resources
2017-05-04 00:06:20 +00:00
def get_prophet_stan_model():
"""Load compiled Stan model"""
model_file = pkg_resources.resource_filename(
'fbprophet',
'stan_model/prophet_model.pkl',
)
with open(model_file, 'rb') as f:
return pickle.load(f)
2017-05-04 00:06:20 +00:00
prophet_stan_model = get_prophet_stan_model()