text_plain_output_1.png
from sklearn.compose import ColumnTransformer

from sklearn.ensemble import RandomForestRegressor

from sklearn.pipeline import Pipeline

from sklearn.preprocessing import MinMaxScaler, StandardScaler, OneHotEncoder, LabelEncoder

numerical_pipeline = Pipeline([('scaling', MinMaxScaler())])
categoric_second_pipeline = Pipeline([('label', OneHotEncoder(sparse=False))])

preprocessing = ColumnTransformer([('numeric', numerical_pipeline, ['kms_driven', 'age', 'power']), ('cat_second', categoric_second_pipeline, ['owner', 'bike_name', 'city', 'brand'])])

pipeline = Pipeline([('algo', preprocessing), ('model', RandomForestRegressor(random_state=42))])

pipeline.fit(X_train, y_train)

pipeline.get_params()