def test_train_predict_prob_LGBC_wine(): inputer = Inputers( description_filepath="../../descriptions/pre/inputers/wine.yaml") wine = inputer.transform() y = wine[inputer.target].values X = wine[wine.columns.difference([inputer.target])] learner = Learners( description_filepath="../../descriptions/learners/LGBC.yaml") learner.train(X, y, target=inputer.target, checkpoint="wineLGBMC.ckp") assert learner.predict_proba(X).shape == (178, 3)
def test_train_predict_prob_XGBC_creditdard(): inputer = Inputers( description_filepath="../../descriptions/pre/inputers/creditcard.yaml") creditdard = inputer.transform() y = creditdard[inputer.target].values X = creditdard[creditdard.columns.difference([inputer.target])] learner = Learners( description_filepath="../../descriptions/learners/XGBC.yaml") learner.train(X, y, checkpoint="creditdardLGBMC.ckp") assert learner.predict_proba(X).shape == (284807, 2)
def test_train_predict_prob_XGBC_yeast3(): inputer = Inputers( description_filepath="../../descriptions/pre/inputers/yeast3.yaml") yeast3 = inputer.transform() y = yeast3[inputer.target].values X = yeast3[yeast3.columns.difference([inputer.target])] learner = Learners( description_filepath="../../descriptions/learners/XGBC.yaml") learner.train(X, y, checkpoint="yeast3LGBMC.ckp") assert learner.predict_proba(X).shape == (1484, 2)
def test_train_predict_prob_LGBC(): inputer = Inputers(description_filepath= "../../descriptions/pre/inputers/pima-diabetes.yaml") diabetes = inputer.transform() y = diabetes[inputer.target].values X = diabetes[diabetes.columns.difference([inputer.target])] learner = Learners( description_filepath="../../descriptions/learners/LGBC.yaml") learner.train(X, y, checkpoint="diabetesLGBMC.ckp") assert learner.predict_proba(X).shape == (768, 2)
def test_predict_Prob_error(): inputer = Inputers(description_filepath= "../../descriptions/pre/inputers/pima-diabetes.yaml") diabetes = inputer.transform() learner = Learners( description_filepath="../../descriptions/learners/LGBC.yaml") # learner.train( # diabetes, target=inputer.target, checkpoint="diabetesLGBMC.ckp" # ) X = diabetes X_train = X[X.columns.difference([inputer.target])] with pytest.raises(PasoError): assert learner.predict_proba(X_train).shape == (768, 2)