Commit graph

668 commits

Author SHA1 Message Date
Cuong Duong
499dd50a43 add cran badge to readme 2021-05-17 22:25:40 +10:00
Thuy-An-Nguyen
b75844e07c
Update README.md, fix broken link (#1908)
* Update README.md, fix broken link

Fixes a broken link to Pystan documentation about Windows installation instructions

* Update README.md with link to pystan2 windows docs
2021-05-11 16:44:25 -07:00
Cuong Duong
949a07b500
Include cmdstanr installation instructions for R (#1905)
* update installation instructions for R

* force rstantools 2.0.0

* remove mc-stan repo, do not install Suggests

* install suggested packages manually
2021-05-11 08:39:20 -07:00
Cuong Duong
14fa36b4d5
Update ignores for development (#1906)
* update ignores for development

* force rstantools 2.0.0

* remove mc-stan repo, do not install Suggests

* install suggested packages manually
2021-05-11 08:37:19 -07:00
Cuong Duong
f99fff94b3
Fix R CI (#1907)
* force rstantools 2.0.0

* remove mc-stan repo, do not install Suggests

* install suggested packages manually
2021-05-11 08:24:22 -07:00
Cuong Duong
a794018d65
Add support for cmdstanr backend (#1806)
* init

* add suggested packages

* use environment variables and align more with Py package

* remove additional testing logic, default to lbfgs

* Remove Newton specifier from test because cmdstanr expects newton

Co-authored-by: Ben Letham <bletham@gmail.com>
2021-05-10 16:09:25 -07:00
Cuong Duong
9cad5a05fb
regenerate holidays csv (#1902) 2021-05-10 16:05:59 -07:00
Greg Rafferty
4b859bca01
added argument for point color to cv plot (#1895) 2021-05-10 16:04:34 -07:00
dependabot[bot]
7ace29d70b
Bump rexml from 3.2.4 to 3.2.5 in /docs (#1892)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.4...v3.2.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 16:03:28 -07:00
Cuong Duong
f5cfaaf46b
Add CI for R (#1891)
* add r github actions

* fix r workflow

* simplify r ci

* install remotes first

* fix bugs

* fix system requirements
2021-05-10 15:17:42 -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
9f0ce77be5 Merge branch 'loulo1-patch-1' 2021-04-20 17:50:02 -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
Ben Letham
e11135e4a4 Add to additional topics docs 2021-04-15 14:58:19 -07:00
loulo1
3a0061e8e1
change init into inits for CmdStanPyBackend 2021-04-14 15:39:02 +02:00
Tyler Kennedy
cd8a24eddd
Fix PyStan Installation Link (#1860)
`installation_beginner.html` no longer exists on RTD.
2021-04-03 18:03:28 -04:00
Vladimir Shargin
899b4fac13
Add include_legend flag to m.plot() (#1858) 2021-04-03 18:01:41 -04:00
Ben Letham
c72ed7abcd Update with notes for latest release 2021-04-02 16:53:06 -07:00
Sean Taylor
1eed11b0f1 Remove organization field from license 2021-03-29 15:36:57 -07:00
Sean Taylor
cb0160e111 Pin shim to fixed version 2021-03-29 15:36:57 -07:00
Ben Letham
3f4edef7f5 Fix R handling of dates to work for tsibble 2021-03-29 15:06:09 -07: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
360d294dbc
Refresh online docs, change package name in docs (#1852) 2021-03-26 00:03:05 -04:00
Ben Letham
4869ccf943 Skip stan function tests on windows 2021-03-24 08:46:44 -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
b5e67e59c3 Clean up R check warnings 2021-03-04 20:59:51 -08:00
Ben Letham
49a89d2a4e Bump version in unit test 2021-03-04 20:12:34 -08:00
Ben Letham
b7a583ec63 R manual update 2021-03-04 17:17:51 -08:00
Ben Letham
612934695b Version bump 2021-03-04 17:16:23 -08:00
Ben Letham
a4b31cd70b Refactor R cross validation to match Py function structure 2021-03-04 14:04:48 -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
4e99ac686e Validate custom cutoffs for data range (R #1650) 2021-03-03 17:59:24 -08:00
Ben Letham
58a0b96550 Plot continuous weekly seasonality in R (#1557, translates #1615 and #1707) 2021-03-03 17:43:58 -08:00
Ben Letham
aaa89445a1 R use GMT for all dates to avoid daylight savings (#1501) 2021-03-03 16:53:39 -08:00
Ben Letham
47ce88f255 Add stepwise trend as example of custom trend to documentation 2021-03-03 16:10:44 -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
Ben Letham
8f1c1d5a27 Fix bug in timezone handling in R (#1501) 2021-03-03 14:35:36 -08:00
Cuong Duong
fae1ac1f9a
add mdape and smape to performance metrics tests (#1804) 2021-03-02 08:30:23 -08:00