{"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"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":"nvidiaTeslaT4","dataSources":[{"sourceId":81933,"databundleVersionId":9643020,"sourceType":"competition"}],"dockerImageVersionId":30805,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# 1. Library imports","metadata":{}},{"cell_type":"code","source":"import os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:12.833182Z","iopub.execute_input":"2024-12-07T17:52:12.833985Z","iopub.status.idle":"2024-12-07T17:52:14.282713Z","shell.execute_reply.started":"2024-12-07T17:52:12.833948Z","shell.execute_reply":"2024-12-07T17:52:14.281459Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"import numpy as np \nimport pandas as pd \nimport polars as pl \nimport warnings\nwarnings.filterwarnings('ignore')\nimport matplotlib.pyplot as plt \nimport seaborn as sns \nimport plotly.express as px\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.284164Z","iopub.execute_input":"2024-12-07T17:52:14.284434Z","iopub.status.idle":"2024-12-07T17:52:14.289243Z","shell.execute_reply.started":"2024-12-07T17:52:14.284406Z","shell.execute_reply":"2024-12-07T17:52:14.288315Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 2. Dataset read","metadata":{}},{"cell_type":"code","source":"train_data = pl.read_csv('/kaggle/input/child-mind-institute-problematic-internet-use/train.csv')\ntest_data = pl.read_csv('/kaggle/input/child-mind-institute-problematic-internet-use/test.csv')\nprint(f\"Train Data dimension : {train_data.shape}\")\nprint(f\"Test Data dimension : {test_data.shape}\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.290789Z","iopub.execute_input":"2024-12-07T17:52:14.291128Z","iopub.status.idle":"2024-12-07T17:52:14.317461Z","shell.execute_reply.started":"2024-12-07T17:52:14.291089Z","shell.execute_reply":"2024-12-07T17:52:14.316741Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 3. Know about Train dataset","metadata":{}},{"cell_type":"code","source":"train_data.head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.319520Z","iopub.execute_input":"2024-12-07T17:52:14.319870Z","iopub.status.idle":"2024-12-07T17:52:14.333784Z","shell.execute_reply.started":"2024-12-07T17:52:14.319834Z","shell.execute_reply":"2024-12-07T17:52:14.332645Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_data.head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.334947Z","iopub.execute_input":"2024-12-07T17:52:14.335265Z","iopub.status.idle":"2024-12-07T17:52:14.351013Z","shell.execute_reply.started":"2024-12-07T17:52:14.335228Z","shell.execute_reply":"2024-12-07T17:52:14.350145Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_data.columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.351986Z","iopub.execute_input":"2024-12-07T17:52:14.352271Z","iopub.status.idle":"2024-12-07T17:52:14.361392Z","shell.execute_reply.started":"2024-12-07T17:52:14.352229Z","shell.execute_reply":"2024-12-07T17:52:14.360531Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 4. EDA","metadata":{}},{"cell_type":"code","source":"train_data.describe()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.362474Z","iopub.execute_input":"2024-12-07T17:52:14.362769Z","iopub.status.idle":"2024-12-07T17:52:14.402875Z","shell.execute_reply.started":"2024-12-07T17:52:14.362737Z","shell.execute_reply":"2024-12-07T17:52:14.401977Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 4.1 Null value handling","metadata":{}},{"cell_type":"code","source":"train_data.null_count().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.404090Z","iopub.execute_input":"2024-12-07T17:52:14.405014Z","iopub.status.idle":"2024-12-07T17:52:14.413332Z","shell.execute_reply.started":"2024-12-07T17:52:14.404974Z","shell.execute_reply":"2024-12-07T17:52:14.412377Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"irrelavant_col = ['id','Basic_Demos-Enroll_Season','CGAS-Season','Physical-Season','Fitness_Endurance-Season','FGC-Season',\n                  'BIA-Season','PAQ_A-Season','PAQ_C-Season','SDS-Season','PreInt_EduHx-Season','PCIAT-Season',\n                  'BIA-BIA_ECW','PCIAT-PCIAT_01',\n 'PCIAT-PCIAT_02',\n 'PCIAT-PCIAT_03',\n 'PCIAT-PCIAT_04',\n 'PCIAT-PCIAT_05',\n 'PCIAT-PCIAT_06',\n 'PCIAT-PCIAT_07',\n 'PCIAT-PCIAT_08',\n 'PCIAT-PCIAT_09',\n 'PCIAT-PCIAT_10',\n 'PCIAT-PCIAT_11',\n 'PCIAT-PCIAT_12',\n 'PCIAT-PCIAT_13',\n 'PCIAT-PCIAT_14',\n 'PCIAT-PCIAT_15',\n 'PCIAT-PCIAT_16',\n 'PCIAT-PCIAT_17',\n 'PCIAT-PCIAT_18',\n 'PCIAT-PCIAT_19',\n 'PCIAT-PCIAT_20']\n\ntrain_data = train_data.drop(irrelavant_col)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.414376Z","iopub.execute_input":"2024-12-07T17:52:14.414792Z","iopub.status.idle":"2024-12-07T17:52:14.424650Z","shell.execute_reply.started":"2024-12-07T17:52:14.414757Z","shell.execute_reply":"2024-12-07T17:52:14.423923Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_data.head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.428670Z","iopub.execute_input":"2024-12-07T17:52:14.428958Z","iopub.status.idle":"2024-12-07T17:52:14.447685Z","shell.execute_reply.started":"2024-12-07T17:52:14.428915Z","shell.execute_reply":"2024-12-07T17:52:14.446871Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"#train_data = train_data.fill_null(strategy='forward')\n#train_data = train_data.fill_null(strategy='backward')\ntrain_data = train_data.fill_null(strategy= \"max\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.448524Z","iopub.execute_input":"2024-12-07T17:52:14.448786Z","iopub.status.idle":"2024-12-07T17:52:14.460747Z","shell.execute_reply.started":"2024-12-07T17:52:14.448763Z","shell.execute_reply":"2024-12-07T17:52:14.460036Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_data.null_count().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.461684Z","iopub.execute_input":"2024-12-07T17:52:14.461960Z","iopub.status.idle":"2024-12-07T17:52:14.472022Z","shell.execute_reply.started":"2024-12-07T17:52:14.461929Z","shell.execute_reply":"2024-12-07T17:52:14.471196Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"irrelavant_col_test = ['id','Basic_Demos-Enroll_Season','CGAS-Season','Physical-Season','Fitness_Endurance-Season','FGC-Season',\n                  'BIA-Season','PAQ_A-Season','PAQ_C-Season','SDS-Season','PreInt_EduHx-Season']\n\ntest_data =test_data.drop(irrelavant_col_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.473015Z","iopub.execute_input":"2024-12-07T17:52:14.473283Z","iopub.status.idle":"2024-12-07T17:52:14.480731Z","shell.execute_reply.started":"2024-12-07T17:52:14.473241Z","shell.execute_reply":"2024-12-07T17:52:14.479756Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_data.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.481632Z","iopub.execute_input":"2024-12-07T17:52:14.481877Z","iopub.status.idle":"2024-12-07T17:52:14.492421Z","shell.execute_reply.started":"2024-12-07T17:52:14.481854Z","shell.execute_reply":"2024-12-07T17:52:14.491499Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_data.shape","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.493348Z","iopub.execute_input":"2024-12-07T17:52:14.493618Z","iopub.status.idle":"2024-12-07T17:52:14.505389Z","shell.execute_reply.started":"2024-12-07T17:52:14.493560Z","shell.execute_reply":"2024-12-07T17:52:14.504448Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"train_data.columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.506454Z","iopub.execute_input":"2024-12-07T17:52:14.506742Z","iopub.status.idle":"2024-12-07T17:52:14.521021Z","shell.execute_reply.started":"2024-12-07T17:52:14.506713Z","shell.execute_reply":"2024-12-07T17:52:14.520152Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_data.columns","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.522034Z","iopub.execute_input":"2024-12-07T17:52:14.522280Z","iopub.status.idle":"2024-12-07T17:52:14.531135Z","shell.execute_reply.started":"2024-12-07T17:52:14.522249Z","shell.execute_reply":"2024-12-07T17:52:14.530301Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"test_data.null_count().sum()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.532043Z","iopub.execute_input":"2024-12-07T17:52:14.532241Z","iopub.status.idle":"2024-12-07T17:52:14.543873Z","shell.execute_reply.started":"2024-12-07T17:52:14.532220Z","shell.execute_reply":"2024-12-07T17:52:14.542934Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 5. Feature Engineering\n>Binary Target variable","metadata":{}},{"cell_type":"code","source":"train_data.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.544810Z","iopub.execute_input":"2024-12-07T17:52:14.545125Z","iopub.status.idle":"2024-12-07T17:52:14.554809Z","shell.execute_reply.started":"2024-12-07T17:52:14.545099Z","shell.execute_reply":"2024-12-07T17:52:14.553931Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 5.1 Feature scalling","metadata":{}},{"cell_type":"code","source":"from sklearn.preprocessing import StandardScaler","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.555994Z","iopub.execute_input":"2024-12-07T17:52:14.556349Z","iopub.status.idle":"2024-12-07T17:52:14.564396Z","shell.execute_reply.started":"2024-12-07T17:52:14.556306Z","shell.execute_reply":"2024-12-07T17:52:14.563549Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Scale selected numerical columns\nnumerical_features = ['Physical-BMI', 'Physical-Height', 'Physical-Weight', \n                      'Physical-Waist_Circumference', 'CGAS-CGAS_Score', \n                      'SDS-SDS_Total_Raw', 'PreInt_EduHx-computerinternet_hoursday']\n\nscaler = StandardScaler()\nscaled_data = scaler.fit_transform(train_data.select(numerical_features).to_numpy())\nscaled_df = pl.DataFrame(scaled_data, schema=numerical_features)\n\n# Replace original columns with scaled values\ndata = train_data.drop(numerical_features).hstack(scaled_df)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.565551Z","iopub.execute_input":"2024-12-07T17:52:14.565947Z","iopub.status.idle":"2024-12-07T17:52:14.582689Z","shell.execute_reply.started":"2024-12-07T17:52:14.565900Z","shell.execute_reply":"2024-12-07T17:52:14.582053Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Split Data","metadata":{}},{"cell_type":"code","source":"train_data.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.583850Z","iopub.execute_input":"2024-12-07T17:52:14.584203Z","iopub.status.idle":"2024-12-07T17:52:14.596872Z","shell.execute_reply.started":"2024-12-07T17:52:14.584164Z","shell.execute_reply":"2024-12-07T17:52:14.595827Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from sklearn.model_selection import train_test_split","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.597940Z","iopub.execute_input":"2024-12-07T17:52:14.598191Z","iopub.status.idle":"2024-12-07T17:52:14.605462Z","shell.execute_reply.started":"2024-12-07T17:52:14.598167Z","shell.execute_reply":"2024-12-07T17:52:14.604532Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"X = train_data.drop([\"sii\"]).to_numpy()\ny = train_data.select(\"sii\").to_numpy().flatten()\n\nX_train, X_test, y_train, y_test =train_test_split(X, y, test_size=0.2, random_state=42)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.606738Z","iopub.execute_input":"2024-12-07T17:52:14.607145Z","iopub.status.idle":"2024-12-07T17:52:14.619739Z","shell.execute_reply.started":"2024-12-07T17:52:14.607099Z","shell.execute_reply":"2024-12-07T17:52:14.619089Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Building Model\n# 1. Logistic Regression model","metadata":{}},{"cell_type":"code","source":"from sklearn.linear_model import LogisticRegression\nlogistic = LogisticRegression()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.620564Z","iopub.execute_input":"2024-12-07T17:52:14.620832Z","iopub.status.idle":"2024-12-07T17:52:14.635828Z","shell.execute_reply.started":"2024-12-07T17:52:14.620797Z","shell.execute_reply":"2024-12-07T17:52:14.634840Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"logistic.fit(X_train,y_train)\ny_predict= logistic.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.637195Z","iopub.execute_input":"2024-12-07T17:52:14.638077Z","iopub.status.idle":"2024-12-07T17:52:14.742651Z","shell.execute_reply.started":"2024-12-07T17:52:14.638037Z","shell.execute_reply":"2024-12-07T17:52:14.742014Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"logistic.score(X_test,y_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.743544Z","iopub.execute_input":"2024-12-07T17:52:14.743793Z","iopub.status.idle":"2024-12-07T17:52:14.751566Z","shell.execute_reply.started":"2024-12-07T17:52:14.743769Z","shell.execute_reply":"2024-12-07T17:52:14.750753Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 2. RandomForest Classifier","metadata":{}},{"cell_type":"code","source":"from sklearn.ensemble import RandomForestClassifier\nrandomf = RandomForestClassifier(random_state=42)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.755432Z","iopub.execute_input":"2024-12-07T17:52:14.755801Z","iopub.status.idle":"2024-12-07T17:52:14.762076Z","shell.execute_reply.started":"2024-12-07T17:52:14.755770Z","shell.execute_reply":"2024-12-07T17:52:14.761213Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"randomf.fit(X_train,y_train)\ny_predict_rn = randomf.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:14.763266Z","iopub.execute_input":"2024-12-07T17:52:14.763663Z","iopub.status.idle":"2024-12-07T17:52:15.337241Z","shell.execute_reply.started":"2024-12-07T17:52:14.763623Z","shell.execute_reply":"2024-12-07T17:52:15.336090Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"randomf.score(X_test,y_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:15.338676Z","iopub.execute_input":"2024-12-07T17:52:15.339070Z","iopub.status.idle":"2024-12-07T17:52:15.363713Z","shell.execute_reply.started":"2024-12-07T17:52:15.339027Z","shell.execute_reply":"2024-12-07T17:52:15.362763Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 3. Support Vector Machine","metadata":{}},{"cell_type":"code","source":"from sklearn.svm import SVC","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:15.364710Z","iopub.execute_input":"2024-12-07T17:52:15.364921Z","iopub.status.idle":"2024-12-07T17:52:15.368658Z","shell.execute_reply.started":"2024-12-07T17:52:15.364899Z","shell.execute_reply":"2024-12-07T17:52:15.367740Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"svm_model = SVC(random_state=42, probability=True)\nsvm_model.fit(X_train,y_train)\ny_predict_svm = svm_model.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:15.369688Z","iopub.execute_input":"2024-12-07T17:52:15.369970Z","iopub.status.idle":"2024-12-07T17:52:18.313045Z","shell.execute_reply.started":"2024-12-07T17:52:15.369944Z","shell.execute_reply":"2024-12-07T17:52:18.311993Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"svm_model.score(X_test,y_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.314248Z","iopub.execute_input":"2024-12-07T17:52:18.314560Z","iopub.status.idle":"2024-12-07T17:52:18.480200Z","shell.execute_reply.started":"2024-12-07T17:52:18.314533Z","shell.execute_reply":"2024-12-07T17:52:18.479238Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# 4. XGBoost classifier","metadata":{}},{"cell_type":"code","source":"import xgboost as xgb","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.481873Z","iopub.execute_input":"2024-12-07T17:52:18.482321Z","iopub.status.idle":"2024-12-07T17:52:18.487539Z","shell.execute_reply.started":"2024-12-07T17:52:18.482273Z","shell.execute_reply":"2024-12-07T17:52:18.486414Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"xgb_model = xgb.XGBClassifier(random_state=42, eval_metics='logloss')\nxgb_model.fit(X_train,y_train)\ny_predict_xgb = xgb_model.predict(X_test)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.489144Z","iopub.execute_input":"2024-12-07T17:52:18.490056Z","iopub.status.idle":"2024-12-07T17:52:18.669199Z","shell.execute_reply.started":"2024-12-07T17:52:18.490017Z","shell.execute_reply":"2024-12-07T17:52:18.668420Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Evaluation Report","metadata":{}},{"cell_type":"code","source":"from sklearn.metrics import confusion_matrix, classification_report, roc_auc_score, r2_score","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.670003Z","iopub.execute_input":"2024-12-07T17:52:18.670265Z","iopub.status.idle":"2024-12-07T17:52:18.676286Z","shell.execute_reply.started":"2024-12-07T17:52:18.670241Z","shell.execute_reply":"2024-12-07T17:52:18.675609Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Metrics Function\ndef evaluate_model(y_test, y_pred, model_name):\n    print(f\"\\n{model_name} Classification Report:\")\n    print(classification_report(y_test, y_pred))\n    print(\"Confusion Matrix:\")\n    print(confusion_matrix(y_test, y_pred))\n    #print(f\"ROC-AUC Score: {roc_auc_score(y_test, y_pred, multi_class='ovr')}\")\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.677005Z","iopub.execute_input":"2024-12-07T17:52:18.677245Z","iopub.status.idle":"2024-12-07T17:52:18.690559Z","shell.execute_reply.started":"2024-12-07T17:52:18.677217Z","shell.execute_reply":"2024-12-07T17:52:18.689863Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"evaluate_model(y_test, y_predict, \"Logistic Regression\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.691804Z","iopub.execute_input":"2024-12-07T17:52:18.692113Z","iopub.status.idle":"2024-12-07T17:52:18.709494Z","shell.execute_reply.started":"2024-12-07T17:52:18.692078Z","shell.execute_reply":"2024-12-07T17:52:18.708632Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"evaluate_model(y_test, y_predict_rn, \"Random Forest\")\nevaluate_model(y_test, y_predict_svm, \"SVM\")\nevaluate_model(y_test, y_predict_xgb, \"XGBoost\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.710620Z","iopub.execute_input":"2024-12-07T17:52:18.710881Z","iopub.status.idle":"2024-12-07T17:52:18.738105Z","shell.execute_reply.started":"2024-12-07T17:52:18.710858Z","shell.execute_reply":"2024-12-07T17:52:18.737208Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"prediction_xgb =xgb_model.predict(test_data)\nprediction_xgb","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.739180Z","iopub.execute_input":"2024-12-07T17:52:18.739440Z","iopub.status.idle":"2024-12-07T17:52:18.748630Z","shell.execute_reply.started":"2024-12-07T17:52:18.739415Z","shell.execute_reply":"2024-12-07T17:52:18.747856Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission = pd.read_csv('/kaggle/input/child-mind-institute-problematic-internet-use/sample_submission.csv')\nsubmission.head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T17:52:18.749374Z","iopub.execute_input":"2024-12-07T17:52:18.749670Z","iopub.status.idle":"2024-12-07T17:52:18.770228Z","shell.execute_reply.started":"2024-12-07T17:52:18.749638Z","shell.execute_reply":"2024-12-07T17:52:18.769072Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission.sii = prediction_xgb\nsubmission.columns = ['id', 'sii']\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T18:11:28.481683Z","iopub.execute_input":"2024-12-07T18:11:28.482472Z","iopub.status.idle":"2024-12-07T18:11:28.486499Z","shell.execute_reply.started":"2024-12-07T18:11:28.482431Z","shell.execute_reply":"2024-12-07T18:11:28.485440Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission.head(10)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T18:11:32.323704Z","iopub.execute_input":"2024-12-07T18:11:32.324029Z","iopub.status.idle":"2024-12-07T18:11:32.334009Z","shell.execute_reply.started":"2024-12-07T18:11:32.324001Z","shell.execute_reply":"2024-12-07T18:11:32.333088Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"submission.to_csv('submission.csv', index = False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-07T18:11:38.021078Z","iopub.execute_input":"2024-12-07T18:11:38.021735Z","iopub.status.idle":"2024-12-07T18:11:38.026741Z","shell.execute_reply.started":"2024-12-07T18:11:38.021700Z","shell.execute_reply":"2024-12-07T18:11:38.025812Z"}},"outputs":[],"execution_count":null}]}