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

Dose BasisSmoother rely on smoothing_parameter values? #500

Open
mikeaalv opened this issue Nov 29, 2022 · 3 comments
Open

Dose BasisSmoother rely on smoothing_parameter values? #500

mikeaalv opened this issue Nov 29, 2022 · 3 comments
Labels

Comments

@mikeaalv
Copy link

Describe the bug
It seems to me change smoothing_parameter doesn't effect result of BasisSmoother, particularly the score

To Reproduce
I'm using something similar to the one used in the docs

t = np.linspace(0, 1, 5)
x = np.sin(2 * np.pi * t) + np.cos(2 * np.pi * t) + 2
fd = skfda.FDataGrid(data_matrix=x, grid_points=t)
basis = skfda.representation.basis.FourierBasis((0, 1), n_basis=3)
smoother = skfda.preprocessing.smoothing.BasisSmoother(basis,smoothing_parameter=100)
fd_smooth = smoother.fit_transform(fd)
fd_smooth.data_matrix.round(2)
smoother.score(fd,fd)

Expected behavior
changing smoothing_parameter doesn't seem to affect the score. I'm having the updated github version

Version information

  • OS: [e.g. MacOs 13.0]
  • Python version: [e.g. 3.9.15]
  • scikit-fda version: [e.g. latest]
  • Version of other packages involved [e.g. numpy 1.23.4]

Additional context

@mikeaalv mikeaalv added the bug label Nov 29, 2022
@vnmabus
Copy link
Member

vnmabus commented Nov 30, 2022

Thank you for the report! Maybe the documentation is not clear, but you need to specify the type of regularization using the regularization parameter. Otherwise, smoothing_parameter doesn't do anything. In fact, as you can specify a multiplier using the regularization parameter, smoothing_parameter is redundant and will probably be deprecated in the future.

@mikeaalv
Copy link
Author

mikeaalv commented Dec 1, 2022

It seems working for me. Thank you so much. Some examples on lambda search with b-spline basis would be super helpful.

@mynanshan
Copy link

Thanks for the question and the answer here. It would be great to have more examples on BasisSmoother and the GCV parameter selection. Besides, I think it also helpful to provide an independent introduction to some basic modules such as regularization and operator. For now, one may have to look into the source codes to custom a smoother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants