def __init__(self,
                 betas,
                 rescaled_betas,
                 threshold=0.5,
                 filter_method='overlap'):
        """
        :param betas: list(pd.DataFrame[G x K])
        :param rescaled_betas: list(pd.DataFrame[G x K])
        :param threshold: float
        :param filter_method: str
            How to handle gold standard filtering ('overlap' filters to beta, 'keep_all_gold_standard' doesn't filter)
        """

        assert check.dataframes_align(betas)
        self.betas = betas

        assert check.dataframes_align(rescaled_betas)
        self.rescaled_betas = rescaled_betas

        assert check.argument_enum(filter_method, FILTER_METHODS)
        self.filter_method = filter_method

        assert check.argument_numeric(threshold, 0, 1)
        self.threshold = threshold
Esempio n. 2
0
    def test_frame_alignment(self):

        self.assertTrue(
            check.dataframes_align([self.frame1, self.frame1, self.frame1]))
        self.assertTrue(
            check.dataframes_align([self.frame1, self.frame1, self.frame3],
                                   check_order=False))

        with self.assertRaises(ValueError):
            check.dataframes_align([self.frame1, self.frame2, self.frame1])

        with self.assertRaises(ValueError):
            check.dataframes_align([self.frame1, self.frame3, self.frame1])