Merge remote-tracking branch 'origin/master' into v0.2

This commit is contained in:
Ben Letham 2017-07-11 11:16:26 -07:00
commit d48b70b106
8 changed files with 24 additions and 8 deletions

11
.travis.yml Normal file
View file

@ -0,0 +1,11 @@
language: python
python:
- "2.7"
- "3.6"
install:
- pip install --upgrade pip
- pip install -U -r python/requirements.txt
script:
- cd python && python setup.py develop test

View file

@ -3,7 +3,7 @@ notebooks:
do \
NAME=$$(basename $$f .ipynb); \
jupyter nbconvert --to markdown ../notebooks/$$NAME.ipynb --template=nbconvert_template.tpl; \
mv -f "$$NAME".md _docs/; \
mv -f ../notebooks/"$$NAME".md _docs/; \
rm -rf static/"$$NAME"_files; \
mv "$$NAME"_files static/; \
mv ../notebooks/"$$NAME"_files static/; \
done

View file

@ -70,7 +70,7 @@ df.head()
We fit the model by instantiated a new `Prophet` object. Any settings to the forecasting procedure are passed into the constructor. Then you call its `fit` method and pass in the historical dataframe. Fitting should take 1-5 seconds.
We fit the model by instantiating a new `Prophet` object. Any settings to the forecasting procedure are passed into the constructor. Then you call its `fit` method and pass in the historical dataframe. Fitting should take 1-5 seconds.
```python
# Python

View file

@ -22,7 +22,7 @@ Even though we have a lot of places where the rate can possibly change, because
The number of potential changepoints can be set using the argument `n_changepoints`, but this is better tuned by adjusting the regularization.
### Adjusting trend flexibility
If the trend changes are being overfit (too much flexibility) or underfit (not enough flexiblity), you can adjust the strength of the sparse prior using the input argument `changepoint_prior_scale`. By default, this parameter is set to 0.05. Increasing it will make the trend *more* flexibile:
If the trend changes are being overfit (too much flexibility) or underfit (not enough flexibility), you can adjust the strength of the sparse prior using the input argument `changepoint_prior_scale`. By default, this parameter is set to 0.05. Increasing it will make the trend *more* flexible:
```R
# R

View file

@ -119,7 +119,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We fit the model by instantiated a new `Prophet` object. Any settings to the forecasting procedure are passed into the constructor. Then you call its `fit` method and pass in the historical dataframe. Fitting should take 1-5 seconds."
"We fit the model by instantiating a new `Prophet` object. Any settings to the forecasting procedure are passed into the constructor. Then you call its `fit` method and pass in the historical dataframe. Fitting should take 1-5 seconds."
]
},
{

View file

@ -153,7 +153,7 @@
"metadata": {},
"source": [
"### Adjusting trend flexibility\n",
"If the trend changes are being overfit (too much flexibility) or underfit (not enough flexiblity), you can adjust the strength of the sparse prior using the input argument `changepoint_prior_scale`. By default, this parameter is set to 0.05. Increasing it will make the trend *more* flexibile:"
"If the trend changes are being overfit (too much flexibility) or underfit (not enough flexibility), you can adjust the strength of the sparse prior using the input argument `changepoint_prior_scale`. By default, this parameter is set to 0.05. Increasing it will make the trend *more* flexible:"
]
},
{

View file

@ -165,7 +165,7 @@ class Prophet(object):
def setup_dataframe(self, df, initialize_scales=False):
"""Prepare dataframe for fitting or predicting.
Adds a time index and scales y. Creates auxillary columns 't', 't_ix',
Adds a time index and scales y. Creates auxiliary columns 't', 't_ix',
'y_scaled', and 'cap_scaled'. These columns are used during both
fitting and predicting.
@ -221,7 +221,7 @@ class Prophet(object):
if too_low or too_high:
raise ValueError('Changepoints must fall within training data.')
elif self.n_changepoints > 0:
# Place potential changepoints evenly throuh first 80% of history
# Place potential changepoints evenly through first 80% of history
max_ix = np.floor(self.history.shape[0] * 0.8)
cp_indexes = (
np.linspace(0, max_ix, self.n_changepoints + 1)

5
python/requirements.txt Normal file
View file

@ -0,0 +1,5 @@
Cython>=0.22
pystan>=2.14
numpy>=1.10.0
pandas>=0.18.1
matplotlib>=2.0.0