{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.14","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"gpu","dataSources":[{"sourceId":84253,"databundleVersionId":9421888,"sourceType":"competition"}],"dockerImageVersionId":30761,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-08-25T17:45:08.193755Z","iopub.execute_input":"2024-08-25T17:45:08.19447Z","iopub.status.idle":"2024-08-25T17:45:08.610714Z","shell.execute_reply.started":"2024-08-25T17:45:08.194401Z","shell.execute_reply":"2024-08-25T17:45:08.609765Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"BY mistake i edited this notebook to try some other model.... my bad....\ni used feature selection to select top 150 features and then used a linear regression model","metadata":{}},{"cell_type":"code","source":"raw_data = pd.read_csv(\"/kaggle/input/first-steps-in-data-science-new/train (7).csv\")\nraw_data = raw_data.drop(\"Unnamed: 0\", axis = 1)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:09.366217Z","iopub.execute_input":"2024-08-25T17:45:09.366784Z","iopub.status.idle":"2024-08-25T17:45:10.109443Z","shell.execute_reply.started":"2024-08-25T17:45:09.366741Z","shell.execute_reply":"2024-08-25T17:45:10.108513Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = pd.read_csv(\"/kaggle/input/first-steps-in-data-science-new/test (4).csv\")\ntest= test.drop(test.columns[0], axis=1)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:10.110987Z","iopub.execute_input":"2024-08-25T17:45:10.111366Z","iopub.status.idle":"2024-08-25T17:45:12.366434Z","shell.execute_reply.started":"2024-08-25T17:45:10.111329Z","shell.execute_reply":"2024-08-25T17:45:12.365534Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv(\"/kaggle/input/first-steps-in-data-science-new/train (7).csv\") \ntrain= train.drop(train.columns[0], axis=1)\nz_scores = np.abs((train - train.mean()) / train.std())\n\n# Set a threshold\nthreshold = 3.5\n\n# Filter out rows with Z-score greater than the threshold\ntrain_no_outliers = train[(z_scores < threshold).all(axis=1)]\ntrain_no_outliers.shape\n","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:12.784492Z","iopub.execute_input":"2024-08-25T17:45:12.784868Z","iopub.status.idle":"2024-08-25T17:45:13.311575Z","shell.execute_reply.started":"2024-08-25T17:45:12.78483Z","shell.execute_reply":"2024-08-25T17:45:13.310609Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.shape","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:16.153958Z","iopub.execute_input":"2024-08-25T17:45:16.154707Z","iopub.status.idle":"2024-08-25T17:45:16.160537Z","shell.execute_reply.started":"2024-08-25T17:45:16.154667Z","shell.execute_reply":"2024-08-25T17:45:16.159635Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"train_no_outlier is the dataset that we have that doesnt have any outliers","metadata":{}},{"cell_type":"code","source":"train_no_outliers","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:18.909455Z","iopub.execute_input":"2024-08-25T17:45:18.909804Z","iopub.status.idle":"2024-08-25T17:45:18.942654Z","shell.execute_reply.started":"2024-08-25T17:45:18.909771Z","shell.execute_reply":"2024-08-25T17:45:18.941791Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = train_no_outliers.drop(columns=['target'])\ny = train_no_outliers['target']","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:24.370658Z","iopub.execute_input":"2024-08-25T17:45:24.371044Z","iopub.status.idle":"2024-08-25T17:45:24.380723Z","shell.execute_reply.started":"2024-08-25T17:45:24.371006Z","shell.execute_reply":"2024-08-25T17:45:24.379676Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:37:42.854485Z","iopub.execute_input":"2024-08-25T16:37:42.855148Z","iopub.status.idle":"2024-08-25T16:37:42.861747Z","shell.execute_reply.started":"2024-08-25T16:37:42.855107Z","shell.execute_reply":"2024-08-25T16:37:42.860762Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.preprocessing import MinMaxScaler\nfrom sklearn.feature_selection import RFE\nfrom sklearn.model_selection import KFold\nfrom sklearn.metrics import mean_squared_error\nfrom sklearn.linear_model import LinearRegression","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:40.288772Z","iopub.execute_input":"2024-08-25T17:45:40.289728Z","iopub.status.idle":"2024-08-25T17:45:41.016982Z","shell.execute_reply.started":"2024-08-25T17:45:40.289687Z","shell.execute_reply":"2024-08-25T17:45:41.015992Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"scaler = MinMaxScaler(feature_range=(-1, 1))\n\n# Fit and transform the data\nX_final = pd.DataFrame(scaler.fit_transform(X), columns=X.columns)\ntest_final = pd.DataFrame(scaler.transform(test), columns = test.columns)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:48.768036Z","iopub.execute_input":"2024-08-25T17:45:48.769198Z","iopub.status.idle":"2024-08-25T17:45:48.827433Z","shell.execute_reply.started":"2024-08-25T17:45:48.769143Z","shell.execute_reply":"2024-08-25T17:45:48.826421Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"X_final","metadata":{"execution":{"iopub.status.busy":"2024-08-25T17:45:52.603439Z","iopub.execute_input":"2024-08-25T17:45:52.604187Z","iopub.status.idle":"2024-08-25T17:45:52.636578Z","shell.execute_reply.started":"2024-08-25T17:45:52.604144Z","shell.execute_reply":"2024-08-25T17:45:52.635633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# X_final is the scaled dataset , Y is the unscaled target sataset","metadata":{}},{"cell_type":"markdown","source":"# FEATURE SELECTION","metadata":{}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.feature_selection import RFE\nfrom sklearn.ensemble import RandomForestRegressor","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:04:31.36087Z","iopub.execute_input":"2024-08-25T16:04:31.361631Z","iopub.status.idle":"2024-08-25T16:04:31.365784Z","shell.execute_reply.started":"2024-08-25T16:04:31.361588Z","shell.execute_reply":"2024-08-25T16:04:31.364857Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rfe = RFE(estimator = LinearRegression(), n_features_to_select = 150)\nrfe.fit(X, y)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:05:01.8629Z","iopub.execute_input":"2024-08-25T16:05:01.863299Z","iopub.status.idle":"2024-08-25T16:05:07.303895Z","shell.execute_reply.started":"2024-08-25T16:05:01.863262Z","shell.execute_reply":"2024-08-25T16:05:07.303003Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for i,col in zip(range(X_final.shape[1]), X_final.columns):\n    print(\"{} selected = {} rank = {}\" %(col, rfe.support_[i], rfe.ranking_[i]))","metadata":{"execution":{"iopub.status.busy":"2024-08-25T15:39:37.958858Z","iopub.execute_input":"2024-08-25T15:39:37.959259Z","iopub.status.idle":"2024-08-25T15:39:38.371297Z","shell.execute_reply.started":"2024-08-25T15:39:37.95922Z","shell.execute_reply":"2024-08-25T15:39:38.370105Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for i,col in zip(range(X_final.shape[1]), X_final.columns):\n    print((col, rfe.support_[i], rfe.ranking_[i]))","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:05:07.790504Z","iopub.execute_input":"2024-08-25T16:05:07.791164Z","iopub.status.idle":"2024-08-25T16:05:07.799445Z","shell.execute_reply.started":"2024-08-25T16:05:07.791126Z","shell.execute_reply":"2024-08-25T16:05:07.798405Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"selected_features = []\nfor i,col in zip(range(X_final.shape[1]), X_final.columns):\n    if rfe.support_[i] == True:\n        selected_features.append(col)\n","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:05:18.942236Z","iopub.execute_input":"2024-08-25T16:05:18.942625Z","iopub.status.idle":"2024-08-25T16:05:18.948439Z","shell.execute_reply.started":"2024-08-25T16:05:18.942586Z","shell.execute_reply":"2024-08-25T16:05:18.947466Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Unused = []\nfor i,col in zip(range(X_final.shape[1]), X_final.columns):\n    if rfe.support_[i] == False:\n        Unused.append(col)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:05:20.017007Z","iopub.execute_input":"2024-08-25T16:05:20.01811Z","iopub.status.idle":"2024-08-25T16:05:20.024195Z","shell.execute_reply.started":"2024-08-25T16:05:20.018055Z","shell.execute_reply":"2024-08-25T16:05:20.023205Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"len(selected_features)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T15:48:32.532177Z","iopub.execute_input":"2024-08-25T15:48:32.532665Z","iopub.status.idle":"2024-08-25T15:48:32.540332Z","shell.execute_reply.started":"2024-08-25T15:48:32.532608Z","shell.execute_reply":"2024-08-25T15:48:32.539252Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = X_final.drop(columns = Unused)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:05:37.003667Z","iopub.execute_input":"2024-08-25T16:05:37.004069Z","iopub.status.idle":"2024-08-25T16:05:37.010388Z","shell.execute_reply.started":"2024-08-25T16:05:37.004031Z","shell.execute_reply":"2024-08-25T16:05:37.009423Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lr = LinearRegression()\nlr.fit(X, y)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T15:48:38.887068Z","iopub.execute_input":"2024-08-25T15:48:38.887461Z","iopub.status.idle":"2024-08-25T15:48:38.959535Z","shell.execute_reply.started":"2024-08-25T15:48:38.887423Z","shell.execute_reply":"2024-08-25T15:48:38.958473Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_final","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:06:05.987123Z","iopub.execute_input":"2024-08-25T16:06:05.987563Z","iopub.status.idle":"2024-08-25T16:06:06.019267Z","shell.execute_reply.started":"2024-08-25T16:06:05.987524Z","shell.execute_reply":"2024-08-25T16:06:06.018194Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = test_final.drop(columns = Unused)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:06:08.439978Z","iopub.execute_input":"2024-08-25T16:06:08.440622Z","iopub.status.idle":"2024-08-25T16:06:08.455219Z","shell.execute_reply.started":"2024-08-25T16:06:08.440583Z","shell.execute_reply":"2024-08-25T16:06:08.454019Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds = lr.predict(test)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T15:49:06.960904Z","iopub.execute_input":"2024-08-25T15:49:06.961298Z","iopub.status.idle":"2024-08-25T15:49:06.975022Z","shell.execute_reply.started":"2024-08-25T15:49:06.961261Z","shell.execute_reply":"2024-08-25T15:49:06.973787Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# FALTU\n","metadata":{}},{"cell_type":"code","source":"x = X.sample(150)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.316611Z","iopub.status.idle":"2024-08-25T11:49:13.316974Z","shell.execute_reply.started":"2024-08-25T11:49:13.316772Z","shell.execute_reply":"2024-08-25T11:49:13.316788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"target = y.iloc[x.index]","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.319182Z","iopub.status.idle":"2024-08-25T11:49:13.319661Z","shell.execute_reply.started":"2024-08-25T11:49:13.319408Z","shell.execute_reply":"2024-08-25T11:49:13.319432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"target.isnull().sum()","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.321529Z","iopub.status.idle":"2024-08-25T11:49:13.321917Z","shell.execute_reply.started":"2024-08-25T11:49:13.321709Z","shell.execute_reply":"2024-08-25T11:49:13.321727Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lr1 = LinearRegression()\nlr2 = LinearRegression()\nlr3 = LinearRegression()\nlr4 = LinearRegression()\nlr5 = LinearRegression()\nlr6 = LinearRegression()\nlr7 = LinearRegression()\nlr8 = LinearRegression()\nlr9 = LinearRegression()\nlr10 = LinearRegression()\nlr11 = LinearRegression()","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.323255Z","iopub.status.idle":"2024-08-25T11:49:13.323711Z","shell.execute_reply.started":"2024-08-25T11:49:13.323473Z","shell.execute_reply":"2024-08-25T11:49:13.323497Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"x = X.sample(4000)\ntarget = y.iloc[x.index]\nlr1.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr2.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr3.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr4.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr5.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr6.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr7.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr8.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr9.fit(x, target)\n\nx = X.sample(4000)\ntarget = y.iloc[x.index]\nlr10.fit(x, target)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.324944Z","iopub.status.idle":"2024-08-25T11:49:13.3254Z","shell.execute_reply.started":"2024-08-25T11:49:13.325156Z","shell.execute_reply":"2024-08-25T11:49:13.325179Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"prediction1 = lr1.predict(test)\nprediction2 = lr2.predict(test)\nprediction3 = lr3.predict(test)\nprediction4 = lr4.predict(test)\nprediction5 = lr5.predict(test)\nprediction6 = lr6.predict(test)\nprediction7 = lr7.predict(test)\nprediction8 = lr8.predict(test)\nprediction9 = lr9.predict(test)\nprediction10 = lr10.predict(test)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.326982Z","iopub.status.idle":"2024-08-25T11:49:13.32745Z","shell.execute_reply.started":"2024-08-25T11:49:13.327195Z","shell.execute_reply":"2024-08-25T11:49:13.327226Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pred = (prediction1+prediction2+prediction3+prediction4+prediction5+prediction6+prediction7+prediction8+prediction9+prediction10)/10","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.32857Z","iopub.status.idle":"2024-08-25T11:49:13.329047Z","shell.execute_reply.started":"2024-08-25T11:49:13.328786Z","shell.execute_reply":"2024-08-25T11:49:13.328825Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"pred","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:13.330447Z","iopub.status.idle":"2024-08-25T11:49:13.330796Z","shell.execute_reply.started":"2024-08-25T11:49:13.330622Z","shell.execute_reply":"2024-08-25T11:49:13.33064Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.ensemble import RandomForestRegressor","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:49:39.281309Z","iopub.execute_input":"2024-08-25T11:49:39.281668Z","iopub.status.idle":"2024-08-25T11:49:39.285981Z","shell.execute_reply.started":"2024-08-25T11:49:39.281635Z","shell.execute_reply":"2024-08-25T11:49:39.285015Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rf = RandomForestRegressor()\nrf.fit(X, y)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:50:21.775167Z","iopub.execute_input":"2024-08-25T11:50:21.775567Z","iopub.status.idle":"2024-08-25T11:51:53.837071Z","shell.execute_reply.started":"2024-08-25T11:50:21.775529Z","shell.execute_reply":"2024-08-25T11:51:53.836164Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds = rf.predict(test)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:52:09.439224Z","iopub.execute_input":"2024-08-25T11:52:09.439896Z","iopub.status.idle":"2024-08-25T11:52:09.931108Z","shell.execute_reply.started":"2024-08-25T11:52:09.439853Z","shell.execute_reply":"2024-08-25T11:52:09.930094Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:52:18.083049Z","iopub.execute_input":"2024-08-25T11:52:18.083744Z","iopub.status.idle":"2024-08-25T11:52:18.089773Z","shell.execute_reply.started":"2024-08-25T11:52:18.083705Z","shell.execute_reply":"2024-08-25T11:52:18.088865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import xgboost as xgb","metadata":{"execution":{"iopub.status.busy":"2024-08-25T11:55:08.220901Z","iopub.execute_input":"2024-08-25T11:55:08.221308Z","iopub.status.idle":"2024-08-25T11:55:08.401651Z","shell.execute_reply.started":"2024-08-25T11:55:08.221269Z","shell.execute_reply":"2024-08-25T11:55:08.400849Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# X is data y is target","metadata":{}},{"cell_type":"markdown","source":"# now lets try polynomial features\n","metadata":{}},{"cell_type":"code","source":"from sklearn.preprocessing import PolynomialFeatures","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:06:20.699188Z","iopub.execute_input":"2024-08-25T16:06:20.69993Z","iopub.status.idle":"2024-08-25T16:06:20.703861Z","shell.execute_reply.started":"2024-08-25T16:06:20.699891Z","shell.execute_reply":"2024-08-25T16:06:20.702944Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"poly = PolynomialFeatures(degree = 2, include_bias = True)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:06:25.164748Z","iopub.execute_input":"2024-08-25T16:06:25.165944Z","iopub.status.idle":"2024-08-25T16:06:25.17066Z","shell.execute_reply.started":"2024-08-25T16:06:25.165891Z","shell.execute_reply":"2024-08-25T16:06:25.169765Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X","metadata":{"execution":{"iopub.status.busy":"2024-08-25T15:59:37.642293Z","iopub.execute_input":"2024-08-25T15:59:37.642693Z","iopub.status.idle":"2024-08-25T15:59:37.672735Z","shell.execute_reply.started":"2024-08-25T15:59:37.642654Z","shell.execute_reply":"2024-08-25T15:59:37.671788Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test","metadata":{"execution":{"iopub.status.busy":"2024-08-25T15:59:38.822824Z","iopub.execute_input":"2024-08-25T15:59:38.823486Z","iopub.status.idle":"2024-08-25T15:59:38.853913Z","shell.execute_reply.started":"2024-08-25T15:59:38.82344Z","shell.execute_reply":"2024-08-25T15:59:38.852876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train_trans = poly.fit_transform(X)\nX_test_trans = poly.transform(test)","metadata":{"execution":{"iopub.status.busy":"2024-08-25T16:06:58.149086Z","iopub.execute_input":"2024-08-25T16:06:58.149509Z","iopub.status.idle":"2024-08-25T16:07:00.194022Z","shell.execute_reply.started":"2024-08-25T16:06:58.149462Z","shell.execute_reply":"2024-08-25T16:07:00.192974Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"lr = LinearRegression()\n","metadata":{"execution":{"iopub.status.busy":"2024-08-25T15:59:45.121213Z","iopub.execute_input":"2024-08-25T15:59:45.122098Z","iopub.status.idle":"2024-08-25T15:59:45.126072Z","shell.execute_reply.started":"2024-08-25T15:59:45.122057Z","shell.execute_reply":"2024-08-25T15:59:45.125078Z"},"trusted":true},"execution_count":null,"outputs":[]}]}