def test_check_y_pred_4(self): """ Unit test check y pred 4 """ y_pred = [0, 1] with self.assertRaises(ValueError): check_ypred(ypred=y_pred)
def test_check_y_pred_5(self): """ Unit test check y pred 5 """ x_pred = pd.DataFrame(data=np.array([[1, 2], [3, 4]]), columns=['Col1', 'Col2']) y_pred = pd.Series(data=np.array(['0'])) with self.assertRaises(ValueError): check_ypred(x_pred, y_pred)
def check_ypred(self, ypred=None): """ Check that ypred given has the right shape and expected value. Parameters ---------- ypred: pandas.DataFrame (optional) User-specified prediction values. """ return check_ypred(self.data["x"], ypred)
def check_y_pred(self, ypred=None): """ Check if y_pred is a one column dataframe of integer or float and if y_pred index matches x_pred index Parameters ---------- ypred: pandas.DataFrame (optional) User-specified prediction values. """ return check_ypred(self.x_pred, ypred)
def test_check_ypred_1(self): """ Unit test check y pred """ y_pred = None check_ypred(ypred=y_pred)