Skip to content

Instantly share code, notes, and snippets.

@lakshay-arora
Last active January 28, 2020 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lakshay-arora/66a9ab5fa630716c39be6126a3f330c9 to your computer and use it in GitHub Desktop.
Save lakshay-arora/66a9ab5fa630716c39be6126a3f330c9 to your computer and use it in GitHub Desktop.
# Define the Pipeline
"""
Step1: get the oultet binary columns
Step2: pre processing
Step3: Train a Random Forest Model
"""
model_pipeline = Pipeline(steps=[('get_outlet_binary_columns', OutletTypeEncoder()),
('pre_processing',pre_process),
('random_forest', RandomForestRegressor(max_depth=10,random_state=2))
])
# fit the pipeline with the training data
model_pipeline.fit(train_x,train_y)
# predict target values on the training data
model_pipeline.predict(train_x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment