Commit graph

339 commits

Author SHA1 Message Date
Ryan Nazareth
30bcfed918
Include mdape in performance metric docstring (#1512)
* update docstring with mdape in list for python perf metric func

* re-run python notebook cell to generate  mdape in results table

* remove comment

Co-authored-by: Ben Letham <bletham@gmail.com>
2020-06-05 17:51:25 -07:00
Ryan Nazareth
31841c90c9
import tqdm.auto instead (#1509) 2020-06-05 17:46:41 -07:00
Chanran Kim
5669f13abf
Drop Korea class from hdays.py (#1438)
To solve this [issue](https://github.com/facebook/prophet/issues/1437) by @chongdae

Korean lunar calendar which is different from Chinese lunar calendar is added python-holidays package recently.
This commit is about dropping the Korean and KR class in hdays.py file and hdays_part1(holidays) will work for Korean holidays.

```
import fbprophet.hdays as hdays_part2
import holidays as hdays_part1
``
2020-06-05 16:54:58 -07:00
Ryan Nazareth
ac59b44ca3
add implementation for constant trend in Python (#1466)
* add implementation for constant trend

* force k and delta params to be 0s

* add tests and fix n_changepoints, changepoints_t to 0

* Add test for cv with constant trend

* Add docs and test for checking invalid input

* make changes to stan

* add transformed params block in stan and output flat trend vector

* correct syntax

* transformed params syntax

* Fix test and port changes to win stan file

* add test for flat trend function

* Add separate function for flat trend init

* fix test
2020-05-14 21:40:40 -07:00
Ryan Nazareth
cb4f1dcc59
Remove Python 2 from setup.py (#1485)
* remove python 2 from setup.py and add python_requires

* add note in README
2020-05-14 12:16:34 -07:00
above-c-level
9168dcf11d
Removed redundant line in Prophet docstring (#1474) 2020-05-06 13:00:03 -07:00
Chris Benson
98f2a7be18
Fix Issue with Pickling Models in Python3.6 because of Logger Attribute (#1452)
* Fix issue with pickeling models due to logger

* Fixes Model Pickle Error in Python3.6 as described in #1361
2020-04-28 12:30:31 -07:00
Tom Augspurger
5fe3be86c5
Parallel Cross Validation (#1434)
* API: Refactor to parallel / cf

* Added Dask-based parallelism

* fix test

* cover bad parallel

* avoid multiprocess issue under setuptools tests

* Update notebook docs

* fix docstring

* install note

* arbitrary object

* fixups

* fixups

* fixups

* remove unused import
2020-04-28 12:25:41 -07:00
Ben Letham
6cd14438c6 Update version in serialize test 2020-04-04 08:43:28 -07:00
Ben Letham
231200ffaa mark dev version 2020-04-04 08:28:42 -07:00
Ben Letham
c943d966b4
Add functions for serializing to/from JSON (#1414)
* Add functions for serializing to/from JSON

* Fix list vs. series type issue, track version

* Avoid DateTimeIndex

* bugfix

* another fix

* Fix copy test

* Fix issue with pre-epoch dates

* Handle empty datetime series
2020-04-04 08:23:27 -07:00
Marco Fusi
3c69ce3312
modified cross_validation to allow custom cutoffs (#1402)
* modified cross_validation to allow custom cutoffs

* moved set period, initials and identify larg. seas

* modified the diagnostics and added the test

* reverted cv default value tests and added a new custom cutoff test

* reorganized to raise the seasonality period warning message even if cutoffs are manually specified

* moved the initials vs. seasonality check

* changed assertCountEqual to assertItemsEqual in cv

* modified to test lengths instread of cutoff values

Co-authored-by: Fusi Marco <Marco.Fusi@valuelab.it>
2020-03-26 16:36:02 -07:00
Mitzi Morris
d22922d08c
sampling iters arg name, logic changes (#1389)
* sampling iters arg name, logic changes

* Bump cmdstanpy version in requirements to 0.9.5

* Change Model to CmdStanModel

Co-authored-by: Ben Letham <bletham@gmail.com>
2020-03-24 14:33:52 -07:00
sheikheddy
e9771c862d
Holidays in United Arab Emirates (#1390)
Added official holidays of the UAE. Our dates for Eid are slightly longer than other countries. I tried to keep the style consistent with what's already there.  We need to add this and Belarus to the docs here: https://facebook.github.io/prophet/docs/seasonality,_holiday_effects,_and_regressors.html#built-in-country-holidays
2020-03-23 16:25:12 -07:00
Ben Letham
d9bea61969 Remvoe no longer necessary test 2020-03-09 15:20:25 -07:00
Ben Letham
44ceaa8d8b Don't use tqdm with multiprocessing starmap 2020-03-09 12:48:14 -07:00
Ryan Nazareth
39c619dbf7
Running Cross-Validation with Multiprocessing Option (#1356)
* Add multiprocessing Pool and create function for single cutoff forecast

* add params to single forecast function

* Add iterable for input params for pool

* Add docstring for single cutoff forecast func

* Add check for multiprocessing in test_cross_validation

* check ofr is None and is True and add better description for multiprocess in docstring

* Raise error if wrong args chosen and add test

* fix conflicts

* Change arg to True/False, model.kwargs

* docstring units and few more fixes

* change to iterator and add back tqdm to for loop

* add option in diagnosics notebook about multiprocessing option

* add extra test for checking calls to single forecast func
2020-03-09 12:25:01 -07:00
Dmitry
fd61fcbeeb
Holidays in Belarus + codestyle (#1380)
* Holidays in Belarus + codestyle

* Correction + changing hardcode with variable
2020-03-06 18:40:58 -08:00
Ryan Nazareth
0ca50cfb7f
Extract stanfit from model object in Py following cmdstanpy refactoring (#1353)
* add self.stan_fit in fit methods

* small changes to fix tests

* make changes to remove self.params from backend classes
2020-03-06 18:11:04 -08:00
Ben Letham
708ae20c04 lower tqdm required version 2020-03-04 16:03:22 -08:00
Ben Letham
d8dd2f53b7
Add progress bar to cross_validation (#1338)
* tqdm

* Added progress bar to the crossvalidation

In order to improve the user experiance a progress bar is added to the crossvalidation loop.

* Update requirements.txt

* Update python/fbprophet/diagnostics.py

* updated further

* Update requirements.txt
2020-03-04 16:01:02 -08:00
Ram Rachum
952b544928
Fix exception causes in 2 modules (#1370)
Co-authored-by: Ben Letham <bletham@gmail.com>
2020-03-03 17:34:06 -08:00
JayCarraway
560077c8a7
Add possibility of selecting province of country for creation of holiday (#1340)
dataframe
2020-03-03 16:24:48 -08:00
Sean Taylor
101dd50e31 Delay some imports to allow installation w/o deps 2020-02-17 17:20:20 -08:00
Ryan Nazareth
59f34ebc5f
suppress plotly error logging (#1332)
* raise logging level to critical for plot module

* remove setlevel for plot logger
2020-02-17 15:00:14 -08:00
Christoph Deil
8c48f5b042
Remove logging.root basicConfig on fbprophet import (#1336) 2020-02-17 14:11:23 -08:00
Ben Letham
57990e6f50 Change backend logging from info to debug 2020-02-11 03:38:18 -08:00
Ben Letham
9413c1141e version bump 2020-02-09 19:16:05 -08:00
Christopher Suchanek
1d18adc0ba
Replaced pystan with cmdstanpy (#1083)
* changes

* added actual tests for fit method

* precision

* syntax

* sampling not working

* sampling seems to work

* sampling not working again

* sampling works, tests to be removed

* replaced data with rmse

* replace pystan with cmdstanpy

* cleanup

* cleanup

* test for newton

* added support for multiple backends

* minor fixes

* fixed comment

* added support for --test-slow flag

* fixed import

* reverted style change

* specify backend based on env variable

* fixes

* PR fixes
2020-02-07 14:34:08 -08:00
Jack Dent
496facb152
Use np.percentile if array does not contain NaNs (#1311)
Co-authored-by: jackd-stripe <41304233+jackd-stripe@users.noreply.github.com>
2020-02-05 10:10:01 -08:00
Ben Letham
69bd5a2aac Avoid pandas deprecation warning 2020-02-04 16:00:37 -08:00
Ben Letham
30e68fd467 Fix deprecation warning from plotly 2020-02-04 15:55:12 -08:00
Ben Letham
71ca505732 Add test for cross validation with invalid metrics 2020-02-04 15:40:04 -08:00
Ben Letham
64d54e7748 Fixing some holiday parsing for R csv file 2020-02-04 15:23:11 -08:00
Ben Letham
f640308395 Update holidays csv for R, and fix bad utf-8 parsing 2020-02-04 15:12:28 -08:00
Ben Letham
be25372090 improvements in docstrings and testing for disabling uncertainty 2020-02-04 13:22:08 -08:00
Ben Letham
6e51130f28 Use fit kwargs in cross validation (#1040) 2020-02-03 17:02:23 -08:00
Rômulo Madureira Rodrigues
ffb0ea86e2
Correction for issue #1304\n\nChange use of weekday_name to day_name to add consistency with pandas 1.0. (#1308) 2020-02-03 12:40:20 -08:00
Ben Letham
d4c460e3dd Add dateutil requirement, get backwards compatability with holidays 0.9.5 2020-01-31 08:03:33 -08:00
Mert Sarikaya
6070b5a309
update holidays dependency according to the new structure (#1295)
* update holidays dependency according to the new structure

* fix backward compatibility problem

* by-pass version dependency for holidays package

Co-authored-by: Ben Letham <bletham@gmail.com>
2020-01-30 15:24:11 -08:00
Benjamin Ogorek
0a270b4a19
Minor modification in handling strings (#1301)
* Style modifications to fbprophet

* fixing cases where tests were broken

* minor style changes

* changed f-strings to named formatted strings due to Python2 build

* fixing syntax errors

* switching to formatted string quoting using {!r}

* Fixing ValueError Styling in my own branch

* fixing type and changing back one quoted string
2020-01-28 15:24:40 -08:00
Mert Sarikaya
074c87723e do not import holidays==0.10.1 due to refactoring 2020-01-27 15:49:38 -08:00
Mert Sarikaya
5dd6bb09e7 remove repeated sentence in docstring 2020-01-27 14:09:29 -08:00
raajtilaksarma
8bca432810 update hdays.py 2020-01-27 13:32:33 -08:00
Raaj Tilak Sarma
0d4a639c4c update holi and diwali holidays till 2030
Updated holi and diwali holidays till the year 2030. Added a source(link) for Holi dates till 2030.
2020-01-27 13:32:33 -08:00
Ben Letham
af5bb2acda Minor fixes 2020-01-27 13:28:04 -08:00
baogorek
aee14547da fixing syntax errors 2020-01-27 13:25:56 -08:00
baogorek
d98afa0126 changed f-strings to named formatted strings due to Python2 build 2020-01-27 13:25:56 -08:00
baogorek
b1c6f5dd9b minor style changes 2020-01-27 13:25:56 -08:00
baogorek
0b6c2dc6af fixing cases where tests were broken 2020-01-27 13:25:56 -08:00
baogorek
3a6a338ac2 Style modifications to fbprophet 2020-01-27 13:25:56 -08:00
Ryan Nazareth
31c54d53be Modify assertion statement for ignoring ordering of columns to pass on travis 2019-11-06 15:25:09 -08:00
Ryan Nazareth
da05c039ee Add second check for uncertainty=False 2019-11-06 15:25:09 -08:00
Ryan Nazareth
3134c7ff5a Add test for cv in diagnostics 2019-11-06 15:25:09 -08:00
Ryan Nazareth
c9e3a83188 Add test for disabling uncertainty 2019-11-06 15:25:09 -08:00
Maxim Grishin
ca9a49d328 Add test for MCMC with 0 changepoints 2019-11-06 15:23:21 -08:00
Maxim Grishin
a6646670b9 Fix plotting with 0 changepoints 2019-11-06 15:23:21 -08:00
Maxim Grishin
9425b89257 Fix #1189 2019-11-06 15:23:21 -08:00
Marcos Alves de Almeida
5ad4e8a092 Update hdays.py 2019-11-06 15:20:02 -08:00
Maxim Grishin
a3ae4715bb Make Python version consistent with R 2019-10-22 17:28:27 -07:00
Maxim Grishin
05effe55ac Make StanFit4Model object accessible from Prophet 2019-10-22 17:28:27 -07:00
Florian Roessler
e1a2b9c297 updated the change a bit to prevent unnessary copy operations 2019-09-28 17:12:33 -07:00
Florian Roessler
5bc6565c11 Add test and fix for issue #891 2019-09-28 17:12:33 -07:00
Timothy Salmon
f4cb9fc4bb Unpack Solar to date 2019-08-09 17:45:02 -07:00
Timothy Salmon
c02bb3bc15 Replace lunardate lunar2solar calls with LunarCalendar 2019-08-09 17:45:02 -07:00
Francis T. O'Donovan
ded98c493e Add python 2/3 trove classifiers
Clearly identify this project as supporting python 2 and 3.
This is useful for utility programs like [caniusepython3](https://github.com/brettcannon/caniusepython3#how-do-you-tell-if-a-project-has-been-ported-to-python-3).
2019-08-09 17:34:18 -07:00
Alexander Gawrilow
c179a28be2 fix bug in performance metrics 2019-08-09 12:06:24 -07:00
Alexander Gawrilow
7f214f2bc7 adapt cross validation to a model with 0 uncertainty samples 2019-08-09 12:06:24 -07:00
Alexander Gawrilow
a6a1381a0a disable plotting uncertainties if m.uncertainty_samples is 0 or False 2019-08-09 12:06:24 -07:00
Alexander Gawrilow
0679e69dba implemented disabling calculation of uncertainties if uncertainty_samples is 0 2019-08-09 12:06:24 -07:00
Chanran Kim
aa26be5bab Update hdays.py 2019-07-11 15:34:31 -07:00
Chanran Kim
beb133f93f Update hdays.py 2019-07-11 15:34:31 -07:00
Chanran Kim
995a531bc7 Update hdays.py
Add holidays in Republic of Korea
2019-07-11 15:34:31 -07:00
Olof-Hojvall
0d37a46593 Fixed Plotly Holiday Hover Text 2019-07-05 08:34:18 -07:00
Olof-Hojvall
3ac99e18d4 Creation of new Plotly plot for all components 2019-07-05 08:34:18 -07:00
Kishan Manani
df8e39ae15 Replace functools.reduce() with pd.concat() to concat dataframes in cross_validation 2019-06-28 11:41:20 -07:00
Louis Potok
4225bb5fc1 Add mdape to all diagnostics, and fix rolling median behavior. 2019-06-21 15:28:29 -07:00
Louis Potok
1b01ab9f76 add function and test for rolling median 2019-06-21 15:28:29 -07:00
Jose Angel Sanchez Castillejos
ebb304680d Remove ipython from requirements since it would break test for python 2 2019-05-31 11:23:49 -07:00
Jose Angel Sanchez Castillejos
7b34ea13f2 Update README with instructions to install from Makefile 2019-05-31 11:23:49 -07:00
Jose Angel Sanchez Castillejos
2102a5421d Remove test command in make file since test are run from insede container 2019-05-31 11:23:49 -07:00
Daniel Scally
0e0f1a607a Adding validation to Prophet.add_seasonality to prevent user setting fourier_order <= 0 2019-05-31 10:21:09 -07:00
Alessandro Romano
b77f85ffd8 Add figsize parameter to plot methods 2019-05-23 10:29:50 -07:00
Ben Letham
7ff33137eb Change to MIT license 2019-05-21 11:40:04 -07:00
Ben Letham
a087eaec84 Fix FutureWarning in plotting by deregistering matplotlib converters (the future behavior). Also fix bad date formatting in non-daily plot that started came with change in matplotlib default in 3.0.2 2019-05-14 15:26:55 -07:00
Ben Letham
73c8faf15a py version bump 2019-05-14 09:11:21 -07:00
Sean J. Taylor
6a64410646 Merge branch 'master' of github.com:facebook/prophet 2019-05-13 23:00:24 -07:00
Sean J. Taylor
39e356ddbe Readying for 0.5 release 2019-05-13 23:00:12 -07:00
Ben Letham
0203a465f7 Allow pystan 2.19 2019-05-13 17:09:41 -07:00
Ben Letham
526468b6e8 Fix FutureWarning in test, for sorting because non-concatenation axis is not aligned 2019-05-13 15:28:58 -07:00
Ben Letham
fdac46ad40 Fix DeprecationWarning for float64 casting 2019-05-13 15:21:54 -07:00
Ben Letham
f660264e23 Don't allow timezones in pandas datetime 2019-05-13 15:00:45 -07:00
Ben Letham
df6bef8920 Replace to_numpy() with values to maintain pd 0.23.4 support 2019-05-13 13:51:27 -07:00
Ben Letham
28cd55241f Verify that cap > floor (#807) 2019-05-13 13:11:07 -07:00
Ben Letham
269133c133 Change cross validation performance metrics to first aggregate over horizon before computing rolling average (#839, #863) 2019-05-08 10:47:26 -07:00
Ben Letham
e9c017ba01 Default to Newton optimizer if less than 100 datapoints (#842, #870, #888) 2019-05-07 11:47:36 -07:00
Ben Letham
26f60c0a49 If ds column is int, convert to str before pd.to_datetime to avoid nanosecond casting (#675) 2019-05-06 16:38:13 -07:00
Ben Letham
4e5e223e4f Add plotly plot to quickstart example 2019-05-06 16:15:23 -07:00
Olof Höjvall
ee14933b3f Changed returned object of plot_plotly, addressing #937 (#954) 2019-05-06 13:55:25 -07:00
Ben Letham
ec7689f03e R fallback to Newton if non-zero return code from optimization, to match existing Py behavior (#654) 2019-05-06 09:49:29 -07:00