def test_learn_train_predict_prob_LGBC(): inputer = Inputers( description_filepath="../../descriptions/pre/inputers/otto_group.yaml") dataset = inputer.transform() y = dataset[inputer.target].values X = dataset[dataset.columns.difference([inputer.target])] learner = Learners( description_filepath="../../descriptions/learners/LGBC.yaml") learner.train(X, y, checkpoint="otto_group_LGBMC.ckp") assert learner.predict(X).shape == (61878, )
def test_learn_train_predict_XGBC(): inputer = Inputers( description_filepath="../../descriptions/pre/inputers/wine.yaml") dataset = inputer.transform() y = dataset[inputer.target].values X = dataset[dataset.columns.difference([inputer.target])] learner = Learners( description_filepath="../../descriptions/learners/XGBC.yaml") learner.train(X, y, checkpoint="LGBMClassifier.ckp") assert learner.predict(X).shape == (178, )
def test_predict_LGBC_no_fit(): 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(X_train).shape == (768, 2)