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

Allow BasisSmoother to accept irregularly sampled data #499

Closed
wants to merge 1 commit into from

Conversation

opintosant
Copy link
Contributor

Alternatively, I have implemented a separate SparseBasisSmoother class which encapsulates the functionality of BasisSmoother in order to apply it to irregularly sampled data, in the format given in Issue #325

_smoother.fit(d_grid, y)
fitted_smoothers.append(_smoother)

self.fitted_smoothers = fitted_smoothers

Choose a reason for hiding this comment

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

🚫 [mypy] reported by reviewdog 🐶
Incompatible types in assignment (expression has type "List[BasisSmoother]", variable has type "None") [assignment]

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

pep8

skfda/preprocessing/smoothing/_basis.py|421 col 1| D102 Missing docstring in public method
skfda/preprocessing/smoothing/_basis.py|426 col 1| W293 blank line contains whitespace
skfda/preprocessing/smoothing/_basis.py|428 col 1| N400: Found backslash that is used for line breaking
skfda/preprocessing/smoothing/_basis.py|429 col 62| WPS318 Found extra indentation
skfda/preprocessing/smoothing/_basis.py|430 col 1| W293 blank line contains whitespace
skfda/preprocessing/smoothing/_basis.py|433 col 80| E501 line too long (80 > 79 characters)
skfda/preprocessing/smoothing/_basis.py|434 col 1| W293 blank line contains whitespace

@@ -334,3 +334,102 @@ def transform(
)

return super().transform(X, y)


Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W293 blank line contains whitespace



class SparseBasisSmoother(BasisSmoother):
r"""

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D205 1 blank line required between summary line and description



class SparseBasisSmoother(BasisSmoother):
r"""

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
D400 First line should end with a period



class SparseBasisSmoother(BasisSmoother):
r"""

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS360 Found an unnecessary use of a raw string: """


class SparseBasisSmoother(BasisSmoother):
r"""
Transform raw_data in the form of a list of single-function FDataGrid objects

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
E501 line too long (81 > 79 characters)

for d_grid in X:
_smoother = BasisSmoother(
self.basis,
return_basis=self.return_basis

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
C812 missing trailing comma

self.basis,
return_basis=self.return_basis
)
_smoother.fit(d_grid, y)

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS121 Found usage of a variable marked as unused: _smoother

return_basis=self.return_basis
)
_smoother.fit(d_grid, y)
fitted_smoothers.append(_smoother)

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS121 Found usage of a variable marked as unused: _smoother

)
_smoother.fit(d_grid, y)
fitted_smoothers.append(_smoother)

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W293 blank line contains whitespace

self.fitted_smoothers = fitted_smoothers

return self

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W293 blank line contains whitespace

@opintosant opintosant linked an issue Nov 26, 2022 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Nov 26, 2022

Codecov Report

Base: 85.41% // Head: 85.27% // Decreases project coverage by -0.14% ⚠️

Coverage data is based on head (ae6e9b3) compared to base (8756059).
Patch coverage: 23.07% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #499      +/-   ##
===========================================
- Coverage    85.41%   85.27%   -0.15%     
===========================================
  Files          139      139              
  Lines        11103    11128      +25     
===========================================
+ Hits          9484     9489       +5     
- Misses        1619     1639      +20     
Impacted Files Coverage Δ
skfda/preprocessing/smoothing/_basis.py 71.42% <23.07%> (-28.58%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@opintosant opintosant closed this Jun 19, 2023
@opintosant opintosant deleted the feature/sparse_basis_smoother branch June 19, 2023 15:50
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.

Allow BasisSmoother to accept irregularly sampled data
1 participant