Skip to content

Instantly share code, notes, and snippets.

@joshreini1
Created August 30, 2022 19:51
Show Gist options
  • Save joshreini1/96eed04eb76ba6edc4743d7fa8001f2e to your computer and use it in GitHub Desktop.
Save joshreini1/96eed04eb76ba6edc4743d7fa8001f2e to your computer and use it in GitHub Desktop.
Add tuned airbnb xgb to TruEra
#instantiate model
xgb_reg = xgb.XGBRegressor(
gamma = 9.525156702124235,
max_depth = 3,
min_child_weight = 9.517754381682627,
reg_alpha = 0.07435977523021892,
reg_lambda = 1.4770738953975366)
# combine both preprocessing and modeling
xgb_pipe = Pipeline([
('preprocess', comprehensive_preprocessing),
('xgboost', xgb_reg)
])
xgb_pipe.fit(X_train, y_train)
#add model to truera
tru.add_python_model("xgb_pipe_tuned_v3", xgb_pipe, pipeline_feature_map = feature_map_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment