the following snippet loops through the list of categorical variables to transform and prepare list of encoded attributes in [ ]cat_attr_list ['season','is_holiday''weather_condition','is_workingday''hour','weekday','month','year'encoded_attr_list [for col in cat_attr_listreturn_obj fit_transform_ohe( ,colencoded_attr_list append({'label_enc':return_obj[ ]'ohe_enc':return_obj[ ]'feature_df':return_obj[ ]'col_name':col}##note though we have transformed all categoricals into their one-hot encodingsnote that ordinal attributes such as hourweekdayand so on do not require such encoding nextwe merge the numeric and one hot encoded categoricals into dataframe that we will use for our modeling purposes the following snippet helps us prepare the required dataset in [ ]feature_df_list [ [numeric_feature_cols]feature_df_list extend([enc['feature_df'for enc in encoded_attr_list if enc['col_name'in subset_cat_features]train_df_new pd concat(feature_df_listaxis= print("shape::{}format(train_df_new shape)we prepared new dataframe using numeric and one hot encoded categorical attributes from the original training dataframe the original dataframe had such attributes (including both numeric and categoricalspost this transformationthe new dataframe has attributes due to one hot encoding of the categoricals linear regression one of the simplest regression analysis techniques is linear regression as discussed earlier in the linear regression is the analysis of relationship between the dependent and independent variables linear regression assumes linear relationship between the two variables extending on the general regression analysis notationlinear regression takes the following formy bx in this equationy is the dependent variablex is the independent variable the symbol denotes the intercept of the regression line and is the slope of it numerous lines can be fitted to given dataset based on different combinations of the intercept ( aand slope ( bthe aim is to find the best fitting line to model our data