def c_comp(self, p0, p1, sigma0, sigma1, m0_proy, m1_proy):
        """ Computes the c threshold to assign a class to a (projected) point.
            We obtain the exact roots that are local optima of the error
            estimation and then we choose the one that minimizes it.

        Parameters
        ----------
        p0 : float
            prior probability for the first class
        p1 : float
            prior probability for the second class
        sigma0 : float
            maximum likelihood estimator for the std deviation of the
            projected first class
        sigma1 : float
            maximum likelihood estimator for the std deviation of the
            projected second class
        m0_proy : float
            maximum likelihood estimator for the mean of the projected
            first class
        m1_proy : float
            maximum likelihood estimator for the mean of the projected
            second class

        """
        a = -1 / 2 / sigma0**2 + 1 / 2 / sigma1**2
        b = m0_proy / sigma0**2 - m1_proy / sigma1**2
        c = -1 / 2 * m0_proy**2 / sigma0**2 + 1 / 2 * m1_proy**2 / \
            sigma1**2 + np.log(p0 / sigma0) - np.log(p1 / sigma1)
        pol_der = np.array([2 * a, b])
        disc = np.sqrt(b**2 - 4 * a * c)
        rootp = (-b + disc) / (2 * a)
        rootm = (-b - disc) / (2 * a)
        roots = [rootp, rootm]
        index = np.argmin(np.polyval(pol_der, roots))
        self.c = roots[index]

        # c = average of the proyected means (alternative method)
        # self.c = 0.5 * (m0_proy + m1_proy)
dataset/ETHPy150Open vicgalle/machine-learning/fisher.py/Fisher.c_comp/original