예제 #1
0
def test_plot_learning_curve():
    """Assert that the plot_learning_curve method work as intended."""
    atom = ATOMRegressor(X_reg, y_reg, random_state=1)
    pytest.raises(NotFittedError, atom.plot_learning_curve)
    atom.run("LGB")
    atom.delete()  # Clear the pipeline to allow ts
    atom.train_sizing(["Tree", "LGB"], metric="max_error", bagging=4)
    atom.plot_learning_curve(display=False)
    atom.train_sizing(["Tree", "LGB"], metric="max_error")
    atom.plot_learning_curve(display=False)
예제 #2
0
def test_plot_successive_halving():
    """Assert that the plot_successive_halving method work as intended."""
    atom = ATOMRegressor(X_reg, y_reg, random_state=1)
    pytest.raises(NotFittedError, atom.plot_successive_halving)
    atom.run("LGB")
    atom.delete()  # Clear the pipeline to allow sh
    atom.successive_halving(models=["Tree", "Bag", "RF", "LGB"], bagging=4)
    pytest.raises(ValueError, atom.plot_successive_halving, models="unknown")
    pytest.raises(ValueError, atom.plot_successive_halving, models="BR")
    pytest.raises(ValueError, atom.plot_successive_halving, metric="unknown")
    pytest.raises(ValueError, atom.plot_successive_halving, metric=-1)
    pytest.raises(ValueError, atom.plot_successive_halving, metric=1)
    pytest.raises(ValueError, atom.plot_successive_halving, metric="roc_auc")
    atom.plot_successive_halving(display=False)
    atom.successive_halving(models=["Tree", "Bag", "RF", "LGB"])
    atom.plot_successive_halving(display=False)