mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-16 08:38:30 +00:00
Fix notebook Makefile and various typos
This commit is contained in:
parent
1339aada96
commit
03d3ec9f2e
6 changed files with 8 additions and 8 deletions
|
|
@ -3,7 +3,7 @@ notebooks:
|
||||||
do \
|
do \
|
||||||
NAME=$$(basename $$f .ipynb); \
|
NAME=$$(basename $$f .ipynb); \
|
||||||
jupyter nbconvert --to markdown ../notebooks/$$NAME.ipynb --template=nbconvert_template.tpl; \
|
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; \
|
rm -rf static/"$$NAME"_files; \
|
||||||
mv "$$NAME"_files static/; \
|
mv ../notebooks/"$$NAME"_files static/; \
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
# Python
|
# Python
|
||||||
|
|
|
||||||
|
|
@ -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.
|
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
|
### 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
|
||||||
# R
|
# R
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"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."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"### Adjusting trend flexibility\n",
|
"### 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:"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ class Prophet(object):
|
||||||
def setup_dataframe(self, df, initialize_scales=False):
|
def setup_dataframe(self, df, initialize_scales=False):
|
||||||
"""Prepare dataframe for fitting or predicting.
|
"""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
|
'y_scaled', and 'cap_scaled'. These columns are used during both
|
||||||
fitting and predicting.
|
fitting and predicting.
|
||||||
|
|
||||||
|
|
@ -214,7 +214,7 @@ class Prophet(object):
|
||||||
if too_low or too_high:
|
if too_low or too_high:
|
||||||
raise ValueError('Changepoints must fall within training data.')
|
raise ValueError('Changepoints must fall within training data.')
|
||||||
elif self.n_changepoints > 0:
|
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)
|
max_ix = np.floor(self.history.shape[0] * 0.8)
|
||||||
cp_indexes = (
|
cp_indexes = (
|
||||||
np.linspace(0, max_ix, self.n_changepoints + 1)
|
np.linspace(0, max_ix, self.n_changepoints + 1)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue