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

LLR for non orthonormal basis #430

Merged
merged 6 commits into from
Mar 11, 2022
Merged

LLR for non orthonormal basis #430

merged 6 commits into from
Mar 11, 2022

Conversation

ElenaPetrunina
Copy link
Contributor

Close #421

class TestNonOthonormalBasisLLR(unittest.TestCase):
"""Test LocalLinearRegression method with non orthonormal basis."""

def test_llr_non_orthonormal(self):
Copy link

Choose a reason for hiding this comment

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

🚫 [mypy] reported by reviewdog 🐶
Function is missing a return type annotation

class TestNonOthonormalBasisLLR(unittest.TestCase):
"""Test LocalLinearRegression method with non orthonormal basis."""

def test_llr_non_orthonormal(self):
Copy link

Choose a reason for hiding this comment

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

📝 [mypy] reported by reviewdog 🐶
Use "-> None" if function does not return a value

@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Merging #430 (2aebfbd) into develop (c47ec78) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #430   +/-   ##
========================================
  Coverage    80.18%   80.19%           
========================================
  Files           93       93           
  Lines         7264     7266    +2     
========================================
+ Hits          5825     5827    +2     
  Misses        1439     1439           
Impacted Files Coverage Δ
skfda/misc/hat_matrix.py 89.02% <100.00%> (+0.27%) ⬆️
skfda/ml/regression/_kernel_regression.py 95.83% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c47ec78...2aebfbd. Read the comment docs.

@ElenaPetrunina ElenaPetrunina marked this pull request as ready for review March 4, 2022 22:19

# Adding a column of ones in the first position of all matrices
dims = (C.shape[0], C.shape[1], 1)
C = np.c_[np.ones(dims), C]
Copy link
Member

Choose a reason for hiding this comment

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

Why not hstack?

skfda/misc/hat_matrix.py Outdated Show resolved Hide resolved

# Calculate new coefficients taking into account cross-products
# if the basis is orthonormal, C would not change
C = np.einsum(
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this the same as C @= inner_product_matrix?

@vnmabus vnmabus merged commit 89c3cd9 into develop Mar 11, 2022
@vnmabus vnmabus deleted the feature/hat_matrix branch June 28, 2022 14:38
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 non orthonormal basis in local linear regression
2 participants