Commit graph

373 commits

Author SHA1 Message Date
Vincent Koc
05438721e7
Logic simplification (#2192) 2022-09-05 08:31:33 +10:00
Cuong Duong
201887403b
Incorporate cmdstanpy v1.0.4 updates (#2259) 2022-09-05 06:55:58 +10:00
Cuong Duong
4a53023bec
Have a single source for __version__ (#2258) 2022-09-05 06:15:28 +10:00
Brian Ward
95b1741d44
Setup: Fix issue with Windows toolchain install (#2225) 2022-07-08 08:19:56 +10:00
Cuong Duong
65781f4606
Update __init__.py (#2218) 2022-07-02 18:48:26 +10:00
Brian Ward
f73a8d6331
Block broken cmdstanpy versions in pyproject.toml (#2217) 2022-07-02 17:12:15 +10:00
Cuong Duong
679db85047
Update holidays data (#2179) 2022-05-25 00:10:46 +10:00
Oskar Triebe
17b085b6db
hdays: remove countries defined in python-holidays (#2044) 2022-05-24 22:37:42 +10:00
RaymondMcT
e665430adc
Improved execution time of rolling_mean_by_h (#2142) 2022-05-24 22:28:58 +10:00
Andrew Johnson
2bbcd2c698
Use normal glm distribution for Stan model (#2051) 2022-05-24 22:11:22 +10:00
Andrii Oriekhov
4026f1ca4d
add GitHub URL for PyPi (#2128) 2022-05-24 21:51:05 +10:00
Kha
10310ceb2d
Change deprecated append to concat (#2114) 2022-05-23 03:18:14 +10:00
Julian Carrasquillo
cc5484c4e3
adding no history error handling to cross_validation (#2140) 2022-05-23 03:12:46 +10:00
Cuong Duong
0a44095570 pin holidays >=0.13 to fix UK bug 2022-05-23 02:36:14 +10:00
Cuong Duong
385e2afb43
Small fixes to setup and readme (#2175) 2022-05-22 19:40:41 +10:00
Brian Ward
df411c9192
Remove pystan, leave backend abstraction for now (#2148) 2022-05-05 17:37:17 +10:00
Brian Ward
9968f8be41
Simplify setup.py, make CmdStan the default backend (#2088) 2022-04-05 00:06:59 +10:00
Aliaksandr Barouski
efca9301ce
Fixing potential security issue (#2108)
An attacker could access random URL from the executing server if model is crafted. It happens
because pd.read_json checks if the parameter is string contains URL and loads it in the case. The
fix enforcing using parameter as a JSON.

Co-authored-by: Alex Barouski <barouski@fb.com>
2022-01-31 14:18:56 -05:00
Cuong Duong
04ffdc997d
Add Windows wheel (#2089) 2021-12-25 23:20:24 +11:00
Cuong Duong
9cdad80c36 hotfix setup.py 2021-10-04 10:16:55 +11:00
Anurag Kumar
675ece7d6a
Update setup.py (#2027) 2021-10-03 18:42:38 +11:00
Cuong Duong
4fb577e5d4
(Stage 1) Python Wheels for PyPi (#2010) 2021-10-03 12:03:03 +11:00
Cuong Duong
fabf67e73d
Set lower bound for holidays to 0.11.3.1 (#2038) 2021-10-03 05:29:04 +11:00
Marco Edward Gorelli
17dbb86ab0
Speed up make_holiday_features by up to 35% (#1962) 2021-08-28 12:19:40 +10:00
Cuong Duong
be87004df9 Merge remote-tracking branch 'upstream/master' into minor-fixing 2021-08-28 02:04:44 +10:00
slowy07
05aa1fdd37 fix: typo grammar 2021-08-03 08:37:45 +07:00
Drobin Max
d8d819a34f
Update forecaster.py
added 'flat' growth option in docstring
2021-05-24 17:32:14 +03:00
Greg Rafferty
4b859bca01
added argument for point color to cv plot (#1895) 2021-05-10 16:04:34 -07:00
Ben Sully
0616bfb5da
Add model_to_dict and model_from_dict functions (#1871)
This commit adds the model_to_dict and model_from_dict functions, using
all of the logic that previously lived in model_to_json and
model_from_json, and converting those functions to simply reuse the new
ones.

This is useful because sometimes the user may want to serialize the dict
in some other way (e.g. another JSON serialization library such as ujson
or orjson, or something entirely different).
2021-04-20 18:10:06 -07:00
Ben Letham
83c4ef3e2b Merge branch 'patch-1' of https://github.com/loulo1/prophet into loulo1-patch-1 2021-04-20 17:49:17 -07:00
Ben Letham
847ecee033 Merge 2021-04-20 17:43:10 -07:00
loulo1
3a0061e8e1
change init into inits for CmdStanPyBackend 2021-04-14 15:39:02 +02:00
Vladimir Shargin
899b4fac13
Add include_legend flag to m.plot() (#1858) 2021-04-03 18:01:41 -04:00
Sean Taylor
94e5d2e80a Bump version numbers 2021-03-26 15:36:07 -07:00
Sean Taylor
82f3399409 Pin to last 2.* Pystan release. 2021-03-25 22:15:10 -07:00
Ben Letham
6d81543eb2
Pakage rename (#1844)
* Rename package from fbprophet to prophet, and add shim

* Untrack files that should have been ignored

* Update github actions build commands
2021-03-21 14:13:50 -07:00
Cuong Duong
16472a5700
Upgrade CmdStanPy interface (#1849)
* cmdstan variable extraction update

* add backwards compatibility

* Fix bug

* Upgrade stan version in requirements and in CI testing

Co-authored-by: Ben Letham <bletham@gmail.com>
2021-03-20 10:59:58 -07:00
Cuong Duong
8ffa0e02a6
use builtin int and float (#1850) 2021-03-20 10:50:14 -07:00
loulo1
fc8fa49aac Fix the issue #1814
I did as PyStanBackend. And now when we use the method fit of Prophet, we can do like in the documentation:

https://facebook.github.io/prophet/docs/additional_topics.html#updating-fitted-models

def stan_init(m):
    """Retrieve parameters from a trained model.

    Retrieve parameters from a trained model in the format
    used to initialize a new Stan model.

    Parameters
    ----------
    m: A trained model of the Prophet class.

    Returns
    -------
    A Dictionary containing retrieved parameters of m.

    """
    res = {}
    for pname in ['k', 'm', 'sigma_obs']:
        res[pname] = m.params[pname][0][0]
    for pname in ['delta', 'beta']:
        res[pname] = m.params[pname][0]
    return res

df = pd.read_csv('../examples/example_wp_log_peyton_manning.csv')
df1 = df.loc[df['ds'] < '2016-01-19', :]  # All data except the last day
m1 = Prophet().fit(df1) # A model fit to all data except the last day

%timeit m2 = Prophet().fit(df)  # Adding the last day, fitting from scratch
%timeit m2 = Prophet().fit(df, init=stan_init(m1))  # Adding the last day, warm-starting from m1

Update models.py

Update models.py

Update models.py

Update models.py

Update models.py

Update models.py

Update models.py

Test

Test2

Test4

Test4

Test are fixed
2021-03-09 15:05:57 +01:00
Ben Letham
8882c6a3e3 Use pathlib to load model file (#1835) 2021-03-05 09:55:35 -08:00
Ben Letham
49a89d2a4e Bump version in unit test 2021-03-04 20:12:34 -08:00
Ben Letham
612934695b Version bump 2021-03-04 17:16:23 -08:00
Ben Letham
eb6b8f60ec Enable cross validation on a deserialized model (#1709) 2021-03-03 18:40:27 -08:00
Ben Letham
bbc44bf67c Add test for backwards compatibility with v0.7.1 serialized models 2021-03-03 18:14:16 -08:00
Ben Letham
a1803a8801 Minor rearrange 2021-03-03 18:09:59 -08:00
Ben Letham
74b21f7cd9 Error for unrecognized options in StanBackend.set_options 2021-03-03 18:04:15 -08:00
Ben Letham
f123a1a7cc Fix holidays NA handling 2021-03-03 16:06:25 -08:00
Ben Letham
2e9f831474 Check for NAs in holiday dataframe 2021-03-03 15:43:49 -08:00
Ben Letham
29f14172f0 Handle numpy fit_kwargs when serializing (#1701) 2021-03-03 15:23:12 -08:00
Ben Letham
9e4e87af9b Make sure y_scale is not numpy float (#1824) 2021-03-03 14:52:08 -08:00