-
Notifications
You must be signed in to change notification settings - Fork 2
Registration #193
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
base: dev
Are you sure you want to change the base?
Registration #193
Conversation
* comments * FS comments
next: restructure vignette, add growth preprocessing case study...
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Merge branch 'dev' into registration # Conflicts: # .gitignore
|
[WIP] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive functional data registration capabilities to the tf package by implementing elastic deformation and alignment functions. The registration functionality enables temporal alignment of functional data by separating phase (timing) variation from amplitude (shape) variation.
- Implements core registration functionality using SRVF and FDA methods
- Adds comprehensive documentation with real-world examples using growth and pinch datasets
- Provides integration capabilities with the mlr3 framework
Reviewed Changes
Copilot reviewed 26 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
vignettes/registration.Rmd |
Comprehensive tutorial on curve registration with real-world examples |
vignettes/mlr3-integration.Rmd |
Integration example with mlr3 framework for FDA |
tests/testthat/test-vec-cast.R |
Removes debug print statements from test helper function |
tests/testthat/test-register.R |
Comprehensive test suite for registration functionality |
tests/testthat/test-assertions.R |
Tests for warping function validation |
man/*.Rd |
Documentation files for registration functions and datasets |
data-raw/*.R |
Data processing scripts for example datasets |
attic/*.R |
Development and troubleshooting scripts |
_pkgdown.yml |
Updates package documentation structure |
R/register.R |
Core registration implementation with warping/unwarping functions |
R/data.R |
Documentation for example datasets |
R/calculus.R |
Function inversion implementation |
| Multiple other R files | Supporting utilities and improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| The registration process involves: | ||
|
|
||
| 1. Estimating "warping functions" using `tf_register()` - these capture the time scale deformations of the observed functions relative to a (tpyically iteratively estimated) common template. |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error: 'tpyically' should be 'typically'.
| 1. Estimating "warping functions" using `tf_register()` - these capture the time scale deformations of the observed functions relative to a (tpyically iteratively estimated) common template. | |
| 1. Estimating "warping functions" using `tf_register()` - these capture the time scale deformations of the observed functions relative to a (typically iteratively estimated) common template. |
|
|
||
| Some general caveats: | ||
|
|
||
| - alignments can be fairly sensitive to the specifics of data representation (i.e., what kind of basis representation is being used, how many gridpoints the functions are being evaluated on, how to interpolate between grid points, whether/how much the data was smoothed before registration). Even for a simple looking example like the "Berkeley Growth" data shown below, you can get very different alignment results from the same method, depending on the specific pre-processing - see section !!TODO!!. |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder '!!TODO!!' should be replaced with an actual section reference or removed if the section doesn't exist yet.
| - alignments can be fairly sensitive to the specifics of data representation (i.e., what kind of basis representation is being used, how many gridpoints the functions are being evaluated on, how to interpolate between grid points, whether/how much the data was smoothed before registration). Even for a simple looking example like the "Berkeley Growth" data shown below, you can get very different alignment results from the same method, depending on the specific pre-processing - see section !!TODO!!. | |
| - alignments can be fairly sensitive to the specifics of data representation (i.e., what kind of basis representation is being used, how many gridpoints the functions are being evaluated on, how to interpolate between grid points, whether/how much the data was smoothed before registration). Even for a simple looking example like the "Berkeley Growth" data shown below, you can get very different alignment results from the same method, depending on the specific pre-processing. |
|
|
||
| Development of this subject is aligned to the population mean pattern in the first 2-3 years | ||
| (unwarping function follows bisecting angle), and delayed over most of the rest of the observed period (unwarping function below bisecting angle, all arrows pointing left). | ||
| The graph of the original growth trajectory itself is compressed by the alignment early on (slope of unwarping function < 1 for age 2-7, arrows to the left lenghtening), then dilated (steep unwarping function slope for age 7-10, arrows to the left shortening). |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error: 'lenghtening' should be 'lengthening'.
| The graph of the original growth trajectory itself is compressed by the alignment early on (slope of unwarping function < 1 for age 2-7, arrows to the left lenghtening), then dilated (steep unwarping function slope for age 7-10, arrows to the left shortening). | |
| The graph of the original growth trajectory itself is compressed by the alignment early on (slope of unwarping function < 1 for age 2-7, arrows to the left lengthening), then dilated (steep unwarping function slope for age 7-10, arrows to the left shortening). |
| if (is.character(x)) { | ||
| x <- sub("$^", "NA", x) |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regular expression '$^' will never match any string because it looks for end-of-string followed by start-of-string, which is impossible. This should likely be '^$' to match empty strings.
| if (is.character(x)) { | |
| x <- sub("$^", "NA", x) | |
| x <- sub("^$", "NA", x) |
remaining todos: