{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.7.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"gpu","dataSources":[{"sourceId":4120,"databundleVersionId":44256,"sourceType":"competition"},{"sourceId":378227,"sourceType":"datasetVersion","datasetId":166071}],"dockerImageVersionId":29976,"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 5GB 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\n\nfrom matplotlib import pyplot as plt\nfrom catboost import CatBoostClassifier\nimport seaborn as sns\nimport gzip\n\ntest_file = '../input/avazu-ctr-prediction/test.gz'\nsamplesubmision_file = '../input/avazu-ctr-prediction/sampleSubmission.gz'","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-04-21T10:00:53.568771Z","iopub.execute_input":"2024-04-21T10:00:53.569163Z","iopub.status.idle":"2024-04-21T10:00:53.579720Z","shell.execute_reply.started":"2024-04-21T10:00:53.569129Z","shell.execute_reply":"2024-04-21T10:00:53.578899Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"由於文件的Row數量太過龐大 （超過4千萬筆） ，Pandas DataFrame無法讀取這麼大的資料量，因此資料以每100萬筆為一批次分批讀取，並且從每個批次的資料中，隨機抽樣5％的資料，集成一個新的train set。","metadata":{}},{"cell_type":"code","source":"chunksize = 10 ** 6\nnum_of_chunk = 0\ntrain = pd.DataFrame()\n    \n# for chunk in pd.read_csv('../input/avazu-ctr-train/train.csv', chunksize=chunksize):\n#     num_of_chunk += 1\n#     train = pd.concat([train, chunk.sample(frac=.05, replace=False, random_state=123)], axis=0)\n#     print('Processing Chunk No. ' + str(num_of_chunk)) \n    \nfile_path = \"/kaggle/input/avazu-ctr-prediction/train.gz\"\ntrain = pd.read_csv(file_path, header=0, nrows=10000).sample(frac=1)\n    \n    \ntrain.reset_index(inplace=True)\n\n# 備份train 資料長度，以便稍後df重新分割索引用途\ntrain_len = len(train)\ntrain_len","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:53.581415Z","iopub.execute_input":"2024-04-21T10:00:53.581758Z","iopub.status.idle":"2024-04-21T10:00:53.636040Z","shell.execute_reply.started":"2024-04-21T10:00:53.581730Z","shell.execute_reply":"2024-04-21T10:00:53.635167Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"df = pd.concat([train, pd.read_csv(test_file, compression='gzip',header=0, nrows=10000)]).drop(['index', 'id'], axis=1)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:53.637358Z","iopub.execute_input":"2024-04-21T10:00:53.637742Z","iopub.status.idle":"2024-04-21T10:00:53.694394Z","shell.execute_reply.started":"2024-04-21T10:00:53.637703Z","shell.execute_reply":"2024-04-21T10:00:53.693710Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"# 建立一個將hour資料轉換為日期格式的function\ndef get_date(hour):\n    y = '20'+str(hour)[:2]\n    m = str(hour)[2:4]\n    d = str(hour)[4:6]\n    return y+'-'+m+'-'+d\n\n# 建立weekday欄位，將hour轉換後填入\ndf['weekday'] = pd.to_datetime(df.hour.apply(get_date)).dt.dayofweek.astype(str)\n\n# 建立一個將hour資料轉換為時段的function\ndef tran_hour(x):\n    x = x % 100\n    while x in [23,0]:\n        return '23-01'\n    while x in [1,2]:\n        return '01-03'\n    while x in [3,4]:\n        return '03-05'\n    while x in [5,6]:\n        return '05-07'\n    while x in [7,8]:\n        return '07-09'\n    while x in [9,10]:\n        return '09-11'\n    while x in [11,12]:\n        return '11-13'\n    while x in [13,14]:\n        return '13-15'\n    while x in [15,16]:\n        return '15-17'\n    while x in [17,18]:\n        return '17-19'\n    while x in [19,20]:\n        return '19-21'\n    while x in [21,22]:\n        return '21-23'\n\n# 將hour轉換為時段\ndf['hour'] = df.hour.apply(tran_hour)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:53.696583Z","iopub.execute_input":"2024-04-21T10:00:53.696854Z","iopub.status.idle":"2024-04-21T10:00:53.786430Z","shell.execute_reply.started":"2024-04-21T10:00:53.696828Z","shell.execute_reply":"2024-04-21T10:00:53.785730Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 確認資料型別\ndf.info()","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:53.787933Z","iopub.execute_input":"2024-04-21T10:00:53.788318Z","iopub.status.idle":"2024-04-21T10:00:53.828266Z","shell.execute_reply.started":"2024-04-21T10:00:53.788278Z","shell.execute_reply":"2024-04-21T10:00:53.827440Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"確認每個特徵的value count，發現int型別的特徵，最多value的特徵僅4,333個value count，再一個600萬筆資料的資料集中，顯然非連續行變數。由此可斷定，本資料集的所有特徵，皆為Object型態的變數。","metadata":{}},{"cell_type":"code","source":"# len_of_feature_count = []\n# for i in df.columns[2:23].tolist():\n#     print(i, ':', len(df[i].astype(str).value_counts()))\n#     len_of_feature_count.append(len(df[i].astype(str).value_counts()))","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:53.829512Z","iopub.execute_input":"2024-04-21T10:00:53.829888Z","iopub.status.idle":"2024-04-21T10:00:53.833335Z","shell.execute_reply.started":"2024-04-21T10:00:53.829848Z","shell.execute_reply":"2024-04-21T10:00:53.832442Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 建立一個list，將需要轉換行別的特徵名稱存入該list\nneed_tran_feature = df.columns[2:4].tolist() + df.columns[13:23].tolist()\n\n# 依序將變數轉換為object型別\nfor i in need_tran_feature:\n    df[i] = df[i].astype(str)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:53.834694Z","iopub.execute_input":"2024-04-21T10:00:53.835052Z","iopub.status.idle":"2024-04-21T10:00:54.103610Z","shell.execute_reply.started":"2024-04-21T10:00:53.835013Z","shell.execute_reply":"2024-04-21T10:00:54.102669Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"code","source":"# obj_features = []\n\n# for i in range(len(len_of_feature_count)):\n#     if len_of_feature_count[i] > 10:\n#         obj_features.append(df.columns[2:23].tolist()[i])\n# obj_features","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:54.104828Z","iopub.execute_input":"2024-04-21T10:00:54.105089Z","iopub.status.idle":"2024-04-21T10:00:54.108711Z","shell.execute_reply.started":"2024-04-21T10:00:54.105063Z","shell.execute_reply":"2024-04-21T10:00:54.107830Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# df_describe = df.describe()\n# df_describe","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:54.111761Z","iopub.execute_input":"2024-04-21T10:00:54.112152Z","iopub.status.idle":"2024-04-21T10:00:54.118406Z","shell.execute_reply.started":"2024-04-21T10:00:54.112110Z","shell.execute_reply":"2024-04-21T10:00:54.117470Z"},"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":"","metadata":{}},{"cell_type":"code","source":"df.drop(['device_id', 'C14', 'C17', 'C19', 'C20', 'C21'], axis=1, inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:54.120998Z","iopub.execute_input":"2024-04-21T10:00:54.121338Z","iopub.status.idle":"2024-04-21T10:00:54.145803Z","shell.execute_reply.started":"2024-04-21T10:00:54.121297Z","shell.execute_reply":"2024-04-21T10:00:54.145107Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 對所有變數進行 one-hot 編碼\ndf = pd.get_dummies(df)\n\n# 依據處理過得df資料表，重新將train, test分割出來\ntrain = df[:train_len]\ntest = df[train_len:]","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:54.147317Z","iopub.execute_input":"2024-04-21T10:00:54.147705Z","iopub.status.idle":"2024-04-21T10:00:55.403404Z","shell.execute_reply.started":"2024-04-21T10:00:54.147666Z","shell.execute_reply":"2024-04-21T10:00:55.402653Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# # 將處理過的train, test 資料集匯出，避免每次重新的冗長處理時間。\n\n# train.to_csv('new_train.csv', index=False)\n# test.to_csv('new_test.csv', index=False)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:55.404778Z","iopub.execute_input":"2024-04-21T10:00:55.405157Z","iopub.status.idle":"2024-04-21T10:00:55.408871Z","shell.execute_reply.started":"2024-04-21T10:00:55.405118Z","shell.execute_reply":"2024-04-21T10:00:55.407892Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# # 讀取處理過的train, test 資料集，跳過冗長的重新執行處理時間。\n# train = pd.read_csv('new_train.csv')\n# test = pd.read_csv('new_test.csv')","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:55.410281Z","iopub.execute_input":"2024-04-21T10:00:55.410668Z","iopub.status.idle":"2024-04-21T10:00:55.418406Z","shell.execute_reply.started":"2024-04-21T10:00:55.410627Z","shell.execute_reply":"2024-04-21T10:00:55.417704Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"del df","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:55.419533Z","iopub.execute_input":"2024-04-21T10:00:55.419860Z","iopub.status.idle":"2024-04-21T10:00:55.430944Z","shell.execute_reply.started":"2024-04-21T10:00:55.419833Z","shell.execute_reply":"2024-04-21T10:00:55.430301Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"由於資料集非常的龐大，同時正向label的佔比僅佔全部資料17％左右，比例明顯失衡，需要具有強化加權功能的演算法。因此在此決定使用xgboost演算法，解決強化權重問題，同時運用GPU有效節省運算時間。\n\n為節省調參時間，實作預測模型之前，將先以建立100株決策樹，以Grid Search尋找最佳參數與重要特徵，最後再以lightGBM演算法建立模型。為了縮短決策樹的建制時間，將從負向label的資料中抽樣，與所有正向label的資料整併成一份各佔50％的資料集，來平衡權重問題。同時也因為正反label比例平衡，將會採用ROC_AUC 分數來進行調參。","metadata":{}},{"cell_type":"code","source":"# 從train資料集中，標籤為0的資料中，隨機抽樣與標籤為1一樣多的數量，並將其結合成正反標籤佔筆各佔50％的資料集\npre_X = train[train['click'] == 0].sample(n=len(train[train['click'] == 1]), random_state=111)\npre_X = pd.concat([pre_X, train[train['click'] == 1]]).sample(frac=1)\npre_y = pre_X[['click']]\npre_X.drop(['click'], axis=1, inplace=True)\ntest.drop(['click'], axis=1, inplace=True)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:55.431974Z","iopub.execute_input":"2024-04-21T10:00:55.432262Z","iopub.status.idle":"2024-04-21T10:00:56.523985Z","shell.execute_reply.started":"2024-04-21T10:00:55.432236Z","shell.execute_reply":"2024-04-21T10:00:56.523115Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"from sklearn.model_selection import GridSearchCV\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.model_selection import train_test_split\n\n# 將新的資料集分割為訓練集與驗證集\npre_X_train, pre_X_test, pre_y_train, pre_y_test = train_test_split(pre_X, pre_y, test_size=0.20, stratify=pre_y, random_state=1)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:56.525065Z","iopub.execute_input":"2024-04-21T10:00:56.525385Z","iopub.status.idle":"2024-04-21T10:00:56.718233Z","shell.execute_reply.started":"2024-04-21T10:00:56.525356Z","shell.execute_reply":"2024-04-21T10:00:56.717175Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 執行Grid Search調參，建立100棵樹來取得最佳參數\nparams = {\"criterion\":[\"gini\", \"entropy\"], \"max_depth\":range(1,20)}\ngrid_search = GridSearchCV(DecisionTreeClassifier(), param_grid=params, scoring='roc_auc', cv=2, verbose=1, n_jobs=-1)\ngrid_search.fit(pre_X_train, pre_y_train)\ngrid_search.best_score_, grid_search.best_estimator_, grid_search.best_params_","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:00:56.719411Z","iopub.execute_input":"2024-04-21T10:00:56.719698Z","iopub.status.idle":"2024-04-21T10:01:17.469851Z","shell.execute_reply.started":"2024-04-21T10:00:56.719669Z","shell.execute_reply":"2024-04-21T10:01:17.468936Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 依據Grid Search的結果建立一個決策樹模型，並fit完整資料 (前置資料)\ntree = grid_search.best_estimator_\ntree.fit(pre_X,pre_y)\n\n# 輸出重要特徵，並依特徵之重要性排序\nfeature_importances = pd.DataFrame(tree.feature_importances_)\nfeature_importances.index = pre_X_train.columns\nfeature_importances = feature_importances.sort_values(0,ascending=False)\nfeature_importances","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:17.470990Z","iopub.execute_input":"2024-04-21T10:01:17.471316Z","iopub.status.idle":"2024-04-21T10:01:18.088405Z","shell.execute_reply.started":"2024-04-21T10:01:17.471286Z","shell.execute_reply":"2024-04-21T10:01:18.087419Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 調整前置作業訓練集與驗證集，將特徵依特徵重要性縮減為重要性排名之1/3\npre_X_train = pre_X_train[feature_importances.index[:int(len(feature_importances)/3)]]\npre_X_test = pre_X_test[feature_importances.index[:int(len(feature_importances)/3)]]","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:18.089606Z","iopub.execute_input":"2024-04-21T10:01:18.089878Z","iopub.status.idle":"2024-04-21T10:01:18.117631Z","shell.execute_reply.started":"2024-04-21T10:01:18.089851Z","shell.execute_reply":"2024-04-21T10:01:18.116618Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 使用33％的重要特徵重新進行Grid Search調參\nparams = {\"criterion\":[\"gini\", \"entropy\"], \"max_depth\":range(1,12)}\ngrid_search = GridSearchCV(DecisionTreeClassifier(), param_grid=params, scoring='roc_auc', cv=2, verbose=1, n_jobs=-1)\ngrid_search.fit(pre_X_train, pre_y_train)\ngrid_search.best_score_, grid_search.best_estimator_, grid_search.best_params_","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:18.118904Z","iopub.execute_input":"2024-04-21T10:01:18.119199Z","iopub.status.idle":"2024-04-21T10:01:21.905449Z","shell.execute_reply.started":"2024-04-21T10:01:18.119170Z","shell.execute_reply":"2024-04-21T10:01:21.904467Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 調整前置作業完整資料集，將特徵依特徵重要性縮減為重要性排名之1/3\npre_X = pre_X[feature_importances.index[:int(len(feature_importances)/3)]]\n\n# 依據Grid Search的結果建立一個決策樹模型，並fit完整資料 (前置資料)\ntree = grid_search.best_estimator_\ntree.fit(pre_X,pre_y)\n\ndef gbmBoostClassifier(iterations,learning_rate,task_type,loss_function):\n    return CatBoostClassifier(iterations,learning_rate,task_type,loss_function)\n    \n\n# 輸出重要特徵，並依特徵之重要性排序\nfeature_importances = pd.DataFrame(tree.feature_importances_)\nfeature_importances.index = pre_X_train.columns\nfeature_importances = feature_importances.sort_values(0,ascending=False)\nfeature_importances","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:21.906927Z","iopub.execute_input":"2024-04-21T10:01:21.907322Z","iopub.status.idle":"2024-04-21T10:01:22.155427Z","shell.execute_reply.started":"2024-04-21T10:01:21.907282Z","shell.execute_reply":"2024-04-21T10:01:22.154569Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# 最終預測模型之特徵，將採用特徵值 .005以上的變數\nfeature_len = len(feature_importances[feature_importances[feature_importances.columns[0]] > 0.005])\n\n# 調整最終完整Train Set 與 Test set之特徵\ny = train[['click']]\nX = train[feature_importances[:feature_len].index]\ntest = test[feature_importances[:feature_len].index]","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:22.156585Z","iopub.execute_input":"2024-04-21T10:01:22.156847Z","iopub.status.idle":"2024-04-21T10:01:22.178734Z","shell.execute_reply.started":"2024-04-21T10:01:22.156821Z","shell.execute_reply":"2024-04-21T10:01:22.178077Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_count = int(len(train) * 0.9)\nX_train = train.iloc[:train_count,2:]\ny_train = train.iloc[:train_count,1]\nX_val = train.iloc[train_count:,2:]\ny_val = train.iloc[train_count:,1]\nX_val.head()\ngbm_features = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]\n","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:22.179633Z","iopub.execute_input":"2024-04-21T10:01:22.179876Z","iopub.status.idle":"2024-04-21T10:01:22.521334Z","shell.execute_reply.started":"2024-04-21T10:01:22.179851Z","shell.execute_reply":"2024-04-21T10:01:22.520482Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model = CatBoostClassifier(\n    iterations=50,\n    learning_rate=0.5,\n    task_type='GPU',\n    loss_function='Logloss'\n)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:22.522597Z","iopub.execute_input":"2024-04-21T10:01:22.522874Z","iopub.status.idle":"2024-04-21T10:01:22.527698Z","shell.execute_reply.started":"2024-04-21T10:01:22.522845Z","shell.execute_reply":"2024-04-21T10:01:22.526818Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.fit(\n    X_train, y_train,\n    eval_set=(X_val, y_val),\n    cat_features=gbm_features,\n    verbose=10,\n)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:22.528886Z","iopub.execute_input":"2024-04-21T10:01:22.529205Z","iopub.status.idle":"2024-04-21T10:01:24.237605Z","shell.execute_reply.started":"2024-04-21T10:01:22.529165Z","shell.execute_reply":"2024-04-21T10:01:24.236299Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"model.get_feature_importance(prettified=True)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:24.238512Z","iopub.status.idle":"2024-04-21T10:01:24.238986Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"X_test = test.iloc[:, 1:]\nX_test.head()","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:24.240328Z","iopub.status.idle":"2024-04-21T10:01:24.240949Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"y_test = model.predict(X_test, \n                        prediction_type='Probability', \n                        ntree_start=0, ntree_end=model.get_best_iteration(), \n                        thread_count=-1, verbose=None)","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:24.242088Z","iopub.status.idle":"2024-04-21T10:01:24.242705Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"id_test = test.iloc[:, 0:1]\nid_test","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:24.243919Z","iopub.status.idle":"2024-04-21T10:01:24.244540Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"id_test.join(pd.DataFrame(y_test)) ","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:24.245740Z","iopub.status.idle":"2024-04-21T10:01:24.246362Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"submission_df = pd.read_csv(\"/kaggle/input/avazu-ctr-prediction/sampleSubmission.gz\")","metadata":{"execution":{"iopub.status.busy":"2024-04-21T10:01:24.247407Z","iopub.status.idle":"2024-04-21T10:01:24.248013Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"本次提交分数 .0.40985；","metadata":{}}]}