Skip to content

BLR transfer silently ignores new dataset missing batch effects #382

@avchavanne

Description

@avchavanne

I ran the BLR transfer of my trained models on a new dataset with batch effects specified in a different way by accident at first, and then to check further. My trained model has 2 batch effects : sex encoded as M/F, and site. For the transfer norm_data objects, I tried :

  1. 2 batch effects : sex encoded as 1/0 and site
  2. 1 batch effect : site

Both ran without error nor warnings.
Looking at the design matrices, it seems like the toolkit silently assigns batch effects compatible with the trained model - specifically, it assigns to all subjects the first occuring combination of batch effects in trained model/training data (e.g. all become sex 1 from training site 1).
When I try to transfer using correctly encoded sex in a dummy dataset with a previously-seen site, all subjects still get assigned sex 1 from training site 1 in Phi.
So, it seems like the toolkit might not actually be transferring.

This is probably related to the temporary fix we had by commenting out line 208 of normative_models.py :
#new_model[responsevar].be_maps = copy.deepcopy(be_maps)
But leaving that in gave a dimension mismatch between the dimensions of transfer data Phi (if memory serves) and those expected by the model.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions