batchglm icon indicating copy to clipboard operation
batchglm copied to clipboard

Shuffle Assignments doesn't work when generating sample description

Open picciama opened this issue 5 years ago • 0 comments

This here: https://github.com/theislab/batchglm/blob/23484819f0cdb4778c88ad9e68aebbdba0b5c814/batchglm/models/base_glm/simulator.py#L43-L48

is a bug that results in 'DataFrame' object has no attribute 'isel'.

How to reproduce:

from batchglm.api.models.numpy.glm_nb import Simulator

sim = Simulator()
sim.generate_sample_description(shuffle_assignments=True)

I think this is a remnant of the time when we used xarray.DataSet instead of pandas.DataFrame.

The question is now if we wanna fix this or get rid of it? The method returns a design matrix based on the sample_description anyways so shuffling only reorders the rows of the matrix but at the time of generating the sample description, no data has been sampled yet because we need the sample description to simulate counts. So this has no real effect?

So is there any reason to keep it?

picciama avatar Jan 16 '20 23:01 picciama