Exemple #1
0
    def test_density_knotlocs(self, adata_cflare: AnnData):
        g = GAMR(adata_cflare, knotlocs="density")
        g.prepare(adata_cflare.var_names[0], "0", n_test_points=300).fit()
        g.predict(level=0.95)

        assert g.y_test.shape == (300,)
        assert g.conf_int.shape == (300, 2)
Exemple #2
0
def _create_gamr_model(_adata: AnnData) -> Optional[GAMR]:
    try:
        m = GAMR(_adata)
        m.prepare(_adata.var_names[0], "0").fit()
        m.predict(level=0.95)
        return m
    except:
        return None