def test_xprob_yprob(self): z2, _y = stats.probplot(self.y, fit=False) p2 = stats.norm.cdf(z2) * 100 scales = {'fitlogs': None, 'fitprobs': 'both'} x, y = self.probs, p2, x_, y_, res = viz._fit_line(x, y, **scales) nptest.assert_array_almost_equal(y_, self.known_y_probprob) nt.assert_true(isinstance(res, np.ndarray))
def test_custom_xhat(self): x, y = self.zscores, self.data x_, y_, res = viz._fit_line(x, y, xhat=self.custom_xhat) nptest.assert_array_almost_equal(y_, self.known_custom_yhat)
def test_bad_fitprobs(self): x, y = self.zscores, self.data x_, y_, res = viz._fit_line(x, y, fitprobs='junk')
def test_xprob_ylog(self): scales = {'fitlogs': 'y', 'fitprobs': 'x'} x, y = self.probs, self.data x_, y_, res = viz._fit_line(x, y, **scales) nptest.assert_array_almost_equal(y_, self.known_y_problog) nt.assert_true(isinstance(res, np.ndarray))
def test_xlog_yprob(self): scales = {'fitlogs': 'x', 'fitprobs': 'y'} x, y = self.data, self.probs x_, y_, res = viz._fit_line(x, y, **scales) nptest.assert_array_almost_equal(y_, self.known_y_logprob) nt.assert_true(isinstance(res, np.ndarray))
def test_xlog_ylog(self): scales = {'fitlogs': 'both', 'fitprobs': None} x, y = self.data, self.y x_, y_, res = viz._fit_line(x, y, **scales) nptest.assert_array_almost_equal(y_, self.known_y_loglog) nt.assert_true(isinstance(res, np.ndarray))
def test_xlinear_ylinear(self): scales = {'fitlogs': None, 'fitprobs': None} x, y = self.zscores, self.data x_, y_, res = viz._fit_line(x, y, **scales) nptest.assert_array_almost_equal(y_, self.known_y_linlin) nt.assert_true(isinstance(res, np.ndarray))