{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":130062,"databundleVersionId":15606741,"sourceType":"competition"}],"dockerImageVersionId":31259,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# **1️⃣ Data Preprocessing**","metadata":{}},{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.compose import ColumnTransformer\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.metrics import mean_squared_log_error","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:27:22.918775Z","iopub.execute_input":"2026-02-17T16:27:22.919037Z","iopub.status.idle":"2026-02-17T16:27:27.513179Z","shell.execute_reply.started":"2026-02-17T16:27:22.919009Z","shell.execute_reply":"2026-02-17T16:27:27.512187Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Load data\n\nraw_train = pd.read_csv('/kaggle/input/bidding-predictions-for-construction/raw_train.csv')\ntrain_summary = pd.read_csv('/kaggle/input/bidding-predictions-for-construction/train_summary.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:27:50.458886Z","iopub.execute_input":"2026-02-17T16:27:50.459588Z","iopub.status.idle":"2026-02-17T16:27:54.560904Z","shell.execute_reply.started":"2026-02-17T16:27:50.459552Z","shell.execute_reply":"2026-02-17T16:27:54.560041Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"print(\"Raw Train Shape:\", raw_train.shape)\nprint(\"Train Summary Shape:\", train_summary.shape)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:27:58.165802Z","iopub.execute_input":"2026-02-17T16:27:58.166303Z","iopub.status.idle":"2026-02-17T16:27:58.172391Z","shell.execute_reply.started":"2026-02-17T16:27:58.166269Z","shell.execute_reply":"2026-02-17T16:27:58.171389Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"raw_train","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:01.006241Z","iopub.execute_input":"2026-02-17T16:28:01.006547Z","iopub.status.idle":"2026-02-17T16:28:01.047625Z","shell.execute_reply.started":"2026-02-17T16:28:01.006519Z","shell.execute_reply":"2026-02-17T16:28:01.046865Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_summary","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:03.632766Z","iopub.execute_input":"2026-02-17T16:28:03.633638Z","iopub.status.idle":"2026-02-17T16:28:03.645398Z","shell.execute_reply.started":"2026-02-17T16:28:03.633588Z","shell.execute_reply":"2026-02-17T16:28:03.644565Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_summary.info()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:08.707541Z","iopub.execute_input":"2026-02-17T16:28:08.707870Z","iopub.status.idle":"2026-02-17T16:28:08.729749Z","shell.execute_reply.started":"2026-02-17T16:28:08.707842Z","shell.execute_reply":"2026-02-17T16:28:08.728684Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_summary.describe()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:10.889077Z","iopub.execute_input":"2026-02-17T16:28:10.889810Z","iopub.status.idle":"2026-02-17T16:28:10.906125Z","shell.execute_reply.started":"2026-02-17T16:28:10.889777Z","shell.execute_reply":"2026-02-17T16:28:10.905020Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"raw_train['bid_date'] = pd.to_datetime(raw_train['bid_date'])\ntrain_summary['bid_date'] = pd.to_datetime(train_summary['bid_date'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:31.756855Z","iopub.execute_input":"2026-02-17T16:28:31.757718Z","iopub.status.idle":"2026-02-17T16:28:31.864673Z","shell.execute_reply.started":"2026-02-17T16:28:31.757684Z","shell.execute_reply":"2026-02-17T16:28:31.863678Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"raw_train.isnull().sum().sort_values(ascending=False).head(20)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:45.122500Z","iopub.execute_input":"2026-02-17T16:28:45.123593Z","iopub.status.idle":"2026-02-17T16:28:45.519453Z","shell.execute_reply.started":"2026-02-17T16:28:45.123533Z","shell.execute_reply":"2026-02-17T16:28:45.518558Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"raw_train['unit_english_id'] = raw_train['unit_english_id'].fillna('Unknown')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:48.283344Z","iopub.execute_input":"2026-02-17T16:28:48.283698Z","iopub.status.idle":"2026-02-17T16:28:48.351671Z","shell.execute_reply.started":"2026-02-17T16:28:48.283670Z","shell.execute_reply":"2026-02-17T16:28:48.350778Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_summary.isnull().sum().sort_values(ascending=False).head(20)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:51.062823Z","iopub.execute_input":"2026-02-17T16:28:51.063186Z","iopub.status.idle":"2026-02-17T16:28:51.074180Z","shell.execute_reply.started":"2026-02-17T16:28:51.063158Z","shell.execute_reply":"2026-02-17T16:28:51.072910Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.figure(figsize=(8,5))\nsns.histplot(train_summary['total_bid'], bins=50)\nplt.title(\"Distribution of Total Bid\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:56.068524Z","iopub.execute_input":"2026-02-17T16:28:56.069721Z","iopub.status.idle":"2026-02-17T16:28:56.376500Z","shell.execute_reply.started":"2026-02-17T16:28:56.069671Z","shell.execute_reply":"2026-02-17T16:28:56.375422Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"plt.figure(figsize=(8,5))\nsns.histplot(np.log1p(train_summary['total_bid']), bins=50)\nplt.title(\"Log Distribution of Total Bid\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:28:59.923383Z","iopub.execute_input":"2026-02-17T16:28:59.923816Z","iopub.status.idle":"2026-02-17T16:29:00.137514Z","shell.execute_reply.started":"2026-02-17T16:28:59.923773Z","shell.execute_reply":"2026-02-17T16:29:00.136784Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"**The original total_bid distribution was highly right-skewed,due to the presence of both very small and very large projects.**\n\n**This skewness can cause**:\n - Large projects dominating the training process\n - Poor learning for smaller projects\n - Unstable model behavior\n\n **To address this, we apply a log1p transformation:**\n log1p(x) = log(1 + x)\n\n**Benefits**:\n - Reduces the impact of extreme values (outliers)\n - Makes the distribution closer to normal\n - Improves training stability\n - Aligns with the competition metric (RMSLE)\n  \n**Important:**\n After prediction, we apply expm1 to convert values\n back to the original scale.","metadata":{}},{"cell_type":"code","source":"print(\"Unique Contractors:\", train_summary['contractor_id'].nunique())","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:03.438510Z","iopub.execute_input":"2026-02-17T16:29:03.439484Z","iopub.status.idle":"2026-02-17T16:29:03.445921Z","shell.execute_reply.started":"2026-02-17T16:29:03.439448Z","shell.execute_reply":"2026-02-17T16:29:03.444885Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_summary['contractor_id'].value_counts().head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:05.747949Z","iopub.execute_input":"2026-02-17T16:29:05.748272Z","iopub.status.idle":"2026-02-17T16:29:05.756877Z","shell.execute_reply.started":"2026-02-17T16:29:05.748246Z","shell.execute_reply":"2026-02-17T16:29:05.756047Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_summary['year'] = train_summary['bid_date'].dt.year\n\nyearly = train_summary.groupby('year')['total_bid'].mean()\n\nplt.figure(figsize=(8,5))\nyearly.plot()\nplt.title(\"Average Bid Per Year\")\nplt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:08.494518Z","iopub.execute_input":"2026-02-17T16:29:08.494961Z","iopub.status.idle":"2026-02-17T16:29:08.718326Z","shell.execute_reply.started":"2026-02-17T16:29:08.494920Z","shell.execute_reply":"2026-02-17T16:29:08.717397Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"agg_features = raw_train.groupby(['job_id', 'contractor_id']).agg(total_quantity=('quantity', 'sum'),mean_quantity=('quantity', 'mean'),\n    num_items=('pay_item_id', 'count'),\n    unique_items=('pay_item_id', 'nunique')).reset_index()\n\nagg_features","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:25.921857Z","iopub.execute_input":"2026-02-17T16:29:25.922668Z","iopub.status.idle":"2026-02-17T16:29:26.234222Z","shell.execute_reply.started":"2026-02-17T16:29:25.922630Z","shell.execute_reply":"2026-02-17T16:29:26.233342Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"**We aggregate raw_train at the (job_id + contractor_id) level.**\n\nraw_train is stored at the pay-item level (each row = one item),while the model is trained and evaluated at the contractor–job level.\n \nTherefore, we transform the dataset from item-level to project-level features for each contractor.\n\n**Extracted features:**\n - total_quantity: total project size (overall volume of work)\n - mean_quantity: average quantity per item (distribution of work)\n - num_items: number of pay items (project complexity)\n - unique_items: number of distinct items (work diversity)\n\n**These features help the model understand:**\n  project size, complexity, and diversity instead of treating each item independently.","metadata":{}},{"cell_type":"code","source":"train_merged = train_summary.merge( agg_features,on=['job_id', 'contractor_id'], how='left')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:37.848713Z","iopub.execute_input":"2026-02-17T16:29:37.849629Z","iopub.status.idle":"2026-02-17T16:29:37.869247Z","shell.execute_reply.started":"2026-02-17T16:29:37.849575Z","shell.execute_reply":"2026-02-17T16:29:37.867988Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_merged","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:40.926285Z","iopub.execute_input":"2026-02-17T16:29:40.927018Z","iopub.status.idle":"2026-02-17T16:29:40.943681Z","shell.execute_reply.started":"2026-02-17T16:29:40.926987Z","shell.execute_reply":"2026-02-17T16:29:40.942805Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_merged['bid_date'] = pd.to_datetime(train_merged['bid_date'])\n\ntrain_merged['year'] = train_merged['bid_date'].dt.year\ntrain_merged['month'] = train_merged['bid_date'].dt.month\ntrain_merged['quarter'] = train_merged['bid_date'].dt.quarter\n\ntrain_merged = train_merged.drop(columns=['bid_date'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:46.243661Z","iopub.execute_input":"2026-02-17T16:29:46.243962Z","iopub.status.idle":"2026-02-17T16:29:46.267976Z","shell.execute_reply.started":"2026-02-17T16:29:46.243937Z","shell.execute_reply":"2026-02-17T16:29:46.266978Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"**Convert bid_date to datetime format to extract meaningful time-based features**\n\n**Extract time-related features:**\n - year: captures long-term trend (e.g., inflation / market growth)\n - month: captures possible seasonality effects\n - quarter: provides broader temporal grouping\n   \n**This allows the model to learn how bidding behavior and construction costs change over time,instead of treating the date as a raw string**\n\n**Then Drop original datetime column.Tree-based models cannot directly use datetime objects,and keeping it may cause training errors**\n\n**Time features are critical in cost prediction problems due to inflation, material price fluctuations, and contractor behavior drift over time.**","metadata":{}},{"cell_type":"code","source":"train_merged","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:29:55.853082Z","iopub.execute_input":"2026-02-17T16:29:55.853443Z","iopub.status.idle":"2026-02-17T16:29:55.871176Z","shell.execute_reply.started":"2026-02-17T16:29:55.853404Z","shell.execute_reply":"2026-02-17T16:29:55.870288Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# **2️⃣Model**","metadata":{}},{"cell_type":"code","source":"y = np.log1p(train_merged['total_bid'])\nX = train_merged.drop(columns=['total_bid'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:30:04.372501Z","iopub.execute_input":"2026-02-17T16:30:04.373448Z","iopub.status.idle":"2026-02-17T16:30:04.380526Z","shell.execute_reply.started":"2026-02-17T16:30:04.373408Z","shell.execute_reply":"2026-02-17T16:30:04.379738Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"y[:5]","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:30:06.874836Z","iopub.execute_input":"2026-02-17T16:30:06.875903Z","iopub.status.idle":"2026-02-17T16:30:06.882998Z","shell.execute_reply.started":"2026-02-17T16:30:06.875865Z","shell.execute_reply":"2026-02-17T16:30:06.882029Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:30:32.850170Z","iopub.execute_input":"2026-02-17T16:30:32.850476Z","iopub.status.idle":"2026-02-17T16:30:32.860941Z","shell.execute_reply.started":"2026-02-17T16:30:32.850451Z","shell.execute_reply":"2026-02-17T16:30:32.859923Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"categorical_cols = X.select_dtypes(include=['object']).columns\nnumeric_cols = X.select_dtypes(include=['int64','float64']).columns\n\npreprocessor = ColumnTransformer(\n    transformers=[\n        ('num', 'passthrough', numeric_cols),\n        ('cat', OneHotEncoder(handle_unknown='ignore'), categorical_cols)])\n\nmodel = RandomForestRegressor(\n    n_estimators=200,\n    random_state=42,\n    n_jobs=-1)\n\npipeline = Pipeline(steps=[\n    ('preprocessor', preprocessor),\n    ('model', model)])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:33:28.830007Z","iopub.execute_input":"2026-02-17T16:33:28.830873Z","iopub.status.idle":"2026-02-17T16:33:28.838391Z","shell.execute_reply.started":"2026-02-17T16:33:28.830838Z","shell.execute_reply":"2026-02-17T16:33:28.837364Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pipeline.fit(X_train, y_train)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:34:35.065863Z","iopub.execute_input":"2026-02-17T16:34:35.066170Z","iopub.status.idle":"2026-02-17T16:35:27.011170Z","shell.execute_reply.started":"2026-02-17T16:34:35.066144Z","shell.execute_reply":"2026-02-17T16:35:27.010380Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"preds = pipeline.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:36:21.023743Z","iopub.execute_input":"2026-02-17T16:36:21.024495Z","iopub.status.idle":"2026-02-17T16:36:21.147836Z","shell.execute_reply.started":"2026-02-17T16:36:21.024464Z","shell.execute_reply":"2026-02-17T16:36:21.146802Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"rmsle = np.sqrt(mean_squared_log_error(np.expm1(y_test),np.expm1(preds)))\n\nprint(\"Validation RMSLE:\", rmsle)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:36:25.222886Z","iopub.execute_input":"2026-02-17T16:36:25.223580Z","iopub.status.idle":"2026-02-17T16:36:25.231423Z","shell.execute_reply.started":"2026-02-17T16:36:25.223545Z","shell.execute_reply":"2026-02-17T16:36:25.230357Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"importances = pipeline.named_steps['model'].feature_importances_\n\nfeature_names = pipeline.named_steps['preprocessor'].get_feature_names_out()\n\nfeat_imp = pd.Series(importances, index=feature_names)\nfeat_imp.sort_values(ascending=False).head(20)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:36:29.063900Z","iopub.execute_input":"2026-02-17T16:36:29.064296Z","iopub.status.idle":"2026-02-17T16:36:29.173024Z","shell.execute_reply.started":"2026-02-17T16:36:29.064255Z","shell.execute_reply":"2026-02-17T16:36:29.172261Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"**Feature Importance Analysis:**\ntotal_quantity dominates the model (~73% importance),indicating that overall project size is the strongest predictor of total bid value.\n\n**Secondary features:**\n - num_items (~9.5%): reflects project complexity.\n - unique_items and mean_quantity (~2% each):\n   capture diversity and distribution of work.\n\n**Categorical features (job category, location, contractor)have relatively low importance, suggesting that the model primarily relies on projectvolume rather than contractor behavior or project type.**\n\n**Insight:**\n The current model roughly learns:\n total_bid ≈ total_quantity × scaling factor\n\nThis indicates that the model is still relatively shallow and does not yet capture deeper pricing behavior patterns.","metadata":{}},{"cell_type":"markdown","source":"# **3️⃣Predict Test**","metadata":{}},{"cell_type":"code","source":"raw_test = pd.read_csv('/kaggle/input/bidding-predictions-for-construction/raw_test.csv')\ntest = pd.read_csv('/kaggle/input/bidding-predictions-for-construction/test.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:56:51.107666Z","iopub.execute_input":"2026-02-17T16:56:51.108093Z","iopub.status.idle":"2026-02-17T16:56:51.386244Z","shell.execute_reply.started":"2026-02-17T16:56:51.108064Z","shell.execute_reply":"2026-02-17T16:56:51.385447Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"raw_test","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:56:53.069936Z","iopub.execute_input":"2026-02-17T16:56:53.070803Z","iopub.status.idle":"2026-02-17T16:56:53.086946Z","shell.execute_reply.started":"2026-02-17T16:56:53.070766Z","shell.execute_reply":"2026-02-17T16:56:53.085537Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:56:55.109518Z","iopub.execute_input":"2026-02-17T16:56:55.110099Z","iopub.status.idle":"2026-02-17T16:56:55.122587Z","shell.execute_reply.started":"2026-02-17T16:56:55.110061Z","shell.execute_reply":"2026-02-17T16:56:55.121801Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"agg_test = raw_test.groupby(\n    ['job_id','contractor_id']).agg(\n    total_quantity=('quantity','sum'),\n    mean_quantity=('quantity','mean'),\n    num_items=('pay_item_id','count'),\n    unique_items=('pay_item_id','nunique')).reset_index()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:57:01.626545Z","iopub.execute_input":"2026-02-17T16:57:01.627037Z","iopub.status.idle":"2026-02-17T16:57:01.679471Z","shell.execute_reply.started":"2026-02-17T16:57:01.627005Z","shell.execute_reply":"2026-02-17T16:57:01.678674Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test = test.merge(agg_test,on=['job_id','contractor_id'],how='left')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:57:04.680346Z","iopub.execute_input":"2026-02-17T16:57:04.681525Z","iopub.status.idle":"2026-02-17T16:57:04.690420Z","shell.execute_reply.started":"2026-02-17T16:57:04.681490Z","shell.execute_reply":"2026-02-17T16:57:04.689563Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test['bid_date'] = pd.to_datetime(test['bid_date'])\n\ntest['year'] = test['bid_date'].dt.year\ntest['month'] = test['bid_date'].dt.month\ntest['quarter'] = test['bid_date'].dt.quarter\n\ntest = test.drop(columns=['bid_date'])","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:57:09.888497Z","iopub.execute_input":"2026-02-17T16:57:09.889278Z","iopub.status.idle":"2026-02-17T16:57:09.903135Z","shell.execute_reply.started":"2026-02-17T16:57:09.889245Z","shell.execute_reply":"2026-02-17T16:57:09.902003Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:57:12.679415Z","iopub.execute_input":"2026-02-17T16:57:12.680129Z","iopub.status.idle":"2026-02-17T16:57:12.694972Z","shell.execute_reply.started":"2026-02-17T16:57:12.680097Z","shell.execute_reply":"2026-02-17T16:57:12.694075Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X_test = test.drop(columns=['row_id'])\n\ntest_preds = pipeline.predict(X_test)\ntest_preds = np.expm1(test_preds)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:57:23.329312Z","iopub.execute_input":"2026-02-17T16:57:23.330002Z","iopub.status.idle":"2026-02-17T16:57:23.453052Z","shell.execute_reply.started":"2026-02-17T16:57:23.329969Z","shell.execute_reply":"2026-02-17T16:57:23.452185Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# **4️⃣Submission**","metadata":{}},{"cell_type":"code","source":"submission = pd.DataFrame({'row_id': test['row_id'],'total_bid': test_preds})","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:58:04.506360Z","iopub.execute_input":"2026-02-17T16:58:04.506678Z","iopub.status.idle":"2026-02-17T16:58:04.512122Z","shell.execute_reply.started":"2026-02-17T16:58:04.506652Z","shell.execute_reply":"2026-02-17T16:58:04.511148Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission.to_csv('submission.csv', index=False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:58:10.288630Z","iopub.execute_input":"2026-02-17T16:58:10.288953Z","iopub.status.idle":"2026-02-17T16:58:10.299761Z","shell.execute_reply.started":"2026-02-17T16:58:10.288926Z","shell.execute_reply":"2026-02-17T16:58:10.298809Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-17T16:58:20.618791Z","iopub.execute_input":"2026-02-17T16:58:20.619197Z","iopub.status.idle":"2026-02-17T16:58:20.632335Z","shell.execute_reply.started":"2026-02-17T16:58:20.619153Z","shell.execute_reply":"2026-02-17T16:58:20.631089Z"}},"outputs":[],"execution_count":null}]}