Repository navigation
Leave a response fixed per subject untransformed in tpls(), tplsda() and block_tpls() - #17
Open
kimanh-lecao wants to merge 7 commits into
Open
kimanh-lecao wants to merge 7 commits into
kimanh-lecao wants to merge 7 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #16; only the last commit is new.
A response that is fixed per subject, such as a class label or an endpoint measured once, is copied
to every time point and m-transformed with X. Under the DCT it is then non-zero on face 1 only, the
subject time averages, so every component comes from face 1 and
tplsda()equals PLS-DA on thetime averages: features whose groups differ in how they change over time, but not in their mean,
cannot be found.
Change. A new argument
transform_y.tpls()andblock_tpls():NULLby default, decided by the shape of the response. A vector or ann x q matrix (the target block, for
block_tpls()) is fixed per subject and is not transformed, soevery face of X is compared with the response itself; an order-3 tensor is transformed as before.
FALSEwith a tensor that changes over time stops with an error.tplsda()andblock_tplsda():transform_y = multi_label, so a single label per subject is nottransformed and labels repeated over time still are.
deflated on every face. In
block_tpls()regression mode that is the existing average over theblocks' deflations, applied to every face.
Calls with a tensor response,
multi_label = TRUEandtransform_y = TRUEareidentical()tobefore. The default
tplsda()andblock_tplsda()fits change, as intended. Face scaling, whichthe untransformed response needs once between-subject variation is large (face 1 then wins on its
size), follows in #18.
Tests. New tests in
test-tens.tpls.R,test-tens.tplsda.Randtest-tens.block.tplsda.R:on data like the example's,
tplsda()andblock_tplsda()leave face 1, and stay on it withtransform_y = TRUE; a matrix response and the same response as a constant tensor give the same fit;a rank-1 response in canonical mode leaves nothing for a second component, which checks that it is
deflated on every face; and
transform_y = FALSErefuses a response that changes over time. They failon the current main and pass with the change. The full test suite passes.
Closes #7.