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

[DOC] Add example notebook for the graphical pipeline #5175

Merged
merged 16 commits into from
Aug 8, 2024

Conversation

benHeid
Copy link
Contributor

@benHeid benHeid commented Aug 28, 2023

Reference Issues/PRs

See #4652 and #4281

What does this implement/fix? Explain your changes.

This PR adds the graphical pipeline jupyter notebook. Furthermore, it ensures that the ForecastingGridSearchCV call fit,predict etc. using keywords instead of positional arguments to enable that the gridsearch works with the graphical pipeline.

Does your contribution introduce a new dependency? If yes, which one?

No

What should a reviewer concentrate their feedback on?

Did you add any tests for the change?

Any other comments?

PR checklist

For all contributions
  • I've added myself to the list of contributors with any new badges I've earned :-)
    How to: add yourself to the all-contributors file in the sktime root directory (not the CONTRIBUTORS.md). Common badges: code - fixing a bug, or adding code logic. doc - writing or improving documentation or docstrings. bug - reporting or diagnosing a bug (get this plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release.
    See here for full badge reference
  • Optionally, I've added myself and possibly others to the CODEOWNERS file - do this if you want to become the owner or maintainer of an estimator you added.
    See here for further details on the algorithm maintainer role.
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.
  • If the estimator relies on a soft dependency, I've set the python_dependencies tag and ensured
    dependency isolation, see the estimator dependencies guide.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@benHeid benHeid force-pushed the notebook_graphpipeline branch 3 times, most recently from bd84ec9 to 50456a5 Compare September 1, 2023 07:45
@benHeid benHeid force-pushed the notebook_graphpipeline branch 4 times, most recently from b02eb08 to c55768e Compare September 10, 2023 18:03
@benHeid benHeid marked this pull request as ready for review September 10, 2023 18:03
@benHeid benHeid changed the title [WIP] Notebook graphpipeline [DOC] Add example notebook for the graphical pipeline Sep 10, 2023
@fkiraly
Copy link
Collaborator

fkiraly commented Nov 3, 2023

@benHeid, are you still working on this?

@benHeid
Copy link
Contributor Author

benHeid commented Nov 6, 2023

Yes, I am planning to work on this again. Was a bit blocked and needed some time to relax in the last weeks :D

@benHeid benHeid force-pushed the notebook_graphpipeline branch from 150d1d5 to ef41c90 Compare January 28, 2024 17:46
@benHeid
Copy link
Contributor Author

benHeid commented Feb 11, 2024

@fkiraly I was able to work on that notebook. I would appreciate feedback :)

@fkiraly
Copy link
Collaborator

fkiraly commented Feb 11, 2024

ofc, wasn't sure if it's done

"<img src=\"img/graphical_pipeline_example.png\" width=900 />\n",
"\n",
"\n",
"**Note:** The current experimental state of the graphical pipeline does not fully support this use-case. However, we are working on this. If you are interested in this use-case and want to contribute, please contact us.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

that's an odd note to start with.

  • it appears twice - copy-paste error?
  • is it still true that this cannot be done?
  • irrespectively, I think it would be best to have a small paragraph at the start that explains "when to use what", and the use cases the graphical pipeline covers in addition.

Copy link
Collaborator

Choose a reason for hiding this comment

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

is the "more complex example" at the bottom not of this kind?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can imagine that even more complex stuff can be created. However, I reworked the statement

"1. Pass all steps to the pipeline during initialisation as for the sequential pipelines.\n",
"\n",
"```python\n",
"pipeline = Pipeline([\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this code not be in jupyter cells? Users will attempt to copy or execxute these, but it is not possible. Imo notebooks like this work best if the instructions are followed by actual code.

Copy link
Collaborator

@fkiraly fkiraly Feb 18, 2024

Choose a reason for hiding this comment

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

I see why you don't use actual code - you want to explain it abstractly.
Trying to read it with the mindset of someone new to this, I would be confused about (a) what is skobject1, and (b) the lack of reference conceptualization (e.g., the graph) - "what are we building". Perhaps add a simple example, or merge it with the first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I merged it with the following example. Should now be easier to understand

"collapsed": false
},
"source": [
"## How to build a Graphical Pipeline\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

this section would be much better if a graphical representation comes at the start, and then ecah part of the specification is matched ot a graphical element

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

"name": "stderr",
"output_type": "stream",
"text": [
"/Users/benediktheidrich/code/sktime/sktime/pipeline/pipeline.py:160: UserWarning: This generalised graphical pipeline is experimental, with all the usual risks of edge features. For mature alternatives, use single-purpose pipelines and compositors, such as TransformedTargetForecaster, ForecastingPipeline, ClassificationPipeline, etc., see for instance notebooks 01_forecasting.ipynb and 02_classification.ipynb athttps://github.com/sktime/sktime/blob/main/examples/.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

this causes a lot of warnings. To you want to deactivate them at the start of the nb? you can also do so via set_config(warnings="off")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

nice notebook!

I left some comments to consider. Imo most important is to get the intro section right, it reads a bit odd. The rest is robust.

@benHeid
Copy link
Contributor Author

benHeid commented Jul 2, 2024

Completely forgot about this PR...

@benHeid benHeid requested a review from fkiraly July 5, 2024 07:45
@fkiraly fkiraly added the documentation Documentation & tutorials label Jul 13, 2024
@fkiraly fkiraly merged commit 0c9fde4 into main Aug 8, 2024
45 of 46 checks passed
@fkiraly fkiraly deleted the notebook_graphpipeline branch August 8, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation & tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants