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

Feature/fdm #621

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Feature/fdm #621

wants to merge 7 commits into from

Conversation

E105D104U125
Copy link
Contributor

  • Added FDM feature in the dimensionality reduction submodule of the preprocessing module _fdm.py .
  • Included a test file for testing the new method test_fdm.py .
  • Created and added an example for the wiki plot_fdm.py .

@E105D104U125
Copy link
Contributor Author

Ignoring flake8 errors WPS440 and WPS441 in the doc example file plot_fdm .

Copy link
Member

@vnmabus vnmabus left a comment

Choose a reason for hiding this comment

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

Again, sorry for taking so long reviewing this. The main functionality is great, I just have a couple of nitpicks in documentation and tests.

If you do not have the time/will to do the changes, just tell me and I will apply them myself (but please, answer my question about the comparison in the tests, as I truly do not remember which was the reference package).

>>> embedding_train = fdm.fit_transform(X=fd_train)
>>> embedding_test = fdm.transform(X=fd_test)

Notes:
Copy link
Member

Choose a reason for hiding this comment

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

I would put this note before the Parameters section. Here is too low and it can be missed.

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 agree.

)


def rbf_kernel(fd: FData, sigma: float) -> NDArrayFloat:
Copy link
Member

Choose a reason for hiding this comment

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

Cannot we use here the covariances in the covariances module? I think this can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. The fdm module was implemented before extending the covariance kernels to functional data. It makes no sense anymore, I'll change it.

def test_precalculated_grid_example(
precalculated_fdatagrid_example: FDataGrid,
) -> None:
"""Compare the embedding in grid against the fda package."""
Copy link
Member

Choose a reason for hiding this comment

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

Does the fda package have FDM? I do not think so. Can you put the code used to get the values in the docstring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These examples where computed by hand. I will the necessary details for reproducibility of the calculations.

)


def laplacian_kernel(fd: FData, sigma: float) -> NDArrayFloat:
Copy link
Member

Choose a reason for hiding this comment

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

This is unused, remove.

@E105D104U125
Copy link
Contributor Author

Again, sorry for taking so long reviewing this. The main functionality is great, I just have a couple of nitpicks in documentation and tests.

If you do not have the time/will to do the changes, just tell me and I will apply them myself (but please, answer my question about the comparison in the tests, as I truly do not remember which was the reference package).

I implemented and pushed all changes.
There is a problem with the style tests FileNotFoundError: [Errno 2] No such file or directory: 'examples/plot_fdm.py skfda/preprocessing/dim_reduction/__init__.py .

@E105D104U125
Copy link
Contributor Author

E105D104U125 commented Mar 9, 2025

Also, I created a web version of the study that I did on the FDM method, FDM GitHub pages
I was thinking it could be interesting to reference it in a note in the FDM class example of use. The website is essentially a more in depth version of the example of use notebook, including mathematical background and further experiments.
Please let me know your view on this.

@vnmabus
Copy link
Member

vnmabus commented Mar 9, 2025

Also, I created a web version of the study that I did on the FDM method, FDM GitHub pages I was thinking it could be interesting to reference it in a note in the FDM class example of use. The website is essentially a more in depth version of the example of use notebook, including mathematical background and further experiments. Please let me know your view on this.

Hey, that is cool! Yes, you can add a note on the top pointing to that page, or just reference it with a footnote cite, also at the top of the page, so that nobody misses it.

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.

3 participants