aeon icon indicating copy to clipboard operation
aeon copied to clipboard

[DOC] Improve visualization module documentation

Open Kaustbh opened this issue 9 months ago • 5 comments

Reference Issues/PRs

Fixes: #2580

What does this implement/fix? Explain your changes.

This PR addresses the following improvements in the Aeon documentation:

Adding New Notebooks:

  • Introduces notebooks for the distances and estimator modules.

Fixing Duplication:

  • Modifies examples.md to correctly render the plotting_for_learning_tasks notebook.

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

Any other comments?

PR checklist

For all contributions
  • [ ] I've added myself to the list of contributors. Alternatively, you can use the @all-contributors bot to do this for you after the PR has been merged.
  • [x] The PR title starts with either [ENH], [MNT], [DOC], [BUG], [REF], [DEP] or [GOV] indicating whether the PR topic is related to enhancement, maintenance, documentation, bugs, refactoring, deprecation or governance.
For new estimators and functions
  • [ ] I've added the estimator/function to the online API documentation.
  • [ ] (OPTIONAL) I've added myself as a __maintainer__ at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.
For developers with write access
  • [ ] (OPTIONAL) I've updated aeon's CODEOWNERS to receive notifications about future changes to these files.

Kaustbh avatar Mar 09 '25 17:03 Kaustbh

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ $\color{#F3B9F8}{\textsf{documentation}}$ ]. I have added the following labels to this PR based on the changes made: [ $\color{#45FD64}{\textsf{examples}}$ ]. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.

Don't hesitate to ask questions on the aeon Slack channel if you have any.

PR CI actions

These checkboxes will add labels to enable/disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

  • [ ] Run pre-commit checks for all files
  • [ ] Run mypy typecheck tests
  • [ ] Run all pytest tests and configurations
  • [ ] Run all notebook example tests
  • [ ] Run numba-disabled codecov tests
  • [ ] Stop automatic pre-commit fixes (always disabled for drafts)
  • [ ] Disable numba cache loading
  • [ ] Push an empty commit to re-run CI checks

aeon-actions-bot[bot] avatar Mar 09 '25 17:03 aeon-actions-bot[bot]

Hi are there any issues with this? It is still a draft.

MatthewMiddlehurst avatar Apr 03 '25 14:04 MatthewMiddlehurst

There is a little change in examples.md I want to do, and additionally I am thinking of adding a notebook for estimator module.

Kaustbh avatar Apr 03 '25 17:04 Kaustbh

Hi, @MatthewMiddlehurst I have made the changes, you can review it now.

Kaustbh avatar Apr 24 '25 03:04 Kaustbh

Okay, I will work on it.

Kaustbh avatar Jun 07 '25 02:06 Kaustbh

I was more referring to this image. image

I would reduce the name of channels from 5 used in the notebook to 3, may be confusing to have the same series length and channels. a length of 5 is a bit short also for a series, I would say 10 minimum.

MatthewMiddlehurst avatar Jun 25 '25 13:06 MatthewMiddlehurst

Hi, Matthew, I have made the changes.

Kaustbh avatar Jun 29 '25 05:06 Kaustbh

This is still incorrect, looks like the series length and number of channels are swapped.

MatthewMiddlehurst avatar Jun 29 '25 18:06 MatthewMiddlehurst

Hi, when I am running the below code snippet,

from aeon.datasets import load_arrow_head
from aeon.distances import euclidean_pairwise_distance
from aeon.visualisation import plot_pairwise_distance_matrix

X, y = load_arrow_head(split="test", return_type="numpy2D")

a = X[10:15,:10] 
b = X[15:20,:10] 

distance_matrix = euclidean_pairwise_distance(a,b)

path = [(i, i) for i in range(len(a))]

_ = plot_pairwise_distance_matrix(distance_matrix, a, b, path)

image

Since I'm selecting 5 rows and 10 timepoints for both a and b, I expected the plots for a (blue) and b (orange) to show 5 lines, each representing one time series. However, the plot shows 10 lines instead.

Could this be due to how matplotlib.plot() interprets the 2D array (plotting one line per column)? Would it make sense to transpose the input or loop through each row for plotting?

Kaustbh avatar Jul 08 '25 18:07 Kaustbh

Hi, @MatthewMiddlehurst, can you please take a look at the above message?

Kaustbh avatar Jul 11 '25 17:07 Kaustbh

Yes probably best to transpose the matrix array. Does the documentation mention the dimensions of the output?

MatthewMiddlehurst avatar Jul 24 '25 16:07 MatthewMiddlehurst

Sorry for the delayed response. There is no mention of the expected input dimensions in the documentation. In the latest commit, I modified the internal logic of the pairwise_distance_matrix function to handle the dimensions internally, so we no longer need to explicitly pass the transpose when calling the plotting function. Do you think this approach is acceptable, or would you prefer we keep transposing the input explicitly at the call site?

Kaustbh avatar Aug 01 '25 05:08 Kaustbh

I think maybe just leave the function as it is for now and input a univariate series (1d numpy array). The current image does not display 10 time points.

MatthewMiddlehurst avatar Aug 08 '25 09:08 MatthewMiddlehurst

Hi, it is working fine for, 10 time series and 10 time points,

a = X[0:10, 10:20] 

b = X[10:20, 10:20]

should I keep the function as it is?

image

Kaustbh avatar Aug 12 '25 17:08 Kaustbh