Example #1
0
    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))
Example #2
0
 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)
Example #3
0
 def test_bad_fitprobs(self):
     x, y = self.zscores, self.data
     x_, y_, res = viz._fit_line(x, y, fitprobs='junk')
Example #4
0
 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))
Example #5
0
 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))
Example #6
0
 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))
Example #7
0
 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))