{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.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":57988,"databundleVersionId":6263341,"sourceType":"competition"}],"dockerImageVersionId":30626,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"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-01-05T19:49:37.122157Z","iopub.execute_input":"2024-01-05T19:49:37.122560Z","iopub.status.idle":"2024-01-05T19:49:37.131508Z","shell.execute_reply.started":"2024-01-05T19:49:37.122529Z","shell.execute_reply":"2024-01-05T19:49:37.129374Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv('/kaggle/input/air-toxicity-and-chronic-respiratory-diseases-us/train.csv')","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.195042Z","iopub.execute_input":"2024-01-05T19:49:37.195468Z","iopub.status.idle":"2024-01-05T19:49:37.208783Z","shell.execute_reply.started":"2024-01-05T19:49:37.195434Z","shell.execute_reply":"2024-01-05T19:49:37.207081Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.303528Z","iopub.execute_input":"2024-01-05T19:49:37.304928Z","iopub.status.idle":"2024-01-05T19:49:37.320698Z","shell.execute_reply.started":"2024-01-05T19:49:37.304877Z","shell.execute_reply":"2024-01-05T19:49:37.319010Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train.info()","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.400469Z","iopub.execute_input":"2024-01-05T19:49:37.400841Z","iopub.status.idle":"2024-01-05T19:49:37.415729Z","shell.execute_reply.started":"2024-01-05T19:49:37.400811Z","shell.execute_reply":"2024-01-05T19:49:37.414424Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train[['Age']]","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.468121Z","iopub.execute_input":"2024-01-05T19:49:37.469644Z","iopub.status.idle":"2024-01-05T19:49:37.481790Z","shell.execute_reply.started":"2024-01-05T19:49:37.469600Z","shell.execute_reply":"2024-01-05T19:49:37.480643Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['Age'] = train['Age'].apply(lambda x: sum(map(int, x.split('-'))) / 2).astype(int)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.537865Z","iopub.execute_input":"2024-01-05T19:49:37.538770Z","iopub.status.idle":"2024-01-05T19:49:37.550213Z","shell.execute_reply.started":"2024-01-05T19:49:37.538729Z","shell.execute_reply":"2024-01-05T19:49:37.548687Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.672258Z","iopub.execute_input":"2024-01-05T19:49:37.672894Z","iopub.status.idle":"2024-01-05T19:49:37.688781Z","shell.execute_reply.started":"2024-01-05T19:49:37.672858Z","shell.execute_reply":"2024-01-05T19:49:37.686603Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train['Age'].unique()","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.742031Z","iopub.execute_input":"2024-01-05T19:49:37.742523Z","iopub.status.idle":"2024-01-05T19:49:37.752028Z","shell.execute_reply.started":"2024-01-05T19:49:37.742488Z","shell.execute_reply":"2024-01-05T19:49:37.750320Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_f = train.drop('ID',axis=1)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:37.839460Z","iopub.execute_input":"2024-01-05T19:49:37.839826Z","iopub.status.idle":"2024-01-05T19:49:37.845337Z","shell.execute_reply.started":"2024-01-05T19:49:37.839795Z","shell.execute_reply":"2024-01-05T19:49:37.844152Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_f","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:38.047248Z","iopub.execute_input":"2024-01-05T19:49:38.047922Z","iopub.status.idle":"2024-01-05T19:49:38.062998Z","shell.execute_reply.started":"2024-01-05T19:49:38.047882Z","shell.execute_reply":"2024-01-05T19:49:38.061748Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import seaborn as sns","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:38.102833Z","iopub.execute_input":"2024-01-05T19:49:38.103715Z","iopub.status.idle":"2024-01-05T19:49:38.108587Z","shell.execute_reply.started":"2024-01-05T19:49:38.103677Z","shell.execute_reply":"2024-01-05T19:49:38.106590Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.relplot(x=train_f['Year'],y=train_f['Incidence'],hue=train_f['State.Name'])","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:38.172715Z","iopub.execute_input":"2024-01-05T19:49:38.173121Z","iopub.status.idle":"2024-01-05T19:49:39.922037Z","shell.execute_reply.started":"2024-01-05T19:49:38.173089Z","shell.execute_reply":"2024-01-05T19:49:39.921273Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.relplot(x=train_f['Year'][train_f['State.Name']=='Alabama'],y=train_f['Incidence'],hue=train_f['Age'])","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:39.923415Z","iopub.execute_input":"2024-01-05T19:49:39.923795Z","iopub.status.idle":"2024-01-05T19:49:40.557824Z","shell.execute_reply.started":"2024-01-05T19:49:39.923772Z","shell.execute_reply":"2024-01-05T19:49:40.556939Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sns.relplot(x=train_f['Year'][train_f['State.Name']=='Washington'],y=train_f['Incidence'],hue=train_f['Age'])","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:40.559039Z","iopub.execute_input":"2024-01-05T19:49:40.559562Z","iopub.status.idle":"2024-01-05T19:49:41.180086Z","shell.execute_reply.started":"2024-01-05T19:49:40.559526Z","shell.execute_reply":"2024-01-05T19:49:41.179242Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_f = train_f.drop('State.Name',axis=1)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.182461Z","iopub.execute_input":"2024-01-05T19:49:41.182972Z","iopub.status.idle":"2024-01-05T19:49:41.189783Z","shell.execute_reply.started":"2024-01-05T19:49:41.182941Z","shell.execute_reply":"2024-01-05T19:49:41.187967Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_f","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.191550Z","iopub.execute_input":"2024-01-05T19:49:41.192029Z","iopub.status.idle":"2024-01-05T19:49:41.210122Z","shell.execute_reply.started":"2024-01-05T19:49:41.191978Z","shell.execute_reply":"2024-01-05T19:49:41.208823Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_f.isna().sum()","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.211999Z","iopub.execute_input":"2024-01-05T19:49:41.212414Z","iopub.status.idle":"2024-01-05T19:49:41.222609Z","shell.execute_reply.started":"2024-01-05T19:49:41.212376Z","shell.execute_reply":"2024-01-05T19:49:41.221413Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"def remove_outliers(df):\n    for column in df.columns:\n        Q1 = df[column].quantile(0.25)\n        Q3 = df[column].quantile(0.75)\n        IQR = Q3 - Q1\n        lower_bound = Q1 - 1.5 * IQR\n        upper_bound = Q3 + 1.5 * IQR\n        outlier_mask = (df[column] < lower_bound) | (df[column] > upper_bound)\n        df = df[~outlier_mask]\n    return df","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.224258Z","iopub.execute_input":"2024-01-05T19:49:41.225585Z","iopub.status.idle":"2024-01-05T19:49:41.234047Z","shell.execute_reply.started":"2024-01-05T19:49:41.225514Z","shell.execute_reply":"2024-01-05T19:49:41.232635Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"remove_outliers(train_f)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.235748Z","iopub.execute_input":"2024-01-05T19:49:41.236614Z","iopub.status.idle":"2024-01-05T19:49:41.260231Z","shell.execute_reply.started":"2024-01-05T19:49:41.236547Z","shell.execute_reply":"2024-01-05T19:49:41.259580Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.261831Z","iopub.execute_input":"2024-01-05T19:49:41.262373Z","iopub.status.idle":"2024-01-05T19:49:41.266327Z","shell.execute_reply.started":"2024-01-05T19:49:41.262323Z","shell.execute_reply":"2024-01-05T19:49:41.265391Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X = train_f.drop('Incidence',axis=1).values\ny = train_f['Incidence']","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.270066Z","iopub.execute_input":"2024-01-05T19:49:41.270571Z","iopub.status.idle":"2024-01-05T19:49:41.276389Z","shell.execute_reply.started":"2024-01-05T19:49:41.270536Z","shell.execute_reply":"2024-01-05T19:49:41.275671Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2,random_state=4500)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T20:01:24.378185Z","iopub.execute_input":"2024-01-05T20:01:24.378612Z","iopub.status.idle":"2024-01-05T20:01:24.385280Z","shell.execute_reply.started":"2024-01-05T20:01:24.378576Z","shell.execute_reply":"2024-01-05T20:01:24.384129Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.ensemble import RandomForestRegressor","metadata":{"execution":{"iopub.status.busy":"2024-01-05T20:01:25.632112Z","iopub.execute_input":"2024-01-05T20:01:25.632469Z","iopub.status.idle":"2024-01-05T20:01:25.638576Z","shell.execute_reply.started":"2024-01-05T20:01:25.632445Z","shell.execute_reply":"2024-01-05T20:01:25.636865Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mod = RandomForestRegressor(n_estimators=1500).fit(X_train,y_train)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T20:01:27.260003Z","iopub.execute_input":"2024-01-05T20:01:27.260411Z","iopub.status.idle":"2024-01-05T20:01:30.498331Z","shell.execute_reply.started":"2024-01-05T20:01:27.260380Z","shell.execute_reply":"2024-01-05T20:01:30.496601Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"mod.score(X_test,y_test)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T20:01:31.940764Z","iopub.execute_input":"2024-01-05T20:01:31.941126Z","iopub.status.idle":"2024-01-05T20:01:32.104444Z","shell.execute_reply.started":"2024-01-05T20:01:31.941098Z","shell.execute_reply":"2024-01-05T20:01:32.103650Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.linear_model import LinearRegression","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.549661Z","iopub.execute_input":"2024-01-05T19:49:41.549950Z","iopub.status.idle":"2024-01-05T19:49:41.555577Z","shell.execute_reply.started":"2024-01-05T19:49:41.549923Z","shell.execute_reply":"2024-01-05T19:49:41.554537Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"m = LinearRegression().fit(X_train,y_train)\nm.score(X_test,y_test)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.557166Z","iopub.execute_input":"2024-01-05T19:49:41.557515Z","iopub.status.idle":"2024-01-05T19:49:41.569898Z","shell.execute_reply.started":"2024-01-05T19:49:41.557487Z","shell.execute_reply":"2024-01-05T19:49:41.568407Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model = RandomForestRegressor(random_state=4500).fit(X,y)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:23.767141Z","iopub.execute_input":"2024-01-05T19:51:23.767509Z","iopub.status.idle":"2024-01-05T19:51:24.009859Z","shell.execute_reply.started":"2024-01-05T19:51:23.767480Z","shell.execute_reply":"2024-01-05T19:51:24.008876Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test = pd.read_csv('/kaggle/input/air-toxicity-and-chronic-respiratory-diseases-us/test.csv') ","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.824258Z","iopub.execute_input":"2024-01-05T19:49:41.825470Z","iopub.status.idle":"2024-01-05T19:49:41.836602Z","shell.execute_reply.started":"2024-01-05T19:49:41.825414Z","shell.execute_reply":"2024-01-05T19:49:41.835045Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.838470Z","iopub.execute_input":"2024-01-05T19:49:41.838844Z","iopub.status.idle":"2024-01-05T19:49:41.853924Z","shell.execute_reply.started":"2024-01-05T19:49:41.838813Z","shell.execute_reply":"2024-01-05T19:49:41.852463Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_f = test.drop(['ID','State.Name'],axis=1)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.855147Z","iopub.execute_input":"2024-01-05T19:49:41.855503Z","iopub.status.idle":"2024-01-05T19:49:41.864321Z","shell.execute_reply.started":"2024-01-05T19:49:41.855467Z","shell.execute_reply":"2024-01-05T19:49:41.862723Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_f","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.866039Z","iopub.execute_input":"2024-01-05T19:49:41.866394Z","iopub.status.idle":"2024-01-05T19:49:41.884022Z","shell.execute_reply.started":"2024-01-05T19:49:41.866334Z","shell.execute_reply":"2024-01-05T19:49:41.882330Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_f['Age'] = test_f['Age'].apply(lambda x:sum(map(int,x.split('-')))/2).astype(int)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.885773Z","iopub.execute_input":"2024-01-05T19:49:41.886251Z","iopub.status.idle":"2024-01-05T19:49:41.898589Z","shell.execute_reply.started":"2024-01-05T19:49:41.886203Z","shell.execute_reply":"2024-01-05T19:49:41.896735Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"test_f","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:49:41.900111Z","iopub.execute_input":"2024-01-05T19:49:41.900501Z","iopub.status.idle":"2024-01-05T19:49:41.914765Z","shell.execute_reply.started":"2024-01-05T19:49:41.900471Z","shell.execute_reply":"2024-01-05T19:49:41.913157Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.predict(test_f)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:35.180941Z","iopub.execute_input":"2024-01-05T19:51:35.181342Z","iopub.status.idle":"2024-01-05T19:51:35.212395Z","shell.execute_reply.started":"2024-01-05T19:51:35.181304Z","shell.execute_reply":"2024-01-05T19:51:35.210736Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds = pd.DataFrame(model.predict(test_f))","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:39.088982Z","iopub.execute_input":"2024-01-05T19:51:39.089412Z","iopub.status.idle":"2024-01-05T19:51:39.114024Z","shell.execute_reply.started":"2024-01-05T19:51:39.089373Z","shell.execute_reply":"2024-01-05T19:51:39.112321Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:41.023328Z","iopub.execute_input":"2024-01-05T19:51:41.023753Z","iopub.status.idle":"2024-01-05T19:51:41.038252Z","shell.execute_reply.started":"2024-01-05T19:51:41.023721Z","shell.execute_reply":"2024-01-05T19:51:41.036476Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds.columns = ['Incidence']","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:47.504675Z","iopub.execute_input":"2024-01-05T19:51:47.505074Z","iopub.status.idle":"2024-01-05T19:51:47.510756Z","shell.execute_reply.started":"2024-01-05T19:51:47.505041Z","shell.execute_reply":"2024-01-05T19:51:47.509573Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"preds","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:49.882044Z","iopub.execute_input":"2024-01-05T19:51:49.882437Z","iopub.status.idle":"2024-01-05T19:51:49.897717Z","shell.execute_reply.started":"2024-01-05T19:51:49.882408Z","shell.execute_reply":"2024-01-05T19:51:49.896432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ids = test[['ID']]","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:53.521961Z","iopub.execute_input":"2024-01-05T19:51:53.522323Z","iopub.status.idle":"2024-01-05T19:51:53.529465Z","shell.execute_reply.started":"2024-01-05T19:51:53.522295Z","shell.execute_reply":"2024-01-05T19:51:53.527856Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ids","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:55.821106Z","iopub.execute_input":"2024-01-05T19:51:55.821531Z","iopub.status.idle":"2024-01-05T19:51:55.834440Z","shell.execute_reply.started":"2024-01-05T19:51:55.821499Z","shell.execute_reply":"2024-01-05T19:51:55.833119Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub = pd.concat([ids,preds],axis=1)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:51:59.606431Z","iopub.execute_input":"2024-01-05T19:51:59.606770Z","iopub.status.idle":"2024-01-05T19:51:59.613094Z","shell.execute_reply.started":"2024-01-05T19:51:59.606744Z","shell.execute_reply":"2024-01-05T19:51:59.611709Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:52:01.467234Z","iopub.execute_input":"2024-01-05T19:52:01.467598Z","iopub.status.idle":"2024-01-05T19:52:01.482023Z","shell.execute_reply.started":"2024-01-05T19:52:01.467569Z","shell.execute_reply":"2024-01-05T19:52:01.479863Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.to_csv('Us_submissions_2.csv',index=False)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:52:08.919925Z","iopub.execute_input":"2024-01-05T19:52:08.920325Z","iopub.status.idle":"2024-01-05T19:52:08.937639Z","shell.execute_reply.started":"2024-01-05T19:52:08.920294Z","shell.execute_reply":"2024-01-05T19:52:08.935853Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.svm import SVC\nfrom sklearn.tree import DecisionTreeRegressor","metadata":{"execution":{"iopub.status.busy":"2024-01-05T19:58:19.470665Z","iopub.execute_input":"2024-01-05T19:58:19.471042Z","iopub.status.idle":"2024-01-05T19:58:19.476214Z","shell.execute_reply.started":"2024-01-05T19:58:19.471012Z","shell.execute_reply":"2024-01-05T19:58:19.474637Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.metrics import mean_squared_error\nimport xgboost as xgb\nml = xgb.XGBRegressor(objective ='reg:squarederror', colsample_bytree = 0.3, learning_rate = 0.1,\n                max_depth = 7, alpha = 15, n_estimators = 1000).fit(X_train,y_train)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T20:07:18.947124Z","iopub.execute_input":"2024-01-05T20:07:18.947519Z","iopub.status.idle":"2024-01-05T20:07:19.187110Z","shell.execute_reply.started":"2024-01-05T20:07:18.947488Z","shell.execute_reply":"2024-01-05T20:07:19.186092Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"ml.score(X_test,y_test)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T20:07:21.154007Z","iopub.execute_input":"2024-01-05T20:07:21.154619Z","iopub.status.idle":"2024-01-05T20:07:21.168385Z","shell.execute_reply.started":"2024-01-05T20:07:21.154584Z","shell.execute_reply":"2024-01-05T20:07:21.167481Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub","metadata":{"execution":{"iopub.status.busy":"2024-01-05T20:07:41.626924Z","iopub.execute_input":"2024-01-05T20:07:41.627388Z","iopub.status.idle":"2024-01-05T20:07:41.645536Z","shell.execute_reply.started":"2024-01-05T20:07:41.627339Z","shell.execute_reply":"2024-01-05T20:07:41.643964Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}