# 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)