from mlxtend.regressor import StackingRegressor from sklearn.ensemble.forest import RandomForestRegressor as RFR from sklearn.ensemble import GradientBoostingRegressor as GBR import xgboost as xgb rfr = RFR(n_estimators=500, n_jobs=cc.ncpu, random_state=0) gbr = GBR(n_estimators=1000, random_state=0) xgr = xgb.XGBRegressor() mtr = RFR()
In the above code, I want to use regression to vote mlxtend , and also use a random forest to select the appropriate functions. However, this code does not work, and I get an error
ValueError: Invalid parameter xgr for estimator StackingRegressor(meta_regressor=RandomForestRegressor(bootstrap=True, criterion='mse', max_depth=None, max_features='auto', max_leaf_nodes=None, min_impurity_split=1e-07, min_samples_leaf=1, min_samples_split=2, min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1, oob_score=False, random_state=None, verbose=0, warm_start=False), regressors=[RandomForestRegressor(bootstrap=True, criterion='mse', max_depth=None, max_features='auto', max_leaf_nodes=None, min_impurity_split=1e-07, min_samples_leaf=1, min_samples_split=2, min_weight_fraction_leaf=0.0, n_estimators=500, n_jobs=5, oob_sc...eg:linear', reg_alpha=0, reg_lambda=1, scale_pos_weight=1, seed=0, silent=True, subsample=1)], verbose=0). Check the list of available parameters with `estimator.get_params().keys()`.
How to fix it?