Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update installation docs for Prophet #2713

Merged
merged 7 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ installdeps:
pip install --upgrade pip -q
pip install -e . -q

SITE_PACKAGES_DIR=$$(python -c 'import site; print(site.getsitepackages()[0])')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I first tried this out in a fresh environment, I got the infamous no such file ...prophet_model.bin error when I tried running the unit tests.

I was really confused about why this happened, but when I looked at the pip install, I saw:

Collecting prophet==1.0.1
  Using cached prophet-1.0.1-py3-none-any.whl

This stood out to me because as we all know by now, prophet does not publish any wheels! So I was confused why we weren't building from source.

Then I read the pip documentation, and I learned that locally built wheels are added to the cache.

So my guess as to what went wrong for me is that I had installed prophet beforehand without a cmdstan backend and then subsequent installs with a cmdstan backend were using the cached version so it was not properly setting up cmdstan.

So in short, I think we need to do pip install --no-cache-dir prophet==1.0.1 instead. That properly set up the cmdstan backend and I was able to get the unit tests to pass.

Apparently, --no-cache-dir is discouraged, but the workaround in the pip docs did not work for me.

.PHONY: installdeps-prophet
installdeps-prophet:
pip install cmdstanpy==0.9.68
python ${SITE_PACKAGES_DIR}/cmdstanpy/install_cmdstan.py --dir ${SITE_PACKAGES_DIR}
echo "Installing Prophet with CMDSTANPY backend"
CMDSTAN=${SITE_PACKAGES_DIR}/cmdstan-2.27.0 STAN_BACKEND=CMDSTANPY pip install --no-cache-dir prophet==1.0.1

.PHONY: installdeps-core
installdeps-core:
pip install -e . -q
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ pip install evalml
```
### Add-ons

#### Time Series support with Facebook's Prophet

To support the `Prophet` time series estimator, be sure to install it as an extra requirement. Please note that this may take a few minutes.
Prophet is currently only supported via pip installation in EvalML.
```shell
pip install evalml[prophet]
```

#### Update checker

Receive automatic notifications of new EvalML releases
Expand Down
28 changes: 28 additions & 0 deletions docs/source/install.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,34 @@
"\n",
"EvalML is available for Python 3.7 and 3.8 with experimental support 3.9. It can be installed with pip or conda.\n",
"\n",
"## Time Series support with Facebook's Prophet \n",
"\n",
"To support the `Prophet` time series estimator, be sure to install it as an extra requirement. Please note that this may take a few minutes.\n",
"Prophet is currently only supported via pip installation in EvalML for Mac with CmdStan as a backend.\n",
"```shell\n",
"pip install evalml[prophet]\n",
"```\n",
"Another option for installing Prophet with CmdStan as a backend is to use `make installdeps-prophet`.\n",
"\n",
"Note: In order to do this, you must have the EvalML repo cloned and you must be in the top level folder `<your_directory>/evalml/` to execute this command.\n",
"This command will do the following:\n",
"- Pip install `cmdstanpy==0.9.68`\n",
"- Execute the `install_cmdstan.py` script found within your `site-packages/cmdstanpy` which builds `cmdstan` in your `site-packages`.\n",
"- Install `Prophet==1.0.1` with the `CMDSTAN` and `STAN_BACKEND` environment variables set.\n",
"\n",
"If the `site-packages` path is incorrect or you'd like to specify a different one, just run `make installdeps-prophet SITE_PACKAGES_DIR=\"<path_to_your_site_packages>\"`.\n",
"\n",
"If you'd like to have more fine-tuned control over the installation steps for Prophet, such as specifying the backend, follow these steps:\n",
"\n",
"For CmdStanPy as a backend:\n",
"1. `pip install cmdstanpy==0.9.68`\n",
"2. `python <path_to_installed_cmdstanpy>/install_cmdstan.py --dir <path_to_build_cmdstan>`\n",
"3. `CMDSTAN=<path_to_build_cmdstan>/cmdstan-2.27.0 STAN_BACKEND=CMDSTANPY pip install prophet==1.0.1`\n",
"\n",
"For PyStan as a backend (PyStan is used by default):\n",
"1. `pip install prophet==1.0.1`\n",
"\n",
"\n",
"## Pip with all dependencies\n",
"\n",
"To install evalml with pip, run the following command:\n",
Expand Down
1 change: 1 addition & 0 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Release Notes
* Fixes
* Changes
* Documentation Changes
* Specified installation steps for Prophet :pr:`2713`
* Added documentation for data exploration on data check actions :pr:`2696`
* Testing Changes
* Fixed flaky ``TargetDistributionDataCheck`` test for very_lognormal distribution :pr:`2748`
Expand Down