It isn't easy to come up with a generic procedure for this calculation in the former scenario since many methods further process the expression matrix internally without reporting it.
The model output can be arbitrarily worse for non-linear methods and produce negative values for this evaluation.
For k selection (assuming good model fit) we can get a knee plot by plotting the variance explained by each component w.r.t. total modeled variance. This evaluation will focus on selecting the appropriate k while we can introduce a different evaluation to assess goodness of fit.
Or we could come up with a generalisable evaluation (e.g. information based) to compute goodness of fit that can also be used for k selection.
It isn't easy to come up with a generic procedure for this calculation in the former scenario since many methods further process the expression matrix internally without reporting it.
The model output can be arbitrarily worse for non-linear methods and produce negative values for this evaluation.
For k selection (assuming good model fit) we can get a knee plot by plotting the variance explained by each component w.r.t. total modeled variance. This evaluation will focus on selecting the appropriate k while we can introduce a different evaluation to assess goodness of fit.
Or we could come up with a generalisable evaluation (e.g. information based) to compute goodness of fit that can also be used for k selection.