def test_ridge(data): estimator = make_pipeline( StandardScaler(), MLPRegressor(hidden_layer_sizes=(50, 15,)) ) ttr.check_model(data, "MLPRegressor", estimator)
def test(data): svr = make_pipeline( # PolynomialFeatures(), StandardScaler(), SVR(kernel="rbf", C=25, gamma="scale"), ) ttr.check_model(data, "SVR rbf", svr)
def test_linear_model(data): ttr.check_model( data, "SGD", make_pipeline( # StandardScaler(), PolynomialFeatures(), SGDRegressor(max_iter=1000, tol=1e-3)))
def test_search_random_forest(data): grid_params = { "randomforestregressor__n_estimators": [20, 50, 100, 150, 200], "randomforestregressor__criterion": ["mse"], "randomforestregressor__min_samples_leaf": [2, 4, 8, 16, 32], } model = make_pipeline( ColumnRemover(("timeStamp", )), RandomForestRegressor(), ) ttr.search(data, "Random Forest", model, grid_params)
def test_scan(data): parameters = { "svr__kernel": ["rbf"], # "kernel": ["rbf", "poly", "sigmoid"], "svr__C": [1, 10, 25, 30], "svr__gamma": ["auto", 2. / 16, 4. / 16, 1.] } svr = make_pipeline( ColumnRemover(("timeStamp",)), StandardScaler(), SVR(), ) ttr.search(data, "SVR ", svr, parameters)
def test_bagging(data): ttr.check_model(data, "Bagging", BaggingRegressor())
def test_gradient(data): ttr.check_model(data, "Gradient boost", GradientBoostingRegressor())
def test_ada(data): ttr.check_model(data, "Ada boost", AdaBoostRegressor())
def test_random_forest(data): ttr.check_model(data, "Random Forest", RandomForestRegressor())
def main(): rf = make_pipeline( StandardScaler(), SVR(kernel="rbf", C=25), ) ttr.check_model("SVR", rf)