Ejemplo n.º 1
0
 def load_model(self):
     import cmdstanpy
     model_file = pkg_resources.resource_filename(
         'fbprophet',
         'stan_model/prophet_model.bin',
     )
     return cmdstanpy.Model(exe_file=model_file)
Ejemplo n.º 2
0
    def build_model(target_dir, model_dir):
        from shutil import copy
        import cmdstanpy
        model_name = 'prophet.stan'
        target_name = 'prophet_model.bin'

        sm = cmdstanpy.Model(stan_file=os.path.join(model_dir, model_name))
        sm.compile()
        copy(sm.exe_file, os.path.join(target_dir, target_name))