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

Adding the official version for SDK-FB-prophet-online-forecasting-notebook #317

Conversation

krishr2d2
Copy link
Contributor

@krishr2d2 krishr2d2 commented Feb 21, 2022

Checklist for moving the notebook to the main repo:

  • Use the notebook template as a starting point.
  • Follow the style and grammar rules outlined in the above notebook template.
  • Verify the notebook runs successfully in Colab since the automated tests cannot guarantee this even when it passes.
  • Passes all the required automated checks. You can locally test for formatting and linting with these instructions.
  • You have consulted with a tech writer to see if tech writer review is necessary. If so, the notebook has been reviewed by a tech writer, and they have approved it.
  • This notebook has been added to the CODEOWNERS file under # Official Notebooks section, pointing to the author or the author's team.
  • The Jupyter notebook cleans up any artifacts it has created (datasets, ML models, endpoints, etc) so as not to eat up unnecessary resources.

@krishr2d2 krishr2d2 requested a review from a team as a code owner February 21, 2022 11:41
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@kweinmeister
Copy link
Contributor

/gcbrun

@kweinmeister
Copy link
Contributor

/gcbrun

@kweinmeister
Copy link
Contributor

/gcbrun

@kweinmeister
Copy link
Contributor

I saw a failure installing pystan in the build logs.

@krishr2d2
Copy link
Contributor Author

I saw a failure installing pystan in the build logs.

It must be the build related error messages while installing the fbprophet library. Those messages while installation seem common while installing fbprophet according to : facebook/prophet#1598 but ultimately the library gets installed.

@ivanmkc
Copy link
Contributor

ivanmkc commented Feb 28, 2022

@sudarshan-SpringML Please fix PR title. It's not clear if it's a small edit or a whole new notebook from the title.

@ivanmkc
Copy link
Contributor

ivanmkc commented Feb 28, 2022

@krishr2d2 The installation seemed to never finish after 17 hours. This is one of those cases where you'll have to dig a bit into why pip is behaving this way.

I recommend using Vertex Workbench with a custom container to debug:
Screen Shot 2022-02-28 at 11 35 54 AM

The image you should use is gcr.io/cloud-devrel-public-resources/python-samples-testing-docker:latest

@krishr2d2 krishr2d2 changed the title Sdk fbprophet forecasting online Adding the official version for SDK-FB-prophet-online-forecasting-notebook Mar 1, 2022
…to overcome the errors during fbprophet installation
…to overcome the errors during fbprophet installation
@krishr2d2
Copy link
Contributor Author

krishr2d2 commented Mar 1, 2022

@krishr2d2 The installation seemed to never finish after 17 hours. This is one of those cases where you'll have to dig a bit into why pip is behaving this way.

I recommend using Vertex Workbench with a custom container to debug: Screen Shot 2022-02-28 at 11 35 54 AM

The image you should use is gcr.io/cloud-devrel-public-resources/python-samples-testing-docker:latest

@ivanmkc Are there any additional steps to get the instance started?? I tried creating the instance using the provided image but it doesn't allow me to access the JupyterLab on it.
no_jupyter_link
The "OPEN JUPYTERLAB" button gets greyed out.

Alternatively, I've tested separating out the steps that install the fb-propphet's dependencies and the fb-prophet library without any installation errors on the user-managed instances but unable to run the linter test successfully on the changes. The linter test gave the following two errors :

error-1 : ImportError: cannot import name 'ParameterSource' from 'click.core' 

error-2 : ModuleNotFoundError: No module named 'absl'

These seem like coming from the linter test script rather than the the notebook.

@krishr2d2
Copy link
Contributor Author

@krishr2d2 The installation seemed to never finish after 17 hours. This is one of those cases where you'll have to dig a bit into why pip is behaving this way.
I recommend using Vertex Workbench with a custom container to debug: Screen Shot 2022-02-28 at 11 35 54 AM
The image you should use is gcr.io/cloud-devrel-public-resources/python-samples-testing-docker:latest

@ivanmkc Are there any additional steps to get the instance started?? I tried creating the instance using the provided image but it doesn't allow me to access the JupyterLab on it. no_jupyter_link The "OPEN JUPYTERLAB" button gets greyed out.

Alternatively, I've tested separating out the steps that install the fb-propphet's dependencies and the fb-prophet library without any installation errors on the user-managed instances but unable to run the linter test successfully on the changes. The linter test gave the following two errors :

error-1 : ImportError: cannot import name 'ParameterSource' from 'click.core' 

error-2 : ModuleNotFoundError: No module named 'absl'

These seem like coming from the linter test script rather than the the notebook.

The linter test related errors are gone after re-installing the requirements for linter test.

@andrewferlitsch
Copy link
Contributor

@ivanmkc gcbrun was 16 days ago, but still running?

@krishr2d2
Copy link
Contributor Author

@ivanmkc , Is there a way to access the executed notebook for this PR. I can't find it currently as the logs are truncated. Also, the docker builds are replaced by gcloud build commands. Still, I suspect that the container building process is taking a lot of time in this case ultimately leading to a TIMEOUT.

@andrewferlitsch
Copy link
Contributor

ValueError Traceback (most recent call last)
Step #5: Step #4: Cell In [21], line 6
Step #5: Step #4: 1 get_ipython().run_line_magic('cd', 'app/')
Step #5: Step #4: 3 # Choose a few product categories to build forecasts for from the Iowa Liquor sales data in BQ: bigquery-public-data:iowa_liquor_sales.sales
Step #5: Step #4: 4 # 1012100 CANADIAN WHISKIES
Step #5: Step #4: 5 # 1031100 AMERICAN VODKAS
Step #5: Step #4: ----> 6 train("1012100")
Step #5: Step #4: 7 train("1031100")
Step #5: Step #4: 9 get_ipython().run_line_magic('cd', '..')
Step #5: Step #4:
Step #5: Step #4: Cell In [20], line 30, in train(category)
Step #5: Step #4: 28 # Train the Prophet model
Step #5: Step #4: 29 model = Prophet()
Step #5: Step #4: ---> 30 model.fit(df_forecast)
Step #5: Step #4: 32 # Save the model locally
Step #5: Step #4: 33 joblib.dump(model, "{}.sav".format(category))
Step #5: Step #4:
Step #5: Step #4: File /workspace/workspace/env/lib/python3.9/site-packages/prophet/forecaster.py:1113, in Prophet.fit(self, df, **kwargs)
Step #5: Step #4: 1111 history = df[df['y'].notnull()].copy()
Step #5: Step #4: 1112 if history.shape[0] < 2:
Step #5: Step #4: -> 1113 raise ValueError('Dataframe has less than 2 non-NaN rows.')
Step #5: Step #4: 1114 self.history_dates = pd.to_datetime(pd.Series(df['ds'].unique(), name='ds')).sort_values()
Step #5: Step #4: 1116 history = self.setup_dataframe(history, initialize_scales=True)
Step #5: Step #4:
Step #5: Step #4: ValueError: Dataframe has less than 2 non-NaN rows.

@ivanmkc ivanmkc added the automerge Summon MOG for automerging label Nov 15, 2022
@gcf-merge-on-green gcf-merge-on-green bot merged commit d45bbb3 into GoogleCloudPlatform:main Nov 16, 2022
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Summon MOG for automerging label Nov 16, 2022
@krishr2d2 krishr2d2 deleted the sdk_fbprophet_forecasting_online branch November 16, 2022 05:01
gericdong pushed a commit to gericdong/edong-vertex-ai-samples-0902 that referenced this pull request Nov 22, 2022
…ebook (GoogleCloudPlatform#317)

Checklist for moving the notebook to the main repo: 
- [x] Use the [notebook template](https://togithub.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/notebook_template.ipynb) as a starting point.
- [x] Follow the style and grammar rules outlined in the above notebook template.
- [x] Verify the notebook runs successfully in Colab since the automated tests cannot guarantee this even when it passes.
- [x] Passes all the required automated checks. You can locally test for formatting and linting with these [instructions](https://togithub.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/docs/contributing.md#code-quality-checks).
- [ ] You have consulted with a tech writer to see if tech writer review is necessary. If so, the notebook has been reviewed by a tech writer, and they have approved it.
- [x] This notebook has been added to the [CODEOWNERS](https://togithub.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/docs/CODEOWNERS) file under `# Official Notebooks` section, pointing to the author or the author's team.
- [x] The Jupyter notebook cleans up any artifacts it has created (datasets, ML models, endpoints, etc) so as not to eat up unnecessary resources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants