Skip to content

Instantly share code, notes, and snippets.

@mikekeith52
Last active May 4, 2022 14:04
Show Gist options
  • Save mikekeith52/c2b7b1b1c7103ab934995ceebc2535ae to your computer and use it in GitHub Desktop.
Save mikekeith52/c2b7b1b1c7103ab934995ceebc2535ae to your computer and use it in GitHub Desktop.
f.add_sklearn_estimator(StackingRegressor,'stacking')
f.set_estimator('stacking')
results = f.export('model_summaries')
estimators = [
('knn',
KNeighborsRegressor(**results.loc[results['ModelNickname'] == 'knn','HyperParams'].values[0])),
('xgboost',
XGBRegressor(**results.loc[results['ModelNickname'] == 'xgboost','HyperParams'].values[0])),
('lightgbm',
LGBMRegressor(**results.loc[results['ModelNickname'] == 'lightgbm','HyperParams'].values[0])),
('sgd',
SGDRegressor(**results.loc[results['ModelNickname'] == 'sgd','HyperParams'].values[0])),
]
final_estimator = BaggingRegressor(
base_estimator = MLPRegressor(
hidden_layer_sizes=(100,100,100),
solver='lbfgs',
),
max_samples = 0.9,
max_features = 0.5,
)
f.manual_forecast(estimators=estimators,final_estimator=final_estimator)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment