Skip to content

Instantly share code, notes, and snippets.

@joshreini1
Created August 30, 2022 19:47
Show Gist options
  • Save joshreini1/e876655e217856a55077542b430c99f9 to your computer and use it in GitHub Desktop.
Save joshreini1/e876655e217856a55077542b430c99f9 to your computer and use it in GitHub Desktop.
instantiate xgboost regression for airbnb
#instantiate model
xgb_reg = xgb.XGBRegressor()
# combine both preprocessing and modeling
xgb_pipe = Pipeline([
('preprocess', comprehensive_preprocessing),
('xgboost', xgb_reg)
])
#fit pipe
xgb_pipe.fit(X_train,y_train)
#add model to truera
tru.add_python_model("xgb_pipe", 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