|
a |
|
b/03-Experiments/12-AutoGluon.ipynb |
|
|
1 |
{ |
|
|
2 |
"cells": [ |
|
|
3 |
{ |
|
|
4 |
"cell_type": "code", |
|
|
5 |
"execution_count": 1, |
|
|
6 |
"metadata": {}, |
|
|
7 |
"outputs": [ |
|
|
8 |
{ |
|
|
9 |
"data": { |
|
|
10 |
"text/plain": [ |
|
|
11 |
"<Experiment: artifact_location='/Users/arham/Downloads/Projects/03-Experiments/mlruns/3', creation_time=1713916994501, experiment_id='3', last_update_time=1713916994501, lifecycle_stage='active', name='AutoGluon', tags={}>" |
|
|
12 |
] |
|
|
13 |
}, |
|
|
14 |
"execution_count": 1, |
|
|
15 |
"metadata": {}, |
|
|
16 |
"output_type": "execute_result" |
|
|
17 |
} |
|
|
18 |
], |
|
|
19 |
"source": [ |
|
|
20 |
"import mlflow\n", |
|
|
21 |
"\n", |
|
|
22 |
"# Set the MLflow tracking URI to a new SQLite URI\n", |
|
|
23 |
"mlflow.set_tracking_uri(\"sqlite:///new_mlflow.db\")\n", |
|
|
24 |
"mlflow.set_experiment(\"AutoGluon\")" |
|
|
25 |
] |
|
|
26 |
}, |
|
|
27 |
{ |
|
|
28 |
"cell_type": "markdown", |
|
|
29 |
"metadata": {}, |
|
|
30 |
"source": [ |
|
|
31 |
"Experiment Setup" |
|
|
32 |
] |
|
|
33 |
}, |
|
|
34 |
{ |
|
|
35 |
"cell_type": "code", |
|
|
36 |
"execution_count": 12, |
|
|
37 |
"metadata": {}, |
|
|
38 |
"outputs": [], |
|
|
39 |
"source": [ |
|
|
40 |
"import pandas as pd\n", |
|
|
41 |
"from sklearn.model_selection import train_test_split\n", |
|
|
42 |
"import matplotlib.pyplot as plt\n", |
|
|
43 |
"import seaborn as sns\n", |
|
|
44 |
"import numpy as np\n", |
|
|
45 |
"from sklearn.preprocessing import MinMaxScaler\n", |
|
|
46 |
"from sklearn.preprocessing import PolynomialFeatures\n", |
|
|
47 |
"import lightgbm as lgb\n", |
|
|
48 |
"from sklearn.metrics import accuracy_score\n", |
|
|
49 |
"\n", |
|
|
50 |
"import pandas as pd\n", |
|
|
51 |
"from sklearn.model_selection import train_test_split\n", |
|
|
52 |
"import matplotlib.pyplot as plt\n", |
|
|
53 |
"import seaborn as sns\n", |
|
|
54 |
"import numpy as np\n", |
|
|
55 |
"from sklearn.preprocessing import MinMaxScaler\n", |
|
|
56 |
"from sklearn.preprocessing import PolynomialFeatures\n", |
|
|
57 |
"import lightgbm as lgb\n", |
|
|
58 |
"from sklearn.metrics import accuracy_score\n", |
|
|
59 |
"import warnings\n", |
|
|
60 |
"from sklearn.tree import DecisionTreeClassifier\n", |
|
|
61 |
"from sklearn.model_selection import cross_val_score\n", |
|
|
62 |
"from sklearn.metrics import accuracy_score, precision_score, recall_score\n", |
|
|
63 |
"import xgboost as xgb\n", |
|
|
64 |
"from sklearn.metrics import accuracy_score, precision_score, recall_score\n", |
|
|
65 |
"from sklearn.model_selection import cross_val_score\n", |
|
|
66 |
"\n", |
|
|
67 |
"\n", |
|
|
68 |
"def load_data(path):\n", |
|
|
69 |
" df = pd.read_csv(path)\n", |
|
|
70 |
" train_df, test_df = train_test_split(df, test_size=0.35, random_state=42)\n", |
|
|
71 |
" train_df, val_df, = train_test_split(train_df, test_size=0.20, random_state=42)\n", |
|
|
72 |
" train_df = train_df.drop(['id'], axis=1).drop_duplicates().reset_index(drop=True)\n", |
|
|
73 |
" test_df = test_df.drop(['id'], axis=1).drop_duplicates().reset_index(drop=True)\n", |
|
|
74 |
" val_df = val_df.drop(['id'], axis=1).drop_duplicates().reset_index(drop=True)\n", |
|
|
75 |
" return train_df, val_df, test_df\n", |
|
|
76 |
"\n", |
|
|
77 |
"def encode_target(train):\n", |
|
|
78 |
" 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", |
|
|
79 |
" train['NObeyesdad'] = train['NObeyesdad'].map(target_key)\n", |
|
|
80 |
" return train\n", |
|
|
81 |
"\n", |
|
|
82 |
"def make_gender_binary(train):\n", |
|
|
83 |
" train['Gender'] = train['Gender'].map({'Male':0, 'Female':1})\n", |
|
|
84 |
"\n", |
|
|
85 |
"def datatypes(train):\n", |
|
|
86 |
" train['Weight'] = train['Weight'].astype(float)\n", |
|
|
87 |
" train['Age'] = train['Age'].astype(float)\n", |
|
|
88 |
" train['Height'] = train['Height'].astype(float)\n", |
|
|
89 |
" return train\n", |
|
|
90 |
"\n", |
|
|
91 |
"# def age_binning(train_df):\n", |
|
|
92 |
"# # 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", |
|
|
93 |
"# train_df['Age_Group'] = pd.cut(train_df['Age'], bins=[0, 20, 30, 40, 50, train_df['Age'].max()], labels=[1, 2, 3, 4, 5])\n", |
|
|
94 |
"# train_df['Age_Group'] = train_df['Age_Group'].astype(int)\n", |
|
|
95 |
"# return train_df\n", |
|
|
96 |
"\n", |
|
|
97 |
"def age_binning(df):\n", |
|
|
98 |
" age_groups = []\n", |
|
|
99 |
" for age in df['Age']:\n", |
|
|
100 |
" if age <= 20:\n", |
|
|
101 |
" age_group = 1\n", |
|
|
102 |
" elif age <= 30:\n", |
|
|
103 |
" age_group = 2\n", |
|
|
104 |
" elif age <= 40:\n", |
|
|
105 |
" age_group = 3\n", |
|
|
106 |
" elif age <= 50:\n", |
|
|
107 |
" age_group = 4\n", |
|
|
108 |
" else:\n", |
|
|
109 |
" age_group = 5\n", |
|
|
110 |
" age_groups.append(age_group)\n", |
|
|
111 |
" df['Age_Group'] = age_groups\n", |
|
|
112 |
" return df\n", |
|
|
113 |
"\n", |
|
|
114 |
"def age_scaling_log(train_df):\n", |
|
|
115 |
" train_df['Age'] = train_df['Age'].astype(float)\n", |
|
|
116 |
" train_df['Log_Age'] = np.log1p(train_df['Age'])\n", |
|
|
117 |
" return train_df\n", |
|
|
118 |
"\n", |
|
|
119 |
"def age_scaling_minmax(train_df):\n", |
|
|
120 |
" train_df['Age'] = train_df['Age'].astype(float)\n", |
|
|
121 |
" scaler_age = MinMaxScaler()\n", |
|
|
122 |
" train_df['Scaled_Age'] = scaler_age.fit_transform(train_df['Age'].values.reshape(-1, 1))\n", |
|
|
123 |
" return train_df, scaler_age\n", |
|
|
124 |
"\n", |
|
|
125 |
"def weight_scaling_log(train_df):\n", |
|
|
126 |
" train_df['Weight'] = train_df['Weight'].astype(float)\n", |
|
|
127 |
" train_df['Log_Weight'] = np.log1p(train_df['Weight'])\n", |
|
|
128 |
" return train_df\n", |
|
|
129 |
"\n", |
|
|
130 |
"def weight_scaling_minmax(train_df):\n", |
|
|
131 |
" train_df['Weight'] = train_df['Weight'].astype(float)\n", |
|
|
132 |
" scaler_weight = MinMaxScaler()\n", |
|
|
133 |
" train_df['Scaled_Weight'] = scaler_weight.fit_transform(train_df['Weight'].values.reshape(-1, 1))\n", |
|
|
134 |
" return train_df, scaler_weight\n", |
|
|
135 |
"\n", |
|
|
136 |
"def height_scaling_log(train_df):\n", |
|
|
137 |
" train_df['Log_Height'] = np.log1p(train_df['Height'])\n", |
|
|
138 |
" return train_df\n", |
|
|
139 |
"\n", |
|
|
140 |
"def height_scaling_minmax(train_df):\n", |
|
|
141 |
" scaler_height = MinMaxScaler()\n", |
|
|
142 |
" train_df['Scaled_Height'] = scaler_height.fit_transform(train_df['Height'].values.reshape(-1, 1))\n", |
|
|
143 |
" return train_df, scaler_height\n", |
|
|
144 |
"\n", |
|
|
145 |
"def make_gender_binary(train):\n", |
|
|
146 |
" train['Gender'] = train['Gender'].map({'Female':1, 'Male':0})\n", |
|
|
147 |
" return train\n", |
|
|
148 |
"\n", |
|
|
149 |
"def fix_binary_columns(train):\n", |
|
|
150 |
" Binary_Cols = ['family_history_with_overweight','FAVC', 'SCC','SMOKE']\n", |
|
|
151 |
" # if yes then 1 else 0\n", |
|
|
152 |
" for col in Binary_Cols:\n", |
|
|
153 |
" train[col] = train[col].map({'yes': 1, 'no': 0})\n", |
|
|
154 |
" # column datatype integer\n", |
|
|
155 |
" train[col] = train[col].astype(int)\n", |
|
|
156 |
" return train\n", |
|
|
157 |
"\n", |
|
|
158 |
"def freq_cat_cols(train):\n", |
|
|
159 |
" # One hot encoding\n", |
|
|
160 |
" cat_cols = ['CAEC', 'CALC']\n", |
|
|
161 |
" for col in cat_cols:\n", |
|
|
162 |
" train[col] = train[col].map({'no': 0, 'Sometimes': 1, 'Frequently': 2, 'Always': 3})\n", |
|
|
163 |
" return train\n", |
|
|
164 |
"\n", |
|
|
165 |
"def Mtrans(train):\n", |
|
|
166 |
" \"\"\"\n", |
|
|
167 |
" Public_Transportation 8692\n", |
|
|
168 |
" Automobile 1835\n", |
|
|
169 |
" Walking 231\n", |
|
|
170 |
" Motorbike 19\n", |
|
|
171 |
" Bike 16\n", |
|
|
172 |
" \"\"\"\n", |
|
|
173 |
" # train['MTRANS'] = train['MTRANS'].map({'Public_Transportation': 3, 'Automobile': 5, 'Walking': 1, 'Motorbike': 4, 'Bike': 2})\n", |
|
|
174 |
" # dummify column\n", |
|
|
175 |
" train = pd.get_dummies(train, columns=['MTRANS'])\n", |
|
|
176 |
" # convert these columns to integer\n", |
|
|
177 |
" train['MTRANS_Automobile'] = train['MTRANS_Automobile'].astype(int)\n", |
|
|
178 |
" train['MTRANS_Walking'] = train['MTRANS_Walking'].astype(int)\n", |
|
|
179 |
" train['MTRANS_Motorbike'] = train['MTRANS_Motorbike'].astype(int)\n", |
|
|
180 |
" train['MTRANS_Bike'] = train['MTRANS_Bike'].astype(int)\n", |
|
|
181 |
" train['MTRANS_Public_Transportation'] = train['MTRANS_Public_Transportation'].astype(int)\n", |
|
|
182 |
" return train\n", |
|
|
183 |
"\n", |
|
|
184 |
"\n", |
|
|
185 |
"def other_features(train):\n", |
|
|
186 |
" train['BMI'] = train['Weight'] / (train['Height'] ** 2)\n", |
|
|
187 |
" # train['Age'*'Gender'] = train['Age'] * train['Gender']\n", |
|
|
188 |
" polynomial_features = PolynomialFeatures(degree=2)\n", |
|
|
189 |
" X_poly = polynomial_features.fit_transform(train[['Age', 'BMI']])\n", |
|
|
190 |
" poly_features_df = pd.DataFrame(X_poly, columns=['Age^2', 'Age^3', 'BMI^2', 'Age * BMI', 'Age * BMI^2', 'Age^2 * BMI^2'])\n", |
|
|
191 |
" train = pd.concat([train, poly_features_df], axis=1)\n", |
|
|
192 |
" return train\n", |
|
|
193 |
"\n", |
|
|
194 |
"\n", |
|
|
195 |
"def test_pipeline(test, scaler_age, scaler_weight, scaler_height):\n", |
|
|
196 |
" test = datatypes(test)\n", |
|
|
197 |
" test = encode_target(test)\n", |
|
|
198 |
" test = age_binning(test)\n", |
|
|
199 |
" test = age_scaling_log(test)\n", |
|
|
200 |
" test['Scaled_Age'] = scaler_age.transform(test['Age'].values.reshape(-1, 1))\n", |
|
|
201 |
" test = weight_scaling_log(test)\n", |
|
|
202 |
" test['Scaled_Weight'] = scaler_weight.transform(test['Weight'].values.reshape(-1, 1))\n", |
|
|
203 |
" test = height_scaling_log(test)\n", |
|
|
204 |
" test['Scaled_Height'] = scaler_height.transform(test['Height'].values.reshape(-1, 1))\n", |
|
|
205 |
" test = make_gender_binary(test)\n", |
|
|
206 |
" test = fix_binary_columns(test)\n", |
|
|
207 |
" test = freq_cat_cols(test)\n", |
|
|
208 |
" test = Mtrans(test)\n", |
|
|
209 |
" test = other_features(test)\n", |
|
|
210 |
"\n", |
|
|
211 |
" return test\n", |
|
|
212 |
"\n", |
|
|
213 |
"def train_model(params, X_train, y_train):\n", |
|
|
214 |
" lgb_train = lgb.Dataset(X_train, y_train)\n", |
|
|
215 |
" model = lgb.train(params, lgb_train, num_boost_round=1000)\n", |
|
|
216 |
" return model\n", |
|
|
217 |
"\n", |
|
|
218 |
"def evaluate_model(model, X_val, y_val):\n", |
|
|
219 |
" y_pred = model.predict(X_val)\n", |
|
|
220 |
" y_pred = [np.argmax(y) for y in y_pred]\n", |
|
|
221 |
" accuracy = accuracy_score(y_val, y_pred)\n", |
|
|
222 |
" return accuracy\n", |
|
|
223 |
"\n", |
|
|
224 |
"def objective(trial, X_train, y_train):\n", |
|
|
225 |
" params = {\n", |
|
|
226 |
" 'objective': 'multiclass',\n", |
|
|
227 |
" 'num_class': 7,\n", |
|
|
228 |
" 'metric': 'multi_logloss',\n", |
|
|
229 |
" 'boosting_type': 'gbdt',\n", |
|
|
230 |
" 'learning_rate': trial.suggest_loguniform('learning_rate', 0.005, 0.5),\n", |
|
|
231 |
" 'num_leaves': trial.suggest_int('num_leaves', 10, 1000),\n", |
|
|
232 |
" 'max_depth': trial.suggest_int('max_depth', -1, 20),\n", |
|
|
233 |
" 'bagging_fraction': trial.suggest_uniform('bagging_fraction', 0.6, 0.95),\n", |
|
|
234 |
" 'feature_fraction': trial.suggest_uniform('feature_fraction', 0.6, 0.95),\n", |
|
|
235 |
" 'verbosity': -1\n", |
|
|
236 |
" }\n", |
|
|
237 |
"\n", |
|
|
238 |
" n_splits = 5\n", |
|
|
239 |
" kf = StratifiedKFold(n_splits=n_splits, shuffle=True, random_state=42)\n", |
|
|
240 |
" scores = []\n", |
|
|
241 |
"\n", |
|
|
242 |
" for train_index, val_index in kf.split(X_train, y_train):\n", |
|
|
243 |
" X_tr, X_val = X_train.iloc[train_index], X_train.iloc[val_index]\n", |
|
|
244 |
" y_tr, y_val = y_train.iloc[train_index], y_train.iloc[val_index]\n", |
|
|
245 |
"\n", |
|
|
246 |
" model = train_model(params, X_tr, y_tr)\n", |
|
|
247 |
" accuracy = evaluate_model(model, X_val, y_val)\n", |
|
|
248 |
" scores.append(accuracy)\n", |
|
|
249 |
"\n", |
|
|
250 |
" return np.mean(scores)\n", |
|
|
251 |
"\n", |
|
|
252 |
"def optimize_hyperparameters(X_train, y_train, n_trials=2):\n", |
|
|
253 |
" study = optuna.create_study(direction='maximize')\n", |
|
|
254 |
" study.optimize(lambda trial: objective(trial, X_train, y_train), n_trials=n_trials)\n", |
|
|
255 |
" return study.best_params" |
|
|
256 |
] |
|
|
257 |
}, |
|
|
258 |
{ |
|
|
259 |
"cell_type": "markdown", |
|
|
260 |
"metadata": {}, |
|
|
261 |
"source": [ |
|
|
262 |
"Experiment" |
|
|
263 |
] |
|
|
264 |
}, |
|
|
265 |
{ |
|
|
266 |
"cell_type": "code", |
|
|
267 |
"execution_count": 13, |
|
|
268 |
"metadata": {}, |
|
|
269 |
"outputs": [], |
|
|
270 |
"source": [ |
|
|
271 |
"path = '/Users/arham/Downloads/Projects/01-Dataset/01-Data-for-model-building/train.csv'\n", |
|
|
272 |
"train_df, val_df, test_df = load_data(path)\n", |
|
|
273 |
"\n", |
|
|
274 |
"train_df = datatypes(train_df)\n", |
|
|
275 |
"train_df = encode_target(train_df)\n", |
|
|
276 |
"train_df = age_binning(train_df)\n", |
|
|
277 |
"train_df, scaler_age = age_scaling_minmax(train_df)\n", |
|
|
278 |
"train_df = age_scaling_log(train_df)\n", |
|
|
279 |
"train_df, scaler_weight = weight_scaling_minmax(train_df)\n", |
|
|
280 |
"train_df = weight_scaling_log(train_df)\n", |
|
|
281 |
"train_df, scaler_height = height_scaling_minmax(train_df)\n", |
|
|
282 |
"train_df = height_scaling_log(train_df)\n", |
|
|
283 |
"train_df = make_gender_binary(train_df)\n", |
|
|
284 |
"train_df = fix_binary_columns(train_df)\n", |
|
|
285 |
"train_df = freq_cat_cols(train_df)\n", |
|
|
286 |
"train_df = Mtrans(train_df)\n", |
|
|
287 |
"train_df = other_features(train_df)\n", |
|
|
288 |
"\n", |
|
|
289 |
"val_df = test_pipeline(val_df, scaler_age, scaler_weight, scaler_height)\n", |
|
|
290 |
"test_df = test_pipeline(test_df, scaler_age, scaler_weight, scaler_height)\n", |
|
|
291 |
"\n", |
|
|
292 |
"Target = 'NObeyesdad'\n", |
|
|
293 |
"features = train_df.columns.drop(Target)\n", |
|
|
294 |
"\n", |
|
|
295 |
"features = ['Gender', 'Age', 'Height', 'Weight', 'family_history_with_overweight',\n", |
|
|
296 |
" 'FAVC', 'FCVC', 'NCP', 'CAEC', 'SMOKE', 'CH2O', 'SCC', 'FAF', 'TUE',\n", |
|
|
297 |
" 'CALC', \n", |
|
|
298 |
" 'MTRANS_Automobile', 'MTRANS_Bike', 'MTRANS_Motorbike',\n", |
|
|
299 |
" 'MTRANS_Public_Transportation', 'MTRANS_Walking']\n", |
|
|
300 |
" # 'BMI', 'Age^2',\n", |
|
|
301 |
" # 'Age^3', 'BMI^2', 'Age * BMI', 'Age * BMI^2', 'Age^2 * BMI^2'] \n", |
|
|
302 |
"#'Scaled_Age', 'Log_Age', 'Scaled_Weight', 'Log_Weight', 'Scaled_Height', 'Log_Height',\n", |
|
|
303 |
"\n", |
|
|
304 |
"X_train = train_df[features]\n", |
|
|
305 |
"y_train = train_df[Target]\n", |
|
|
306 |
"X_val = val_df[features]\n", |
|
|
307 |
"y_val = val_df[Target]\n", |
|
|
308 |
"X_test = test_df[features]\n", |
|
|
309 |
"y_test = test_df[Target]\n", |
|
|
310 |
"\n", |
|
|
311 |
"#combine X_train and y_train as one dataframe\n", |
|
|
312 |
"tr = pd.concat([X_train, y_train], axis=1)\n", |
|
|
313 |
"te = pd.concat([X_test, y_test], axis =1)\n", |
|
|
314 |
"va = pd.concat([X_val, y_val], axis = 1)" |
|
|
315 |
] |
|
|
316 |
}, |
|
|
317 |
{ |
|
|
318 |
"cell_type": "code", |
|
|
319 |
"execution_count": 16, |
|
|
320 |
"metadata": {}, |
|
|
321 |
"outputs": [ |
|
|
322 |
{ |
|
|
323 |
"data": { |
|
|
324 |
"text/plain": [ |
|
|
325 |
"{6: 0.19790605021773372,\n", |
|
|
326 |
" 5: 0.1545446122486797,\n", |
|
|
327 |
" 1: 0.15056054850365977,\n", |
|
|
328 |
" 4: 0.13879366255906606,\n", |
|
|
329 |
" 0: 0.12202353377188918,\n", |
|
|
330 |
" 3: 0.12081904938385991,\n", |
|
|
331 |
" 2: 0.11535254331511165}" |
|
|
332 |
] |
|
|
333 |
}, |
|
|
334 |
"execution_count": 16, |
|
|
335 |
"metadata": {}, |
|
|
336 |
"output_type": "execute_result" |
|
|
337 |
} |
|
|
338 |
], |
|
|
339 |
"source": [ |
|
|
340 |
"y_train.value_counts()/len(y_train)\n", |
|
|
341 |
"# to dict as weights\n", |
|
|
342 |
"weights = y_train.value_counts(normalize=True).to_dict()\n", |
|
|
343 |
"weights" |
|
|
344 |
] |
|
|
345 |
}, |
|
|
346 |
{ |
|
|
347 |
"cell_type": "code", |
|
|
348 |
"execution_count": 10, |
|
|
349 |
"metadata": {}, |
|
|
350 |
"outputs": [ |
|
|
351 |
{ |
|
|
352 |
"name": "stderr", |
|
|
353 |
"output_type": "stream", |
|
|
354 |
"text": [ |
|
|
355 |
"No path specified. Models will be saved in: \"AutogluonModels/ag-20240426_034247\"\n", |
|
|
356 |
"No presets specified! To achieve strong results with AutoGluon, it is recommended to use the available presets.\n", |
|
|
357 |
"\tRecommended Presets (For more details refer to https://auto.gluon.ai/stable/tutorials/tabular/tabular-essentials.html#presets):\n", |
|
|
358 |
"\tpresets='best_quality' : Maximize accuracy. Default time_limit=3600.\n", |
|
|
359 |
"\tpresets='high_quality' : Strong accuracy with fast inference speed. Default time_limit=3600.\n", |
|
|
360 |
"\tpresets='good_quality' : Good accuracy with very fast inference speed. Default time_limit=3600.\n", |
|
|
361 |
"\tpresets='medium_quality' : Fast training time, ideal for initial prototyping.\n", |
|
|
362 |
"Beginning AutoGluon training ...\n", |
|
|
363 |
"AutoGluon will save models to \"AutogluonModels/ag-20240426_034247\"\n", |
|
|
364 |
"=================== System Info ===================\n", |
|
|
365 |
"AutoGluon Version: 1.1.0\n", |
|
|
366 |
"Python Version: 3.10.13\n", |
|
|
367 |
"Operating System: Darwin\n", |
|
|
368 |
"Platform Machine: arm64\n", |
|
|
369 |
"Platform Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:57 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8112\n", |
|
|
370 |
"CPU Count: 8\n", |
|
|
371 |
"Memory Avail: 1.25 GB / 8.00 GB (15.7%)\n", |
|
|
372 |
"Disk Space Avail: 24.83 GB / 228.27 GB (10.9%)\n", |
|
|
373 |
"===================================================\n", |
|
|
374 |
"Train Data Rows: 10793\n", |
|
|
375 |
"Train Data Columns: 20\n", |
|
|
376 |
"Label Column: NObeyesdad\n", |
|
|
377 |
"AutoGluon infers your prediction problem is: 'multiclass' (because dtype of label-column == int, but few unique label-values observed).\n", |
|
|
378 |
"\t7 unique label values: [0, 3, 1, 6, 4, 2, 5]\n", |
|
|
379 |
"\tIf 'multiclass' is not the correct problem_type, please manually specify the problem_type parameter during predictor init (You may specify problem_type as one of: ['binary', 'multiclass', 'regression'])\n", |
|
|
380 |
"Problem Type: multiclass\n", |
|
|
381 |
"Preprocessing data ...\n", |
|
|
382 |
"Train Data Class Count: 7\n", |
|
|
383 |
"Using Feature Generators to preprocess the data ...\n", |
|
|
384 |
"Fitting AutoMLPipelineFeatureGenerator...\n", |
|
|
385 |
"\tAvailable Memory: 1285.60 MB\n", |
|
|
386 |
"\tTrain Data (Original) Memory Usage: 1.65 MB (0.1% of available memory)\n", |
|
|
387 |
"\tInferring data type of each feature based on column values. Set feature_metadata_in to manually specify special dtypes of the features.\n", |
|
|
388 |
"\tStage 1 Generators:\n", |
|
|
389 |
"\t\tFitting AsTypeFeatureGenerator...\n", |
|
|
390 |
"\t\t\tNote: Converting 10 features to boolean dtype as they only contain 2 unique values.\n", |
|
|
391 |
"\tStage 2 Generators:\n", |
|
|
392 |
"\t\tFitting FillNaFeatureGenerator...\n", |
|
|
393 |
"\tStage 3 Generators:\n", |
|
|
394 |
"\t\tFitting IdentityFeatureGenerator...\n", |
|
|
395 |
"\tStage 4 Generators:\n", |
|
|
396 |
"\t\tFitting DropUniqueFeatureGenerator...\n", |
|
|
397 |
"\tStage 5 Generators:\n", |
|
|
398 |
"\t\tFitting DropDuplicatesFeatureGenerator...\n", |
|
|
399 |
"\tTypes of features in original data (raw dtype, special dtypes):\n", |
|
|
400 |
"\t\t('float', []) : 8 | ['Age', 'Height', 'Weight', 'FCVC', 'NCP', ...]\n", |
|
|
401 |
"\t\t('int', []) : 12 | ['Gender', 'family_history_with_overweight', 'FAVC', 'CAEC', 'SMOKE', ...]\n", |
|
|
402 |
"\tTypes of features in processed data (raw dtype, special dtypes):\n", |
|
|
403 |
"\t\t('float', []) : 8 | ['Age', 'Height', 'Weight', 'FCVC', 'NCP', ...]\n", |
|
|
404 |
"\t\t('int', []) : 2 | ['CAEC', 'CALC']\n", |
|
|
405 |
"\t\t('int', ['bool']) : 10 | ['Gender', 'family_history_with_overweight', 'FAVC', 'SMOKE', 'SCC', ...]\n", |
|
|
406 |
"\t0.1s = Fit runtime\n", |
|
|
407 |
"\t20 features in original data used to generate 20 features in processed data.\n", |
|
|
408 |
"\tTrain Data (Processed) Memory Usage: 0.93 MB (0.1% of available memory)\n", |
|
|
409 |
"Data preprocessing and feature engineering runtime = 0.07s ...\n", |
|
|
410 |
"AutoGluon will gauge predictive performance using evaluation metric: 'accuracy'\n", |
|
|
411 |
"\tTo change this, specify the eval_metric parameter of Predictor()\n", |
|
|
412 |
"Automatically generating train/validation split with holdout_frac=0.1, Train Rows: 9713, Val Rows: 1080\n", |
|
|
413 |
"User-specified model hyperparameters to be fit:\n", |
|
|
414 |
"{\n", |
|
|
415 |
"\t'NN_TORCH': {},\n", |
|
|
416 |
"\t'GBM': [{'extra_trees': True, 'ag_args': {'name_suffix': 'XT'}}, {}, 'GBMLarge'],\n", |
|
|
417 |
"\t'CAT': {},\n", |
|
|
418 |
"\t'XGB': {},\n", |
|
|
419 |
"\t'FASTAI': {},\n", |
|
|
420 |
"\t'RF': [{'criterion': 'gini', 'ag_args': {'name_suffix': 'Gini', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'entropy', 'ag_args': {'name_suffix': 'Entr', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'squared_error', 'ag_args': {'name_suffix': 'MSE', 'problem_types': ['regression', 'quantile']}}],\n", |
|
|
421 |
"\t'XT': [{'criterion': 'gini', 'ag_args': {'name_suffix': 'Gini', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'entropy', 'ag_args': {'name_suffix': 'Entr', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'squared_error', 'ag_args': {'name_suffix': 'MSE', 'problem_types': ['regression', 'quantile']}}],\n", |
|
|
422 |
"\t'KNN': [{'weights': 'uniform', 'ag_args': {'name_suffix': 'Unif'}}, {'weights': 'distance', 'ag_args': {'name_suffix': 'Dist'}}],\n", |
|
|
423 |
"}\n", |
|
|
424 |
"Fitting 13 L1 models ...\n", |
|
|
425 |
"Fitting model: KNeighborsUnif ...\n", |
|
|
426 |
"\t0.837\t = Validation score (accuracy)\n", |
|
|
427 |
"\t0.04s\t = Training runtime\n", |
|
|
428 |
"\t0.02s\t = Validation runtime\n", |
|
|
429 |
"Fitting model: KNeighborsDist ...\n", |
|
|
430 |
"\t0.8361\t = Validation score (accuracy)\n", |
|
|
431 |
"\t0.02s\t = Training runtime\n", |
|
|
432 |
"\t0.01s\t = Validation runtime\n", |
|
|
433 |
"Fitting model: NeuralNetFastAI ...\n", |
|
|
434 |
"\t0.8907\t = Validation score (accuracy)\n", |
|
|
435 |
"\t6.55s\t = Training runtime\n", |
|
|
436 |
"\t0.02s\t = Validation runtime\n", |
|
|
437 |
"Fitting model: LightGBMXT ...\n", |
|
|
438 |
"\t0.9019\t = Validation score (accuracy)\n", |
|
|
439 |
"\t7.58s\t = Training runtime\n", |
|
|
440 |
"\t0.06s\t = Validation runtime\n", |
|
|
441 |
"Fitting model: LightGBM ...\n", |
|
|
442 |
"\t0.9204\t = Validation score (accuracy)\n", |
|
|
443 |
"\t9.07s\t = Training runtime\n", |
|
|
444 |
"\t0.03s\t = Validation runtime\n", |
|
|
445 |
"Fitting model: RandomForestGini ...\n", |
|
|
446 |
"\t0.9037\t = Validation score (accuracy)\n", |
|
|
447 |
"\t1.18s\t = Training runtime\n", |
|
|
448 |
"\t0.06s\t = Validation runtime\n", |
|
|
449 |
"Fitting model: RandomForestEntr ...\n", |
|
|
450 |
"\t0.9083\t = Validation score (accuracy)\n", |
|
|
451 |
"\t1.13s\t = Training runtime\n", |
|
|
452 |
"\t0.05s\t = Validation runtime\n", |
|
|
453 |
"Fitting model: CatBoost ...\n", |
|
|
454 |
"\t0.913\t = Validation score (accuracy)\n", |
|
|
455 |
"\t9.03s\t = Training runtime\n", |
|
|
456 |
"\t0.01s\t = Validation runtime\n", |
|
|
457 |
"Fitting model: ExtraTreesGini ...\n", |
|
|
458 |
"\t0.8778\t = Validation score (accuracy)\n", |
|
|
459 |
"\t0.98s\t = Training runtime\n", |
|
|
460 |
"\t0.08s\t = Validation runtime\n", |
|
|
461 |
"Fitting model: ExtraTreesEntr ...\n", |
|
|
462 |
"\t0.875\t = Validation score (accuracy)\n", |
|
|
463 |
"\t0.98s\t = Training runtime\n", |
|
|
464 |
"\t0.07s\t = Validation runtime\n", |
|
|
465 |
"Fitting model: XGBoost ...\n", |
|
|
466 |
"\t0.9176\t = Validation score (accuracy)\n", |
|
|
467 |
"\t6.6s\t = Training runtime\n", |
|
|
468 |
"\t0.02s\t = Validation runtime\n", |
|
|
469 |
"Fitting model: NeuralNetTorch ...\n", |
|
|
470 |
"\tWarning: Exception caused NeuralNetTorch to fail during training... Skipping this model.\n", |
|
|
471 |
"\t\tmodule 'torch.utils._pytree' has no attribute 'register_pytree_node'\n", |
|
|
472 |
"Detailed Traceback:\n", |
|
|
473 |
"Traceback (most recent call last):\n", |
|
|
474 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/trainer/abstract_trainer.py\", line 1904, in _train_and_save\n", |
|
|
475 |
" model = self._train_single(X, y, model, X_val, y_val, total_resources=total_resources, **model_fit_kwargs)\n", |
|
|
476 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/trainer/abstract_trainer.py\", line 1844, in _train_single\n", |
|
|
477 |
" model = model.fit(X=X, y=y, X_val=X_val, y_val=y_val, total_resources=total_resources, **model_fit_kwargs)\n", |
|
|
478 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/models/abstract/abstract_model.py\", line 855, in fit\n", |
|
|
479 |
" out = self._fit(**kwargs)\n", |
|
|
480 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/tabular/models/tabular_nn/torch/tabular_nn_torch.py\", line 196, in _fit\n", |
|
|
481 |
" self.optimizer = self._init_optimizer(**optimizer_kwargs)\n", |
|
|
482 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/tabular/models/tabular_nn/torch/tabular_nn_torch.py\", line 553, in _init_optimizer\n", |
|
|
483 |
" optimizer = torch.optim.Adam(params=self.model.parameters(), lr=learning_rate, weight_decay=weight_decay)\n", |
|
|
484 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/optim/adam.py\", line 45, in __init__\n", |
|
|
485 |
" super().__init__(params, defaults)\n", |
|
|
486 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/optim/optimizer.py\", line 266, in __init__\n", |
|
|
487 |
" self.add_param_group(cast(dict, param_group))\n", |
|
|
488 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_compile.py\", line 22, in inner\n", |
|
|
489 |
" import torch._dynamo\n", |
|
|
490 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_dynamo/__init__.py\", line 2, in <module>\n", |
|
|
491 |
" from . import allowed_functions, convert_frame, eval_frame, resume_execution\n", |
|
|
492 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_dynamo/allowed_functions.py\", line 26, in <module>\n", |
|
|
493 |
" from . import config\n", |
|
|
494 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_dynamo/config.py\", line 49, in <module>\n", |
|
|
495 |
" torch.onnx.is_in_onnx_export: False,\n", |
|
|
496 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/__init__.py\", line 1831, in __getattr__\n", |
|
|
497 |
" return importlib.import_module(f\".{name}\", __name__)\n", |
|
|
498 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/importlib/__init__.py\", line 126, in import_module\n", |
|
|
499 |
" return _bootstrap._gcd_import(name[level:], package, level)\n", |
|
|
500 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/__init__.py\", line 46, in <module>\n", |
|
|
501 |
" from ._internal.exporter import ( # usort:skip. needs to be last to avoid circular import\n", |
|
|
502 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/_internal/exporter.py\", line 42, in <module>\n", |
|
|
503 |
" from torch.onnx._internal.fx import (\n", |
|
|
504 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/_internal/fx/__init__.py\", line 1, in <module>\n", |
|
|
505 |
" from .patcher import ONNXTorchPatcher\n", |
|
|
506 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/_internal/fx/patcher.py\", line 11, in <module>\n", |
|
|
507 |
" import transformers # type: ignore[import]\n", |
|
|
508 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/__init__.py\", line 26, in <module>\n", |
|
|
509 |
" from . import dependency_versions_check\n", |
|
|
510 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/dependency_versions_check.py\", line 16, in <module>\n", |
|
|
511 |
" from .utils.versions import require_version, require_version_core\n", |
|
|
512 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/utils/__init__.py\", line 33, in <module>\n", |
|
|
513 |
" from .generic import (\n", |
|
|
514 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/utils/generic.py\", line 455, in <module>\n", |
|
|
515 |
" _torch_pytree.register_pytree_node(\n", |
|
|
516 |
"AttributeError: module 'torch.utils._pytree' has no attribute 'register_pytree_node'. Did you mean: '_register_pytree_node'?\n", |
|
|
517 |
"Fitting model: LightGBMLarge ...\n", |
|
|
518 |
"\t0.912\t = Validation score (accuracy)\n", |
|
|
519 |
"\t75.08s\t = Training runtime\n", |
|
|
520 |
"\t0.09s\t = Validation runtime\n", |
|
|
521 |
"Fitting model: WeightedEnsemble_L2 ...\n", |
|
|
522 |
"\tEnsemble Weights: {'LightGBM': 0.3, 'RandomForestEntr': 0.3, 'KNeighborsUnif': 0.2, 'NeuralNetFastAI': 0.1, 'XGBoost': 0.1}\n", |
|
|
523 |
"\t0.9259\t = Validation score (accuracy)\n", |
|
|
524 |
"\t0.13s\t = Training runtime\n", |
|
|
525 |
"\t0.0s\t = Validation runtime\n", |
|
|
526 |
"AutoGluon training complete, total runtime = 121.18s ... Best model: \"WeightedEnsemble_L2\"\n", |
|
|
527 |
"TabularPredictor saved. To load, use: predictor = TabularPredictor.load(\"AutogluonModels/ag-20240426_034247\")\n" |
|
|
528 |
] |
|
|
529 |
}, |
|
|
530 |
{ |
|
|
531 |
"name": "stdout", |
|
|
532 |
"output_type": "stream", |
|
|
533 |
"text": [ |
|
|
534 |
"Recall for class 0: 0.9462025316455697\n", |
|
|
535 |
"Recall for class 1: 0.8957219251336899\n", |
|
|
536 |
"Recall for class 2: 0.755223880597015\n", |
|
|
537 |
"Recall for class 3: 0.8449848024316109\n", |
|
|
538 |
"Recall for class 4: 0.8788598574821853\n", |
|
|
539 |
"Recall for class 5: 0.9688995215311005\n", |
|
|
540 |
"Recall for class 6: 0.9960474308300395\n" |
|
|
541 |
] |
|
|
542 |
} |
|
|
543 |
], |
|
|
544 |
"source": [ |
|
|
545 |
"from autogluon.tabular import TabularDataset, TabularPredictor\n", |
|
|
546 |
"from sklearn.metrics import precision_recall_fscore_support\n", |
|
|
547 |
"import mlflow\n", |
|
|
548 |
"\n", |
|
|
549 |
"# Load your data into AutoGluon TabularDataset format\n", |
|
|
550 |
"train_data = TabularDataset(X_train.join(y_train))\n", |
|
|
551 |
"val_data = TabularDataset(X_val.join(y_val))\n", |
|
|
552 |
"\n", |
|
|
553 |
"# Define the label column\n", |
|
|
554 |
"label_column = Target # Replace 'Target' with your actual label column name\n", |
|
|
555 |
"\n", |
|
|
556 |
"# Specify the task and run AutoGluon\n", |
|
|
557 |
"predictor = TabularPredictor(label=label_column).fit(train_data=train_data)\n", |
|
|
558 |
"\n", |
|
|
559 |
"# Make predictions on the validation set\n", |
|
|
560 |
"y_val_pred_autogluon = predictor.predict(val_data.drop(columns=[label_column]))\n", |
|
|
561 |
"\n", |
|
|
562 |
"# Evaluate performance\n", |
|
|
563 |
"precision, recall, f1, support = precision_recall_fscore_support(y_val, y_val_pred_autogluon, average='weighted')\n", |
|
|
564 |
"\n", |
|
|
565 |
"# Log metrics and model using MLflow\n", |
|
|
566 |
"with mlflow.start_run(run_name=\"AutoGluon_Without_Feature_Engineering\"):\n", |
|
|
567 |
" # Log AutoGluon model\n", |
|
|
568 |
" mlflow.sklearn.log_model(predictor, \"autogluon_model\")\n", |
|
|
569 |
" \n", |
|
|
570 |
" # Log metrics\n", |
|
|
571 |
" mlflow.log_metric('accuracy', accuracy_score(y_val, y_val_pred_autogluon))\n", |
|
|
572 |
" mlflow.log_metric('precision', precision)\n", |
|
|
573 |
" mlflow.log_metric('recall', recall)\n", |
|
|
574 |
" mlflow.log_metric('f1', f1)\n", |
|
|
575 |
"\n", |
|
|
576 |
" # Log recall per class\n", |
|
|
577 |
" recall_per_class = recall_score(y_val, y_val_pred_autogluon, average=None)\n", |
|
|
578 |
" for i, recall_class in enumerate(recall_per_class):\n", |
|
|
579 |
" print(f\"Recall for class {i}: {recall_class}\")\n", |
|
|
580 |
" mlflow.log_metric(f'recall_class_{i}', recall_class)\n", |
|
|
581 |
"\n", |
|
|
582 |
" mlflow.set_tag('experiments', 'Arham A.')\n", |
|
|
583 |
" mlflow.set_tag('model_name', 'AutoGluon')\n", |
|
|
584 |
" mlflow.set_tag('preprocessing', 'Yes')" |
|
|
585 |
] |
|
|
586 |
}, |
|
|
587 |
{ |
|
|
588 |
"cell_type": "code", |
|
|
589 |
"execution_count": 28, |
|
|
590 |
"metadata": {}, |
|
|
591 |
"outputs": [ |
|
|
592 |
{ |
|
|
593 |
"name": "stdout", |
|
|
594 |
"output_type": "stream", |
|
|
595 |
"text": [ |
|
|
596 |
"[2024-04-26 05:38:37 -0400] [14055] [INFO] Starting gunicorn 21.2.0\n", |
|
|
597 |
"[2024-04-26 05:38:37 -0400] [14055] [INFO] Listening at: http://127.0.0.1:5000 (14055)\n", |
|
|
598 |
"[2024-04-26 05:38:37 -0400] [14055] [INFO] Using worker: sync\n", |
|
|
599 |
"[2024-04-26 05:38:37 -0400] [14056] [INFO] Booting worker with pid: 14056\n", |
|
|
600 |
"[2024-04-26 05:38:37 -0400] [14057] [INFO] Booting worker with pid: 14057\n", |
|
|
601 |
"[2024-04-26 05:38:37 -0400] [14058] [INFO] Booting worker with pid: 14058\n", |
|
|
602 |
"[2024-04-26 05:38:37 -0400] [14059] [INFO] Booting worker with pid: 14059\n", |
|
|
603 |
"[2024-04-26 06:53:19 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:14056)\n", |
|
|
604 |
"[2024-04-26 06:53:19 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:14057)\n", |
|
|
605 |
"[2024-04-26 06:53:19 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:14058)\n", |
|
|
606 |
"[2024-04-26 06:53:19 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:14059)\n", |
|
|
607 |
"[2024-04-26 06:53:19 -0400] [14059] [INFO] Worker exiting (pid: 14059)\n", |
|
|
608 |
"[2024-04-26 06:53:19 -0400] [14058] [INFO] Worker exiting (pid: 14058)\n", |
|
|
609 |
"[2024-04-26 06:53:19 -0400] [14057] [INFO] Worker exiting (pid: 14057)\n", |
|
|
610 |
"[2024-04-26 06:53:19 -0400] [14056] [INFO] Worker exiting (pid: 14056)\n", |
|
|
611 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14058) exited with code 1\n", |
|
|
612 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14058) exited with code 1.\n", |
|
|
613 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14059) exited with code 1\n", |
|
|
614 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14059) exited with code 1.\n", |
|
|
615 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14056) exited with code 1\n", |
|
|
616 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14056) exited with code 1.\n", |
|
|
617 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14057) exited with code 1\n", |
|
|
618 |
"[2024-04-26 06:53:20 -0400] [14055] [ERROR] Worker (pid:14057) exited with code 1.\n", |
|
|
619 |
"[2024-04-26 06:53:20 -0400] [16284] [INFO] Booting worker with pid: 16284\n", |
|
|
620 |
"[2024-04-26 06:53:20 -0400] [16285] [INFO] Booting worker with pid: 16285\n", |
|
|
621 |
"[2024-04-26 06:53:20 -0400] [16286] [INFO] Booting worker with pid: 16286\n", |
|
|
622 |
"[2024-04-26 06:53:20 -0400] [16287] [INFO] Booting worker with pid: 16287\n", |
|
|
623 |
"[2024-04-26 07:10:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16284)\n", |
|
|
624 |
"[2024-04-26 07:10:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16285)\n", |
|
|
625 |
"[2024-04-26 07:10:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16286)\n", |
|
|
626 |
"[2024-04-26 07:10:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16287)\n", |
|
|
627 |
"[2024-04-26 07:10:32 -0400] [16287] [INFO] Worker exiting (pid: 16287)\n", |
|
|
628 |
"[2024-04-26 07:10:32 -0400] [16285] [INFO] Worker exiting (pid: 16285)\n", |
|
|
629 |
"[2024-04-26 07:10:32 -0400] [16286] [INFO] Worker exiting (pid: 16286)\n", |
|
|
630 |
"[2024-04-26 07:10:32 -0400] [16284] [INFO] Worker exiting (pid: 16284)\n", |
|
|
631 |
"[2024-04-26 07:10:33 -0400] [14055] [ERROR] Worker (pid:16287) exited with code 1\n", |
|
|
632 |
"[2024-04-26 07:10:33 -0400] [14055] [ERROR] Worker (pid:16287) exited with code 1.\n", |
|
|
633 |
"[2024-04-26 07:10:33 -0400] [14055] [ERROR] Worker (pid:16284) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
634 |
"[2024-04-26 07:10:33 -0400] [14055] [ERROR] Worker (pid:16285) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
635 |
"[2024-04-26 07:10:33 -0400] [14055] [ERROR] Worker (pid:16286) exited with code 1\n", |
|
|
636 |
"[2024-04-26 07:10:33 -0400] [14055] [ERROR] Worker (pid:16286) exited with code 1.\n", |
|
|
637 |
"[2024-04-26 07:10:33 -0400] [16374] [INFO] Booting worker with pid: 16374\n", |
|
|
638 |
"[2024-04-26 07:10:33 -0400] [16375] [INFO] Booting worker with pid: 16375\n", |
|
|
639 |
"[2024-04-26 07:10:33 -0400] [16376] [INFO] Booting worker with pid: 16376\n", |
|
|
640 |
"[2024-04-26 07:10:33 -0400] [16377] [INFO] Booting worker with pid: 16377\n", |
|
|
641 |
"[2024-04-26 07:48:01 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16374)\n", |
|
|
642 |
"[2024-04-26 07:48:01 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16375)\n", |
|
|
643 |
"[2024-04-26 07:48:01 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16376)\n", |
|
|
644 |
"[2024-04-26 07:48:01 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16377)\n", |
|
|
645 |
"[2024-04-26 07:48:01 -0400] [16376] [INFO] Worker exiting (pid: 16376)\n", |
|
|
646 |
"[2024-04-26 07:48:01 -0400] [16377] [INFO] Worker exiting (pid: 16377)\n", |
|
|
647 |
"[2024-04-26 07:48:01 -0400] [16375] [INFO] Worker exiting (pid: 16375)\n", |
|
|
648 |
"[2024-04-26 07:48:01 -0400] [16374] [INFO] Worker exiting (pid: 16374)\n", |
|
|
649 |
"[2024-04-26 07:48:02 -0400] [14055] [ERROR] Worker (pid:16374) exited with code 1\n", |
|
|
650 |
"[2024-04-26 07:48:02 -0400] [14055] [ERROR] Worker (pid:16374) exited with code 1.\n", |
|
|
651 |
"[2024-04-26 07:48:02 -0400] [16404] [INFO] Booting worker with pid: 16404\n", |
|
|
652 |
"[2024-04-26 07:48:02 -0400] [14055] [ERROR] Worker (pid:16375) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
653 |
"[2024-04-26 07:48:02 -0400] [14055] [ERROR] Worker (pid:16376) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
654 |
"[2024-04-26 07:48:02 -0400] [14055] [ERROR] Worker (pid:16377) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
655 |
"[2024-04-26 07:48:02 -0400] [16405] [INFO] Booting worker with pid: 16405\n", |
|
|
656 |
"[2024-04-26 07:48:02 -0400] [16406] [INFO] Booting worker with pid: 16406\n", |
|
|
657 |
"[2024-04-26 07:48:02 -0400] [16407] [INFO] Booting worker with pid: 16407\n", |
|
|
658 |
"[2024-04-26 07:54:51 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16404)\n", |
|
|
659 |
"[2024-04-26 07:54:51 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16405)\n", |
|
|
660 |
"[2024-04-26 07:54:51 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16406)\n", |
|
|
661 |
"[2024-04-26 07:54:51 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16407)\n", |
|
|
662 |
"[2024-04-26 07:54:51 -0400] [16406] [INFO] Worker exiting (pid: 16406)\n", |
|
|
663 |
"[2024-04-26 07:54:51 -0400] [16405] [INFO] Worker exiting (pid: 16405)\n", |
|
|
664 |
"[2024-04-26 07:54:51 -0400] [16404] [INFO] Worker exiting (pid: 16404)\n", |
|
|
665 |
"[2024-04-26 07:54:51 -0400] [16407] [INFO] Worker exiting (pid: 16407)\n", |
|
|
666 |
"[2024-04-26 07:54:52 -0400] [14055] [ERROR] Worker (pid:16404) exited with code 1\n", |
|
|
667 |
"[2024-04-26 07:54:52 -0400] [14055] [ERROR] Worker (pid:16404) exited with code 1.\n", |
|
|
668 |
"[2024-04-26 07:54:52 -0400] [14055] [ERROR] Worker (pid:16407) exited with code 1\n", |
|
|
669 |
"[2024-04-26 07:54:52 -0400] [14055] [ERROR] Worker (pid:16407) exited with code 1.\n", |
|
|
670 |
"[2024-04-26 07:54:52 -0400] [14055] [ERROR] Worker (pid:16406) exited with code 1\n", |
|
|
671 |
"[2024-04-26 07:54:52 -0400] [14055] [ERROR] Worker (pid:16406) exited with code 1.\n", |
|
|
672 |
"[2024-04-26 07:54:52 -0400] [16450] [INFO] Booting worker with pid: 16450\n", |
|
|
673 |
"[2024-04-26 07:54:52 -0400] [14055] [ERROR] Worker (pid:16405) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
674 |
"[2024-04-26 07:54:52 -0400] [16451] [INFO] Booting worker with pid: 16451\n", |
|
|
675 |
"[2024-04-26 07:54:52 -0400] [16452] [INFO] Booting worker with pid: 16452\n", |
|
|
676 |
"[2024-04-26 07:54:52 -0400] [16453] [INFO] Booting worker with pid: 16453\n", |
|
|
677 |
"[2024-04-26 08:04:43 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16450)\n", |
|
|
678 |
"[2024-04-26 08:04:43 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16451)\n", |
|
|
679 |
"[2024-04-26 08:04:43 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16452)\n", |
|
|
680 |
"[2024-04-26 08:04:43 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16453)\n", |
|
|
681 |
"[2024-04-26 08:04:43 -0400] [16450] [INFO] Worker exiting (pid: 16450)\n", |
|
|
682 |
"[2024-04-26 08:04:43 -0400] [16451] [INFO] Worker exiting (pid: 16451)\n", |
|
|
683 |
"[2024-04-26 08:04:43 -0400] [16453] [INFO] Worker exiting (pid: 16453)\n", |
|
|
684 |
"[2024-04-26 08:04:43 -0400] [16452] [INFO] Worker exiting (pid: 16452)\n", |
|
|
685 |
"[2024-04-26 08:04:44 -0400] [14055] [ERROR] Worker (pid:16453) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
686 |
"[2024-04-26 08:04:44 -0400] [16510] [INFO] Booting worker with pid: 16510\n", |
|
|
687 |
"[2024-04-26 08:04:44 -0400] [14055] [ERROR] Worker (pid:16452) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
688 |
"[2024-04-26 08:04:44 -0400] [14055] [ERROR] Worker (pid:16451) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
689 |
"[2024-04-26 08:04:44 -0400] [14055] [ERROR] Worker (pid:16450) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
690 |
"[2024-04-26 08:04:44 -0400] [16511] [INFO] Booting worker with pid: 16511\n", |
|
|
691 |
"[2024-04-26 08:04:44 -0400] [16512] [INFO] Booting worker with pid: 16512\n", |
|
|
692 |
"[2024-04-26 08:04:44 -0400] [16514] [INFO] Booting worker with pid: 16514\n", |
|
|
693 |
"[2024-04-26 08:23:29 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16510)\n", |
|
|
694 |
"[2024-04-26 08:23:29 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16511)\n", |
|
|
695 |
"[2024-04-26 08:23:29 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16512)\n", |
|
|
696 |
"[2024-04-26 08:23:29 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16514)\n", |
|
|
697 |
"[2024-04-26 08:23:29 -0400] [16514] [INFO] Worker exiting (pid: 16514)\n", |
|
|
698 |
"[2024-04-26 08:23:29 -0400] [16511] [INFO] Worker exiting (pid: 16511)\n", |
|
|
699 |
"[2024-04-26 08:23:29 -0400] [16512] [INFO] Worker exiting (pid: 16512)\n", |
|
|
700 |
"[2024-04-26 08:23:29 -0400] [16510] [INFO] Worker exiting (pid: 16510)\n", |
|
|
701 |
"[2024-04-26 08:23:29 -0400] [14055] [ERROR] Worker (pid:16514) exited with code 1\n", |
|
|
702 |
"[2024-04-26 08:23:29 -0400] [14055] [ERROR] Worker (pid:16514) exited with code 1.\n", |
|
|
703 |
"[2024-04-26 08:23:29 -0400] [14055] [ERROR] Worker (pid:16512) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
704 |
"[2024-04-26 08:23:29 -0400] [14055] [ERROR] Worker (pid:16511) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
705 |
"[2024-04-26 08:23:29 -0400] [14055] [ERROR] Worker (pid:16510) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
706 |
"[2024-04-26 08:23:29 -0400] [16747] [INFO] Booting worker with pid: 16747\n", |
|
|
707 |
"[2024-04-26 08:23:29 -0400] [16748] [INFO] Booting worker with pid: 16748\n", |
|
|
708 |
"[2024-04-26 08:23:29 -0400] [16749] [INFO] Booting worker with pid: 16749\n", |
|
|
709 |
"[2024-04-26 08:23:29 -0400] [16750] [INFO] Booting worker with pid: 16750\n", |
|
|
710 |
"[2024-04-26 08:31:37 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16747)\n", |
|
|
711 |
"[2024-04-26 08:31:37 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16748)\n", |
|
|
712 |
"[2024-04-26 08:31:37 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16749)\n", |
|
|
713 |
"[2024-04-26 08:31:37 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16750)\n", |
|
|
714 |
"[2024-04-26 08:31:37 -0400] [16749] [INFO] Worker exiting (pid: 16749)\n", |
|
|
715 |
"[2024-04-26 08:31:37 -0400] [16750] [INFO] Worker exiting (pid: 16750)\n", |
|
|
716 |
"[2024-04-26 08:31:37 -0400] [16747] [INFO] Worker exiting (pid: 16747)\n", |
|
|
717 |
"[2024-04-26 08:31:37 -0400] [16748] [INFO] Worker exiting (pid: 16748)\n", |
|
|
718 |
"[2024-04-26 08:31:37 -0400] [14055] [ERROR] Worker (pid:16750) exited with code 1\n", |
|
|
719 |
"[2024-04-26 08:31:37 -0400] [14055] [ERROR] Worker (pid:16750) exited with code 1.\n", |
|
|
720 |
"[2024-04-26 08:31:37 -0400] [16768] [INFO] Booting worker with pid: 16768\n", |
|
|
721 |
"[2024-04-26 08:31:37 -0400] [14055] [ERROR] Worker (pid:16748) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
722 |
"[2024-04-26 08:31:37 -0400] [14055] [ERROR] Worker (pid:16747) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
723 |
"[2024-04-26 08:31:37 -0400] [14055] [ERROR] Worker (pid:16749) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
724 |
"[2024-04-26 08:31:37 -0400] [16769] [INFO] Booting worker with pid: 16769\n", |
|
|
725 |
"[2024-04-26 08:31:37 -0400] [16771] [INFO] Booting worker with pid: 16771\n", |
|
|
726 |
"[2024-04-26 08:31:37 -0400] [16772] [INFO] Booting worker with pid: 16772\n", |
|
|
727 |
"[2024-04-26 08:37:33 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16768)\n", |
|
|
728 |
"[2024-04-26 08:37:33 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16769)\n", |
|
|
729 |
"[2024-04-26 08:37:33 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16771)\n", |
|
|
730 |
"[2024-04-26 08:37:33 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16772)\n", |
|
|
731 |
"[2024-04-26 08:37:33 -0400] [16769] [INFO] Worker exiting (pid: 16769)\n", |
|
|
732 |
"[2024-04-26 08:37:33 -0400] [16768] [INFO] Worker exiting (pid: 16768)\n", |
|
|
733 |
"[2024-04-26 08:37:33 -0400] [16771] [INFO] Worker exiting (pid: 16771)\n", |
|
|
734 |
"[2024-04-26 08:37:33 -0400] [16772] [INFO] Worker exiting (pid: 16772)\n", |
|
|
735 |
"[2024-04-26 08:37:33 -0400] [14055] [ERROR] Worker (pid:16772) exited with code 1\n", |
|
|
736 |
"[2024-04-26 08:37:33 -0400] [14055] [ERROR] Worker (pid:16772) exited with code 1.\n", |
|
|
737 |
"[2024-04-26 08:37:33 -0400] [14055] [ERROR] Worker (pid:16771) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
738 |
"[2024-04-26 08:37:33 -0400] [14055] [ERROR] Worker (pid:16768) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
739 |
"[2024-04-26 08:37:33 -0400] [14055] [ERROR] Worker (pid:16769) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
740 |
"[2024-04-26 08:37:33 -0400] [16901] [INFO] Booting worker with pid: 16901\n", |
|
|
741 |
"[2024-04-26 08:37:33 -0400] [16902] [INFO] Booting worker with pid: 16902\n", |
|
|
742 |
"[2024-04-26 08:37:33 -0400] [16903] [INFO] Booting worker with pid: 16903\n", |
|
|
743 |
"[2024-04-26 08:37:33 -0400] [16904] [INFO] Booting worker with pid: 16904\n", |
|
|
744 |
"[2024-04-26 08:38:21 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16901)\n", |
|
|
745 |
"[2024-04-26 08:38:21 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16902)\n", |
|
|
746 |
"[2024-04-26 08:38:21 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16903)\n", |
|
|
747 |
"[2024-04-26 08:38:21 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16904)\n", |
|
|
748 |
"[2024-04-26 08:38:21 -0400] [16901] [INFO] Worker exiting (pid: 16901)\n", |
|
|
749 |
"[2024-04-26 08:38:21 -0400] [16902] [INFO] Worker exiting (pid: 16902)\n", |
|
|
750 |
"[2024-04-26 08:38:21 -0400] [16903] [INFO] Worker exiting (pid: 16903)\n", |
|
|
751 |
"[2024-04-26 08:38:21 -0400] [16904] [INFO] Worker exiting (pid: 16904)\n", |
|
|
752 |
"[2024-04-26 08:38:21 -0400] [14055] [ERROR] Worker (pid:16904) exited with code 1\n", |
|
|
753 |
"[2024-04-26 08:38:21 -0400] [14055] [ERROR] Worker (pid:16904) exited with code 1.\n", |
|
|
754 |
"[2024-04-26 08:38:21 -0400] [14055] [ERROR] Worker (pid:16902) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
755 |
"[2024-04-26 08:38:21 -0400] [16965] [INFO] Booting worker with pid: 16965\n", |
|
|
756 |
"[2024-04-26 08:38:21 -0400] [14055] [ERROR] Worker (pid:16901) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
757 |
"[2024-04-26 08:38:21 -0400] [14055] [ERROR] Worker (pid:16903) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
758 |
"[2024-04-26 08:38:21 -0400] [16966] [INFO] Booting worker with pid: 16966\n", |
|
|
759 |
"[2024-04-26 08:38:21 -0400] [16967] [INFO] Booting worker with pid: 16967\n", |
|
|
760 |
"[2024-04-26 08:38:21 -0400] [16968] [INFO] Booting worker with pid: 16968\n", |
|
|
761 |
"[2024-04-26 08:39:34 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16965)\n", |
|
|
762 |
"[2024-04-26 08:39:34 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16966)\n", |
|
|
763 |
"[2024-04-26 08:39:34 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16967)\n", |
|
|
764 |
"[2024-04-26 08:39:34 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:16968)\n", |
|
|
765 |
"[2024-04-26 08:39:34 -0400] [16965] [INFO] Worker exiting (pid: 16965)\n", |
|
|
766 |
"[2024-04-26 08:39:34 -0400] [16966] [INFO] Worker exiting (pid: 16966)\n", |
|
|
767 |
"[2024-04-26 08:39:34 -0400] [16967] [INFO] Worker exiting (pid: 16967)\n", |
|
|
768 |
"[2024-04-26 08:39:34 -0400] [16968] [INFO] Worker exiting (pid: 16968)\n", |
|
|
769 |
"[2024-04-26 08:39:34 -0400] [14055] [ERROR] Worker (pid:16965) exited with code 1\n", |
|
|
770 |
"[2024-04-26 08:39:34 -0400] [14055] [ERROR] Worker (pid:16965) exited with code 1.\n", |
|
|
771 |
"[2024-04-26 08:39:34 -0400] [17085] [INFO] Booting worker with pid: 17085\n", |
|
|
772 |
"[2024-04-26 08:39:34 -0400] [14055] [ERROR] Worker (pid:16966) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
773 |
"[2024-04-26 08:39:34 -0400] [14055] [ERROR] Worker (pid:16967) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
774 |
"[2024-04-26 08:39:34 -0400] [14055] [ERROR] Worker (pid:16968) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
775 |
"[2024-04-26 08:39:34 -0400] [17086] [INFO] Booting worker with pid: 17086\n", |
|
|
776 |
"[2024-04-26 08:39:34 -0400] [17087] [INFO] Booting worker with pid: 17087\n", |
|
|
777 |
"[2024-04-26 08:39:34 -0400] [17088] [INFO] Booting worker with pid: 17088\n", |
|
|
778 |
"[2024-04-26 08:40:44 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17085)\n", |
|
|
779 |
"[2024-04-26 08:40:44 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17086)\n", |
|
|
780 |
"[2024-04-26 08:40:44 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17087)\n", |
|
|
781 |
"[2024-04-26 08:40:44 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17088)\n", |
|
|
782 |
"[2024-04-26 08:40:44 -0400] [17086] [INFO] Worker exiting (pid: 17086)\n", |
|
|
783 |
"[2024-04-26 08:40:44 -0400] [17087] [INFO] Worker exiting (pid: 17087)\n", |
|
|
784 |
"[2024-04-26 08:40:44 -0400] [17085] [INFO] Worker exiting (pid: 17085)\n", |
|
|
785 |
"[2024-04-26 08:40:44 -0400] [17088] [INFO] Worker exiting (pid: 17088)\n", |
|
|
786 |
"[2024-04-26 08:40:44 -0400] [14055] [ERROR] Worker (pid:17086) exited with code 1\n", |
|
|
787 |
"[2024-04-26 08:40:44 -0400] [14055] [ERROR] Worker (pid:17086) exited with code 1.\n", |
|
|
788 |
"[2024-04-26 08:40:44 -0400] [17139] [INFO] Booting worker with pid: 17139\n", |
|
|
789 |
"[2024-04-26 08:40:44 -0400] [14055] [ERROR] Worker (pid:17088) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
790 |
"[2024-04-26 08:40:44 -0400] [14055] [ERROR] Worker (pid:17085) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
791 |
"[2024-04-26 08:40:44 -0400] [14055] [ERROR] Worker (pid:17087) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
792 |
"[2024-04-26 08:40:44 -0400] [17140] [INFO] Booting worker with pid: 17140\n", |
|
|
793 |
"[2024-04-26 08:40:44 -0400] [17141] [INFO] Booting worker with pid: 17141\n", |
|
|
794 |
"[2024-04-26 08:40:44 -0400] [17142] [INFO] Booting worker with pid: 17142\n", |
|
|
795 |
"[2024-04-26 08:41:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17139)\n", |
|
|
796 |
"[2024-04-26 08:41:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17140)\n", |
|
|
797 |
"[2024-04-26 08:41:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17141)\n", |
|
|
798 |
"[2024-04-26 08:41:32 -0400] [14055] [CRITICAL] WORKER TIMEOUT (pid:17142)\n", |
|
|
799 |
"[2024-04-26 08:41:32 -0400] [17142] [INFO] Worker exiting (pid: 17142)\n", |
|
|
800 |
"[2024-04-26 08:41:32 -0400] [17140] [INFO] Worker exiting (pid: 17140)\n", |
|
|
801 |
"[2024-04-26 08:41:32 -0400] [17141] [INFO] Worker exiting (pid: 17141)\n", |
|
|
802 |
"[2024-04-26 08:41:32 -0400] [17139] [INFO] Worker exiting (pid: 17139)\n", |
|
|
803 |
"[2024-04-26 08:41:32 -0400] [14055] [ERROR] Worker (pid:17140) exited with code 1\n", |
|
|
804 |
"[2024-04-26 08:41:32 -0400] [14055] [ERROR] Worker (pid:17140) exited with code 1.\n", |
|
|
805 |
"[2024-04-26 08:41:32 -0400] [14055] [ERROR] Worker (pid:17139) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
806 |
"[2024-04-26 08:41:32 -0400] [14055] [ERROR] Worker (pid:17141) exited with code 1\n", |
|
|
807 |
"[2024-04-26 08:41:32 -0400] [14055] [ERROR] Worker (pid:17141) exited with code 1.\n", |
|
|
808 |
"[2024-04-26 08:41:32 -0400] [14055] [ERROR] Worker (pid:17142) was sent SIGKILL! Perhaps out of memory?\n", |
|
|
809 |
"[2024-04-26 08:41:32 -0400] [17204] [INFO] Booting worker with pid: 17204\n", |
|
|
810 |
"[2024-04-26 08:41:32 -0400] [17205] [INFO] Booting worker with pid: 17205\n", |
|
|
811 |
"[2024-04-26 08:41:33 -0400] [17206] [INFO] Booting worker with pid: 17206\n", |
|
|
812 |
"[2024-04-26 08:41:33 -0400] [17207] [INFO] Booting worker with pid: 17207\n", |
|
|
813 |
"^C\n", |
|
|
814 |
"[2024-04-26 08:55:21 -0400] [14055] [INFO] Handling signal: int\n", |
|
|
815 |
"[2024-04-26 08:55:21 -0400] [17207] [INFO] Worker exiting (pid: 17207)\n", |
|
|
816 |
"[2024-04-26 08:55:21 -0400] [17205] [INFO] Worker exiting (pid: 17205)\n", |
|
|
817 |
"[2024-04-26 08:55:21 -0400] [17206] [INFO] Worker exiting (pid: 17206)\n", |
|
|
818 |
"[2024-04-26 08:55:21 -0400] [17204] [INFO] Worker exiting (pid: 17204)\n" |
|
|
819 |
] |
|
|
820 |
} |
|
|
821 |
], |
|
|
822 |
"source": [ |
|
|
823 |
"!mlflow ui --backend-store-uri \"sqlite:////Users/arham/Downloads/Projects/03-Experiments/new_mlflow.db\"" |
|
|
824 |
] |
|
|
825 |
}, |
|
|
826 |
{ |
|
|
827 |
"cell_type": "markdown", |
|
|
828 |
"metadata": {}, |
|
|
829 |
"source": [ |
|
|
830 |
"## Saving probabilities for stacked model later" |
|
|
831 |
] |
|
|
832 |
}, |
|
|
833 |
{ |
|
|
834 |
"cell_type": "code", |
|
|
835 |
"execution_count": 8, |
|
|
836 |
"metadata": {}, |
|
|
837 |
"outputs": [], |
|
|
838 |
"source": [ |
|
|
839 |
"# Make predictions on train, validation, and test data\n", |
|
|
840 |
"y_pred_train = predictor.predict(tr)\n", |
|
|
841 |
"y_pred_va = predictor.predict(va)\n", |
|
|
842 |
"y_pred_test = predictor.predict(te)\n", |
|
|
843 |
"\n", |
|
|
844 |
"# Get prediction probabilities for each class\n", |
|
|
845 |
"y_probabilities_train = predictor.predict_proba(tr)\n", |
|
|
846 |
"y_probabilities_va = predictor.predict_proba(va)\n", |
|
|
847 |
"y_probabilities_test = predictor.predict_proba(te)\n", |
|
|
848 |
"\n", |
|
|
849 |
"# add to tr, te, va\n", |
|
|
850 |
"test = pd.concat([te, y_probabilities_test.iloc[:, -7:]], axis=1)\n", |
|
|
851 |
"train = pd.concat([tr, y_probabilities_train.iloc[:, -7:]], axis=1)\n", |
|
|
852 |
"val = pd.concat([va, y_probabilities_va.iloc[:, -7:]], axis=1)\n" |
|
|
853 |
] |
|
|
854 |
}, |
|
|
855 |
{ |
|
|
856 |
"cell_type": "code", |
|
|
857 |
"execution_count": 9, |
|
|
858 |
"metadata": {}, |
|
|
859 |
"outputs": [ |
|
|
860 |
{ |
|
|
861 |
"data": { |
|
|
862 |
"text/html": [ |
|
|
863 |
"<div>\n", |
|
|
864 |
"<style scoped>\n", |
|
|
865 |
" .dataframe tbody tr th:only-of-type {\n", |
|
|
866 |
" vertical-align: middle;\n", |
|
|
867 |
" }\n", |
|
|
868 |
"\n", |
|
|
869 |
" .dataframe tbody tr th {\n", |
|
|
870 |
" vertical-align: top;\n", |
|
|
871 |
" }\n", |
|
|
872 |
"\n", |
|
|
873 |
" .dataframe thead th {\n", |
|
|
874 |
" text-align: right;\n", |
|
|
875 |
" }\n", |
|
|
876 |
"</style>\n", |
|
|
877 |
"<table border=\"1\" class=\"dataframe\">\n", |
|
|
878 |
" <thead>\n", |
|
|
879 |
" <tr style=\"text-align: right;\">\n", |
|
|
880 |
" <th></th>\n", |
|
|
881 |
" <th>Gender</th>\n", |
|
|
882 |
" <th>Age</th>\n", |
|
|
883 |
" <th>Height</th>\n", |
|
|
884 |
" <th>Weight</th>\n", |
|
|
885 |
" <th>family_history_with_overweight</th>\n", |
|
|
886 |
" <th>FAVC</th>\n", |
|
|
887 |
" <th>FCVC</th>\n", |
|
|
888 |
" <th>NCP</th>\n", |
|
|
889 |
" <th>CAEC</th>\n", |
|
|
890 |
" <th>SMOKE</th>\n", |
|
|
891 |
" <th>...</th>\n", |
|
|
892 |
" <th>Age * BMI^2</th>\n", |
|
|
893 |
" <th>Age^2 * BMI^2</th>\n", |
|
|
894 |
" <th>NObeyesdad</th>\n", |
|
|
895 |
" <th>0</th>\n", |
|
|
896 |
" <th>1</th>\n", |
|
|
897 |
" <th>2</th>\n", |
|
|
898 |
" <th>3</th>\n", |
|
|
899 |
" <th>4</th>\n", |
|
|
900 |
" <th>5</th>\n", |
|
|
901 |
" <th>6</th>\n", |
|
|
902 |
" </tr>\n", |
|
|
903 |
" </thead>\n", |
|
|
904 |
" <tbody>\n", |
|
|
905 |
" <tr>\n", |
|
|
906 |
" <th>0</th>\n", |
|
|
907 |
" <td>1</td>\n", |
|
|
908 |
" <td>21.000000</td>\n", |
|
|
909 |
" <td>1.550000</td>\n", |
|
|
910 |
" <td>51.000000</td>\n", |
|
|
911 |
" <td>0</td>\n", |
|
|
912 |
" <td>1</td>\n", |
|
|
913 |
" <td>3.000000</td>\n", |
|
|
914 |
" <td>1.0</td>\n", |
|
|
915 |
" <td>2</td>\n", |
|
|
916 |
" <td>0</td>\n", |
|
|
917 |
" <td>...</td>\n", |
|
|
918 |
" <td>445.785640</td>\n", |
|
|
919 |
" <td>450.623213</td>\n", |
|
|
920 |
" <td>0</td>\n", |
|
|
921 |
" <td>0.797175</td>\n", |
|
|
922 |
" <td>0.196596</td>\n", |
|
|
923 |
" <td>0.005617</td>\n", |
|
|
924 |
" <td>0.000520</td>\n", |
|
|
925 |
" <td>0.000032</td>\n", |
|
|
926 |
" <td>0.000019</td>\n", |
|
|
927 |
" <td>0.000040</td>\n", |
|
|
928 |
" </tr>\n", |
|
|
929 |
" <tr>\n", |
|
|
930 |
" <th>1</th>\n", |
|
|
931 |
" <td>0</td>\n", |
|
|
932 |
" <td>20.000000</td>\n", |
|
|
933 |
" <td>1.700000</td>\n", |
|
|
934 |
" <td>80.000000</td>\n", |
|
|
935 |
" <td>1</td>\n", |
|
|
936 |
" <td>1</td>\n", |
|
|
937 |
" <td>2.000000</td>\n", |
|
|
938 |
" <td>3.0</td>\n", |
|
|
939 |
" <td>1</td>\n", |
|
|
940 |
" <td>0</td>\n", |
|
|
941 |
" <td>...</td>\n", |
|
|
942 |
" <td>553.633218</td>\n", |
|
|
943 |
" <td>766.274350</td>\n", |
|
|
944 |
" <td>3</td>\n", |
|
|
945 |
" <td>0.000041</td>\n", |
|
|
946 |
" <td>0.001926</td>\n", |
|
|
947 |
" <td>0.047782</td>\n", |
|
|
948 |
" <td>0.948167</td>\n", |
|
|
949 |
" <td>0.002041</td>\n", |
|
|
950 |
" <td>0.000018</td>\n", |
|
|
951 |
" <td>0.000025</td>\n", |
|
|
952 |
" </tr>\n", |
|
|
953 |
" <tr>\n", |
|
|
954 |
" <th>2</th>\n", |
|
|
955 |
" <td>1</td>\n", |
|
|
956 |
" <td>18.000000</td>\n", |
|
|
957 |
" <td>1.600000</td>\n", |
|
|
958 |
" <td>60.000000</td>\n", |
|
|
959 |
" <td>1</td>\n", |
|
|
960 |
" <td>1</td>\n", |
|
|
961 |
" <td>2.000000</td>\n", |
|
|
962 |
" <td>3.0</td>\n", |
|
|
963 |
" <td>1</td>\n", |
|
|
964 |
" <td>0</td>\n", |
|
|
965 |
" <td>...</td>\n", |
|
|
966 |
" <td>421.875000</td>\n", |
|
|
967 |
" <td>549.316406</td>\n", |
|
|
968 |
" <td>1</td>\n", |
|
|
969 |
" <td>0.011628</td>\n", |
|
|
970 |
" <td>0.953612</td>\n", |
|
|
971 |
" <td>0.033047</td>\n", |
|
|
972 |
" <td>0.001538</td>\n", |
|
|
973 |
" <td>0.000150</td>\n", |
|
|
974 |
" <td>0.000005</td>\n", |
|
|
975 |
" <td>0.000020</td>\n", |
|
|
976 |
" </tr>\n", |
|
|
977 |
" <tr>\n", |
|
|
978 |
" <th>3</th>\n", |
|
|
979 |
" <td>1</td>\n", |
|
|
980 |
" <td>26.000000</td>\n", |
|
|
981 |
" <td>1.632983</td>\n", |
|
|
982 |
" <td>111.720238</td>\n", |
|
|
983 |
" <td>1</td>\n", |
|
|
984 |
" <td>1</td>\n", |
|
|
985 |
" <td>3.000000</td>\n", |
|
|
986 |
" <td>3.0</td>\n", |
|
|
987 |
" <td>1</td>\n", |
|
|
988 |
" <td>0</td>\n", |
|
|
989 |
" <td>...</td>\n", |
|
|
990 |
" <td>1089.285877</td>\n", |
|
|
991 |
" <td>1755.242193</td>\n", |
|
|
992 |
" <td>6</td>\n", |
|
|
993 |
" <td>0.000001</td>\n", |
|
|
994 |
" <td>0.000002</td>\n", |
|
|
995 |
" <td>0.000008</td>\n", |
|
|
996 |
" <td>0.000018</td>\n", |
|
|
997 |
" <td>0.000172</td>\n", |
|
|
998 |
" <td>0.000040</td>\n", |
|
|
999 |
" <td>0.999759</td>\n", |
|
|
1000 |
" </tr>\n", |
|
|
1001 |
" <tr>\n", |
|
|
1002 |
" <th>4</th>\n", |
|
|
1003 |
" <td>1</td>\n", |
|
|
1004 |
" <td>21.682636</td>\n", |
|
|
1005 |
" <td>1.748524</td>\n", |
|
|
1006 |
" <td>133.845064</td>\n", |
|
|
1007 |
" <td>1</td>\n", |
|
|
1008 |
" <td>1</td>\n", |
|
|
1009 |
" <td>3.000000</td>\n", |
|
|
1010 |
" <td>3.0</td>\n", |
|
|
1011 |
" <td>1</td>\n", |
|
|
1012 |
" <td>0</td>\n", |
|
|
1013 |
" <td>...</td>\n", |
|
|
1014 |
" <td>949.229536</td>\n", |
|
|
1015 |
" <td>1916.541944</td>\n", |
|
|
1016 |
" <td>6</td>\n", |
|
|
1017 |
" <td>0.000001</td>\n", |
|
|
1018 |
" <td>0.000001</td>\n", |
|
|
1019 |
" <td>0.000004</td>\n", |
|
|
1020 |
" <td>0.000012</td>\n", |
|
|
1021 |
" <td>0.000092</td>\n", |
|
|
1022 |
" <td>0.000058</td>\n", |
|
|
1023 |
" <td>0.999831</td>\n", |
|
|
1024 |
" </tr>\n", |
|
|
1025 |
" <tr>\n", |
|
|
1026 |
" <th>...</th>\n", |
|
|
1027 |
" <td>...</td>\n", |
|
|
1028 |
" <td>...</td>\n", |
|
|
1029 |
" <td>...</td>\n", |
|
|
1030 |
" <td>...</td>\n", |
|
|
1031 |
" <td>...</td>\n", |
|
|
1032 |
" <td>...</td>\n", |
|
|
1033 |
" <td>...</td>\n", |
|
|
1034 |
" <td>...</td>\n", |
|
|
1035 |
" <td>...</td>\n", |
|
|
1036 |
" <td>...</td>\n", |
|
|
1037 |
" <td>...</td>\n", |
|
|
1038 |
" <td>...</td>\n", |
|
|
1039 |
" <td>...</td>\n", |
|
|
1040 |
" <td>...</td>\n", |
|
|
1041 |
" <td>...</td>\n", |
|
|
1042 |
" <td>...</td>\n", |
|
|
1043 |
" <td>...</td>\n", |
|
|
1044 |
" <td>...</td>\n", |
|
|
1045 |
" <td>...</td>\n", |
|
|
1046 |
" <td>...</td>\n", |
|
|
1047 |
" <td>...</td>\n", |
|
|
1048 |
" </tr>\n", |
|
|
1049 |
" <tr>\n", |
|
|
1050 |
" <th>10788</th>\n", |
|
|
1051 |
" <td>0</td>\n", |
|
|
1052 |
" <td>18.000000</td>\n", |
|
|
1053 |
" <td>1.780000</td>\n", |
|
|
1054 |
" <td>108.000000</td>\n", |
|
|
1055 |
" <td>1</td>\n", |
|
|
1056 |
" <td>1</td>\n", |
|
|
1057 |
" <td>2.000000</td>\n", |
|
|
1058 |
" <td>3.0</td>\n", |
|
|
1059 |
" <td>1</td>\n", |
|
|
1060 |
" <td>0</td>\n", |
|
|
1061 |
" <td>...</td>\n", |
|
|
1062 |
" <td>613.558894</td>\n", |
|
|
1063 |
" <td>1161.896656</td>\n", |
|
|
1064 |
" <td>4</td>\n", |
|
|
1065 |
" <td>0.000007</td>\n", |
|
|
1066 |
" <td>0.000014</td>\n", |
|
|
1067 |
" <td>0.000035</td>\n", |
|
|
1068 |
" <td>0.000287</td>\n", |
|
|
1069 |
" <td>0.998704</td>\n", |
|
|
1070 |
" <td>0.000949</td>\n", |
|
|
1071 |
" <td>0.000005</td>\n", |
|
|
1072 |
" </tr>\n", |
|
|
1073 |
" <tr>\n", |
|
|
1074 |
" <th>10789</th>\n", |
|
|
1075 |
" <td>1</td>\n", |
|
|
1076 |
" <td>26.000000</td>\n", |
|
|
1077 |
" <td>1.641601</td>\n", |
|
|
1078 |
" <td>111.830924</td>\n", |
|
|
1079 |
" <td>1</td>\n", |
|
|
1080 |
" <td>1</td>\n", |
|
|
1081 |
" <td>3.000000</td>\n", |
|
|
1082 |
" <td>3.0</td>\n", |
|
|
1083 |
" <td>1</td>\n", |
|
|
1084 |
" <td>0</td>\n", |
|
|
1085 |
" <td>...</td>\n", |
|
|
1086 |
" <td>1078.946835</td>\n", |
|
|
1087 |
" <td>1722.080284</td>\n", |
|
|
1088 |
" <td>6</td>\n", |
|
|
1089 |
" <td>0.000001</td>\n", |
|
|
1090 |
" <td>0.000002</td>\n", |
|
|
1091 |
" <td>0.000007</td>\n", |
|
|
1092 |
" <td>0.000020</td>\n", |
|
|
1093 |
" <td>0.000154</td>\n", |
|
|
1094 |
" <td>0.000059</td>\n", |
|
|
1095 |
" <td>0.999757</td>\n", |
|
|
1096 |
" </tr>\n", |
|
|
1097 |
" <tr>\n", |
|
|
1098 |
" <th>10790</th>\n", |
|
|
1099 |
" <td>0</td>\n", |
|
|
1100 |
" <td>21.000000</td>\n", |
|
|
1101 |
" <td>1.770000</td>\n", |
|
|
1102 |
" <td>75.000000</td>\n", |
|
|
1103 |
" <td>0</td>\n", |
|
|
1104 |
" <td>1</td>\n", |
|
|
1105 |
" <td>3.000000</td>\n", |
|
|
1106 |
" <td>3.0</td>\n", |
|
|
1107 |
" <td>2</td>\n", |
|
|
1108 |
" <td>0</td>\n", |
|
|
1109 |
" <td>...</td>\n", |
|
|
1110 |
" <td>502.729101</td>\n", |
|
|
1111 |
" <td>573.098750</td>\n", |
|
|
1112 |
" <td>2</td>\n", |
|
|
1113 |
" <td>0.000212</td>\n", |
|
|
1114 |
" <td>0.341897</td>\n", |
|
|
1115 |
" <td>0.657261</td>\n", |
|
|
1116 |
" <td>0.000391</td>\n", |
|
|
1117 |
" <td>0.000052</td>\n", |
|
|
1118 |
" <td>0.000019</td>\n", |
|
|
1119 |
" <td>0.000168</td>\n", |
|
|
1120 |
" </tr>\n", |
|
|
1121 |
" <tr>\n", |
|
|
1122 |
" <th>10791</th>\n", |
|
|
1123 |
" <td>0</td>\n", |
|
|
1124 |
" <td>29.669219</td>\n", |
|
|
1125 |
" <td>1.774644</td>\n", |
|
|
1126 |
" <td>105.966894</td>\n", |
|
|
1127 |
" <td>1</td>\n", |
|
|
1128 |
" <td>1</td>\n", |
|
|
1129 |
" <td>2.934671</td>\n", |
|
|
1130 |
" <td>3.0</td>\n", |
|
|
1131 |
" <td>1</td>\n", |
|
|
1132 |
" <td>0</td>\n", |
|
|
1133 |
" <td>...</td>\n", |
|
|
1134 |
" <td>998.283353</td>\n", |
|
|
1135 |
" <td>1132.127734</td>\n", |
|
|
1136 |
" <td>4</td>\n", |
|
|
1137 |
" <td>0.000621</td>\n", |
|
|
1138 |
" <td>0.000067</td>\n", |
|
|
1139 |
" <td>0.000338</td>\n", |
|
|
1140 |
" <td>0.004232</td>\n", |
|
|
1141 |
" <td>0.936736</td>\n", |
|
|
1142 |
" <td>0.057409</td>\n", |
|
|
1143 |
" <td>0.000597</td>\n", |
|
|
1144 |
" </tr>\n", |
|
|
1145 |
" <tr>\n", |
|
|
1146 |
" <th>10792</th>\n", |
|
|
1147 |
" <td>1</td>\n", |
|
|
1148 |
" <td>26.000000</td>\n", |
|
|
1149 |
" <td>1.656504</td>\n", |
|
|
1150 |
" <td>111.884535</td>\n", |
|
|
1151 |
" <td>1</td>\n", |
|
|
1152 |
" <td>1</td>\n", |
|
|
1153 |
" <td>3.000000</td>\n", |
|
|
1154 |
" <td>3.0</td>\n", |
|
|
1155 |
" <td>1</td>\n", |
|
|
1156 |
" <td>0</td>\n", |
|
|
1157 |
" <td>...</td>\n", |
|
|
1158 |
" <td>1060.128308</td>\n", |
|
|
1159 |
" <td>1662.532588</td>\n", |
|
|
1160 |
" <td>6</td>\n", |
|
|
1161 |
" <td>0.000001</td>\n", |
|
|
1162 |
" <td>0.000002</td>\n", |
|
|
1163 |
" <td>0.000007</td>\n", |
|
|
1164 |
" <td>0.000021</td>\n", |
|
|
1165 |
" <td>0.000173</td>\n", |
|
|
1166 |
" <td>0.000076</td>\n", |
|
|
1167 |
" <td>0.999719</td>\n", |
|
|
1168 |
" </tr>\n", |
|
|
1169 |
" </tbody>\n", |
|
|
1170 |
"</table>\n", |
|
|
1171 |
"<p>10793 rows × 36 columns</p>\n", |
|
|
1172 |
"</div>" |
|
|
1173 |
], |
|
|
1174 |
"text/plain": [ |
|
|
1175 |
" Gender Age Height Weight \\\n", |
|
|
1176 |
"0 1 21.000000 1.550000 51.000000 \n", |
|
|
1177 |
"1 0 20.000000 1.700000 80.000000 \n", |
|
|
1178 |
"2 1 18.000000 1.600000 60.000000 \n", |
|
|
1179 |
"3 1 26.000000 1.632983 111.720238 \n", |
|
|
1180 |
"4 1 21.682636 1.748524 133.845064 \n", |
|
|
1181 |
"... ... ... ... ... \n", |
|
|
1182 |
"10788 0 18.000000 1.780000 108.000000 \n", |
|
|
1183 |
"10789 1 26.000000 1.641601 111.830924 \n", |
|
|
1184 |
"10790 0 21.000000 1.770000 75.000000 \n", |
|
|
1185 |
"10791 0 29.669219 1.774644 105.966894 \n", |
|
|
1186 |
"10792 1 26.000000 1.656504 111.884535 \n", |
|
|
1187 |
"\n", |
|
|
1188 |
" family_history_with_overweight FAVC FCVC NCP CAEC SMOKE ... \\\n", |
|
|
1189 |
"0 0 1 3.000000 1.0 2 0 ... \n", |
|
|
1190 |
"1 1 1 2.000000 3.0 1 0 ... \n", |
|
|
1191 |
"2 1 1 2.000000 3.0 1 0 ... \n", |
|
|
1192 |
"3 1 1 3.000000 3.0 1 0 ... \n", |
|
|
1193 |
"4 1 1 3.000000 3.0 1 0 ... \n", |
|
|
1194 |
"... ... ... ... ... ... ... ... \n", |
|
|
1195 |
"10788 1 1 2.000000 3.0 1 0 ... \n", |
|
|
1196 |
"10789 1 1 3.000000 3.0 1 0 ... \n", |
|
|
1197 |
"10790 0 1 3.000000 3.0 2 0 ... \n", |
|
|
1198 |
"10791 1 1 2.934671 3.0 1 0 ... \n", |
|
|
1199 |
"10792 1 1 3.000000 3.0 1 0 ... \n", |
|
|
1200 |
"\n", |
|
|
1201 |
" Age * BMI^2 Age^2 * BMI^2 NObeyesdad 0 1 2 \\\n", |
|
|
1202 |
"0 445.785640 450.623213 0 0.797175 0.196596 0.005617 \n", |
|
|
1203 |
"1 553.633218 766.274350 3 0.000041 0.001926 0.047782 \n", |
|
|
1204 |
"2 421.875000 549.316406 1 0.011628 0.953612 0.033047 \n", |
|
|
1205 |
"3 1089.285877 1755.242193 6 0.000001 0.000002 0.000008 \n", |
|
|
1206 |
"4 949.229536 1916.541944 6 0.000001 0.000001 0.000004 \n", |
|
|
1207 |
"... ... ... ... ... ... ... \n", |
|
|
1208 |
"10788 613.558894 1161.896656 4 0.000007 0.000014 0.000035 \n", |
|
|
1209 |
"10789 1078.946835 1722.080284 6 0.000001 0.000002 0.000007 \n", |
|
|
1210 |
"10790 502.729101 573.098750 2 0.000212 0.341897 0.657261 \n", |
|
|
1211 |
"10791 998.283353 1132.127734 4 0.000621 0.000067 0.000338 \n", |
|
|
1212 |
"10792 1060.128308 1662.532588 6 0.000001 0.000002 0.000007 \n", |
|
|
1213 |
"\n", |
|
|
1214 |
" 3 4 5 6 \n", |
|
|
1215 |
"0 0.000520 0.000032 0.000019 0.000040 \n", |
|
|
1216 |
"1 0.948167 0.002041 0.000018 0.000025 \n", |
|
|
1217 |
"2 0.001538 0.000150 0.000005 0.000020 \n", |
|
|
1218 |
"3 0.000018 0.000172 0.000040 0.999759 \n", |
|
|
1219 |
"4 0.000012 0.000092 0.000058 0.999831 \n", |
|
|
1220 |
"... ... ... ... ... \n", |
|
|
1221 |
"10788 0.000287 0.998704 0.000949 0.000005 \n", |
|
|
1222 |
"10789 0.000020 0.000154 0.000059 0.999757 \n", |
|
|
1223 |
"10790 0.000391 0.000052 0.000019 0.000168 \n", |
|
|
1224 |
"10791 0.004232 0.936736 0.057409 0.000597 \n", |
|
|
1225 |
"10792 0.000021 0.000173 0.000076 0.999719 \n", |
|
|
1226 |
"\n", |
|
|
1227 |
"[10793 rows x 36 columns]" |
|
|
1228 |
] |
|
|
1229 |
}, |
|
|
1230 |
"execution_count": 9, |
|
|
1231 |
"metadata": {}, |
|
|
1232 |
"output_type": "execute_result" |
|
|
1233 |
} |
|
|
1234 |
], |
|
|
1235 |
"source": [ |
|
|
1236 |
"train" |
|
|
1237 |
] |
|
|
1238 |
}, |
|
|
1239 |
{ |
|
|
1240 |
"cell_type": "code", |
|
|
1241 |
"execution_count": 27, |
|
|
1242 |
"metadata": {}, |
|
|
1243 |
"outputs": [ |
|
|
1244 |
{ |
|
|
1245 |
"data": { |
|
|
1246 |
"text/html": [ |
|
|
1247 |
"<style type=\"text/css\">\n", |
|
|
1248 |
"#T_960f5_row8_col1 {\n", |
|
|
1249 |
" background-color: lightgreen;\n", |
|
|
1250 |
"}\n", |
|
|
1251 |
"</style>\n", |
|
|
1252 |
"<table id=\"T_960f5\">\n", |
|
|
1253 |
" <thead>\n", |
|
|
1254 |
" <tr>\n", |
|
|
1255 |
" <th class=\"blank level0\" > </th>\n", |
|
|
1256 |
" <th id=\"T_960f5_level0_col0\" class=\"col_heading level0 col0\" >Description</th>\n", |
|
|
1257 |
" <th id=\"T_960f5_level0_col1\" class=\"col_heading level0 col1\" >Value</th>\n", |
|
|
1258 |
" </tr>\n", |
|
|
1259 |
" </thead>\n", |
|
|
1260 |
" <tbody>\n", |
|
|
1261 |
" <tr>\n", |
|
|
1262 |
" <th id=\"T_960f5_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n", |
|
|
1263 |
" <td id=\"T_960f5_row0_col0\" class=\"data row0 col0\" >Session id</td>\n", |
|
|
1264 |
" <td id=\"T_960f5_row0_col1\" class=\"data row0 col1\" >5119</td>\n", |
|
|
1265 |
" </tr>\n", |
|
|
1266 |
" <tr>\n", |
|
|
1267 |
" <th id=\"T_960f5_level0_row1\" class=\"row_heading level0 row1\" >1</th>\n", |
|
|
1268 |
" <td id=\"T_960f5_row1_col0\" class=\"data row1 col0\" >Target</td>\n", |
|
|
1269 |
" <td id=\"T_960f5_row1_col1\" class=\"data row1 col1\" >NObeyesdad</td>\n", |
|
|
1270 |
" </tr>\n", |
|
|
1271 |
" <tr>\n", |
|
|
1272 |
" <th id=\"T_960f5_level0_row2\" class=\"row_heading level0 row2\" >2</th>\n", |
|
|
1273 |
" <td id=\"T_960f5_row2_col0\" class=\"data row2 col0\" >Target type</td>\n", |
|
|
1274 |
" <td id=\"T_960f5_row2_col1\" class=\"data row2 col1\" >Multiclass</td>\n", |
|
|
1275 |
" </tr>\n", |
|
|
1276 |
" <tr>\n", |
|
|
1277 |
" <th id=\"T_960f5_level0_row3\" class=\"row_heading level0 row3\" >3</th>\n", |
|
|
1278 |
" <td id=\"T_960f5_row3_col0\" class=\"data row3 col0\" >Original data shape</td>\n", |
|
|
1279 |
" <td id=\"T_960f5_row3_col1\" class=\"data row3 col1\" >(10793, 35)</td>\n", |
|
|
1280 |
" </tr>\n", |
|
|
1281 |
" <tr>\n", |
|
|
1282 |
" <th id=\"T_960f5_level0_row4\" class=\"row_heading level0 row4\" >4</th>\n", |
|
|
1283 |
" <td id=\"T_960f5_row4_col0\" class=\"data row4 col0\" >Transformed data shape</td>\n", |
|
|
1284 |
" <td id=\"T_960f5_row4_col1\" class=\"data row4 col1\" >(10793, 35)</td>\n", |
|
|
1285 |
" </tr>\n", |
|
|
1286 |
" <tr>\n", |
|
|
1287 |
" <th id=\"T_960f5_level0_row5\" class=\"row_heading level0 row5\" >5</th>\n", |
|
|
1288 |
" <td id=\"T_960f5_row5_col0\" class=\"data row5 col0\" >Transformed train set shape</td>\n", |
|
|
1289 |
" <td id=\"T_960f5_row5_col1\" class=\"data row5 col1\" >(7555, 35)</td>\n", |
|
|
1290 |
" </tr>\n", |
|
|
1291 |
" <tr>\n", |
|
|
1292 |
" <th id=\"T_960f5_level0_row6\" class=\"row_heading level0 row6\" >6</th>\n", |
|
|
1293 |
" <td id=\"T_960f5_row6_col0\" class=\"data row6 col0\" >Transformed test set shape</td>\n", |
|
|
1294 |
" <td id=\"T_960f5_row6_col1\" class=\"data row6 col1\" >(3238, 35)</td>\n", |
|
|
1295 |
" </tr>\n", |
|
|
1296 |
" <tr>\n", |
|
|
1297 |
" <th id=\"T_960f5_level0_row7\" class=\"row_heading level0 row7\" >7</th>\n", |
|
|
1298 |
" <td id=\"T_960f5_row7_col0\" class=\"data row7 col0\" >Numeric features</td>\n", |
|
|
1299 |
" <td id=\"T_960f5_row7_col1\" class=\"data row7 col1\" >34</td>\n", |
|
|
1300 |
" </tr>\n", |
|
|
1301 |
" <tr>\n", |
|
|
1302 |
" <th id=\"T_960f5_level0_row8\" class=\"row_heading level0 row8\" >8</th>\n", |
|
|
1303 |
" <td id=\"T_960f5_row8_col0\" class=\"data row8 col0\" >Preprocess</td>\n", |
|
|
1304 |
" <td id=\"T_960f5_row8_col1\" class=\"data row8 col1\" >True</td>\n", |
|
|
1305 |
" </tr>\n", |
|
|
1306 |
" <tr>\n", |
|
|
1307 |
" <th id=\"T_960f5_level0_row9\" class=\"row_heading level0 row9\" >9</th>\n", |
|
|
1308 |
" <td id=\"T_960f5_row9_col0\" class=\"data row9 col0\" >Imputation type</td>\n", |
|
|
1309 |
" <td id=\"T_960f5_row9_col1\" class=\"data row9 col1\" >simple</td>\n", |
|
|
1310 |
" </tr>\n", |
|
|
1311 |
" <tr>\n", |
|
|
1312 |
" <th id=\"T_960f5_level0_row10\" class=\"row_heading level0 row10\" >10</th>\n", |
|
|
1313 |
" <td id=\"T_960f5_row10_col0\" class=\"data row10 col0\" >Numeric imputation</td>\n", |
|
|
1314 |
" <td id=\"T_960f5_row10_col1\" class=\"data row10 col1\" >mean</td>\n", |
|
|
1315 |
" </tr>\n", |
|
|
1316 |
" <tr>\n", |
|
|
1317 |
" <th id=\"T_960f5_level0_row11\" class=\"row_heading level0 row11\" >11</th>\n", |
|
|
1318 |
" <td id=\"T_960f5_row11_col0\" class=\"data row11 col0\" >Categorical imputation</td>\n", |
|
|
1319 |
" <td id=\"T_960f5_row11_col1\" class=\"data row11 col1\" >mode</td>\n", |
|
|
1320 |
" </tr>\n", |
|
|
1321 |
" <tr>\n", |
|
|
1322 |
" <th id=\"T_960f5_level0_row12\" class=\"row_heading level0 row12\" >12</th>\n", |
|
|
1323 |
" <td id=\"T_960f5_row12_col0\" class=\"data row12 col0\" >Fold Generator</td>\n", |
|
|
1324 |
" <td id=\"T_960f5_row12_col1\" class=\"data row12 col1\" >StratifiedKFold</td>\n", |
|
|
1325 |
" </tr>\n", |
|
|
1326 |
" <tr>\n", |
|
|
1327 |
" <th id=\"T_960f5_level0_row13\" class=\"row_heading level0 row13\" >13</th>\n", |
|
|
1328 |
" <td id=\"T_960f5_row13_col0\" class=\"data row13 col0\" >Fold Number</td>\n", |
|
|
1329 |
" <td id=\"T_960f5_row13_col1\" class=\"data row13 col1\" >10</td>\n", |
|
|
1330 |
" </tr>\n", |
|
|
1331 |
" <tr>\n", |
|
|
1332 |
" <th id=\"T_960f5_level0_row14\" class=\"row_heading level0 row14\" >14</th>\n", |
|
|
1333 |
" <td id=\"T_960f5_row14_col0\" class=\"data row14 col0\" >CPU Jobs</td>\n", |
|
|
1334 |
" <td id=\"T_960f5_row14_col1\" class=\"data row14 col1\" >-1</td>\n", |
|
|
1335 |
" </tr>\n", |
|
|
1336 |
" <tr>\n", |
|
|
1337 |
" <th id=\"T_960f5_level0_row15\" class=\"row_heading level0 row15\" >15</th>\n", |
|
|
1338 |
" <td id=\"T_960f5_row15_col0\" class=\"data row15 col0\" >Use GPU</td>\n", |
|
|
1339 |
" <td id=\"T_960f5_row15_col1\" class=\"data row15 col1\" >False</td>\n", |
|
|
1340 |
" </tr>\n", |
|
|
1341 |
" <tr>\n", |
|
|
1342 |
" <th id=\"T_960f5_level0_row16\" class=\"row_heading level0 row16\" >16</th>\n", |
|
|
1343 |
" <td id=\"T_960f5_row16_col0\" class=\"data row16 col0\" >Log Experiment</td>\n", |
|
|
1344 |
" <td id=\"T_960f5_row16_col1\" class=\"data row16 col1\" >False</td>\n", |
|
|
1345 |
" </tr>\n", |
|
|
1346 |
" <tr>\n", |
|
|
1347 |
" <th id=\"T_960f5_level0_row17\" class=\"row_heading level0 row17\" >17</th>\n", |
|
|
1348 |
" <td id=\"T_960f5_row17_col0\" class=\"data row17 col0\" >Experiment Name</td>\n", |
|
|
1349 |
" <td id=\"T_960f5_row17_col1\" class=\"data row17 col1\" >clf-default-name</td>\n", |
|
|
1350 |
" </tr>\n", |
|
|
1351 |
" <tr>\n", |
|
|
1352 |
" <th id=\"T_960f5_level0_row18\" class=\"row_heading level0 row18\" >18</th>\n", |
|
|
1353 |
" <td id=\"T_960f5_row18_col0\" class=\"data row18 col0\" >USI</td>\n", |
|
|
1354 |
" <td id=\"T_960f5_row18_col1\" class=\"data row18 col1\" >2ccb</td>\n", |
|
|
1355 |
" </tr>\n", |
|
|
1356 |
" </tbody>\n", |
|
|
1357 |
"</table>\n" |
|
|
1358 |
], |
|
|
1359 |
"text/plain": [ |
|
|
1360 |
"<pandas.io.formats.style.Styler at 0x143ae0a90>" |
|
|
1361 |
] |
|
|
1362 |
}, |
|
|
1363 |
"metadata": {}, |
|
|
1364 |
"output_type": "display_data" |
|
|
1365 |
}, |
|
|
1366 |
{ |
|
|
1367 |
"data": { |
|
|
1368 |
"text/html": [], |
|
|
1369 |
"text/plain": [ |
|
|
1370 |
"<IPython.core.display.HTML object>" |
|
|
1371 |
] |
|
|
1372 |
}, |
|
|
1373 |
"metadata": {}, |
|
|
1374 |
"output_type": "display_data" |
|
|
1375 |
}, |
|
|
1376 |
{ |
|
|
1377 |
"data": { |
|
|
1378 |
"text/html": [ |
|
|
1379 |
"<style type=\"text/css\">\n", |
|
|
1380 |
"#T_d099c_row10_col0, #T_d099c_row10_col1, #T_d099c_row10_col2, #T_d099c_row10_col3, #T_d099c_row10_col4, #T_d099c_row10_col5, #T_d099c_row10_col6 {\n", |
|
|
1381 |
" background: yellow;\n", |
|
|
1382 |
"}\n", |
|
|
1383 |
"</style>\n", |
|
|
1384 |
"<table id=\"T_d099c\">\n", |
|
|
1385 |
" <thead>\n", |
|
|
1386 |
" <tr>\n", |
|
|
1387 |
" <th class=\"blank level0\" > </th>\n", |
|
|
1388 |
" <th id=\"T_d099c_level0_col0\" class=\"col_heading level0 col0\" >Accuracy</th>\n", |
|
|
1389 |
" <th id=\"T_d099c_level0_col1\" class=\"col_heading level0 col1\" >AUC</th>\n", |
|
|
1390 |
" <th id=\"T_d099c_level0_col2\" class=\"col_heading level0 col2\" >Recall</th>\n", |
|
|
1391 |
" <th id=\"T_d099c_level0_col3\" class=\"col_heading level0 col3\" >Prec.</th>\n", |
|
|
1392 |
" <th id=\"T_d099c_level0_col4\" class=\"col_heading level0 col4\" >F1</th>\n", |
|
|
1393 |
" <th id=\"T_d099c_level0_col5\" class=\"col_heading level0 col5\" >Kappa</th>\n", |
|
|
1394 |
" <th id=\"T_d099c_level0_col6\" class=\"col_heading level0 col6\" >MCC</th>\n", |
|
|
1395 |
" </tr>\n", |
|
|
1396 |
" <tr>\n", |
|
|
1397 |
" <th class=\"index_name level0\" >Fold</th>\n", |
|
|
1398 |
" <th class=\"blank col0\" > </th>\n", |
|
|
1399 |
" <th class=\"blank col1\" > </th>\n", |
|
|
1400 |
" <th class=\"blank col2\" > </th>\n", |
|
|
1401 |
" <th class=\"blank col3\" > </th>\n", |
|
|
1402 |
" <th class=\"blank col4\" > </th>\n", |
|
|
1403 |
" <th class=\"blank col5\" > </th>\n", |
|
|
1404 |
" <th class=\"blank col6\" > </th>\n", |
|
|
1405 |
" </tr>\n", |
|
|
1406 |
" </thead>\n", |
|
|
1407 |
" <tbody>\n", |
|
|
1408 |
" <tr>\n", |
|
|
1409 |
" <th id=\"T_d099c_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n", |
|
|
1410 |
" <td id=\"T_d099c_row0_col0\" class=\"data row0 col0\" >0.8307</td>\n", |
|
|
1411 |
" <td id=\"T_d099c_row0_col1\" class=\"data row0 col1\" >0.9024</td>\n", |
|
|
1412 |
" <td id=\"T_d099c_row0_col2\" class=\"data row0 col2\" >0.8307</td>\n", |
|
|
1413 |
" <td id=\"T_d099c_row0_col3\" class=\"data row0 col3\" >0.8307</td>\n", |
|
|
1414 |
" <td id=\"T_d099c_row0_col4\" class=\"data row0 col4\" >0.8304</td>\n", |
|
|
1415 |
" <td id=\"T_d099c_row0_col5\" class=\"data row0 col5\" >0.8013</td>\n", |
|
|
1416 |
" <td id=\"T_d099c_row0_col6\" class=\"data row0 col6\" >0.8014</td>\n", |
|
|
1417 |
" </tr>\n", |
|
|
1418 |
" <tr>\n", |
|
|
1419 |
" <th id=\"T_d099c_level0_row1\" class=\"row_heading level0 row1\" >1</th>\n", |
|
|
1420 |
" <td id=\"T_d099c_row1_col0\" class=\"data row1 col0\" >0.8241</td>\n", |
|
|
1421 |
" <td id=\"T_d099c_row1_col1\" class=\"data row1 col1\" >0.8991</td>\n", |
|
|
1422 |
" <td id=\"T_d099c_row1_col2\" class=\"data row1 col2\" >0.8241</td>\n", |
|
|
1423 |
" <td id=\"T_d099c_row1_col3\" class=\"data row1 col3\" >0.8259</td>\n", |
|
|
1424 |
" <td id=\"T_d099c_row1_col4\" class=\"data row1 col4\" >0.8248</td>\n", |
|
|
1425 |
" <td id=\"T_d099c_row1_col5\" class=\"data row1 col5\" >0.7937</td>\n", |
|
|
1426 |
" <td id=\"T_d099c_row1_col6\" class=\"data row1 col6\" >0.7938</td>\n", |
|
|
1427 |
" </tr>\n", |
|
|
1428 |
" <tr>\n", |
|
|
1429 |
" <th id=\"T_d099c_level0_row2\" class=\"row_heading level0 row2\" >2</th>\n", |
|
|
1430 |
" <td id=\"T_d099c_row2_col0\" class=\"data row2 col0\" >0.8571</td>\n", |
|
|
1431 |
" <td id=\"T_d099c_row2_col1\" class=\"data row2 col1\" >0.9178</td>\n", |
|
|
1432 |
" <td id=\"T_d099c_row2_col2\" class=\"data row2 col2\" >0.8571</td>\n", |
|
|
1433 |
" <td id=\"T_d099c_row2_col3\" class=\"data row2 col3\" >0.8616</td>\n", |
|
|
1434 |
" <td id=\"T_d099c_row2_col4\" class=\"data row2 col4\" >0.8588</td>\n", |
|
|
1435 |
" <td id=\"T_d099c_row2_col5\" class=\"data row2 col5\" >0.8324</td>\n", |
|
|
1436 |
" <td id=\"T_d099c_row2_col6\" class=\"data row2 col6\" >0.8325</td>\n", |
|
|
1437 |
" </tr>\n", |
|
|
1438 |
" <tr>\n", |
|
|
1439 |
" <th id=\"T_d099c_level0_row3\" class=\"row_heading level0 row3\" >3</th>\n", |
|
|
1440 |
" <td id=\"T_d099c_row3_col0\" class=\"data row3 col0\" >0.8347</td>\n", |
|
|
1441 |
" <td id=\"T_d099c_row3_col1\" class=\"data row3 col1\" >0.9048</td>\n", |
|
|
1442 |
" <td id=\"T_d099c_row3_col2\" class=\"data row3 col2\" >0.8347</td>\n", |
|
|
1443 |
" <td id=\"T_d099c_row3_col3\" class=\"data row3 col3\" >0.8336</td>\n", |
|
|
1444 |
" <td id=\"T_d099c_row3_col4\" class=\"data row3 col4\" >0.8334</td>\n", |
|
|
1445 |
" <td id=\"T_d099c_row3_col5\" class=\"data row3 col5\" >0.8059</td>\n", |
|
|
1446 |
" <td id=\"T_d099c_row3_col6\" class=\"data row3 col6\" >0.8061</td>\n", |
|
|
1447 |
" </tr>\n", |
|
|
1448 |
" <tr>\n", |
|
|
1449 |
" <th id=\"T_d099c_level0_row4\" class=\"row_heading level0 row4\" >4</th>\n", |
|
|
1450 |
" <td id=\"T_d099c_row4_col0\" class=\"data row4 col0\" >0.8254</td>\n", |
|
|
1451 |
" <td id=\"T_d099c_row4_col1\" class=\"data row4 col1\" >0.8996</td>\n", |
|
|
1452 |
" <td id=\"T_d099c_row4_col2\" class=\"data row4 col2\" >0.8254</td>\n", |
|
|
1453 |
" <td id=\"T_d099c_row4_col3\" class=\"data row4 col3\" >0.8254</td>\n", |
|
|
1454 |
" <td id=\"T_d099c_row4_col4\" class=\"data row4 col4\" >0.8253</td>\n", |
|
|
1455 |
" <td id=\"T_d099c_row4_col5\" class=\"data row4 col5\" >0.7951</td>\n", |
|
|
1456 |
" <td id=\"T_d099c_row4_col6\" class=\"data row4 col6\" >0.7951</td>\n", |
|
|
1457 |
" </tr>\n", |
|
|
1458 |
" <tr>\n", |
|
|
1459 |
" <th id=\"T_d099c_level0_row5\" class=\"row_heading level0 row5\" >5</th>\n", |
|
|
1460 |
" <td id=\"T_d099c_row5_col0\" class=\"data row5 col0\" >0.8477</td>\n", |
|
|
1461 |
" <td id=\"T_d099c_row5_col1\" class=\"data row5 col1\" >0.9123</td>\n", |
|
|
1462 |
" <td id=\"T_d099c_row5_col2\" class=\"data row5 col2\" >0.8477</td>\n", |
|
|
1463 |
" <td id=\"T_d099c_row5_col3\" class=\"data row5 col3\" >0.8471</td>\n", |
|
|
1464 |
" <td id=\"T_d099c_row5_col4\" class=\"data row5 col4\" >0.8473</td>\n", |
|
|
1465 |
" <td id=\"T_d099c_row5_col5\" class=\"data row5 col5\" >0.8213</td>\n", |
|
|
1466 |
" <td id=\"T_d099c_row5_col6\" class=\"data row5 col6\" >0.8213</td>\n", |
|
|
1467 |
" </tr>\n", |
|
|
1468 |
" <tr>\n", |
|
|
1469 |
" <th id=\"T_d099c_level0_row6\" class=\"row_heading level0 row6\" >6</th>\n", |
|
|
1470 |
" <td id=\"T_d099c_row6_col0\" class=\"data row6 col0\" >0.8278</td>\n", |
|
|
1471 |
" <td id=\"T_d099c_row6_col1\" class=\"data row6 col1\" >0.9007</td>\n", |
|
|
1472 |
" <td id=\"T_d099c_row6_col2\" class=\"data row6 col2\" >0.8278</td>\n", |
|
|
1473 |
" <td id=\"T_d099c_row6_col3\" class=\"data row6 col3\" >0.8268</td>\n", |
|
|
1474 |
" <td id=\"T_d099c_row6_col4\" class=\"data row6 col4\" >0.8271</td>\n", |
|
|
1475 |
" <td id=\"T_d099c_row6_col5\" class=\"data row6 col5\" >0.7979</td>\n", |
|
|
1476 |
" <td id=\"T_d099c_row6_col6\" class=\"data row6 col6\" >0.7980</td>\n", |
|
|
1477 |
" </tr>\n", |
|
|
1478 |
" <tr>\n", |
|
|
1479 |
" <th id=\"T_d099c_level0_row7\" class=\"row_heading level0 row7\" >7</th>\n", |
|
|
1480 |
" <td id=\"T_d099c_row7_col0\" class=\"data row7 col0\" >0.8291</td>\n", |
|
|
1481 |
" <td id=\"T_d099c_row7_col1\" class=\"data row7 col1\" >0.9019</td>\n", |
|
|
1482 |
" <td id=\"T_d099c_row7_col2\" class=\"data row7 col2\" >0.8291</td>\n", |
|
|
1483 |
" <td id=\"T_d099c_row7_col3\" class=\"data row7 col3\" >0.8330</td>\n", |
|
|
1484 |
" <td id=\"T_d099c_row7_col4\" class=\"data row7 col4\" >0.8298</td>\n", |
|
|
1485 |
" <td id=\"T_d099c_row7_col5\" class=\"data row7 col5\" >0.7997</td>\n", |
|
|
1486 |
" <td id=\"T_d099c_row7_col6\" class=\"data row7 col6\" >0.8002</td>\n", |
|
|
1487 |
" </tr>\n", |
|
|
1488 |
" <tr>\n", |
|
|
1489 |
" <th id=\"T_d099c_level0_row8\" class=\"row_heading level0 row8\" >8</th>\n", |
|
|
1490 |
" <td id=\"T_d099c_row8_col0\" class=\"data row8 col0\" >0.8424</td>\n", |
|
|
1491 |
" <td id=\"T_d099c_row8_col1\" class=\"data row8 col1\" >0.9093</td>\n", |
|
|
1492 |
" <td id=\"T_d099c_row8_col2\" class=\"data row8 col2\" >0.8424</td>\n", |
|
|
1493 |
" <td id=\"T_d099c_row8_col3\" class=\"data row8 col3\" >0.8451</td>\n", |
|
|
1494 |
" <td id=\"T_d099c_row8_col4\" class=\"data row8 col4\" >0.8434</td>\n", |
|
|
1495 |
" <td id=\"T_d099c_row8_col5\" class=\"data row8 col5\" >0.8151</td>\n", |
|
|
1496 |
" <td id=\"T_d099c_row8_col6\" class=\"data row8 col6\" >0.8152</td>\n", |
|
|
1497 |
" </tr>\n", |
|
|
1498 |
" <tr>\n", |
|
|
1499 |
" <th id=\"T_d099c_level0_row9\" class=\"row_heading level0 row9\" >9</th>\n", |
|
|
1500 |
" <td id=\"T_d099c_row9_col0\" class=\"data row9 col0\" >0.8331</td>\n", |
|
|
1501 |
" <td id=\"T_d099c_row9_col1\" class=\"data row9 col1\" >0.9038</td>\n", |
|
|
1502 |
" <td id=\"T_d099c_row9_col2\" class=\"data row9 col2\" >0.8331</td>\n", |
|
|
1503 |
" <td id=\"T_d099c_row9_col3\" class=\"data row9 col3\" >0.8334</td>\n", |
|
|
1504 |
" <td id=\"T_d099c_row9_col4\" class=\"data row9 col4\" >0.8329</td>\n", |
|
|
1505 |
" <td id=\"T_d099c_row9_col5\" class=\"data row9 col5\" >0.8041</td>\n", |
|
|
1506 |
" <td id=\"T_d099c_row9_col6\" class=\"data row9 col6\" >0.8043</td>\n", |
|
|
1507 |
" </tr>\n", |
|
|
1508 |
" <tr>\n", |
|
|
1509 |
" <th id=\"T_d099c_level0_row10\" class=\"row_heading level0 row10\" >Mean</th>\n", |
|
|
1510 |
" <td id=\"T_d099c_row10_col0\" class=\"data row10 col0\" >0.8352</td>\n", |
|
|
1511 |
" <td id=\"T_d099c_row10_col1\" class=\"data row10 col1\" >0.9052</td>\n", |
|
|
1512 |
" <td id=\"T_d099c_row10_col2\" class=\"data row10 col2\" >0.8352</td>\n", |
|
|
1513 |
" <td id=\"T_d099c_row10_col3\" class=\"data row10 col3\" >0.8363</td>\n", |
|
|
1514 |
" <td id=\"T_d099c_row10_col4\" class=\"data row10 col4\" >0.8353</td>\n", |
|
|
1515 |
" <td id=\"T_d099c_row10_col5\" class=\"data row10 col5\" >0.8066</td>\n", |
|
|
1516 |
" <td id=\"T_d099c_row10_col6\" class=\"data row10 col6\" >0.8068</td>\n", |
|
|
1517 |
" </tr>\n", |
|
|
1518 |
" <tr>\n", |
|
|
1519 |
" <th id=\"T_d099c_level0_row11\" class=\"row_heading level0 row11\" >Std</th>\n", |
|
|
1520 |
" <td id=\"T_d099c_row11_col0\" class=\"data row11 col0\" >0.0101</td>\n", |
|
|
1521 |
" <td id=\"T_d099c_row11_col1\" class=\"data row11 col1\" >0.0058</td>\n", |
|
|
1522 |
" <td id=\"T_d099c_row11_col2\" class=\"data row11 col2\" >0.0101</td>\n", |
|
|
1523 |
" <td id=\"T_d099c_row11_col3\" class=\"data row11 col3\" >0.0110</td>\n", |
|
|
1524 |
" <td id=\"T_d099c_row11_col4\" class=\"data row11 col4\" >0.0105</td>\n", |
|
|
1525 |
" <td id=\"T_d099c_row11_col5\" class=\"data row11 col5\" >0.0119</td>\n", |
|
|
1526 |
" <td id=\"T_d099c_row11_col6\" class=\"data row11 col6\" >0.0119</td>\n", |
|
|
1527 |
" </tr>\n", |
|
|
1528 |
" </tbody>\n", |
|
|
1529 |
"</table>\n" |
|
|
1530 |
], |
|
|
1531 |
"text/plain": [ |
|
|
1532 |
"<pandas.io.formats.style.Styler at 0x143b24130>" |
|
|
1533 |
] |
|
|
1534 |
}, |
|
|
1535 |
"metadata": {}, |
|
|
1536 |
"output_type": "display_data" |
|
|
1537 |
}, |
|
|
1538 |
{ |
|
|
1539 |
"data": { |
|
|
1540 |
"text/html": [], |
|
|
1541 |
"text/plain": [ |
|
|
1542 |
"<IPython.core.display.HTML object>" |
|
|
1543 |
] |
|
|
1544 |
}, |
|
|
1545 |
"metadata": {}, |
|
|
1546 |
"output_type": "display_data" |
|
|
1547 |
}, |
|
|
1548 |
{ |
|
|
1549 |
"data": { |
|
|
1550 |
"text/html": [ |
|
|
1551 |
"<style type=\"text/css\">\n", |
|
|
1552 |
"</style>\n", |
|
|
1553 |
"<table id=\"T_d319f\">\n", |
|
|
1554 |
" <thead>\n", |
|
|
1555 |
" <tr>\n", |
|
|
1556 |
" <th class=\"blank level0\" > </th>\n", |
|
|
1557 |
" <th id=\"T_d319f_level0_col0\" class=\"col_heading level0 col0\" >Model</th>\n", |
|
|
1558 |
" <th id=\"T_d319f_level0_col1\" class=\"col_heading level0 col1\" >Accuracy</th>\n", |
|
|
1559 |
" <th id=\"T_d319f_level0_col2\" class=\"col_heading level0 col2\" >AUC</th>\n", |
|
|
1560 |
" <th id=\"T_d319f_level0_col3\" class=\"col_heading level0 col3\" >Recall</th>\n", |
|
|
1561 |
" <th id=\"T_d319f_level0_col4\" class=\"col_heading level0 col4\" >Prec.</th>\n", |
|
|
1562 |
" <th id=\"T_d319f_level0_col5\" class=\"col_heading level0 col5\" >F1</th>\n", |
|
|
1563 |
" <th id=\"T_d319f_level0_col6\" class=\"col_heading level0 col6\" >Kappa</th>\n", |
|
|
1564 |
" <th id=\"T_d319f_level0_col7\" class=\"col_heading level0 col7\" >MCC</th>\n", |
|
|
1565 |
" </tr>\n", |
|
|
1566 |
" </thead>\n", |
|
|
1567 |
" <tbody>\n", |
|
|
1568 |
" <tr>\n", |
|
|
1569 |
" <th id=\"T_d319f_level0_row0\" class=\"row_heading level0 row0\" >0</th>\n", |
|
|
1570 |
" <td id=\"T_d319f_row0_col0\" class=\"data row0 col0\" >Decision Tree Classifier</td>\n", |
|
|
1571 |
" <td id=\"T_d319f_row0_col1\" class=\"data row0 col1\" >0.8222</td>\n", |
|
|
1572 |
" <td id=\"T_d319f_row0_col2\" class=\"data row0 col2\" >0.8973</td>\n", |
|
|
1573 |
" <td id=\"T_d319f_row0_col3\" class=\"data row0 col3\" >0.8222</td>\n", |
|
|
1574 |
" <td id=\"T_d319f_row0_col4\" class=\"data row0 col4\" >0.8227</td>\n", |
|
|
1575 |
" <td id=\"T_d319f_row0_col5\" class=\"data row0 col5\" >0.8222</td>\n", |
|
|
1576 |
" <td id=\"T_d319f_row0_col6\" class=\"data row0 col6\" >0.7916</td>\n", |
|
|
1577 |
" <td id=\"T_d319f_row0_col7\" class=\"data row0 col7\" >0.7917</td>\n", |
|
|
1578 |
" </tr>\n", |
|
|
1579 |
" </tbody>\n", |
|
|
1580 |
"</table>\n" |
|
|
1581 |
], |
|
|
1582 |
"text/plain": [ |
|
|
1583 |
"<pandas.io.formats.style.Styler at 0x28324fa90>" |
|
|
1584 |
] |
|
|
1585 |
}, |
|
|
1586 |
"metadata": {}, |
|
|
1587 |
"output_type": "display_data" |
|
|
1588 |
}, |
|
|
1589 |
{ |
|
|
1590 |
"ename": "ValueError", |
|
|
1591 |
"evalue": "Classification metrics can't handle a mix of multiclass and continuous-multioutput targets", |
|
|
1592 |
"output_type": "error", |
|
|
1593 |
"traceback": [ |
|
|
1594 |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
|
|
1595 |
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", |
|
|
1596 |
"Cell \u001b[0;32mIn[27], line 64\u001b[0m\n\u001b[1;32m 61\u001b[0m y_val_pred_pycaret \u001b[38;5;241m=\u001b[39m predict_model(model, data\u001b[38;5;241m=\u001b[39mval_data)\n\u001b[1;32m 63\u001b[0m \u001b[38;5;66;03m# Evaluate performance\u001b[39;00m\n\u001b[0;32m---> 64\u001b[0m precision, recall, f1, support \u001b[38;5;241m=\u001b[39m \u001b[43mprecision_recall_fscore_support\u001b[49m\u001b[43m(\u001b[49m\u001b[43my_val\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my_val_pred_pycaret\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maverage\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mweighted\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 66\u001b[0m \u001b[38;5;66;03m# Log metrics and model using MLflow\u001b[39;00m\n\u001b[1;32m 67\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m mlflow\u001b[38;5;241m.\u001b[39mstart_run(run_name\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPyCaret_Extended_Engineering\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 68\u001b[0m \u001b[38;5;66;03m# Log PyCaret model\u001b[39;00m\n", |
|
|
1597 |
"File \u001b[0;32m~/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/utils/_param_validation.py:213\u001b[0m, in \u001b[0;36mvalidate_params.<locals>.decorator.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 207\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 208\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m config_context(\n\u001b[1;32m 209\u001b[0m skip_parameter_validation\u001b[38;5;241m=\u001b[39m(\n\u001b[1;32m 210\u001b[0m prefer_skip_nested_validation \u001b[38;5;129;01mor\u001b[39;00m global_skip_validation\n\u001b[1;32m 211\u001b[0m )\n\u001b[1;32m 212\u001b[0m ):\n\u001b[0;32m--> 213\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 214\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m InvalidParameterError \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 215\u001b[0m \u001b[38;5;66;03m# When the function is just a wrapper around an estimator, we allow\u001b[39;00m\n\u001b[1;32m 216\u001b[0m \u001b[38;5;66;03m# the function to delegate validation to the estimator, but we replace\u001b[39;00m\n\u001b[1;32m 217\u001b[0m \u001b[38;5;66;03m# the name of the estimator by the name of the function in the error\u001b[39;00m\n\u001b[1;32m 218\u001b[0m \u001b[38;5;66;03m# message to avoid confusion.\u001b[39;00m\n\u001b[1;32m 219\u001b[0m msg \u001b[38;5;241m=\u001b[39m re\u001b[38;5;241m.\u001b[39msub(\n\u001b[1;32m 220\u001b[0m \u001b[38;5;124mr\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mparameter of \u001b[39m\u001b[38;5;124m\\\u001b[39m\u001b[38;5;124mw+ must be\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 221\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mparameter of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfunc\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__qualname__\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m must be\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 222\u001b[0m \u001b[38;5;28mstr\u001b[39m(e),\n\u001b[1;32m 223\u001b[0m )\n", |
|
|
1598 |
"File \u001b[0;32m~/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/metrics/_classification.py:1755\u001b[0m, in \u001b[0;36mprecision_recall_fscore_support\u001b[0;34m(y_true, y_pred, beta, labels, pos_label, average, warn_for, sample_weight, zero_division)\u001b[0m\n\u001b[1;32m 1592\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Compute precision, recall, F-measure and support for each class.\u001b[39;00m\n\u001b[1;32m 1593\u001b[0m \n\u001b[1;32m 1594\u001b[0m \u001b[38;5;124;03mThe precision is the ratio ``tp / (tp + fp)`` where ``tp`` is the number of\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1752\u001b[0m \u001b[38;5;124;03m array([2, 2, 2]))\u001b[39;00m\n\u001b[1;32m 1753\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1754\u001b[0m _check_zero_division(zero_division)\n\u001b[0;32m-> 1755\u001b[0m labels \u001b[38;5;241m=\u001b[39m \u001b[43m_check_set_wise_labels\u001b[49m\u001b[43m(\u001b[49m\u001b[43my_true\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my_pred\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maverage\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlabels\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpos_label\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1757\u001b[0m \u001b[38;5;66;03m# Calculate tp_sum, pred_sum, true_sum ###\u001b[39;00m\n\u001b[1;32m 1758\u001b[0m samplewise \u001b[38;5;241m=\u001b[39m average \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msamples\u001b[39m\u001b[38;5;124m\"\u001b[39m\n", |
|
|
1599 |
"File \u001b[0;32m~/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/metrics/_classification.py:1527\u001b[0m, in \u001b[0;36m_check_set_wise_labels\u001b[0;34m(y_true, y_pred, average, labels, pos_label)\u001b[0m\n\u001b[1;32m 1524\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m average \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m average_options \u001b[38;5;129;01mand\u001b[39;00m average \u001b[38;5;241m!=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mbinary\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n\u001b[1;32m 1525\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124maverage has to be one of \u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m+\u001b[39m \u001b[38;5;28mstr\u001b[39m(average_options))\n\u001b[0;32m-> 1527\u001b[0m y_type, y_true, y_pred \u001b[38;5;241m=\u001b[39m \u001b[43m_check_targets\u001b[49m\u001b[43m(\u001b[49m\u001b[43my_true\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my_pred\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1528\u001b[0m \u001b[38;5;66;03m# Convert to Python primitive type to avoid NumPy type / Python str\u001b[39;00m\n\u001b[1;32m 1529\u001b[0m \u001b[38;5;66;03m# comparison. See https://github.com/numpy/numpy/issues/6784\u001b[39;00m\n\u001b[1;32m 1530\u001b[0m present_labels \u001b[38;5;241m=\u001b[39m unique_labels(y_true, y_pred)\u001b[38;5;241m.\u001b[39mtolist()\n", |
|
|
1600 |
"File \u001b[0;32m~/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/metrics/_classification.py:94\u001b[0m, in \u001b[0;36m_check_targets\u001b[0;34m(y_true, y_pred)\u001b[0m\n\u001b[1;32m 91\u001b[0m y_type \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmulticlass\u001b[39m\u001b[38;5;124m\"\u001b[39m}\n\u001b[1;32m 93\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(y_type) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m---> 94\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 95\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mClassification metrics can\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt handle a mix of \u001b[39m\u001b[38;5;132;01m{0}\u001b[39;00m\u001b[38;5;124m and \u001b[39m\u001b[38;5;132;01m{1}\u001b[39;00m\u001b[38;5;124m targets\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\n\u001b[1;32m 96\u001b[0m type_true, type_pred\n\u001b[1;32m 97\u001b[0m )\n\u001b[1;32m 98\u001b[0m )\n\u001b[1;32m 100\u001b[0m \u001b[38;5;66;03m# We can't have more than one value on y_type => The set is no more needed\u001b[39;00m\n\u001b[1;32m 101\u001b[0m y_type \u001b[38;5;241m=\u001b[39m y_type\u001b[38;5;241m.\u001b[39mpop()\n", |
|
|
1601 |
"\u001b[0;31mValueError\u001b[0m: Classification metrics can't handle a mix of multiclass and continuous-multioutput targets" |
|
|
1602 |
] |
|
|
1603 |
} |
|
|
1604 |
], |
|
|
1605 |
"source": [ |
|
|
1606 |
"path = '/Users/arham/Downloads/Projects/01-Dataset/01-Data-for-model-building/train.csv'\n", |
|
|
1607 |
"train_df, val_df, test_df = load_data(path)\n", |
|
|
1608 |
"\n", |
|
|
1609 |
"train_df = datatypes(train_df)\n", |
|
|
1610 |
"train_df = encode_target(train_df)\n", |
|
|
1611 |
"train_df = age_binning(train_df)\n", |
|
|
1612 |
"train_df, scaler_age = age_scaling_minmax(train_df)\n", |
|
|
1613 |
"train_df = age_scaling_log(train_df)\n", |
|
|
1614 |
"train_df, scaler_weight = weight_scaling_minmax(train_df)\n", |
|
|
1615 |
"train_df = weight_scaling_log(train_df)\n", |
|
|
1616 |
"train_df, scaler_height = height_scaling_minmax(train_df)\n", |
|
|
1617 |
"train_df = height_scaling_log(train_df)\n", |
|
|
1618 |
"train_df = make_gender_binary(train_df)\n", |
|
|
1619 |
"train_df = fix_binary_columns(train_df)\n", |
|
|
1620 |
"train_df = freq_cat_cols(train_df)\n", |
|
|
1621 |
"train_df = Mtrans(train_df)\n", |
|
|
1622 |
"train_df = other_features(train_df)\n", |
|
|
1623 |
"\n", |
|
|
1624 |
"val_df = test_pipeline(val_df, scaler_age, scaler_weight, scaler_height)\n", |
|
|
1625 |
"test_df = test_pipeline(test_df, scaler_age, scaler_weight, scaler_height)\n", |
|
|
1626 |
"\n", |
|
|
1627 |
"Target = 'NObeyesdad'\n", |
|
|
1628 |
"features = train_df.columns.drop(Target)\n", |
|
|
1629 |
"\n", |
|
|
1630 |
"features = ['Gender', 'Age', 'Height', 'Weight', 'family_history_with_overweight',\n", |
|
|
1631 |
" 'FAVC', 'FCVC', 'NCP', 'CAEC', 'SMOKE', 'CH2O', 'SCC', 'FAF', 'TUE',\n", |
|
|
1632 |
" 'CALC', 'Age_Group', \n", |
|
|
1633 |
" 'MTRANS_Automobile', 'MTRANS_Bike', 'MTRANS_Motorbike',\n", |
|
|
1634 |
" 'MTRANS_Public_Transportation', 'MTRANS_Walking', 'BMI', 'Age^2',\n", |
|
|
1635 |
" 'Age^3', 'BMI^2', 'Age * BMI', 'Age * BMI^2', 'Age^2 * BMI^2', \n", |
|
|
1636 |
" 'Scaled_Age', 'Log_Age', 'Scaled_Weight', 'Log_Weight', 'Scaled_Height', 'Log_Height']\n", |
|
|
1637 |
"#'Scaled_Age', 'Log_Age', 'Scaled_Weight', 'Log_Weight', 'Scaled_Height', 'Log_Height',\n", |
|
|
1638 |
"\n", |
|
|
1639 |
"X_train = train_df[features]\n", |
|
|
1640 |
"y_train = train_df[Target]\n", |
|
|
1641 |
"X_val = val_df[features]\n", |
|
|
1642 |
"y_val = val_df[Target]\n", |
|
|
1643 |
"X_test = test_df[features]\n", |
|
|
1644 |
"y_test = test_df[Target]\n", |
|
|
1645 |
"\n", |
|
|
1646 |
"#combine X_train and y_train as one dataframe\n", |
|
|
1647 |
"tr = pd.concat([X_train, y_train], axis=1)\n", |
|
|
1648 |
"te = pd.concat([X_test, y_test], axis =1)\n", |
|
|
1649 |
"va = pd.concat([X_val, y_val], axis = 1)\n" |
|
|
1650 |
] |
|
|
1651 |
}, |
|
|
1652 |
{ |
|
|
1653 |
"cell_type": "markdown", |
|
|
1654 |
"metadata": {}, |
|
|
1655 |
"source": [ |
|
|
1656 |
"### Zero Shot Learning" |
|
|
1657 |
] |
|
|
1658 |
}, |
|
|
1659 |
{ |
|
|
1660 |
"cell_type": "code", |
|
|
1661 |
"execution_count": 20, |
|
|
1662 |
"metadata": {}, |
|
|
1663 |
"outputs": [ |
|
|
1664 |
{ |
|
|
1665 |
"name": "stderr", |
|
|
1666 |
"output_type": "stream", |
|
|
1667 |
"text": [ |
|
|
1668 |
"No path specified. Models will be saved in: \"AutogluonModels/ag-20240426_052138\"\n", |
|
|
1669 |
"No presets specified! To achieve strong results with AutoGluon, it is recommended to use the available presets.\n", |
|
|
1670 |
"\tRecommended Presets (For more details refer to https://auto.gluon.ai/stable/tutorials/tabular/tabular-essentials.html#presets):\n", |
|
|
1671 |
"\tpresets='best_quality' : Maximize accuracy. Default time_limit=3600.\n", |
|
|
1672 |
"\tpresets='high_quality' : Strong accuracy with fast inference speed. Default time_limit=3600.\n", |
|
|
1673 |
"\tpresets='good_quality' : Good accuracy with very fast inference speed. Default time_limit=3600.\n", |
|
|
1674 |
"\tpresets='medium_quality' : Fast training time, ideal for initial prototyping.\n", |
|
|
1675 |
"Beginning AutoGluon training ...\n", |
|
|
1676 |
"AutoGluon will save models to \"AutogluonModels/ag-20240426_052138\"\n", |
|
|
1677 |
"=================== System Info ===================\n", |
|
|
1678 |
"AutoGluon Version: 1.1.0\n", |
|
|
1679 |
"Python Version: 3.10.13\n", |
|
|
1680 |
"Operating System: Darwin\n", |
|
|
1681 |
"Platform Machine: arm64\n", |
|
|
1682 |
"Platform Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:57 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8112\n", |
|
|
1683 |
"CPU Count: 8\n", |
|
|
1684 |
"Memory Avail: 1.23 GB / 8.00 GB (15.3%)\n", |
|
|
1685 |
"Disk Space Avail: 14.94 GB / 228.27 GB (6.5%)\n", |
|
|
1686 |
"===================================================\n", |
|
|
1687 |
"Train Data Rows: 10793\n", |
|
|
1688 |
"Train Data Columns: 34\n", |
|
|
1689 |
"Label Column: NObeyesdad\n", |
|
|
1690 |
"AutoGluon infers your prediction problem is: 'multiclass' (because dtype of label-column == int, but few unique label-values observed).\n", |
|
|
1691 |
"\t7 unique label values: [0, 3, 1, 6, 4, 2, 5]\n", |
|
|
1692 |
"\tIf 'multiclass' is not the correct problem_type, please manually specify the problem_type parameter during predictor init (You may specify problem_type as one of: ['binary', 'multiclass', 'regression'])\n", |
|
|
1693 |
"Problem Type: multiclass\n", |
|
|
1694 |
"Preprocessing data ...\n", |
|
|
1695 |
"Train Data Class Count: 7\n", |
|
|
1696 |
"Using Feature Generators to preprocess the data ...\n", |
|
|
1697 |
"Fitting AutoMLPipelineFeatureGenerator...\n", |
|
|
1698 |
"\tAvailable Memory: 1252.16 MB\n", |
|
|
1699 |
"\tTrain Data (Original) Memory Usage: 2.80 MB (0.2% of available memory)\n", |
|
|
1700 |
"\tInferring data type of each feature based on column values. Set feature_metadata_in to manually specify special dtypes of the features.\n", |
|
|
1701 |
"\tStage 1 Generators:\n", |
|
|
1702 |
"\t\tFitting AsTypeFeatureGenerator...\n", |
|
|
1703 |
"\t\t\tNote: Converting 10 features to boolean dtype as they only contain 2 unique values.\n", |
|
|
1704 |
"\tStage 2 Generators:\n", |
|
|
1705 |
"\t\tFitting FillNaFeatureGenerator...\n", |
|
|
1706 |
"\tStage 3 Generators:\n", |
|
|
1707 |
"\t\tFitting IdentityFeatureGenerator...\n", |
|
|
1708 |
"\tStage 4 Generators:\n", |
|
|
1709 |
"\t\tFitting DropUniqueFeatureGenerator...\n", |
|
|
1710 |
"\tStage 5 Generators:\n", |
|
|
1711 |
"\t\tFitting DropDuplicatesFeatureGenerator...\n", |
|
|
1712 |
"\tUseless Original Features (Count: 1): ['Age^2']\n", |
|
|
1713 |
"\t\tThese features carry no predictive signal and should be manually investigated.\n", |
|
|
1714 |
"\t\tThis is typically a feature which has the same value for all rows.\n", |
|
|
1715 |
"\t\tThese features do not need to be present at inference time.\n", |
|
|
1716 |
"\tUnused Original Features (Count: 2): ['Age^3', 'BMI^2']\n", |
|
|
1717 |
"\t\tThese features were not used to generate any of the output features. Add a feature generator compatible with these features to utilize them.\n", |
|
|
1718 |
"\t\tFeatures can also be unused if they carry very little information, such as being categorical but having almost entirely unique values or being duplicates of other features.\n", |
|
|
1719 |
"\t\tThese features do not need to be present at inference time.\n", |
|
|
1720 |
"\t\t('float', []) : 2 | ['Age^3', 'BMI^2']\n", |
|
|
1721 |
"\tTypes of features in original data (raw dtype, special dtypes):\n", |
|
|
1722 |
"\t\t('float', []) : 18 | ['Age', 'Height', 'Weight', 'FCVC', 'NCP', ...]\n", |
|
|
1723 |
"\t\t('int', []) : 13 | ['Gender', 'family_history_with_overweight', 'FAVC', 'CAEC', 'SMOKE', ...]\n", |
|
|
1724 |
"\tTypes of features in processed data (raw dtype, special dtypes):\n", |
|
|
1725 |
"\t\t('float', []) : 18 | ['Age', 'Height', 'Weight', 'FCVC', 'NCP', ...]\n", |
|
|
1726 |
"\t\t('int', []) : 3 | ['CAEC', 'CALC', 'Age_Group']\n", |
|
|
1727 |
"\t\t('int', ['bool']) : 10 | ['Gender', 'family_history_with_overweight', 'FAVC', 'SMOKE', 'SCC', ...]\n", |
|
|
1728 |
"\t0.6s = Fit runtime\n", |
|
|
1729 |
"\t31 features in original data used to generate 31 features in processed data.\n", |
|
|
1730 |
"\tTrain Data (Processed) Memory Usage: 1.83 MB (0.1% of available memory)\n", |
|
|
1731 |
"Data preprocessing and feature engineering runtime = 0.67s ...\n", |
|
|
1732 |
"AutoGluon will gauge predictive performance using evaluation metric: 'accuracy'\n", |
|
|
1733 |
"\tTo change this, specify the eval_metric parameter of Predictor()\n", |
|
|
1734 |
"Automatically generating train/validation split with holdout_frac=0.1, Train Rows: 9713, Val Rows: 1080\n", |
|
|
1735 |
"User-specified model hyperparameters to be fit:\n", |
|
|
1736 |
"{\n", |
|
|
1737 |
"\t'NN_TORCH': {},\n", |
|
|
1738 |
"\t'GBM': [{'extra_trees': True, 'ag_args': {'name_suffix': 'XT'}}, {}, 'GBMLarge'],\n", |
|
|
1739 |
"\t'CAT': {},\n", |
|
|
1740 |
"\t'XGB': {},\n", |
|
|
1741 |
"\t'FASTAI': {},\n", |
|
|
1742 |
"\t'RF': [{'criterion': 'gini', 'ag_args': {'name_suffix': 'Gini', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'entropy', 'ag_args': {'name_suffix': 'Entr', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'squared_error', 'ag_args': {'name_suffix': 'MSE', 'problem_types': ['regression', 'quantile']}}],\n", |
|
|
1743 |
"\t'XT': [{'criterion': 'gini', 'ag_args': {'name_suffix': 'Gini', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'entropy', 'ag_args': {'name_suffix': 'Entr', 'problem_types': ['binary', 'multiclass']}}, {'criterion': 'squared_error', 'ag_args': {'name_suffix': 'MSE', 'problem_types': ['regression', 'quantile']}}],\n", |
|
|
1744 |
"\t'KNN': [{'weights': 'uniform', 'ag_args': {'name_suffix': 'Unif'}}, {'weights': 'distance', 'ag_args': {'name_suffix': 'Dist'}}],\n", |
|
|
1745 |
"}\n", |
|
|
1746 |
"Fitting 13 L1 models ...\n", |
|
|
1747 |
"Fitting model: KNeighborsUnif ...\n", |
|
|
1748 |
"\tWarning: Exception caused KNeighborsUnif to fail during training... Skipping this model.\n", |
|
|
1749 |
"\t\t'NoneType' object has no attribute 'split'\n", |
|
|
1750 |
"Detailed Traceback:\n", |
|
|
1751 |
"Traceback (most recent call last):\n", |
|
|
1752 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/trainer/abstract_trainer.py\", line 1926, in _train_and_save\n", |
|
|
1753 |
" y_pred_proba_val = model.predict_proba(X_val)\n", |
|
|
1754 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/models/abstract/abstract_model.py\", line 950, in predict_proba\n", |
|
|
1755 |
" y_pred_proba = self._predict_proba(X=X, **kwargs)\n", |
|
|
1756 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/models/abstract/abstract_model.py\", line 992, in _predict_proba\n", |
|
|
1757 |
" y_pred_proba = self.model.predict_proba(X)\n", |
|
|
1758 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/neighbors/_classification.py\", line 366, in predict_proba\n", |
|
|
1759 |
" neigh_ind = self.kneighbors(X, return_distance=False)\n", |
|
|
1760 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/neighbors/_base.py\", line 850, in kneighbors\n", |
|
|
1761 |
" results = ArgKmin.compute(\n", |
|
|
1762 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.py\", line 279, in compute\n", |
|
|
1763 |
" return ArgKmin32.compute(\n", |
|
|
1764 |
" File \"sklearn/metrics/_pairwise_distances_reduction/_argkmin.pyx\", line 575, in sklearn.metrics._pairwise_distances_reduction._argkmin.ArgKmin32.compute\n", |
|
|
1765 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/utils/fixes.py\", line 94, in threadpool_limits\n", |
|
|
1766 |
" return threadpoolctl.threadpool_limits(limits=limits, user_api=user_api)\n", |
|
|
1767 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 171, in __init__\n", |
|
|
1768 |
" self._original_info = self._set_threadpool_limits()\n", |
|
|
1769 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 268, in _set_threadpool_limits\n", |
|
|
1770 |
" modules = _ThreadpoolInfo(prefixes=self._prefixes,\n", |
|
|
1771 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 340, in __init__\n", |
|
|
1772 |
" self._load_modules()\n", |
|
|
1773 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 371, in _load_modules\n", |
|
|
1774 |
" self._find_modules_with_dyld()\n", |
|
|
1775 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 428, in _find_modules_with_dyld\n", |
|
|
1776 |
" self._make_module_from_path(filepath)\n", |
|
|
1777 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 515, in _make_module_from_path\n", |
|
|
1778 |
" module = module_class(filepath, prefix, user_api, internal_api)\n", |
|
|
1779 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 606, in __init__\n", |
|
|
1780 |
" self.version = self.get_version()\n", |
|
|
1781 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 646, in get_version\n", |
|
|
1782 |
" config = get_config().split()\n", |
|
|
1783 |
"AttributeError: 'NoneType' object has no attribute 'split'\n", |
|
|
1784 |
"Fitting model: KNeighborsDist ...\n", |
|
|
1785 |
"\tWarning: Exception caused KNeighborsDist to fail during training... Skipping this model.\n", |
|
|
1786 |
"\t\t'NoneType' object has no attribute 'split'\n", |
|
|
1787 |
"Detailed Traceback:\n", |
|
|
1788 |
"Traceback (most recent call last):\n", |
|
|
1789 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/trainer/abstract_trainer.py\", line 1926, in _train_and_save\n", |
|
|
1790 |
" y_pred_proba_val = model.predict_proba(X_val)\n", |
|
|
1791 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/models/abstract/abstract_model.py\", line 950, in predict_proba\n", |
|
|
1792 |
" y_pred_proba = self._predict_proba(X=X, **kwargs)\n", |
|
|
1793 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/models/abstract/abstract_model.py\", line 992, in _predict_proba\n", |
|
|
1794 |
" y_pred_proba = self.model.predict_proba(X)\n", |
|
|
1795 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/neighbors/_classification.py\", line 369, in predict_proba\n", |
|
|
1796 |
" neigh_dist, neigh_ind = self.kneighbors(X)\n", |
|
|
1797 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/neighbors/_base.py\", line 850, in kneighbors\n", |
|
|
1798 |
" results = ArgKmin.compute(\n", |
|
|
1799 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/metrics/_pairwise_distances_reduction/_dispatcher.py\", line 279, in compute\n", |
|
|
1800 |
" return ArgKmin32.compute(\n", |
|
|
1801 |
" File \"sklearn/metrics/_pairwise_distances_reduction/_argkmin.pyx\", line 575, in sklearn.metrics._pairwise_distances_reduction._argkmin.ArgKmin32.compute\n", |
|
|
1802 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/sklearn/utils/fixes.py\", line 94, in threadpool_limits\n", |
|
|
1803 |
" return threadpoolctl.threadpool_limits(limits=limits, user_api=user_api)\n", |
|
|
1804 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 171, in __init__\n", |
|
|
1805 |
" self._original_info = self._set_threadpool_limits()\n", |
|
|
1806 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 268, in _set_threadpool_limits\n", |
|
|
1807 |
" modules = _ThreadpoolInfo(prefixes=self._prefixes,\n", |
|
|
1808 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 340, in __init__\n", |
|
|
1809 |
" self._load_modules()\n", |
|
|
1810 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 371, in _load_modules\n", |
|
|
1811 |
" self._find_modules_with_dyld()\n", |
|
|
1812 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 428, in _find_modules_with_dyld\n", |
|
|
1813 |
" self._make_module_from_path(filepath)\n", |
|
|
1814 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 515, in _make_module_from_path\n", |
|
|
1815 |
" module = module_class(filepath, prefix, user_api, internal_api)\n", |
|
|
1816 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 606, in __init__\n", |
|
|
1817 |
" self.version = self.get_version()\n", |
|
|
1818 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/threadpoolctl.py\", line 646, in get_version\n", |
|
|
1819 |
" config = get_config().split()\n", |
|
|
1820 |
"AttributeError: 'NoneType' object has no attribute 'split'\n", |
|
|
1821 |
"Fitting model: NeuralNetFastAI ...\n", |
|
|
1822 |
"\t0.8944\t = Validation score (accuracy)\n", |
|
|
1823 |
"\t8.91s\t = Training runtime\n", |
|
|
1824 |
"\t0.03s\t = Validation runtime\n", |
|
|
1825 |
"Fitting model: LightGBMXT ...\n", |
|
|
1826 |
"\t0.9148\t = Validation score (accuracy)\n", |
|
|
1827 |
"\t17.49s\t = Training runtime\n", |
|
|
1828 |
"\t0.03s\t = Validation runtime\n", |
|
|
1829 |
"Fitting model: LightGBM ...\n", |
|
|
1830 |
"\t0.9139\t = Validation score (accuracy)\n", |
|
|
1831 |
"\t28.87s\t = Training runtime\n", |
|
|
1832 |
"\t0.05s\t = Validation runtime\n", |
|
|
1833 |
"Fitting model: RandomForestGini ...\n", |
|
|
1834 |
"\t0.9093\t = Validation score (accuracy)\n", |
|
|
1835 |
"\t2.86s\t = Training runtime\n", |
|
|
1836 |
"\t0.08s\t = Validation runtime\n", |
|
|
1837 |
"Fitting model: RandomForestEntr ...\n", |
|
|
1838 |
"\t0.9028\t = Validation score (accuracy)\n", |
|
|
1839 |
"\t2.62s\t = Training runtime\n", |
|
|
1840 |
"\t0.08s\t = Validation runtime\n", |
|
|
1841 |
"Fitting model: CatBoost ...\n", |
|
|
1842 |
"\t0.9102\t = Validation score (accuracy)\n", |
|
|
1843 |
"\t12.96s\t = Training runtime\n", |
|
|
1844 |
"\t0.01s\t = Validation runtime\n", |
|
|
1845 |
"Fitting model: ExtraTreesGini ...\n", |
|
|
1846 |
"\t0.9065\t = Validation score (accuracy)\n", |
|
|
1847 |
"\t1.1s\t = Training runtime\n", |
|
|
1848 |
"\t0.09s\t = Validation runtime\n", |
|
|
1849 |
"Fitting model: ExtraTreesEntr ...\n", |
|
|
1850 |
"\t0.9083\t = Validation score (accuracy)\n", |
|
|
1851 |
"\t0.94s\t = Training runtime\n", |
|
|
1852 |
"\t0.06s\t = Validation runtime\n", |
|
|
1853 |
"Fitting model: XGBoost ...\n", |
|
|
1854 |
"\t0.9111\t = Validation score (accuracy)\n", |
|
|
1855 |
"\t15.38s\t = Training runtime\n", |
|
|
1856 |
"\t0.05s\t = Validation runtime\n", |
|
|
1857 |
"Fitting model: NeuralNetTorch ...\n", |
|
|
1858 |
"\tWarning: Exception caused NeuralNetTorch to fail during training... Skipping this model.\n", |
|
|
1859 |
"\t\tmodule 'torch.utils._pytree' has no attribute 'register_pytree_node'\n", |
|
|
1860 |
"Detailed Traceback:\n", |
|
|
1861 |
"Traceback (most recent call last):\n", |
|
|
1862 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/trainer/abstract_trainer.py\", line 1904, in _train_and_save\n", |
|
|
1863 |
" model = self._train_single(X, y, model, X_val, y_val, total_resources=total_resources, **model_fit_kwargs)\n", |
|
|
1864 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/trainer/abstract_trainer.py\", line 1844, in _train_single\n", |
|
|
1865 |
" model = model.fit(X=X, y=y, X_val=X_val, y_val=y_val, total_resources=total_resources, **model_fit_kwargs)\n", |
|
|
1866 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/core/models/abstract/abstract_model.py\", line 855, in fit\n", |
|
|
1867 |
" out = self._fit(**kwargs)\n", |
|
|
1868 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/tabular/models/tabular_nn/torch/tabular_nn_torch.py\", line 196, in _fit\n", |
|
|
1869 |
" self.optimizer = self._init_optimizer(**optimizer_kwargs)\n", |
|
|
1870 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/autogluon/tabular/models/tabular_nn/torch/tabular_nn_torch.py\", line 553, in _init_optimizer\n", |
|
|
1871 |
" optimizer = torch.optim.Adam(params=self.model.parameters(), lr=learning_rate, weight_decay=weight_decay)\n", |
|
|
1872 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/optim/adam.py\", line 45, in __init__\n", |
|
|
1873 |
" super().__init__(params, defaults)\n", |
|
|
1874 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/optim/optimizer.py\", line 266, in __init__\n", |
|
|
1875 |
" self.add_param_group(cast(dict, param_group))\n", |
|
|
1876 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_compile.py\", line 22, in inner\n", |
|
|
1877 |
" import torch._dynamo\n", |
|
|
1878 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_dynamo/__init__.py\", line 2, in <module>\n", |
|
|
1879 |
" from . import allowed_functions, convert_frame, eval_frame, resume_execution\n", |
|
|
1880 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_dynamo/allowed_functions.py\", line 26, in <module>\n", |
|
|
1881 |
" from . import config\n", |
|
|
1882 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/_dynamo/config.py\", line 49, in <module>\n", |
|
|
1883 |
" torch.onnx.is_in_onnx_export: False,\n", |
|
|
1884 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/__init__.py\", line 1831, in __getattr__\n", |
|
|
1885 |
" return importlib.import_module(f\".{name}\", __name__)\n", |
|
|
1886 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/importlib/__init__.py\", line 126, in import_module\n", |
|
|
1887 |
" return _bootstrap._gcd_import(name[level:], package, level)\n", |
|
|
1888 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/__init__.py\", line 46, in <module>\n", |
|
|
1889 |
" from ._internal.exporter import ( # usort:skip. needs to be last to avoid circular import\n", |
|
|
1890 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/_internal/exporter.py\", line 42, in <module>\n", |
|
|
1891 |
" from torch.onnx._internal.fx import (\n", |
|
|
1892 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/_internal/fx/__init__.py\", line 1, in <module>\n", |
|
|
1893 |
" from .patcher import ONNXTorchPatcher\n", |
|
|
1894 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/torch/onnx/_internal/fx/patcher.py\", line 11, in <module>\n", |
|
|
1895 |
" import transformers # type: ignore[import]\n", |
|
|
1896 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/__init__.py\", line 26, in <module>\n", |
|
|
1897 |
" from . import dependency_versions_check\n", |
|
|
1898 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/dependency_versions_check.py\", line 16, in <module>\n", |
|
|
1899 |
" from .utils.versions import require_version, require_version_core\n", |
|
|
1900 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/utils/__init__.py\", line 33, in <module>\n", |
|
|
1901 |
" from .generic import (\n", |
|
|
1902 |
" File \"/Users/arham/anaconda3/envs/DataScience/lib/python3.10/site-packages/transformers/utils/generic.py\", line 455, in <module>\n", |
|
|
1903 |
" _torch_pytree.register_pytree_node(\n", |
|
|
1904 |
"AttributeError: module 'torch.utils._pytree' has no attribute 'register_pytree_node'. Did you mean: '_register_pytree_node'?\n", |
|
|
1905 |
"Fitting model: LightGBMLarge ...\n", |
|
|
1906 |
"\t0.913\t = Validation score (accuracy)\n", |
|
|
1907 |
"\t95.73s\t = Training runtime\n", |
|
|
1908 |
"\t0.23s\t = Validation runtime\n", |
|
|
1909 |
"Fitting model: WeightedEnsemble_L2 ...\n", |
|
|
1910 |
"\tEnsemble Weights: {'ExtraTreesGini': 0.286, 'NeuralNetFastAI': 0.19, 'LightGBMXT': 0.19, 'CatBoost': 0.143, 'XGBoost': 0.143, 'LightGBMLarge': 0.048}\n", |
|
|
1911 |
"\t0.9204\t = Validation score (accuracy)\n", |
|
|
1912 |
"\t0.21s\t = Training runtime\n", |
|
|
1913 |
"\t0.0s\t = Validation runtime\n", |
|
|
1914 |
"AutoGluon training complete, total runtime = 194.17s ... Best model: \"WeightedEnsemble_L2\"\n", |
|
|
1915 |
"TabularPredictor saved. To load, use: predictor = TabularPredictor.load(\"AutogluonModels/ag-20240426_052138\")\n" |
|
|
1916 |
] |
|
|
1917 |
}, |
|
|
1918 |
{ |
|
|
1919 |
"name": "stdout", |
|
|
1920 |
"output_type": "stream", |
|
|
1921 |
"text": [ |
|
|
1922 |
"Recall for class 0: 0.9335443037974683\n", |
|
|
1923 |
"Recall for class 1: 0.8983957219251337\n", |
|
|
1924 |
"Recall for class 2: 0.7582089552238805\n", |
|
|
1925 |
"Recall for class 3: 0.8389057750759878\n", |
|
|
1926 |
"Recall for class 4: 0.8646080760095012\n", |
|
|
1927 |
"Recall for class 5: 0.9641148325358851\n", |
|
|
1928 |
"Recall for class 6: 0.9960474308300395\n" |
|
|
1929 |
] |
|
|
1930 |
} |
|
|
1931 |
], |
|
|
1932 |
"source": [ |
|
|
1933 |
"from autogluon.tabular import TabularDataset, TabularPredictor\n", |
|
|
1934 |
"from sklearn.metrics import precision_recall_fscore_support\n", |
|
|
1935 |
"import mlflow\n", |
|
|
1936 |
"\n", |
|
|
1937 |
"# Load your data into AutoGluon TabularDataset format\n", |
|
|
1938 |
"train_data = TabularDataset(X_train.join(y_train))\n", |
|
|
1939 |
"val_data = TabularDataset(X_val.join(y_val))\n", |
|
|
1940 |
"\n", |
|
|
1941 |
"# Define the label column\n", |
|
|
1942 |
"label_column = Target # Replace 'Target' with your actual label column name\n", |
|
|
1943 |
"\n", |
|
|
1944 |
"# Specify the task and run AutoGluon\n", |
|
|
1945 |
"predictor = TabularPredictor(label=label_column).fit(train_data=train_data)\n", |
|
|
1946 |
"\n", |
|
|
1947 |
"# Make predictions on the validation set\n", |
|
|
1948 |
"y_val_pred_autogluon = predictor.predict(val_data.drop(columns=[label_column]))\n", |
|
|
1949 |
"\n", |
|
|
1950 |
"# Evaluate performance\n", |
|
|
1951 |
"precision, recall, f1, support = precision_recall_fscore_support(y_val, y_val_pred_autogluon, average='weighted')\n", |
|
|
1952 |
"\n", |
|
|
1953 |
"# Log metrics and model using MLflow\n", |
|
|
1954 |
"with mlflow.start_run(run_name=\"AutoGluon_Without_Feature_Engineering\"):\n", |
|
|
1955 |
" # Log AutoGluon model\n", |
|
|
1956 |
" mlflow.sklearn.log_model(predictor, \"autogluon_model\")\n", |
|
|
1957 |
" \n", |
|
|
1958 |
" # Log metrics\n", |
|
|
1959 |
" mlflow.log_metric('accuracy', accuracy_score(y_val, y_val_pred_autogluon))\n", |
|
|
1960 |
" mlflow.log_metric('precision', precision)\n", |
|
|
1961 |
" mlflow.log_metric('recall', recall)\n", |
|
|
1962 |
" mlflow.log_metric('f1', f1)\n", |
|
|
1963 |
"\n", |
|
|
1964 |
" # Log recall per class\n", |
|
|
1965 |
" recall_per_class = recall_score(y_val, y_val_pred_autogluon, average=None)\n", |
|
|
1966 |
" for i, recall_class in enumerate(recall_per_class):\n", |
|
|
1967 |
" print(f\"Recall for class {i}: {recall_class}\")\n", |
|
|
1968 |
" mlflow.log_metric(f'recall_class_{i}', recall_class)\n", |
|
|
1969 |
"\n", |
|
|
1970 |
" mlflow.set_tag('experiments', 'Arham A.')\n", |
|
|
1971 |
" mlflow.set_tag('model_name', 'AutoGluon')\n", |
|
|
1972 |
" mlflow.set_tag('preprocessing', 'Yes')\n" |
|
|
1973 |
] |
|
|
1974 |
}, |
|
|
1975 |
{ |
|
|
1976 |
"cell_type": "code", |
|
|
1977 |
"execution_count": null, |
|
|
1978 |
"metadata": {}, |
|
|
1979 |
"outputs": [], |
|
|
1980 |
"source": [] |
|
|
1981 |
} |
|
|
1982 |
], |
|
|
1983 |
"metadata": { |
|
|
1984 |
"kernelspec": { |
|
|
1985 |
"display_name": "DataScience", |
|
|
1986 |
"language": "python", |
|
|
1987 |
"name": "python3" |
|
|
1988 |
}, |
|
|
1989 |
"language_info": { |
|
|
1990 |
"codemirror_mode": { |
|
|
1991 |
"name": "ipython", |
|
|
1992 |
"version": 3 |
|
|
1993 |
}, |
|
|
1994 |
"file_extension": ".py", |
|
|
1995 |
"mimetype": "text/x-python", |
|
|
1996 |
"name": "python", |
|
|
1997 |
"nbconvert_exporter": "python", |
|
|
1998 |
"pygments_lexer": "ipython3", |
|
|
1999 |
"version": "3.10.13" |
|
|
2000 |
} |
|
|
2001 |
}, |
|
|
2002 |
"nbformat": 4, |
|
|
2003 |
"nbformat_minor": 2 |
|
|
2004 |
} |