{"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":"none","dataSources":[{"sourceId":81933,"databundleVersionId":9643020,"sourceType":"competition"}],"dockerImageVersionId":30804,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import pandas as pd\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport os\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport pandas as pd\nfrom sklearn.preprocessing import StandardScaler\n\nfrom sklearn.preprocessing import LabelEncoder\nimport lightgbm as lgb\nfrom scipy.optimize import minimize\nfrom sklearn.metrics import cohen_kappa_score\nfrom sklearn.model_selection import KFold, RepeatedStratifiedKFold\nfrom sklearn.base import clone\nfrom tqdm import tqdm\nfrom colorama import Fore, Style\nfrom IPython.display import clear_output\n\nimport seaborn as sns\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:05:10.678712Z","iopub.execute_input":"2024-12-13T08:05:10.679099Z","iopub.status.idle":"2024-12-13T08:05:16.959839Z","shell.execute_reply.started":"2024-12-13T08:05:10.679062Z","shell.execute_reply":"2024-12-13T08:05:16.958899Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Actigraphy Data","metadata":{}},{"cell_type":"code","source":"class AutoEncoder(nn.Module):\n    def __init__(self, input_dim, encoding_dim):\n        super(AutoEncoder, self).__init__()\n        self.encoder = nn.Sequential(\n            nn.Linear(input_dim, encoding_dim*3),\n            nn.ReLU(),\n            nn.Linear(encoding_dim*3, encoding_dim*2),\n            nn.ReLU(),\n            nn.Linear(encoding_dim*2, encoding_dim),\n            nn.ReLU()\n        )\n        self.decoder = nn.Sequential(\n            nn.Linear(encoding_dim, input_dim*2),\n            nn.ReLU(),\n            nn.Linear(input_dim*2, input_dim*3),\n            nn.ReLU(),\n            nn.Linear(input_dim*3, input_dim),\n            nn.Sigmoid()\n        )\n        \n    def forward(self, x):\n        encoded = self.encoder(x)\n        decoded = self.decoder(encoded)\n        return decoded\n         \ndef perform_autoencoder(df, encoding_dim=50, epochs=50, batch_size=32):\n    scaler = StandardScaler()\n    df_scaled = scaler.fit_transform(df)\n    \n    data_tensor = torch.FloatTensor(df_scaled)\n    \n    input_dim = data_tensor.shape[1]\n    autoencoder = AutoEncoder(input_dim, encoding_dim)\n    \n    criterion = nn.MSELoss()\n    optimizer = optim.Adam(autoencoder.parameters())\n    \n    for epoch in range(epochs):\n        for i in range(0, len(data_tensor), batch_size):\n            batch = data_tensor[i : i + batch_size]\n            optimizer.zero_grad()\n            reconstructed = autoencoder(batch)\n            loss = criterion(reconstructed, batch)\n            loss.backward()\n            optimizer.step()\n            \n        if (epoch + 1) % 10 == 0:\n            print(f'Epoch [{epoch + 1}/{epochs}], Loss: {loss.item():.4f}]')\n    \n    return autoencoder, scaler\n\n\ndef encode_features(df, autoencoder, scaler):\n    df_scaled = scaler.transform(df)\n    data_tensor = torch.FloatTensor(df_scaled)\n\n    with torch.no_grad():\n        encoded_data = autoencoder.encoder(data_tensor).numpy()\n        \n    return pd.DataFrame(encoded_data, columns=[f'Enc_{i + 1}' for i in range(encoded_data.shape[1])])\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:05:16.961989Z","iopub.execute_input":"2024-12-13T08:05:16.962765Z","iopub.status.idle":"2024-12-13T08:05:16.974656Z","shell.execute_reply.started":"2024-12-13T08:05:16.962715Z","shell.execute_reply":"2024-12-13T08:05:16.973616Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Actigraphy\nimport os\nfrom concurrent.futures import ThreadPoolExecutor\nfrom tqdm import tqdm\n\ndef get_stat(df, stat_config=None):\n    stat_config = stat_config or {attr: ['count', 'mean', 'std', 'min', '25%', '50%', '75%', 'max'] for attr in df.columns}\n\n    df_stat = df.describe()\n\n    flat_data = {\n        f\"{attr}_{stat_name}\": df_stat.loc[stat_name, attr]\n        for attr, stats in stat_config.items() if attr in df_stat.columns\n        for stat_name in stats if stat_name in df_stat.index\n    }\n\n    return pd.DataFrame([flat_data])\n\ndef actigraphy_feature_selection(df):\n    features_df = pd.DataFrame()\n    \n    non_wear_percentage = (df['non-wear_flag'].sum() / len(df)) * 100\n    df = df[df['non-wear_flag'] == 0].copy()\n    \n    df['time_of_day'] = df['time_of_day'] / 1e9 / 3600 #nanoseconds to hours\n    df['hour_time'] = df['relative_date_PCIAT'] * 24 + df['time_of_day']\n\n    # Statistical Feature Selection\n    stat_config = {\n        'enmo': ['mean', 'std', 'min', '25%', '50%', '75%', 'max'],\n        'anglez': ['mean', 'std', 'min', '25%', '50%', '75%', 'max'],\n        'light': ['mean', 'std', 'min', '25%', '50%', '75%', 'max'], \n        'time_of_day': ['mean', 'std'],\n        'quarter': ['mean']\n    }\n    stat_features = get_stat(df, stat_config)\n\n    # AutoEncode features\n    drop_list = ['step', 'non-wear_flag', 'battery_voltage', 'relative_date_PCIAT']\n    autoencode_features = get_stat(df.drop(drop_list, axis = 1))\n    autoencode_features = autoencode_features.rename(columns = lambda col: f'AEF_{col}')\n\n    # Manual Feature Selection\n    features_df['non_wear_percentage'] = non_wear_percentage\n\n    features_df = pd.concat([features_df, stat_features, autoencode_features], axis = 1)\n    return  features_df\n\ndef process_file(filename, dirname):\n    df = pd.read_parquet(os.path.join(dirname, filename, 'part-0.parquet'))\n    \n    features_df = actigraphy_feature_selection(df)\n    features_df['id'] = filename.split('=')[1]\n    \n    return features_df\n\n\ndef load_time_series(dirname) -> pd.DataFrame:\n    ids = os.listdir(dirname)\n    \n    with ThreadPoolExecutor() as executor:\n        results = list(tqdm(\n            executor.map(lambda fname: process_file(fname, dirname), ids), \n            total=len(ids)\n        ))\n    \n    return pd.concat(results, axis = 0, ignore_index=True)    \n\ntest_ts = load_time_series(\"/kaggle/input/child-mind-institute-problematic-internet-use/series_test.parquet\")\ntest_ts.filter(like='AEF_', axis=1)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:05:16.976012Z","iopub.execute_input":"2024-12-13T08:05:16.976609Z","iopub.status.idle":"2024-12-13T08:05:17.433166Z","shell.execute_reply.started":"2024-12-13T08:05:16.976573Z","shell.execute_reply":"2024-12-13T08:05:17.432204Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Fitness Assessments Data","metadata":{}},{"cell_type":"code","source":"def fa_data_preprocessing(df):\n    return df\n\ndef fa_feature_engineering(df):\n    return df\n\ndef load_csv(dirname) -> pd.DataFrame:\n    df = pd.read_csv(dirname)\n        \n    y_labels = [\n        'PCIAT-PCIAT_01', 'PCIAT-PCIAT_02', 'PCIAT-PCIAT_03', 'PCIAT-PCIAT_04',\n        'PCIAT-PCIAT_05', 'PCIAT-PCIAT_06', 'PCIAT-PCIAT_07', 'PCIAT-PCIAT_08',\n        'PCIAT-PCIAT_09', 'PCIAT-PCIAT_10', 'PCIAT-PCIAT_11', 'PCIAT-PCIAT_12',\n        'PCIAT-PCIAT_13', 'PCIAT-PCIAT_14', 'PCIAT-PCIAT_15', 'PCIAT-PCIAT_16',\n        'PCIAT-PCIAT_17', 'PCIAT-PCIAT_18', 'PCIAT-PCIAT_19', 'PCIAT-PCIAT_20',\n        'PCIAT-PCIAT_Total', 'PCIAT-Season', 'sii']\n    \n    X = df.drop(columns=y_labels, errors='ignore')\n    y = df.filter(items=y_labels, axis=1)\n\n    y['id'] = X['id']\n    \n    return X, y","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:05:17.435173Z","iopub.execute_input":"2024-12-13T08:05:17.435524Z","iopub.status.idle":"2024-12-13T08:05:17.442228Z","shell.execute_reply.started":"2024-12-13T08:05:17.435489Z","shell.execute_reply":"2024-12-13T08:05:17.440936Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"# Data Preparation","metadata":{}},{"cell_type":"code","source":"# Fitness Assessments features\nX_train, y_train = load_csv('/kaggle/input/child-mind-institute-problematic-internet-use/train.csv')\nX_test, _ = load_csv('/kaggle/input/child-mind-institute-problematic-internet-use/test.csv')\n\nX_train = fa_feature_engineering(fa_data_preprocessing(X_train))\nX_test = fa_feature_engineering(fa_data_preprocessing(X_test))\n\n# Actigraphy features\ntrain_ts = load_time_series(\"/kaggle/input/child-mind-institute-problematic-internet-use/series_train.parquet\")\ntest_ts = load_time_series(\"/kaggle/input/child-mind-institute-problematic-internet-use/series_test.parquet\")\n\ntrain_aef = train_ts.filter(like='AEF_', axis=1)\ntest_aef = test_ts.filter(like='AEF_', axis=1)\nautoencoder, scaler = perform_autoencoder(train_aef, encoding_dim=60, epochs=100, batch_size=32)\ntrain_ts = pd.concat([train_ts, encode_features(train_aef, autoencoder, scaler)], axis = 1)\ntest_ts = pd.concat([test_ts, encode_features(test_aef, autoencoder, scaler)], axis = 1)\ntrain_ts.drop(train_ts.filter(like='AEF_').columns, axis = 1, inplace = True)\ntest_ts.drop(test_ts.filter(like='AEF_').columns, axis = 1, inplace = True)\n\n# Merge\nX_train = pd.merge(X_train, train_ts, how=\"left\", on='id')\nX_test = pd.merge(X_test, test_ts, how=\"left\", on='id')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:05:17.443607Z","iopub.execute_input":"2024-12-13T08:05:17.444004Z","iopub.status.idle":"2024-12-13T08:07:49.939367Z","shell.execute_reply.started":"2024-12-13T08:05:17.443948Z","shell.execute_reply":"2024-12-13T08:07:49.938225Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"---","metadata":{}},{"cell_type":"markdown","source":"### Model","metadata":{}},{"cell_type":"code","source":"cat_c = ['Basic_Demos-Enroll_Season', 'CGAS-Season', 'Physical-Season', 'Fitness_Endurance-Season', \n          'FGC-Season', 'BIA-Season', 'PAQ_A-Season', 'PAQ_C-Season', 'SDS-Season', 'PreInt_EduHx-Season']\n\ndef label_encode(df, encoders = None):\n    if encoders is None : encoders = {}\n    df_encoded = df.copy()\n    \n    for col in df.columns:\n        if df[col].dtype != 'object' and df[col].dtype.name != 'category': continue\n        encoder =  encoders[col] if col in encoders else LabelEncoder()\n        df_encoded[col] = encoder.transform(df[col].astype(str)) if col in encoders else encoder.fit_transform(df[col].astype(str))\n        encoders[col] = encoder\n            \n    return df_encoded, encoders","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:07:49.940611Z","iopub.execute_input":"2024-12-13T08:07:49.941126Z","iopub.status.idle":"2024-12-13T08:07:49.947935Z","shell.execute_reply.started":"2024-12-13T08:07:49.941093Z","shell.execute_reply":"2024-12-13T08:07:49.946896Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"SEED = 42\nn_splits = 5\n  \ndef TrainML(model_class, X, y, X_test):\n    val_pred = pd.DataFrame()\n    test_pred = pd.DataFrame()\n\n    for target in tqdm(y.columns, desc=\"Training models for all labels\"):\n        val_pred[target] = np.zeros(len(y[target]))\n        test_pred[target] = np.zeros(len(X_test))\n\n        SKF = RepeatedStratifiedKFold(n_splits=n_splits, n_repeats=1, random_state=SEED)\n        for fold, (train_idx, val_idx) in enumerate(SKF.split(X, y[target])):\n            X_train, X_val = X.iloc[train_idx], X.iloc[val_idx]\n            y_train, y_val = y.loc[train_idx, target], y.loc[val_idx, target]\n\n            model = clone(model_class)\n            model.fit(X_train, y_train)\n            \n            val_pred.loc[val_idx, target] = model.predict(X_val)\n            test_pred[target] += model.predict(X_test) / n_splits\n\n    return test_pred, val_pred","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:07:49.949175Z","iopub.execute_input":"2024-12-13T08:07:49.949542Z","iopub.status.idle":"2024-12-13T08:07:49.960955Z","shell.execute_reply.started":"2024-12-13T08:07:49.949507Z","shell.execute_reply":"2024-12-13T08:07:49.959923Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"### Prediction","metadata":{}},{"cell_type":"code","source":"%%time\nPCIAT_score_labels = [\n        'PCIAT-PCIAT_01', 'PCIAT-PCIAT_02', 'PCIAT-PCIAT_03', 'PCIAT-PCIAT_04',\n        'PCIAT-PCIAT_05', 'PCIAT-PCIAT_06', 'PCIAT-PCIAT_07', 'PCIAT-PCIAT_08',\n        'PCIAT-PCIAT_09', 'PCIAT-PCIAT_10', 'PCIAT-PCIAT_11', 'PCIAT-PCIAT_12',\n        'PCIAT-PCIAT_13', 'PCIAT-PCIAT_14', 'PCIAT-PCIAT_15', 'PCIAT-PCIAT_16',\n        'PCIAT-PCIAT_17', 'PCIAT-PCIAT_18', 'PCIAT-PCIAT_19', 'PCIAT-PCIAT_20',]\n\nX_train_encoded = X_train.copy()\nX_test_encoded = X_test.copy()\n\nX_train_encoded[cat_c], encoders = label_encode(X_train[cat_c])\nX_test_encoded[cat_c], _ = label_encode(X_test[cat_c], encoders)\n\n# ---\nidx = y_train[PCIAT_score_labels].notna().all(axis=1)\nmx = X_train_encoded[idx].reset_index(drop=True)\nmy = y_train[idx].reset_index(drop=True)[PCIAT_score_labels]\nmxt = X_test_encoded\n\nmx = mx.drop('id', axis=1)\nmxt = mxt.drop('id', axis=1)\n\n# -------\nParams7 = {'learning_rate': 0.03884249148676395, 'max_depth': 12, 'num_leaves': 413, 'min_data_in_leaf': 14,\n           'feature_fraction': 0.7987976913702801, 'bagging_fraction': 0.7602261703576205, 'bagging_freq': 2, \n           'lambda_l1': 4.735462555910575, 'lambda_l2': 4.735028557007343e-06} # CV : 0.4094 | LB : 0.471\n\nLight = lgb.LGBMRegressor(**Params7,random_state=SEED, verbose=-1,n_estimators=200)\n# Submission,model = TrainML(Light,mxt)\npred, val_pred = TrainML(Light, mx, my, mxt)\npred.head()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:07:49.962362Z","iopub.execute_input":"2024-12-13T08:07:49.963093Z","iopub.status.idle":"2024-12-13T08:11:05.961658Z","shell.execute_reply.started":"2024-12-13T08:07:49.963045Z","shell.execute_reply":"2024-12-13T08:11:05.959011Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"### Evaluation","metadata":{}},{"cell_type":"code","source":"def quadratic_weighted_kappa(y_true, y_pred):\n    return cohen_kappa_score(y_true, y_pred, weights='quadratic')\n\ndef threshold_rounder(target, thresholds, right=False):\n    thresholds = sorted(thresholds)\n    return np.digitize(target, thresholds, right)\n\ndef evaluate_predictions(thresholds, y_true, y_pred, right=False):\n    rounded_p = threshold_rounder(y_pred, thresholds, right=right)\n    return -quadratic_weighted_kappa(y_true, rounded_p)\n    \ndef QWK_optimize(y_true, y_train_non_rounded, y_test, x0=[i+0.5 for i in range(0, 5)], right=False):\n    KappaOPtimizer = minimize(evaluate_predictions,\n                              x0, args=(y_true, y_train_non_rounded, right), \n                              method='Nelder-Mead') # Nelder-Mead | # Powell\n    assert KappaOPtimizer.success, \"Optimization did not converge.\"\n    \n    y_train_opt = threshold_rounder(y_train_non_rounded, KappaOPtimizer.x)\n    y_test_opt = threshold_rounder(y_test, KappaOPtimizer.x)\n    \n    return y_test_opt, y_train_opt \n\ndef calculate_sii(PCIAT_scores : pd.DataFrame):\n    PCIAT_score_labels = [\n        'PCIAT-PCIAT_01', 'PCIAT-PCIAT_02', 'PCIAT-PCIAT_03', 'PCIAT-PCIAT_04',\n        'PCIAT-PCIAT_05', 'PCIAT-PCIAT_06', 'PCIAT-PCIAT_07', 'PCIAT-PCIAT_08',\n        'PCIAT-PCIAT_09', 'PCIAT-PCIAT_10', 'PCIAT-PCIAT_11', 'PCIAT-PCIAT_12',\n        'PCIAT-PCIAT_13', 'PCIAT-PCIAT_14', 'PCIAT-PCIAT_15', 'PCIAT-PCIAT_16',\n        'PCIAT-PCIAT_17', 'PCIAT-PCIAT_18', 'PCIAT-PCIAT_19', 'PCIAT-PCIAT_20',]\n    \n    # total_scores = PCIAT_scores.filter(items=PCIAT_score_labels, axis=1).sum(axis=1)\n    total_scores = PCIAT_scores[PCIAT_score_labels].sum(axis=1).round(0).astype(int)\n    sii = total_scores.apply(lambda score: \n                           0 if score <= 30 else \n                           1 if 31 <= score <= 49 else \n                           2 if 50 <= score <= 79 else \n                           3)\n    return sii","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:11:05.964148Z","iopub.execute_input":"2024-12-13T08:11:05.964810Z","iopub.status.idle":"2024-12-13T08:11:05.978133Z","shell.execute_reply.started":"2024-12-13T08:11:05.964768Z","shell.execute_reply":"2024-12-13T08:11:05.976966Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# # PCIAT separated\n# val_pred_opt = val_pred.copy()\n# pred_opt = pred.copy()\n\n# for col in my.columns:\n#     y_test_opt, y_val_opt  = QWK_optimize(my[col], val_pred[col], pred[col])\n#     val_pred_opt[col] = y_val_opt\n#     pred_opt[col] = y_test_opt\n\n#     qwk = quadratic_weighted_kappa(my[col], val_pred[col].round(0).astype(int))\n#     qwk_opt = quadratic_weighted_kappa(my[col], y_val_opt)\n\n#     print(f\"{col}\\n ----> Optimized QWK SCORE :: {Fore.RED}{Style.BRIGHT} {qwk:.3f}{Style.RESET_ALL} > {Fore.CYAN}{Style.BRIGHT} {qwk_opt:.3f}{Style.RESET_ALL}\")\n\n\n# sii_qwk = quadratic_weighted_kappa(calculate_sii(my), calculate_sii(val_pred.round(0).astype(int)))\n# sii_qwk_opt = quadratic_weighted_kappa(calculate_sii(my), calculate_sii(val_pred_opt))\n\n# print('='*20)\n# print(f\"'SII' Validation QWK: {Fore.RED}{Style.BRIGHT} {sii_qwk:.3f}{Style.RESET_ALL}\")\n# print(f\"----> || Optimized QWK SCORE :: {Fore.CYAN}{Style.BRIGHT} {sii_qwk_opt:.3f}{Style.RESET_ALL}\")\n\n# sii = calculate_sii(pred_opt)\n\n# Submission = pd.DataFrame()\n# Submission['id'] = X_test['id']\n# Submission['sii'] = sii\n# Submission","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:11:05.982297Z","iopub.execute_input":"2024-12-13T08:11:05.982955Z","iopub.status.idle":"2024-12-13T08:11:15.664290Z","shell.execute_reply.started":"2024-12-13T08:11:05.982919Z","shell.execute_reply":"2024-12-13T08:11:15.663271Z"},"scrolled":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# PCIAT total\nsii_val = calculate_sii(my)\npciat_total_val_pred = val_pred.sum(axis = 1)\npciat_total_pred = pred.sum(axis = 1)\n\nsii_pred_opt, sii_val_pred_opt = QWK_optimize(sii_val, pciat_total_val_pred, pciat_total_pred, x0=[30.5,49.5,79.5])\n\nsii_qwk = quadratic_weighted_kappa(sii_val, calculate_sii(val_pred.round(0).astype(int)))\nsii_qwk_opt = quadratic_weighted_kappa(sii_val, sii_val_pred_opt)\n\nprint(f\"'SII' Validation QWK: {Fore.RED}{Style.BRIGHT} {sii_qwk:.3f}{Style.RESET_ALL}\")\nprint(f\"\\t----> || Optimized QWK SCORE :: {Fore.CYAN}{Style.BRIGHT} {sii_qwk_opt:.3f}{Style.RESET_ALL}\")\n\nsii = sii_pred_opt\n\nSubmission = pd.DataFrame()\nSubmission['id'] = X_test['id']\nSubmission['sii'] = sii\nSubmission","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:11:15.665790Z","iopub.execute_input":"2024-12-13T08:11:15.666224Z","iopub.status.idle":"2024-12-13T08:11:15.672353Z","shell.execute_reply.started":"2024-12-13T08:11:15.666177Z","shell.execute_reply":"2024-12-13T08:11:15.671266Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"---","metadata":{}},{"cell_type":"code","source":"# %%time\n# feature_importance_df = pd.DataFrame({\n#     'Feature': model.booster_.feature_name(),\n#     'Importance': model.booster_.feature_importance(importance_type='gain')\n# })\n\n# feature_importance_df = feature_importance_df.sort_values(by='Importance', ascending=False)\n\n# plt.figure(figsize=(20, 40))\n# sns.barplot(x='Importance', y='Feature', data=feature_importance_df.head(100)) \n# plt.title(\"Top Feature Importance\")\n# plt.show()","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:11:15.673756Z","iopub.execute_input":"2024-12-13T08:11:15.674099Z","iopub.status.idle":"2024-12-13T08:11:15.920725Z","shell.execute_reply.started":"2024-12-13T08:11:15.674054Z","shell.execute_reply":"2024-12-13T08:11:15.919664Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"Submission.to_csv('submission.csv', index=False)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:11:15.921905Z","iopub.execute_input":"2024-12-13T08:11:15.922268Z","iopub.status.idle":"2024-12-13T08:11:15.931513Z","shell.execute_reply.started":"2024-12-13T08:11:15.922236Z","shell.execute_reply":"2024-12-13T08:11:15.930520Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"pd.read_csv('submission.csv')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2024-12-13T08:11:15.933203Z","iopub.execute_input":"2024-12-13T08:11:15.933650Z","iopub.status.idle":"2024-12-13T08:11:15.949371Z","shell.execute_reply.started":"2024-12-13T08:11:15.933604Z","shell.execute_reply":"2024-12-13T08:11:15.948140Z"}},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"---","metadata":{}},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}