{"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"},"colab":{"provenance":[]},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":103436,"databundleVersionId":12476472,"sourceType":"competition"}],"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip install category_encoders\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import StratifiedKFold, train_test_split, RandomizedSearchCV\nfrom sklearn.metrics import f1_score, classification_report\nfrom imblearn.under_sampling import RandomUnderSampler\nfrom lightgbm import LGBMClassifier\nfrom category_encoders import TargetEncoder\n","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"MV5JaOUqmJed","outputId":"612e2b67-a37f-4cba-a27b-9cf36c8e001d"},"outputs":[{"output_type":"stream","name":"stdout","text":["Collecting category_encoders\n","  Downloading category_encoders-2.8.1-py3-none-any.whl.metadata (7.9 kB)\n","Requirement already satisfied: numpy>=1.14.0 in /usr/local/lib/python3.11/dist-packages (from category_encoders) (2.0.2)\n","Requirement already satisfied: pandas>=1.0.5 in /usr/local/lib/python3.11/dist-packages (from category_encoders) (2.2.2)\n","Requirement already satisfied: patsy>=0.5.1 in /usr/local/lib/python3.11/dist-packages (from category_encoders) (1.0.1)\n","Requirement already satisfied: scikit-learn>=1.6.0 in /usr/local/lib/python3.11/dist-packages (from category_encoders) (1.6.1)\n","Requirement already satisfied: scipy>=1.0.0 in /usr/local/lib/python3.11/dist-packages (from category_encoders) (1.15.3)\n","Requirement already satisfied: statsmodels>=0.9.0 in /usr/local/lib/python3.11/dist-packages (from category_encoders) (0.14.4)\n","Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from pandas>=1.0.5->category_encoders) (2.9.0.post0)\n","Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.11/dist-packages (from pandas>=1.0.5->category_encoders) (2025.2)\n","Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.11/dist-packages (from pandas>=1.0.5->category_encoders) (2025.2)\n","Requirement already satisfied: joblib>=1.2.0 in /usr/local/lib/python3.11/dist-packages (from scikit-learn>=1.6.0->category_encoders) (1.5.1)\n","Requirement already satisfied: threadpoolctl>=3.1.0 in /usr/local/lib/python3.11/dist-packages (from scikit-learn>=1.6.0->category_encoders) (3.6.0)\n","Requirement already satisfied: packaging>=21.3 in /usr/local/lib/python3.11/dist-packages (from statsmodels>=0.9.0->category_encoders) (24.2)\n","Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.8.2->pandas>=1.0.5->category_encoders) (1.17.0)\n","Downloading category_encoders-2.8.1-py3-none-any.whl (85 kB)\n","\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m85.7/85.7 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n","\u001b[?25hInstalling collected packages: category_encoders\n","Successfully installed category_encoders-2.8.1\n"]}],"execution_count":15},{"cell_type":"code","source":"files = [\n    '/kaggle/input/ds-108-p-21-assigment-06/delay_4_6_CONDITION_PRODUCT_SUPPLIER.csv',\n    '/kaggle/input/ds-108-p-21-assigment-06/delay_7_9_CONDITION_PRODUCT_SUPPLIER.csv',\n    '/kaggle/input/ds-108-p-21-assigment-06/not_delay_4_6_CONDITION_PRODUCT_SUPPLIER.csv',\n    '/kaggle/input/ds-108-p-21-assigment-06/not_delay_7_9_CONDITION_PRODUCT_SUPPLIER.csv',\n]\ndf_main = pd.concat([pd.read_csv(f) for f in files], ignore_index=True)\n","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"F-2EdjYukJGi","outputId":"db4c87bd-b667-43ba-a8fb-172e9d247e4c"},"outputs":[{"output_type":"stream","name":"stderr","text":["<ipython-input-16-1652975536>:11: DtypeWarning: Columns (10,42) have mixed types. Specify dtype option on import or set low_memory=False.\n","  df_list = [pd.read_csv(f) for f in file_list]\n","<ipython-input-16-1652975536>:11: DtypeWarning: Columns (34) have mixed types. Specify dtype option on import or set low_memory=False.\n","  df_list = [pd.read_csv(f) for f in file_list]\n"]}],"execution_count":16},{"cell_type":"code","source":"# Loại bỏ các cột không cần thiết\ncols_to_drop = ['REASON_CD', 'QTUF_RCV_NO', 'SOUF_RCV_NO', 'SUBSIDIARY_CD', 'GLOBAL_NO',\n                'SPECIAL DIV', 'SUPPLIER INV AMOUNT', 'Stock class', 'ALLOCATION QTY']\ndf_main = df_main.drop(columns=[col for col in cols_to_drop if col in df_main.columns])\n\n# Chuyển kiểu và xử lý thiếu\ndf_main['SUPPLIER_DIV'] = df_main['SUPPLIER_DIV'].astype('Int64')\n# Chuyển sang string trước để xử lý các giá trị không phải số\ndf_main['OTHER AREA SHIP DIV'] = df_main['OTHER AREA SHIP DIV'].astype(str)\n# Thay thế các giá trị không phải số bằng '0'\ndf_main['OTHER AREA SHIP DIV'] = df_main['OTHER AREA SHIP DIV'].str.replace(r'\\D', '0', regex=True)\n# Điền các giá trị rỗng còn lại (nếu có, sau khi thay thế) bằng '0'\ndf_main['OTHER AREA SHIP DIV'] = df_main['OTHER AREA SHIP DIV'].fillna('0')\n# Chuyển sang kiểu số nguyên\ndf_main['OTHER AREA SHIP DIV'] = df_main['OTHER AREA SHIP DIV'].astype(int)\n\n\n# Xử lý ngày tháng\ndf_main['Order date'] = pd.to_datetime(df_main['Order date'], errors='coerce')\ndf_main['VSD'] = pd.to_datetime(df_main['VSD'], errors='coerce')\n\n# Tạo đặc trưng thời gian\ndf_main['SO_DAY'] = df_main['VSD'].dt.day\ndf_main['SO_WEEKDAY'] = df_main['VSD'].dt.weekday + 1\ndf_main['DELIVERY_GAP'] = (df_main['VSD'] - df_main['Order date']).dt.days","metadata":{"id":"AK_7zGnKmXRt"},"outputs":[],"execution_count":17},{"cell_type":"code","source":"# Với dữ liệu số: gán -1\nfor col in df_main.columns:\n    if df_main[col].dtype in ['float64', 'int64'] and df_main[col].isnull().any():\n        df_main[col] = df_main[col].fillna(-1)\n\n# Với dữ liệu dạng object: gán 'unknown'\nfor col in df_main.columns:\n    if df_main[col].dtype == 'object' and df_main[col].isnull().any():\n        df_main[col] = df_main[col].fillna('unknown')\n","metadata":{"id":"By-VbVvemiMB"},"outputs":[],"execution_count":18},{"cell_type":"code","source":"features = [\n    'DELI_DIV', 'DIRECT SHIP FLG', 'WEIGHT PER PIECE', 'PRODUCT_CD', 'SUPPLIER_CD',\n    'CUST_CD', 'SO QTY', 'PACKING RANK', 'PRODUCT ATTRIBUTION', 'Ship Mode',\n    'SO_DAY', 'SO_WEEKDAY', 'DELIVERY_GAP'\n]\n\nX_all = df_main[features].copy()\ny_all = df_main['label']\n\nundersample = RandomUnderSampler(sampling_strategy=0.1, random_state=2024)\nX_balanced, y_balanced = undersample.fit_resample(X_all, y_all)\n\nprint(\"Tỉ lệ sau khi undersample:\")\nprint(y_balanced.value_counts(normalize=True))\n","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"i6KIWuxim44S","outputId":"793bb7f2-e701-47e5-f5f1-6d9a88bc72ed"},"outputs":[{"output_type":"stream","name":"stdout","text":["Tỉ lệ sau khi undersample:\n","label\n","0    0.909091\n","1    0.090909\n","Name: proportion, dtype: float64\n"]}],"execution_count":19},{"cell_type":"code","source":"# Chuyển toàn bộ cột object thành category (LightGBM hiểu được)\nfor col in X_balanced.select_dtypes(include='object').columns:\n    X_balanced[col] = X_balanced[col].astype('category')\n","metadata":{"id":"o24yH5_7oqrF"},"outputs":[],"execution_count":20},{"cell_type":"code","source":"cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=2024)\nmodel = LGBMClassifier(\n    n_estimators=400,\n    learning_rate=0.07,\n    num_leaves=31,\n    random_state=42\n)\n\nf1_scores = []\nfor fold, (train_idx, val_idx) in enumerate(cv.split(X_balanced, y_balanced)):\n    X_tr, X_val = X_balanced.iloc[train_idx], X_balanced.iloc[val_idx]\n    y_tr, y_val = y_balanced.iloc[train_idx], y_balanced.iloc[val_idx]\n\n    model.fit(X_tr, y_tr, eval_set=[(X_val, y_val)], early_stopping_rounds=30, verbose=0)\n    preds = model.predict(X_val)\n    score = f1_score(y_val, preds)\n    f1_scores.append(score)\n    print(f\"Fold {fold+1} F1-score: {score:.4f}\")\n\nprint(f\" Trung bình F1-score: {np.mean(f1_scores):.4f}\")\n","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"kTA1Nenmm8nz","outputId":"13564b72-765a-45c0-a789-21084402d166"},"outputs":[{"output_type":"stream","name":"stdout","text":["Fitting 3 folds for each of 10 candidates, totalling 30 fits\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.030005 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.029350 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.029261 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.050746 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.031729 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.030267 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.029865 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.036623 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing col-wise multi-threading, the overhead of testing was 0.054692 seconds.\n","You can set `force_col_wise=true` to remove the overhead.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.029556 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing col-wise multi-threading, the overhead of testing was 0.056805 seconds.\n","You can set `force_col_wise=true` to remove the overhead.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.032666 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing col-wise multi-threading, the overhead of testing was 0.076158 seconds.\n","You can set `force_col_wise=true` to remove the overhead.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.029241 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.028498 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.045789 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.031257 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.071569 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.030062 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.034181 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.032211 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.028402 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.042281 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.028658 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.028043 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.028782 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.028749 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239666\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.028178 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1503\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302568\n","[LightGBM] [Info] Start training from score -2.302568\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23966, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.031564 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 263633, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090907 -> initscore=-2.302614\n","[LightGBM] [Info] Start training from score -2.302614\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 23967, number of negative: 239667\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.029108 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1511\n","[LightGBM] [Info] Number of data points in the train set: 263634, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090910 -> initscore=-2.302573\n","[LightGBM] [Info] Start training from score -2.302573\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n","[LightGBM] [Info] Number of positive: 35950, number of negative: 359500\n","[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.048074 seconds.\n","You can set `force_row_wise=true` to remove the overhead.\n","And if memory is not enough, you can set `force_col_wise=true`.\n","[LightGBM] [Info] Total Bins 1506\n","[LightGBM] [Info] Number of data points in the train set: 395450, number of used features: 13\n","[LightGBM] [Info] [binary:BoostFromScore]: pavg=0.090909 -> initscore=-2.302585\n","[LightGBM] [Info] Start training from score -2.302585\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n","Best parameters found:  {'num_leaves': 63, 'n_estimators': 400, 'min_child_samples': 20, 'max_depth': 8, 'learning_rate': 0.1}\n"]}],"execution_count":21},{"cell_type":"code","source":"pilot = pd.read_csv('/kaggle/input/ds-108-p-21-assigment-06/PILOT_10.csv')\nsample_solution = pd.read_csv('/kaggle/input/ds-108-p-21-assigment-06/sample_Solution.csv')\n\n# Xử lý tương tự train\npilot['SUPPLIER_DIV'] = pilot['SUPPLIER_DIV'].astype('Int64')\npilot['OTHER AREA SHIP DIV'] = pilot['OTHER AREA SHIP DIV'].fillna('0').astype(int)\npilot['Order date'] = pd.to_datetime(pilot['Order date'], errors='coerce')\npilot['VSD'] = pd.to_datetime(pilot['VSD'], errors='coerce')\npilot['SO_DAY'] = pilot['VSD'].dt.day\npilot['SO_WEEKDAY'] = pilot['VSD'].dt.weekday + 1\npilot['DELIVERY_GAP'] = (pilot['VSD'] - pilot['Order date']).dt.days\n\n# Xử lý thiếu\nfor col in pilot.columns:\n    if pilot[col].dtype in ['float64', 'int64'] and pilot[col].isnull().any():\n        pilot[col] = pilot[col].fillna(-1)\n    if pilot[col].dtype == 'object' and pilot[col].isnull().any():\n        pilot[col] = pilot[col].fillna('unknown')\n\nfor col in X_pilot.select_dtypes(include='object').columns:\n    X_pilot[col] = X_pilot[col].astype('category')\n\n# Dự đoán\nX_pilot = pilot[[col for col in features if col in pilot.columns]]\npilot_pred = model.predict(X_pilot)\n\n# Xuất kết quả\nsubmission = sample_solution.copy()\nsubmission['label'] = pilot_pred\nsubmission.to_csv(\"submission_final.csv\", index=False)\n\nprint(\"File submission_final.csv đã được tạo.\")\n","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"DH79gnHApfd-","outputId":"3e87d9ed-693c-4572-903e-db9cfb28f505"},"outputs":[{"output_type":"stream","name":"stdout","text":["✅ File submission_final.csv đã được tạo.\n"]}],"execution_count":23}]}