a b/03-Experiments/06-LightBGM_With_Focal_Loss.ipynb
1
{
2
 "cells": [
3
  {
4
   "cell_type": "markdown",
5
   "metadata": {},
6
   "source": [
7
    "Gloabl Experiment Setup"
8
   ]
9
  },
10
  {
11
   "cell_type": "code",
12
   "execution_count": 1,
13
   "metadata": {},
14
   "outputs": [
15
    {
16
     "data": {
17
      "text/plain": [
18
       "<Experiment: artifact_location='/Users/arham/Downloads/Projects/03-Experiments/mlruns/4', creation_time=1714075083201, experiment_id='4', last_update_time=1714075083201, lifecycle_stage='active', name='LightGBM', tags={}>"
19
      ]
20
     },
21
     "execution_count": 1,
22
     "metadata": {},
23
     "output_type": "execute_result"
24
    }
25
   ],
26
   "source": [
27
    "import mlflow\n",
28
    "# Set the MLflow tracking URI to a new SQLite URI\n",
29
    "mlflow.set_tracking_uri(\"sqlite:///new_mlflow.db\")\n",
30
    "mlflow.set_experiment(\"LightGBM\")"
31
   ]
32
  },
33
  {
34
   "cell_type": "code",
35
   "execution_count": 17,
36
   "metadata": {},
37
   "outputs": [],
38
   "source": [
39
    "import pandas as pd\n",
40
    "from sklearn.model_selection import train_test_split\n",
41
    "import matplotlib.pyplot as plt\n",
42
    "import seaborn as sns\n",
43
    "import numpy as np\n",
44
    "from sklearn.preprocessing import MinMaxScaler\n",
45
    "from sklearn.preprocessing import PolynomialFeatures\n",
46
    "import lightgbm as lgb\n",
47
    "from sklearn.metrics import accuracy_score\n",
48
    "\n",
49
    "def load_data(path):\n",
50
    "    df = pd.read_csv(path)\n",
51
    "    train_df, test_df = train_test_split(df, test_size=0.35, random_state=42)\n",
52
    "    train_df, val_df,  = train_test_split(train_df, test_size=0.20, random_state=42)\n",
53
    "    train_df = train_df.drop(['id'], axis=1).drop_duplicates().reset_index(drop=True)\n",
54
    "    test_df = test_df.drop(['id'], axis=1).drop_duplicates().reset_index(drop=True)\n",
55
    "    val_df = val_df.drop(['id'], axis=1).drop_duplicates().reset_index(drop=True)\n",
56
    "    return train_df, val_df, test_df\n",
57
    "\n",
58
    "def encode_target(train):\n",
59
    "    target_key = {'Insufficient_Weight': 0, 'Normal_Weight': 1, 'Overweight_Level_I': 2, 'Overweight_Level_II': 3, 'Obesity_Type_I': 4,'Obesity_Type_II' : 5, 'Obesity_Type_III': 6}\n",
60
    "    train['NObeyesdad'] = train['NObeyesdad'].map(target_key)\n",
61
    "    return train\n",
62
    "\n",
63
    "def make_gender_binary(train):\n",
64
    "    train['Gender'] = train['Gender'].map({'Male':0, 'Female':1})\n",
65
    "\n",
66
    "def datatypes(train):\n",
67
    "    train['Weight'] = train['Weight'].astype(float)\n",
68
    "    train['Age'] = train['Age'].astype(float)\n",
69
    "    train['Height'] = train['Height'].astype(float)\n",
70
    "    return train\n",
71
    "\n",
72
    "# def age_binning(train_df):\n",
73
    "#     train_df['Age_Group'] = pd.cut(train_df['Age'], bins=[0, 20, 30, 40, 50, train_df['Age'].max()], labels=['0-20', '21-30', '31-40', '41-50', '50+'])\n",
74
    "#     return train_df\n",
75
    "\n",
76
    "def age_binning(df):\n",
77
    "    age_groups = []\n",
78
    "    for age in df['Age']:\n",
79
    "        if age <= 20:\n",
80
    "            age_group = 1\n",
81
    "        elif age <= 30:\n",
82
    "            age_group = 2\n",
83
    "        elif age <= 40:\n",
84
    "            age_group = 3\n",
85
    "        elif age <= 50:\n",
86
    "            age_group = 4\n",
87
    "        else:\n",
88
    "            age_group = 5\n",
89
    "        age_groups.append(age_group)\n",
90
    "    df['Age_Group'] = age_groups\n",
91
    "    return df\n",
92
    "\n",
93
    "def age_scaling_log(train_df):\n",
94
    "    train_df['Age'] = train_df['Age'].astype(float)\n",
95
    "    train_df['Log_Age'] = np.log1p(train_df['Age'])\n",
96
    "    return train_df\n",
97
    "\n",
98
    "def age_scaling_minmax(train_df):\n",
99
    "    train_df['Age'] = train_df['Age'].astype(float)\n",
100
    "    scaler_age = MinMaxScaler()\n",
101
    "    train_df['Scaled_Age'] = scaler_age.fit_transform(train_df['Age'].values.reshape(-1, 1))\n",
102
    "    return train_df, scaler_age\n",
103
    "\n",
104
    "def weight_scaling_log(train_df):\n",
105
    "    train_df['Weight'] = train_df['Weight'].astype(float)\n",
106
    "    train_df['Log_Weight'] = np.log1p(train_df['Weight'])\n",
107
    "    return train_df\n",
108
    "\n",
109
    "def weight_scaling_minmax(train_df):\n",
110
    "    train_df['Weight'] = train_df['Weight'].astype(float)\n",
111
    "    scaler_weight = MinMaxScaler()\n",
112
    "    train_df['Scaled_Weight'] = scaler_weight.fit_transform(train_df['Weight'].values.reshape(-1, 1))\n",
113
    "    return train_df, scaler_weight\n",
114
    "\n",
115
    "def height_scaling_log(train_df):\n",
116
    "    train_df['Log_Height'] = np.log1p(train_df['Height'])\n",
117
    "    return train_df\n",
118
    "\n",
119
    "def height_scaling_minmax(train_df):\n",
120
    "    scaler_height = MinMaxScaler()\n",
121
    "    train_df['Scaled_Height'] = scaler_height.fit_transform(train_df['Height'].values.reshape(-1, 1))\n",
122
    "    return train_df, scaler_height\n",
123
    "\n",
124
    "def make_gender_binary(train):\n",
125
    "    train['Gender'] = train['Gender'].map({'Female':1, 'Male':0})\n",
126
    "    return train\n",
127
    "\n",
128
    "def fix_binary_columns(train):\n",
129
    "    Binary_Cols = ['family_history_with_overweight','FAVC', 'SCC','SMOKE']\n",
130
    "    # if yes then 1 else 0\n",
131
    "    for col in Binary_Cols:\n",
132
    "        train[col] = train[col].map({'yes': 1, 'no': 0})\n",
133
    "    return train\n",
134
    "\n",
135
    "def freq_cat_cols(train):\n",
136
    "    # One hot encoding\n",
137
    "    cat_cols = ['CAEC', 'CALC']\n",
138
    "    for col in cat_cols:\n",
139
    "        train[col] = train[col].map({'no': 0, 'Sometimes': 1, 'Frequently': 2, 'Always': 3})\n",
140
    "    return train\n",
141
    "\n",
142
    "def Mtrans(train):\n",
143
    "    \"\"\"\n",
144
    "    Public_Transportation    8692\n",
145
    "    Automobile               1835\n",
146
    "    Walking                   231\n",
147
    "    Motorbike                  19\n",
148
    "    Bike                       16\n",
149
    "    \"\"\"\n",
150
    "    # train['MTRANS'] = train['MTRANS'].map({'Public_Transportation': 3, 'Automobile': 5, 'Walking': 1, 'Motorbike': 4, 'Bike': 2})\n",
151
    "    # dummify column\n",
152
    "    train = pd.get_dummies(train, columns=['MTRANS'])\n",
153
    "    return train\n",
154
    "\n",
155
    "\n",
156
    "def other_features(train):\n",
157
    "    train['BMI'] = train['Weight'] / (train['Height'] ** 2)\n",
158
    "    # train['Age'*'Gender'] = train['Age'] * train['Gender']\n",
159
    "    polynomial_features = PolynomialFeatures(degree=2)\n",
160
    "    X_poly = polynomial_features.fit_transform(train[['Age', 'BMI']])\n",
161
    "    poly_features_df = pd.DataFrame(X_poly, columns=['Age^2', 'Age^3', 'BMI^2', 'Age * BMI', 'Age * BMI^2', 'Age^2 * BMI^2'])\n",
162
    "    train = pd.concat([train, poly_features_df], axis=1)\n",
163
    "    return train\n",
164
    "\n",
165
    "\n",
166
    "def test_pipeline(test, scaler_age, scaler_weight, scaler_height):\n",
167
    "    test = datatypes(test)\n",
168
    "    test = encode_target(test)\n",
169
    "    test = age_binning(test)\n",
170
    "    test = age_scaling_log(test)\n",
171
    "    test['Scaled_Age'] = scaler_age.transform(test['Age'].values.reshape(-1, 1))\n",
172
    "    test = weight_scaling_log(test)\n",
173
    "    test['Scaled_Weight'] = scaler_weight.transform(test['Weight'].values.reshape(-1, 1))\n",
174
    "    test = height_scaling_log(test)\n",
175
    "    test['Scaled_Height'] = scaler_height.transform(test['Height'].values.reshape(-1, 1))\n",
176
    "    test = make_gender_binary(test)\n",
177
    "    test = fix_binary_columns(test)\n",
178
    "    test = freq_cat_cols(test)\n",
179
    "    test = Mtrans(test)\n",
180
    "    test = other_features(test)\n",
181
    "\n",
182
    "    return test\n",
183
    "\n",
184
    "def train_model(params, X_train, y_train):\n",
185
    "    lgb_train = lgb.Dataset(X_train, y_train)\n",
186
    "    model = lgb.train(params, lgb_train, num_boost_round=1000)\n",
187
    "    return model\n",
188
    "\n",
189
    "def evaluate_model(model, X_val, y_val):\n",
190
    "    y_pred = model.predict(X_val)\n",
191
    "    y_pred = [np.argmax(y) for y in y_pred]\n",
192
    "    accuracy = accuracy_score(y_val, y_pred)\n",
193
    "    return accuracy\n",
194
    "\n",
195
    "def objective(trial, X_train, y_train):\n",
196
    "    params = {\n",
197
    "        'objective': 'multiclass',\n",
198
    "        'num_class': 7,\n",
199
    "        'metric': 'multi_logloss',\n",
200
    "        'boosting_type': 'gbdt',\n",
201
    "        'learning_rate': trial.suggest_loguniform('learning_rate', 0.005, 0.5),\n",
202
    "        'num_leaves': trial.suggest_int('num_leaves', 10, 1000),\n",
203
    "        'max_depth': trial.suggest_int('max_depth', -1, 20),\n",
204
    "        'bagging_fraction': trial.suggest_uniform('bagging_fraction', 0.6, 0.95),\n",
205
    "        'feature_fraction': trial.suggest_uniform('feature_fraction', 0.6, 0.95),\n",
206
    "        'verbosity': -1\n",
207
    "    }\n",
208
    "\n",
209
    "    n_splits = 5\n",
210
    "    kf = StratifiedKFold(n_splits=n_splits, shuffle=True, random_state=42)\n",
211
    "    scores = []\n",
212
    "\n",
213
    "    for train_index, val_index in kf.split(X_train, y_train):\n",
214
    "        X_tr, X_val = X_train.iloc[train_index], X_train.iloc[val_index]\n",
215
    "        y_tr, y_val = y_train.iloc[train_index], y_train.iloc[val_index]\n",
216
    "\n",
217
    "        model = train_model(params, X_tr, y_tr)\n",
218
    "        accuracy = evaluate_model(model, X_val, y_val)\n",
219
    "        scores.append(accuracy)\n",
220
    "\n",
221
    "    return np.mean(scores)\n",
222
    "\n",
223
    "def optimize_hyperparameters(X_train, y_train, n_trials=2):\n",
224
    "    study = optuna.create_study(direction='maximize')\n",
225
    "    study.optimize(lambda trial: objective(trial, X_train, y_train), n_trials=n_trials)\n",
226
    "    return study.best_params\n",
227
    "\n",
228
    "def New_Test_Instances_Pipeline(test, scaler_age, scaler_weight, scaler_height):\n",
229
    "    test = datatypes(test)\n",
230
    "    test = age_binning(test)\n",
231
    "    test = age_scaling_log(test)\n",
232
    "    test['Scaled_Age'] = scaler_age.transform(test['Age'].values.reshape(-1, 1))\n",
233
    "    test = weight_scaling_log(test)\n",
234
    "    test['Scaled_Weight'] = scaler_weight.transform(test['Weight'].values.reshape(-1, 1))\n",
235
    "    test = height_scaling_log(test)\n",
236
    "    test['Scaled_Height'] = scaler_height.transform(test['Height'].values.reshape(-1, 1))\n",
237
    "    test = make_gender_binary(test)\n",
238
    "    test = fix_binary_columns(test)\n",
239
    "    test = freq_cat_cols(test)\n",
240
    "    test = Mtrans(test)\n",
241
    "    test = other_features(test)\n",
242
    "\n",
243
    "    return test"
244
   ]
245
  },
246
  {
247
   "cell_type": "markdown",
248
   "metadata": {},
249
   "source": [
250
    "Experiment"
251
   ]
252
  },
253
  {
254
   "cell_type": "code",
255
   "execution_count": 11,
256
   "metadata": {},
257
   "outputs": [],
258
   "source": [
259
    "path = '/Users/arham/Downloads/Projects/01-Dataset/01-Data-for-model-building/train.csv'\n",
260
    "train_df, val_df, test_df = load_data(path)\n",
261
    "\n",
262
    "# train test val pipeline\n",
263
    "train_df = datatypes(train_df)\n",
264
    "train_df = encode_target(train_df)\n",
265
    "train_df = age_binning(train_df)\n",
266
    "train_df, scaler_age = age_scaling_minmax(train_df)\n",
267
    "train_df = age_scaling_log(train_df)\n",
268
    "train_df, scaler_weight = weight_scaling_minmax(train_df)\n",
269
    "train_df = weight_scaling_log(train_df)\n",
270
    "train_df, scaler_height = height_scaling_minmax(train_df)\n",
271
    "train_df = height_scaling_log(train_df)\n",
272
    "train_df = make_gender_binary(train_df)\n",
273
    "train_df = fix_binary_columns(train_df)\n",
274
    "train_df = freq_cat_cols(train_df)\n",
275
    "train_df = Mtrans(train_df)\n",
276
    "train_df = other_features(train_df)\n",
277
    "val_df = test_pipeline(val_df, scaler_age, scaler_weight, scaler_height)\n",
278
    "test_df = test_pipeline(test_df, scaler_age, scaler_weight, scaler_height)\n",
279
    "\n",
280
    "\n",
281
    "# target & predictors\n",
282
    "Target = 'NObeyesdad'\n",
283
    "features = ['Gender', 'Age', 'Height', 'Weight', 'family_history_with_overweight',\n",
284
    "       'FAVC', 'FCVC', 'NCP', 'CAEC', 'SMOKE', 'CH2O', 'SCC', 'FAF', 'TUE',\n",
285
    "       'CALC', 'Age_Group', \n",
286
    "       'MTRANS_Automobile', 'MTRANS_Bike', 'MTRANS_Motorbike',\n",
287
    "       'MTRANS_Public_Transportation', 'MTRANS_Walking', 'BMI', 'Age^2',\n",
288
    "       'Age^3', 'BMI^2', 'Age * BMI', 'Age * BMI^2', 'Age^2 * BMI^2'] \n",
289
    "        #'Scaled_Age', 'Log_Age', 'Scaled_Weight', 'Log_Weight', 'Scaled_Height', 'Log_Height',\n"
290
   ]
291
  },
292
  {
293
   "cell_type": "code",
294
   "execution_count": 13,
295
   "metadata": {},
296
   "outputs": [
297
    {
298
     "name": "stderr",
299
     "output_type": "stream",
300
     "text": [
301
      "/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/lightgbm/engine.py:172: UserWarning: Found `num_iterations` in params. Will use it instead of argument\n",
302
      "  _log_warning(f\"Found `{alias}` in params. Will use it instead of argument\")\n"
303
     ]
304
    },
305
    {
306
     "name": "stdout",
307
     "output_type": "stream",
308
     "text": [
309
      "[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n",
310
      "[LightGBM] [Info] Auto-choosing col-wise multi-threading, the overhead of testing was 0.001675 seconds.\n",
311
      "You can set `force_col_wise=true` to remove the overhead.\n",
312
      "[LightGBM] [Info] Total Bins 3576\n",
313
      "[LightGBM] [Info] Number of data points in the train set: 10793, number of used features: 25\n",
314
      "[LightGBM] [Info] Start training from score -2.103541\n",
315
      "[LightGBM] [Info] Start training from score -1.893390\n",
316
      "[LightGBM] [Info] Start training from score -2.159762\n",
317
      "[LightGBM] [Info] Start training from score -2.113461\n",
318
      "[LightGBM] [Info] Start training from score -1.974767\n",
319
      "[LightGBM] [Info] Start training from score -1.867272\n",
320
      "[LightGBM] [Info] Start training from score -1.619963\n",
321
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
322
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
323
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
324
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
325
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
326
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
327
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
328
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
329
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
330
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
331
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
332
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
333
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
334
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
335
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
336
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
337
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
338
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
339
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
340
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
341
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
342
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
343
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
344
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
345
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
346
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
347
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
348
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
349
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
350
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
351
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
352
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
353
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
354
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
355
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
356
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
357
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
358
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
359
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
360
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
361
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
362
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
363
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
364
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
365
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
366
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
367
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
368
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
369
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
370
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
371
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
372
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
373
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
374
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
375
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
376
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
377
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
378
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
379
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
380
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
381
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
382
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
383
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
384
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
385
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
386
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
387
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
388
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
389
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
390
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
391
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
392
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
393
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
394
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
395
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
396
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
397
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
398
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
399
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
400
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
401
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
402
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
403
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
404
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
405
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
406
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
407
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
408
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
409
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
410
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
411
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
412
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
413
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
414
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
415
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
416
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
417
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
418
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
419
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
420
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
421
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
422
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
423
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
424
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
425
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
426
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
427
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
428
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
429
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
430
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
431
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
432
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
433
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
434
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
435
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
436
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
437
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
438
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
439
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
440
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
441
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
442
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
443
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
444
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
445
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
446
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
447
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
448
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
449
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
450
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
451
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
452
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
453
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
454
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
455
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
456
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
457
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
458
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
459
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
460
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
461
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
462
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
463
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
464
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
465
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
466
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
467
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
468
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
469
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
470
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
471
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
472
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
473
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
474
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
475
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
476
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
477
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
478
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
479
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
480
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
481
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
482
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
483
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
484
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
485
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
486
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
487
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
488
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
489
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
490
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
491
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
492
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n"
493
     ]
494
    },
495
    {
496
     "name": "stderr",
497
     "output_type": "stream",
498
     "text": [
499
      "/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/lightgbm/engine.py:172: UserWarning: Found `num_iterations` in params. Will use it instead of argument\n",
500
      "  _log_warning(f\"Found `{alias}` in params. Will use it instead of argument\")\n"
501
     ]
502
    },
503
    {
504
     "name": "stdout",
505
     "output_type": "stream",
506
     "text": [
507
      "[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n",
508
      "[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.000936 seconds.\n",
509
      "You can set `force_row_wise=true` to remove the overhead.\n",
510
      "And if memory is not enough, you can set `force_col_wise=true`.\n",
511
      "[LightGBM] [Info] Total Bins 3576\n",
512
      "[LightGBM] [Info] Number of data points in the train set: 8634, number of used features: 25\n",
513
      "[LightGBM] [Info] Start training from score -2.104065\n",
514
      "[LightGBM] [Info] Start training from score -1.893344\n",
515
      "[LightGBM] [Info] Start training from score -2.159716\n",
516
      "[LightGBM] [Info] Start training from score -2.113607\n",
517
      "[LightGBM] [Info] Start training from score -1.974220\n",
518
      "[LightGBM] [Info] Start training from score -1.867526\n",
519
      "[LightGBM] [Info] Start training from score -1.619799\n",
520
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
521
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
522
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
523
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
524
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
525
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
526
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
527
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
528
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
529
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
530
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
531
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
532
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
533
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
534
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
535
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
536
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
537
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
538
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
539
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
540
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
541
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
542
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
543
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
544
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
545
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
546
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
547
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
548
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
549
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
550
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
551
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
552
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
553
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
554
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
555
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
556
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
557
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
558
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
559
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
560
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
561
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
562
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
563
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
564
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
565
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
566
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
567
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
568
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
569
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
570
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
571
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
572
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
573
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
574
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
575
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
576
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
577
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
578
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
579
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
580
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
581
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
582
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
583
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
584
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
585
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
586
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
587
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
588
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
589
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
590
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
591
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
592
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
593
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
594
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
595
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
596
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
597
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
598
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
599
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
600
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
601
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
602
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
603
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
604
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
605
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
606
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
607
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
608
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
609
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
610
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
611
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
612
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
613
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
614
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
615
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
616
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
617
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
618
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
619
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
620
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
621
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
622
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
623
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
624
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
625
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
626
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
627
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
628
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
629
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
630
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
631
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
632
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
633
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
634
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
635
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
636
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
637
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
638
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
639
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
640
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
641
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
642
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
643
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
644
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
645
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
646
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
647
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
648
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
649
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
650
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
651
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
652
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
653
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
654
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
655
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
656
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
657
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
658
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
659
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
660
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
661
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
662
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
663
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
664
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
665
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
666
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
667
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
668
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
669
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
670
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
671
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
672
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
673
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
674
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
675
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
676
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
677
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
678
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
679
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
680
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
681
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
682
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
683
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
684
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
685
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
686
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
687
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
688
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
689
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
690
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
691
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
692
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
693
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
694
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
695
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
696
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
697
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
698
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
699
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
700
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
701
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
702
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
703
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
704
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
705
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
706
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
707
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
708
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
709
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
710
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
711
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
712
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
713
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
714
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
715
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
716
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
717
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
718
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
719
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
720
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
721
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
722
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
723
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
724
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
725
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
726
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
727
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
728
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
729
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
730
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
731
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
732
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
733
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
734
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
735
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
736
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
737
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
738
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
739
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
740
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
741
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
742
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
743
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
744
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
745
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
746
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
747
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
748
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
749
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
750
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
751
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
752
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
753
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
754
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
755
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
756
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
757
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
758
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
759
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
760
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
761
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
762
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
763
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n"
764
     ]
765
    },
766
    {
767
     "name": "stderr",
768
     "output_type": "stream",
769
     "text": [
770
      "/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/lightgbm/engine.py:172: UserWarning: Found `num_iterations` in params. Will use it instead of argument\n",
771
      "  _log_warning(f\"Found `{alias}` in params. Will use it instead of argument\")\n"
772
     ]
773
    },
774
    {
775
     "name": "stdout",
776
     "output_type": "stream",
777
     "text": [
778
      "[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n",
779
      "[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.001324 seconds.\n",
780
      "You can set `force_row_wise=true` to remove the overhead.\n",
781
      "And if memory is not enough, you can set `force_col_wise=true`.\n",
782
      "[LightGBM] [Info] Total Bins 3573\n",
783
      "[LightGBM] [Info] Number of data points in the train set: 8634, number of used features: 25\n",
784
      "[LightGBM] [Info] Start training from score -2.104065\n",
785
      "[LightGBM] [Info] Start training from score -1.893344\n",
786
      "[LightGBM] [Info] Start training from score -2.159716\n",
787
      "[LightGBM] [Info] Start training from score -2.112648\n",
788
      "[LightGBM] [Info] Start training from score -1.974220\n",
789
      "[LightGBM] [Info] Start training from score -1.867526\n",
790
      "[LightGBM] [Info] Start training from score -1.620385\n",
791
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
792
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
793
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
794
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
795
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
796
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
797
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
798
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
799
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
800
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
801
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
802
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
803
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
804
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
805
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
806
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
807
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
808
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
809
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
810
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
811
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
812
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
813
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
814
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
815
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
816
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
817
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
818
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
819
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
820
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
821
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
822
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
823
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
824
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
825
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
826
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
827
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
828
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
829
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
830
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
831
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
832
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
833
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
834
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
835
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
836
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
837
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
838
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
839
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
840
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
841
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
842
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
843
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
844
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
845
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
846
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
847
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
848
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
849
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
850
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
851
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
852
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
853
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
854
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
855
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
856
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
857
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
858
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
859
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
860
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
861
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
862
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
863
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
864
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
865
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
866
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
867
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
868
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
869
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
870
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
871
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
872
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
873
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
874
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
875
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
876
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
877
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
878
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
879
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
880
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
881
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
882
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
883
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
884
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
885
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
886
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
887
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
888
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
889
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
890
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
891
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
892
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
893
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
894
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
895
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
896
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
897
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
898
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
899
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
900
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
901
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
902
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
903
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
904
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
905
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
906
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
907
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
908
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
909
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
910
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
911
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
912
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
913
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
914
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
915
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
916
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
917
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
918
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
919
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
920
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
921
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
922
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
923
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
924
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
925
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
926
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
927
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
928
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
929
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
930
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
931
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
932
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
933
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
934
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
935
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
936
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
937
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
938
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
939
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
940
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
941
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
942
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
943
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
944
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
945
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
946
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
947
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
948
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
949
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
950
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
951
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
952
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
953
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
954
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
955
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
956
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
957
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
958
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
959
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
960
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
961
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
962
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
963
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
964
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
965
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
966
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
967
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
968
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
969
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
970
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
971
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
972
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
973
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
974
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
975
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
976
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
977
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
978
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
979
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
980
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
981
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
982
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
983
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
984
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
985
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
986
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
987
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
988
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
989
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
990
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
991
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
992
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
993
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
994
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
995
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
996
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
997
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
998
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
999
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1000
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1001
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1002
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1003
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1004
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1005
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1006
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1007
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1008
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1009
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1010
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1011
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1012
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1013
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1014
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1015
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1016
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1017
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1018
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n"
1019
     ]
1020
    },
1021
    {
1022
     "name": "stderr",
1023
     "output_type": "stream",
1024
     "text": [
1025
      "/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/lightgbm/engine.py:172: UserWarning: Found `num_iterations` in params. Will use it instead of argument\n",
1026
      "  _log_warning(f\"Found `{alias}` in params. Will use it instead of argument\")\n"
1027
     ]
1028
    },
1029
    {
1030
     "name": "stdout",
1031
     "output_type": "stream",
1032
     "text": [
1033
      "[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n",
1034
      "[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.000880 seconds.\n",
1035
      "You can set `force_row_wise=true` to remove the overhead.\n",
1036
      "And if memory is not enough, you can set `force_col_wise=true`.\n",
1037
      "[LightGBM] [Info] Total Bins 3572\n",
1038
      "[LightGBM] [Info] Number of data points in the train set: 8634, number of used features: 25\n",
1039
      "[LightGBM] [Info] Start training from score -2.103115\n",
1040
      "[LightGBM] [Info] Start training from score -1.893344\n",
1041
      "[LightGBM] [Info] Start training from score -2.159716\n",
1042
      "[LightGBM] [Info] Start training from score -2.113607\n",
1043
      "[LightGBM] [Info] Start training from score -1.975054\n",
1044
      "[LightGBM] [Info] Start training from score -1.867526\n",
1045
      "[LightGBM] [Info] Start training from score -1.619799\n",
1046
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1047
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1048
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1049
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1050
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1051
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1052
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1053
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1054
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1055
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1056
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1057
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1058
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1059
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1060
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1061
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1062
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1063
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1064
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1065
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1066
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1067
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1068
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1069
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1070
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1071
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1072
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1073
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1074
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1075
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1076
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1077
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1078
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1079
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1080
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1081
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1082
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1083
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1084
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1085
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1086
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1087
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1088
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1089
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1090
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1091
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1092
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1093
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1094
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1095
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1096
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1097
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1098
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1099
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1100
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1101
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1102
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1103
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1104
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1105
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1106
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1107
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1108
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1109
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1110
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1111
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1112
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1113
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1114
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1115
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1116
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1117
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1118
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1119
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1120
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1121
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1122
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1123
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1124
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1125
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1126
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1127
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1128
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1129
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1130
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1131
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1132
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1133
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1134
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1135
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1136
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1137
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1138
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1139
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1140
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1141
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1142
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1143
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1144
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1145
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1146
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1147
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1148
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1149
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1150
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1151
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1152
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1153
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1154
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1155
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1156
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1157
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1158
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1159
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1160
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1161
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1162
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1163
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1164
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1165
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1166
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1167
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1168
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1169
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1170
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1171
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1172
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1173
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1174
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1175
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1176
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1177
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1178
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1179
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1180
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1181
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1182
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1183
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1184
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1185
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1186
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1187
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1188
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1189
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1190
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1191
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1192
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1193
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1194
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1195
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1196
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1197
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1198
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1199
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1200
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1201
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1202
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1203
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1204
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1205
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1206
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1207
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1208
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1209
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1210
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1211
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1212
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1213
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1214
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1215
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1216
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1217
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1218
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1219
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1220
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1221
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1222
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1223
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1224
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1225
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1226
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1227
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1228
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1229
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1230
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1231
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1232
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1233
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1234
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1235
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1236
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1237
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1238
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1239
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1240
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1241
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1242
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1243
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1244
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1245
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1246
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1247
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1248
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1249
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1250
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1251
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1252
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1253
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1254
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1255
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1256
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1257
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1258
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1259
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1260
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1261
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1262
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1263
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1264
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1265
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1266
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1267
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1268
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1269
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1270
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1271
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1272
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1273
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1274
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1275
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1276
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1277
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1278
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n"
1279
     ]
1280
    },
1281
    {
1282
     "name": "stderr",
1283
     "output_type": "stream",
1284
     "text": [
1285
      "/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/lightgbm/engine.py:172: UserWarning: Found `num_iterations` in params. Will use it instead of argument\n",
1286
      "  _log_warning(f\"Found `{alias}` in params. Will use it instead of argument\")\n"
1287
     ]
1288
    },
1289
    {
1290
     "name": "stdout",
1291
     "output_type": "stream",
1292
     "text": [
1293
      "[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n",
1294
      "[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.000655 seconds.\n",
1295
      "You can set `force_row_wise=true` to remove the overhead.\n",
1296
      "And if memory is not enough, you can set `force_col_wise=true`.\n",
1297
      "[LightGBM] [Info] Total Bins 3571\n",
1298
      "[LightGBM] [Info] Number of data points in the train set: 8635, number of used features: 25\n",
1299
      "[LightGBM] [Info] Start training from score -2.103231\n",
1300
      "[LightGBM] [Info] Start training from score -1.893459\n",
1301
      "[LightGBM] [Info] Start training from score -2.159832\n",
1302
      "[LightGBM] [Info] Start training from score -2.113723\n",
1303
      "[LightGBM] [Info] Start training from score -1.975170\n",
1304
      "[LightGBM] [Info] Start training from score -1.866892\n",
1305
      "[LightGBM] [Info] Start training from score -1.619915\n",
1306
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1307
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1308
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1309
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1310
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1311
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1312
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1313
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1314
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1315
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1316
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1317
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1318
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1319
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1320
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1321
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1322
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1323
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1324
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1325
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1326
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1327
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1328
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1329
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1330
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1331
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1332
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1333
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1334
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1335
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1336
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1337
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1338
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1339
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1340
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1341
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1342
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1343
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1344
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1345
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1346
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1347
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1348
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1349
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1350
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1351
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1352
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1353
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1354
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1355
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1356
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1357
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1358
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1359
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1360
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1361
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1362
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1363
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1364
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1365
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1366
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1367
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1368
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1369
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1370
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1371
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1372
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1373
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1374
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1375
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1376
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1377
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1378
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1379
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1380
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1381
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1382
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1383
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1384
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1385
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1386
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1387
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1388
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1389
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1390
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1391
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1392
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1393
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1394
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1395
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1396
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1397
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1398
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1399
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1400
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1401
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1402
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1403
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1404
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1405
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1406
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1407
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1408
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1409
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1410
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1411
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1412
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1413
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1414
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1415
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1416
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1417
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1418
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1419
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1420
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1421
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1422
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1423
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1424
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1425
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1426
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1427
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1428
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1429
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1430
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1431
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1432
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1433
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1434
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1435
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1436
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1437
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1438
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1439
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1440
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1441
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1442
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1443
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1444
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1445
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1446
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1447
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1448
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1449
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1450
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1451
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1452
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1453
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1454
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1455
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1456
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1457
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1458
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1459
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1460
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1461
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1462
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1463
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1464
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1465
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1466
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1467
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1468
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1469
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1470
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1471
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1472
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1473
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1474
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1475
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1476
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1477
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1478
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1479
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1480
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1481
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1482
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1483
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1484
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1485
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1486
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1487
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1488
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1489
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1490
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1491
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1492
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1493
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1494
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1495
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1496
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1497
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1498
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1499
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1500
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1501
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1502
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1503
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1504
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1505
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1506
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1507
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1508
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1509
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1510
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1511
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1512
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1513
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1514
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1515
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1516
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1517
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1518
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1519
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1520
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1521
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1522
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1523
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1524
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1525
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1526
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1527
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1528
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1529
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1530
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1531
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1532
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1533
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n"
1534
     ]
1535
    },
1536
    {
1537
     "name": "stderr",
1538
     "output_type": "stream",
1539
     "text": [
1540
      "/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/lightgbm/engine.py:172: UserWarning: Found `num_iterations` in params. Will use it instead of argument\n",
1541
      "  _log_warning(f\"Found `{alias}` in params. Will use it instead of argument\")\n"
1542
     ]
1543
    },
1544
    {
1545
     "name": "stdout",
1546
     "output_type": "stream",
1547
     "text": [
1548
      "[LightGBM] [Warning] Found whitespace in feature_names, replace with underlines\n",
1549
      "[LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.001269 seconds.\n",
1550
      "You can set `force_row_wise=true` to remove the overhead.\n",
1551
      "And if memory is not enough, you can set `force_col_wise=true`.\n",
1552
      "[LightGBM] [Info] Total Bins 3575\n",
1553
      "[LightGBM] [Info] Number of data points in the train set: 8635, number of used features: 25\n",
1554
      "[LightGBM] [Info] Start training from score -2.103231\n",
1555
      "[LightGBM] [Info] Start training from score -1.893459\n",
1556
      "[LightGBM] [Info] Start training from score -2.159832\n",
1557
      "[LightGBM] [Info] Start training from score -2.113723\n",
1558
      "[LightGBM] [Info] Start training from score -1.975170\n",
1559
      "[LightGBM] [Info] Start training from score -1.866892\n",
1560
      "[LightGBM] [Info] Start training from score -1.619915\n",
1561
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1562
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1563
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1564
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1565
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1566
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1567
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1568
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1569
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1570
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1571
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1572
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1573
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1574
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1575
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1576
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1577
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1578
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1579
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1580
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1581
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1582
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1583
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1584
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1585
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1586
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1587
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1588
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1589
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1590
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1591
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1592
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1593
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1594
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1595
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1596
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1597
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1598
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1599
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1600
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1601
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1602
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1603
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1604
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1605
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1606
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1607
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1608
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1609
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1610
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1611
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1612
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1613
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1614
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1615
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1616
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1617
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1618
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1619
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1620
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1621
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1622
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1623
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1624
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1625
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1626
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1627
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1628
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1629
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1630
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1631
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1632
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1633
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1634
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1635
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1636
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1637
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1638
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1639
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1640
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1641
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1642
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1643
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1644
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1645
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1646
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1647
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1648
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1649
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1650
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1651
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1652
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1653
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1654
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1655
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1656
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1657
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1658
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1659
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1660
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1661
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1662
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1663
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1664
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1665
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1666
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1667
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1668
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1669
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1670
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1671
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1672
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1673
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1674
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1675
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1676
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1677
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1678
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1679
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1680
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1681
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1682
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1683
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1684
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1685
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1686
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1687
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1688
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1689
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1690
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1691
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1692
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1693
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1694
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1695
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1696
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1697
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1698
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1699
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1700
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1701
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1702
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1703
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1704
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1705
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1706
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1707
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1708
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1709
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1710
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1711
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1712
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1713
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1714
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1715
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1716
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1717
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1718
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1719
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1720
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1721
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1722
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1723
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1724
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1725
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1726
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1727
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1728
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1729
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1730
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1731
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1732
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1733
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1734
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1735
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1736
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1737
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1738
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1739
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1740
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1741
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1742
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1743
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1744
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1745
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1746
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1747
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1748
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1749
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1750
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1751
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1752
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1753
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1754
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1755
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1756
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1757
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1758
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1759
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1760
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1761
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1762
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1763
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1764
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1765
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1766
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1767
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1768
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1769
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1770
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1771
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1772
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1773
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1774
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1775
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1776
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1777
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1778
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1779
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1780
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1781
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1782
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1783
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1784
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1785
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1786
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1787
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1788
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1789
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1790
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1791
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1792
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1793
      "[LightGBM] [Warning] No further splits with positive gain, best gain: -inf\n",
1794
      "\n",
1795
      "Accuracy: 0.9020661539886964\n",
1796
      "Precision: 0.9018236286221342\n",
1797
      "Recall: 0.9020661539886964\n",
1798
      "F1: 0.9018567099523006\n",
1799
      "Recall for class 0: 0.9335443037974683\n",
1800
      "Recall for class 1: 0.9037433155080213\n",
1801
      "Recall for class 2: 0.7701492537313432\n",
1802
      "Recall for class 3: 0.8267477203647416\n",
1803
      "Recall for class 4: 0.8574821852731591\n",
1804
      "Recall for class 5: 0.9641148325358851\n",
1805
      "Recall for class 6: 0.9960474308300395\n"
1806
     ]
1807
    }
1808
   ],
1809
   "source": [
1810
    "import numpy as np\n",
1811
    "import lightgbm as lgb\n",
1812
    "from sklearn.metrics import precision_recall_fscore_support, accuracy_score\n",
1813
    "from sklearn.model_selection import cross_val_predict\n",
1814
    "import mlflow\n",
1815
    "\n",
1816
    "# Define focal loss function\n",
1817
    "def focal_loss_lgb(y_true, y_pred, alpha=0.25, gamma=2.0):\n",
1818
    "    \"\"\"\n",
1819
    "    Focal loss for LightGBM, with support for one-vs-rest multiclass classification.\n",
1820
    "    :param y_true: numpy.ndarray, true labels.\n",
1821
    "    :param y_pred: numpy.ndarray, predicted scores.\n",
1822
    "    :param alpha: float, balancing parameter (default=0.25).\n",
1823
    "    :param gamma: float, focusing parameter (default=2.0).\n",
1824
    "    :return: numpy.ndarray, focal loss.\n",
1825
    "    \"\"\"\n",
1826
    "    # Convert y_true to one-hot encoding\n",
1827
    "    one_hot = np.eye(7)[y_true.astype(int)]\n",
1828
    "    \n",
1829
    "    # Calculate focal loss for each class\n",
1830
    "    pt = one_hot * y_pred[:, None] + (1 - one_hot) * (1 - y_pred[:, None])\n",
1831
    "    focal_loss = -alpha * (1 - pt) ** gamma * np.log(pt)\n",
1832
    "    \n",
1833
    "    # Sum the loss across classes\n",
1834
    "    return np.mean(focal_loss, axis=1)\n",
1835
    "\n",
1836
    "# Define training data\n",
1837
    "X_train = train_df[features]\n",
1838
    "y_train = train_df[Target]\n",
1839
    "\n",
1840
    "# Define validation data\n",
1841
    "X_val = val_df[features]\n",
1842
    "y_val = val_df[Target]\n",
1843
    "\n",
1844
    "# Define test data\n",
1845
    "X_test = test_df[features]\n",
1846
    "y_test = test_df[Target]\n",
1847
    "\n",
1848
    "# Define parameters for LightGBM\n",
1849
    "params = {\n",
1850
    "    'objective': 'multiclass',\n",
1851
    "    'num_class': 7,\n",
1852
    "    'metric': 'multi_logloss',\n",
1853
    "    'num_iterations': 300,  # Adjust this as needed\n",
1854
    "}\n",
1855
    "\n",
1856
    "# Start MLflow run\n",
1857
    "with mlflow.start_run(run_name=\"LGBM_with_OvR_and_Focal_Loss\"):\n",
1858
    "    # Fit and evaluate the model\n",
1859
    "    model = lgb.LGBMClassifier(**params)\n",
1860
    "    model.fit(X_train, y_train)\n",
1861
    "    \n",
1862
    "    # CV predictions of LightGBM\n",
1863
    "    cv_predictions = cross_val_predict(model, X_train, y_train, cv=5)\n",
1864
    "    accuracy_lgbm = accuracy_score(y_train, cv_predictions)\n",
1865
    "    \n",
1866
    "    # Compute precision, recall, and F1-score\n",
1867
    "    precision_lgbm, recall_lgbm, f1_lgbm, _ = precision_recall_fscore_support(y_train, cv_predictions, average='weighted')\n",
1868
    "    print(\"\\nAccuracy:\", accuracy_lgbm)\n",
1869
    "    print(\"Precision:\", precision_lgbm)\n",
1870
    "    print(\"Recall:\", recall_lgbm)\n",
1871
    "    print(\"F1:\", f1_lgbm)\n",
1872
    "    \n",
1873
    "    mlflow.log_metric('accuracy', accuracy_lgbm)\n",
1874
    "    mlflow.log_metric('precision', precision_lgbm)\n",
1875
    "    mlflow.log_metric('recall', recall_lgbm)\n",
1876
    "    mlflow.log_metric('f1', f1_lgbm)\n",
1877
    "\n",
1878
    "    # Predict on validation data\n",
1879
    "    y_val_pred_lgbm = model.predict(X_val)\n",
1880
    "    \n",
1881
    "    # Compute precision, recall, and F1-score per class\n",
1882
    "    precision_per_class, recall_per_class, f1_per_class, _ = precision_recall_fscore_support(y_val, y_val_pred_lgbm, average=None)\n",
1883
    "    for i in range(len(recall_per_class)):\n",
1884
    "        print(f\"Recall for class {i}: {recall_per_class[i]}\")\n",
1885
    "        mlflow.log_metric(f'recall_class_{i}', recall_per_class[i])\n",
1886
    "\n",
1887
    "    # Log the model and tags\n",
1888
    "    mlflow.lightgbm.log_model(model, 'model')\n",
1889
    "    mlflow.set_tag('experiments', 'Arham A.')\n",
1890
    "    mlflow.set_tag('model_name', 'LGBM')\n",
1891
    "    mlflow.set_tag('preprocessing', 'Yes')\n"
1892
   ]
1893
  },
1894
  {
1895
   "cell_type": "markdown",
1896
   "metadata": {},
1897
   "source": [
1898
    "Testing Single Instance For Architecture Development"
1899
   ]
1900
  },
1901
  {
1902
   "cell_type": "code",
1903
   "execution_count": 37,
1904
   "metadata": {},
1905
   "outputs": [],
1906
   "source": [
1907
    "# input_data = {\n",
1908
    "#     \"id\": 6204,\n",
1909
    "#     \"Gender\": \"Female\",\n",
1910
    "#     \"Age\": 23.0,\n",
1911
    "#     \"Height\": 1.581527,\n",
1912
    "#     \"Weight\": 78.089575,\n",
1913
    "#     \"family_history_with_overweight\": \"yes\",\n",
1914
    "#     \"FAVC\": \"yes\",\n",
1915
    "#     \"FCVC\": 2.0,\n",
1916
    "#     \"NCP\": 2.070033,\n",
1917
    "#     \"CAEC\": \"Sometimes\",\n",
1918
    "#     \"SMOKE\": \"no\", \n",
1919
    "#     \"CH2O\": 2.953192,\n",
1920
    "#     \"SCC\": \"no\",\n",
1921
    "#     \"FAF\": 0.118271,\n",
1922
    "#     \"TUE\": 0.0,\n",
1923
    "#     \"CALC\": \"no\",\n",
1924
    "#     \"MTRANS\": \"Public_Transportation\"\n",
1925
    "    \n",
1926
    "# }\n",
1927
    "\n",
1928
    "# input_df = pd.DataFrame([input_data])\n",
1929
    "# input_df = New_Test_Instances_Pipeline(input_df, scaler_age, scaler_weight, scaler_height)\n",
1930
    "\n",
1931
    "# # X input to have same columns as features\n",
1932
    "# X_input = pd.DataFrame(columns=features)\n",
1933
    "# # if input df does not have a column that is in features, add it with 0s at the same position\n",
1934
    "# for col in features:\n",
1935
    "#     if col not in input_df.columns:\n",
1936
    "#         if col in ['MTRANS_Automobile', 'MTRANS_Bike', 'MTRANS_Motorbike', 'MTRANS_Public_Transportation', 'MTRANS_Walking']:\n",
1937
    "#             X_input[col] = False\n",
1938
    "#         else:\n",
1939
    "#             X_input[col] = 0\n",
1940
    "#     else:\n",
1941
    "#         X_input[col] = input_df[col]\n",
1942
    "#     # if MTRANS_Automobile, MTRANS_Bike, MTRANS_Motorbike, MTRANS_Public_Transportation, MTRANS_Walking are zero, make them False\n",
1943
    "    \n",
1944
    "# y_pred_proba = model.predict(X_input)\n",
1945
    "# y_pred = np.argmax(y_pred_proba)\n",
1946
    "\n",
1947
    "# y_pred"
1948
   ]
1949
  }
1950
 ],
1951
 "metadata": {
1952
  "kernelspec": {
1953
   "display_name": "DataScience",
1954
   "language": "python",
1955
   "name": "python3"
1956
  },
1957
  "language_info": {
1958
   "codemirror_mode": {
1959
    "name": "ipython",
1960
    "version": 3
1961
   },
1962
   "file_extension": ".py",
1963
   "mimetype": "text/x-python",
1964
   "name": "python",
1965
   "nbconvert_exporter": "python",
1966
   "pygments_lexer": "ipython3",
1967
   "version": "3.10.13"
1968
  }
1969
 },
1970
 "nbformat": 4,
1971
 "nbformat_minor": 2
1972
}