Closed oliviaAB closed 2 years ago
Thanks a lot for reporting this bug and getting to the source of it!
We fixed this problem by removing the inactive factors also from the interpolated values (as it is done for other instances in the MOFA object). This is now part of version 1.7.1 and should resolve your issue. Let us know if you encounter any issues with this.
Thank you for the quick reply and fix! I just tried it with the newest version and everything is working fine :)
Perfect, thanks for the feedback!
Hi,
Thanks for this great package! I've started playing with MEFISTO, and have trained a model. I've used the
new_values
parameter fromget_default_mefisto_options(mefisto_input)
to perform the factor interpolation when training the model in python. However I'm getting an error when trying to use theplot_interpolation_vs_covariate()
function:I've tracked down the issue to the
get_interpolated_factors()
function. Specifically, 3 lines before the return, when the factor column is modified to get the name of the factors rather than their ID as integer:The problem is that the model has learned only 3 factors, and so
factors_names(object)
contains the name of these three factors:but the
interpolated_Z
element in the mefisto trained model has interpolated values for the 15 initial factors:So when running:
values 4 to 15 in the factor column get turned into
NAs
. This triggers an error in the next line:because
spread()
is expecting unique values for the combination of columns other thantype
andvalue
.A solution would be to filter out the rows in
df_interpol
that correspond to factors that have been discarded, e.g. with:Hope this helps!