animint2 icon indicating copy to clipboard operation
animint2 copied to clipboard

Add figure-loss-small-data animint as a test

Open siddhesh195 opened this issue 10 months ago • 9 comments

loss.small.rds and nb.rds stores subset of data from neuroblastoma. Storing the subset helps avoid loading entire neuroblastoma and improves test executing time

Closes #80

siddhesh195 avatar Apr 25 '24 01:04 siddhesh195

Since the PR only adds a test and not any capability, I did not add NEWS item and increase version number. Please let me know if it still recommended

siddhesh195 avatar Apr 25 '24 01:04 siddhesh195

also it looks like update_axes is commented in one of the plots, is that the one that will stop working if update_axes is included? Could you please include two plots, one with update_axes, and one without, and test them both? Also I guess this is not going to be working until after we fix #48 so I guess we can work on that fix in this branch.

tdhock avatar Apr 25 '24 13:04 tdhock

also it looks like update_axes is commented in one of the plots, is that the one that will stop working if update_axes is included? Could you please include two plots, one with update_axes, and one without, and test them both? Also I guess this is not going to be working until after we fix #48 so I guess we can work on that fix in this branch.

Yes, the commented update_axes is the one which stops working. The y axis is the one which does not work. I added another plot to the tests such that both with update_axes and without update_axes are tested

siddhesh195 avatar Apr 29 '24 03:04 siddhesh195

The tests successfully runs on my local machine, however fails after pushing to GitHub: Error in find.package(package, lib.loc, verbose = verbose): there is no package called ‘neuroblastoma’

Let me spend time investigating it further

siddhesh195 avatar Apr 29 '24 03:04 siddhesh195

you may have to add neuroblastoma to Suggests DESCRIPTION to fix "there is no package called neuroblastoma" but again it would be preferable if you could create a small simulated data set that replicates the issue (so we could avoid adding the dependency)

tdhock avatar Apr 29 '24 16:04 tdhock

you may have to add neuroblastoma to Suggests DESCRIPTION to fix "there is no package called neuroblastoma" but again it would be preferable if you could create a small simulated data set that replicates the issue (so we could avoid adding the dependency)

I rewrote the test to simulate neuroblastoma data set and replicate the issue. The simulated data set uses same fields and a uniform random distribution of values. We no longer have dependency on neuroblastoma package. However two other dependencies to jointseg, penaltyLearning packages were required to help compute the simulated data set

siddhesh195 avatar Apr 30 '24 02:04 siddhesh195

Hi Toby and Yufan,

I was able to remove dependency of neuroblastoma data and also reduce the time required to compute the data instead. Please let me know how to latest commit looks

siddhesh195 avatar May 14 '24 22:05 siddhesh195

Looks like good progress, thanks! First of all I think the "Selected data and model" plot could be improved by plotting the geom_segment correctly, see below for an example (first segment should start at first data point, last segment should end at last data point etc) image

Next I believe we need to add a test that fails. https://github.com/animint/animint2/issues/80#issue-1375075969 says "if I add clickSelects it stops working (but it should still work)." which is a bit hard to understand (sorry) but here is a more detailed explanation. Adding the geom_tallrect with clickSelects="changes" yields the following viz below, where the limits on the X axis on the last plot are incorrect -- penalty goes all the way up to 5 but it should be smaller (as in viz above) image So please add the following geom to vizWithUpdateAxes$lines

    geom_tallrect(aes(
      xmin=min.lambda, xmax=max.lambda),
      alpha=0.5,
      clickSelects="changes",
      showSelected="pid.chr",
      data=some.selection)

and add a test about the X axis limits on that plot (max X should not always be 5/max over all pid.chr values, it should be smaller when we click on some other pid.chr values).

Also please delete vizWithoutUpdateAxes, since it is irrelevant (the test should be about the update axis functionality).

tdhock avatar May 22 '24 23:05 tdhock

Also here is the rendered data viz on the new gallery https://tdhock.github.io/2024-05-22-changepoint-model-selection/ (without the geom_tallrect which causes the problematic X axis)

tdhock avatar May 22 '24 23:05 tdhock