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

Features #246

Open
wants to merge 123 commits into
base: patches
Choose a base branch
from
Open

Features #246

wants to merge 123 commits into from

Conversation

kujaku11
Copy link
Owner

@kujaku11 kujaku11 commented Jan 3, 2025

This PR will allow the ability to create features for FC's.

There is some book keeping as well as additional code.

A prototype json for defining weighting schemes based on features of the data is in aurora issue 61. To realize this we will need:

  • An mt_metadata representation of a general feature (it has a name or id), and it has parameters. These are not defined for the abstract base class, but instead are defined individually for each feature, such as "coherence", "multiple_coherence", "mahalanobis_distance", etc.
  • Separate jsons and classes for each feature we may want to implement (we will use "coherence", & "impedance", as first tests for these.
  • A mt_metadata weighting_curve, that controls how weights are assigned for a given feature
  • Specific features to use for weights should be allowed to vary depending on the output variable of the regression (ex, ey, hz), so each output variable will be associated with a list of features, as well as a weighting_strategy_parameters, which maps to a keyword. The simplest case would be multipilcation, i.e. simply multiply the weights from each feature together, but the keyword can map to more complicated methods in future, possibly also involving weighting_strategy_parameters.
  • Most features that take FCs as input will be output in frequency bands. The feature bands are in general not necessarily equal to the transfer function estimation bands, and because of this, they need metadata to specify how the bands will be defined. Here are some ways to do that
    • use the same bands as for TF estimation, with a minimum number of FCs (so if the band has only 1 FC, we widen it by one more FC to each side for example)
    • Use a variation of SigMT's parzen window scheme
    • provide a custom set of frequency bands

- this will help disambiguate from time series Channel objects
- minor updates to doc strings
- remove an unneeded return None
- Add some typehinting for DecimationLevel
- working on finding if we can delete Decimation class
- once correctly dtyped, circular imports were encountered.
- this was fixed by creating frequency_bands.py
- also add FrequencyBands to __init__.py
- alphabetize imports in __init__.py
- move get_fft_harmonics into window.py from decimation_level.py
- add fft_harmonics method to Window and replace other imports and usages
- try to group the decimation-related attributes together at the top, and the STFT related attrs at the bottom
- this may not be needed and this json is slated for deletion, but
until ready to delete this keeps the dual decimation classes close
- this is one of two main replacements that needs to be done on #235
- the next main replacement will be in FCDecimation
- add pass-through getters and setters for decimation_level and decimation_factor,
  - allowing FCDecimation to assing/access via self.time_series_decimation
- remove attrs decimation_level and decimation_factor from fc decimation.json
- update attrs in time_series_decimation.json
@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 81.95021% with 87 lines in your changes missing coverage. Please review.

Project coverage is 84.86%. Comparing base (ba2323e) to head (fdd02d6).
Report is 35 commits behind head on patches.

Files with missing lines Patch % Lines
...er_functions/processing/aurora/decimation_level.py 67.56% 36 Missing ⚠️
...ions/processing/fourier_coefficients/decimation.py 57.14% 24 Missing ⚠️
...t_metadata/transfer_functions/processing/window.py 78.04% 9 Missing ⚠️
...adata/transfer_functions/processing/aurora/band.py 65.00% 7 Missing ⚠️
...fer_functions/processing/aurora/frequency_bands.py 93.05% 5 Missing ⚠️
...er_functions/processing/fourier_coefficients/fc.py 71.42% 2 Missing ⚠️
...nctions/processing/short_time_fourier_transform.py 86.66% 2 Missing ⚠️
...transfer_functions/processing/aurora/processing.py 0.00% 1 Missing ⚠️
...unctions/processing/test_time_series_decimation.py 90.90% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           patches     #246      +/-   ##
===========================================
- Coverage    84.98%   84.86%   -0.12%     
===========================================
  Files          270      274       +4     
  Lines        20515    20535      +20     
===========================================
- Hits         17435    17428       -7     
- Misses        3080     3107      +27     
Flag Coverage Δ
tests 84.86% <81.95%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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