diff --git a/Q1.ipynb b/Q1.ipynb index c25d6e3..6f6909e 100644 --- a/Q1.ipynb +++ b/Q1.ipynb @@ -18,8 +18,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.001330100Z", - "start_time": "2026-04-25T19:44:17.994988800Z" + "end_time": "2026-04-25T21:51:45.013723200Z", + "start_time": "2026-04-25T21:51:43.997124800Z" } }, "cell_type": "code", @@ -31,20 +31,20 @@ ], "id": "edaea0c939a83b79", "outputs": [], - "execution_count": 1352 + "execution_count": 1 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.054894800Z", - "start_time": "2026-04-25T19:44:18.016350700Z" + "end_time": "2026-04-25T21:51:45.032419600Z", + "start_time": "2026-04-25T21:51:45.014721400Z" } }, "cell_type": "code", "source": "df = pd.read_csv('data/googleplaystore_new.csv')", "id": "e657e9baacc13e6b", "outputs": [], - "execution_count": 1353 + "execution_count": 2 }, { "metadata": {}, @@ -62,8 +62,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.085684Z", - "start_time": "2026-04-25T19:44:18.059398300Z" + "end_time": "2026-04-25T21:51:45.058191500Z", + "start_time": "2026-04-25T21:51:45.033428800Z" } }, "cell_type": "code", @@ -73,13 +73,13 @@ ], "id": "756c92821453bbb3", "outputs": [], - "execution_count": 1354 + "execution_count": 3 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.127866600Z", - "start_time": "2026-04-25T19:44:18.086680900Z" + "end_time": "2026-04-25T21:51:45.086823300Z", + "start_time": "2026-04-25T21:51:45.058191500Z" } }, "cell_type": "code", @@ -291,12 +291,12 @@ "" ] }, - "execution_count": 1355, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1355 + "execution_count": 4 }, { "metadata": { @@ -317,8 +317,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.144983600Z", - "start_time": "2026-04-25T19:44:18.130885100Z" + "end_time": "2026-04-25T21:51:45.106420900Z", + "start_time": "2026-04-25T21:51:45.087823200Z" } }, "cell_type": "code", @@ -334,26 +334,26 @@ ], "id": "c15cb7f9831e0f81", "outputs": [], - "execution_count": 1356 + "execution_count": 5 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.162012900Z", - "start_time": "2026-04-25T19:44:18.144983600Z" + "end_time": "2026-04-25T21:51:45.115879400Z", + "start_time": "2026-04-25T21:51:45.107418800Z" } }, "cell_type": "code", "source": "df['Size in bytes'] = df['Size'].apply(parse_size)", "id": "c76da70de24ddc72", "outputs": [], - "execution_count": 1357 + "execution_count": 6 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.199369200Z", - "start_time": "2026-04-25T19:44:18.163861300Z" + "end_time": "2026-04-25T21:51:45.144425200Z", + "start_time": "2026-04-25T21:51:45.116884800Z" } }, "cell_type": "code", @@ -454,18 +454,18 @@ "" ] }, - "execution_count": 1358, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1358 + "execution_count": 7 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.221810Z", - "start_time": "2026-04-25T19:44:18.201434200Z" + "end_time": "2026-04-25T21:51:45.177033700Z", + "start_time": "2026-04-25T21:51:45.169698800Z" } }, "cell_type": "code", @@ -480,13 +480,13 @@ ] } ], - "execution_count": 1359 + "execution_count": 8 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.256387300Z", - "start_time": "2026-04-25T19:44:18.235866900Z" + "end_time": "2026-04-25T21:51:45.196266500Z", + "start_time": "2026-04-25T21:51:45.178541500Z" } }, "cell_type": "code", @@ -501,13 +501,13 @@ ] } ], - "execution_count": 1360 + "execution_count": 9 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.299362300Z", - "start_time": "2026-04-25T19:44:18.257386600Z" + "end_time": "2026-04-25T21:51:45.234527700Z", + "start_time": "2026-04-25T21:51:45.214308100Z" } }, "cell_type": "code", @@ -522,13 +522,13 @@ ] } ], - "execution_count": 1361 + "execution_count": 10 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.314005900Z", - "start_time": "2026-04-25T19:44:18.300370800Z" + "end_time": "2026-04-25T21:51:45.253211700Z", + "start_time": "2026-04-25T21:51:45.235524700Z" } }, "cell_type": "code", @@ -763,12 +763,12 @@ "" ] }, - "execution_count": 1362, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1362 + "execution_count": 11 }, { "metadata": { @@ -790,21 +790,21 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.348297100Z", - "start_time": "2026-04-25T19:44:18.327548200Z" + "end_time": "2026-04-25T21:51:45.274406200Z", + "start_time": "2026-04-25T21:51:45.267978400Z" } }, "cell_type": "code", "source": "df['Numeric Installs'] = df['Installs'].str.replace('+', '').str.replace(',', '').astype(int)", "id": "c8d4f46526918c20", "outputs": [], - "execution_count": 1363 + "execution_count": 12 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.390389600Z", - "start_time": "2026-04-25T19:44:18.349804Z" + "end_time": "2026-04-25T21:51:45.287734300Z", + "start_time": "2026-04-25T21:51:45.274910Z" } }, "cell_type": "code", @@ -1050,12 +1050,12 @@ "" ] }, - "execution_count": 1364, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1364 + "execution_count": 13 }, { "metadata": {}, @@ -1070,15 +1070,15 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.422303100Z", - "start_time": "2026-04-25T19:44:18.408791600Z" + "end_time": "2026-04-25T21:51:45.308799200Z", + "start_time": "2026-04-25T21:51:45.288732900Z" } }, "cell_type": "code", "source": "df.to_csv('data/googleplaystore_new_new.csv', index=False)", "id": "5a99edb9f8b29b12", "outputs": [], - "execution_count": 1365 + "execution_count": 14 }, { "metadata": {}, @@ -1095,8 +1095,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.427917700Z", - "start_time": "2026-04-25T19:44:18.422871700Z" + "end_time": "2026-04-25T21:51:45.539720400Z", + "start_time": "2026-04-25T21:51:45.309801600Z" } }, "cell_type": "code", @@ -1108,26 +1108,26 @@ ], "id": "8cc741d5b19eaa62", "outputs": [], - "execution_count": 1366 + "execution_count": 15 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.437683600Z", - "start_time": "2026-04-25T19:44:18.427917700Z" + "end_time": "2026-04-25T21:51:45.557405200Z", + "start_time": "2026-04-25T21:51:45.541231300Z" } }, "cell_type": "code", "source": "df_new = pd.read_csv('data/googleplaystore_new_new.csv')", "id": "bc158bb312aa3cd7", "outputs": [], - "execution_count": 1367 + "execution_count": 16 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.457900900Z", - "start_time": "2026-04-25T19:44:18.437683600Z" + "end_time": "2026-04-25T21:51:45.563810100Z", + "start_time": "2026-04-25T21:51:45.558406400Z" } }, "cell_type": "code", @@ -1137,13 +1137,13 @@ ], "id": "585677f9cc3efc16", "outputs": [], - "execution_count": 1368 + "execution_count": 17 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.466803800Z", - "start_time": "2026-04-25T19:44:18.457900900Z" + "end_time": "2026-04-25T21:51:45.578320800Z", + "start_time": "2026-04-25T21:51:45.563810100Z" } }, "cell_type": "code", @@ -1410,31 +1410,31 @@ "" ] }, - "execution_count": 1369, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1369 + "execution_count": 18 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.486879200Z", - "start_time": "2026-04-25T19:44:18.467803700Z" + "end_time": "2026-04-25T21:51:45.597024100Z", + "start_time": "2026-04-25T21:51:45.579825600Z" } }, "cell_type": "code", "source": "df_encoded = pd.get_dummies(df_min, columns=['Category', 'Content Rating'])", "id": "8c4742ab98b8b6ca", "outputs": [], - "execution_count": 1370 + "execution_count": 19 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.498401900Z", - "start_time": "2026-04-25T19:44:18.487876200Z" + "end_time": "2026-04-25T21:51:45.616561700Z", + "start_time": "2026-04-25T21:51:45.598024900Z" } }, "cell_type": "code", @@ -1444,26 +1444,26 @@ ], "id": "7faed3f843076351", "outputs": [], - "execution_count": 1371 + "execution_count": 20 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.505587600Z", - "start_time": "2026-04-25T19:44:18.499408700Z" + "end_time": "2026-04-25T21:51:45.647543500Z", + "start_time": "2026-04-25T21:51:45.618565200Z" } }, "cell_type": "code", "source": "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=101)", "id": "8646df724923b0f5", "outputs": [], - "execution_count": 1372 + "execution_count": 21 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.525671500Z", - "start_time": "2026-04-25T19:44:18.505587600Z" + "end_time": "2026-04-25T21:51:45.664223100Z", + "start_time": "2026-04-25T21:51:45.647543500Z" } }, "cell_type": "code", @@ -1482,20 +1482,20 @@ ], "id": "44c698b18cdce613", "outputs": [], - "execution_count": 1373 + "execution_count": 22 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.533207300Z", - "start_time": "2026-04-25T19:44:18.525671500Z" + "end_time": "2026-04-25T21:51:45.668665Z", + "start_time": "2026-04-25T21:51:45.664223100Z" } }, "cell_type": "code", "source": "results = []", "id": "d8740e0256fe177b", "outputs": [], - "execution_count": 1374 + "execution_count": 23 }, { "metadata": {}, @@ -1506,8 +1506,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.596382500Z", - "start_time": "2026-04-25T19:44:18.535105700Z" + "end_time": "2026-04-25T21:51:45.704792300Z", + "start_time": "2026-04-25T21:51:45.670169600Z" } }, "cell_type": "code", @@ -1518,13 +1518,13 @@ ], "id": "db88942671bdf26a", "outputs": [], - "execution_count": 1375 + "execution_count": 24 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.631625500Z", - "start_time": "2026-04-25T19:44:18.598381100Z" + "end_time": "2026-04-25T21:51:45.730725700Z", + "start_time": "2026-04-25T21:51:45.705792200Z" } }, "cell_type": "code", @@ -1953,18 +1953,18 @@ "" ] }, - "execution_count": 1376, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1376 + "execution_count": 25 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.701757800Z", - "start_time": "2026-04-25T19:44:18.632626400Z" + "end_time": "2026-04-25T21:51:45.860288100Z", + "start_time": "2026-04-25T21:51:45.731230400Z" } }, "cell_type": "code", @@ -1996,7 +1996,7 @@ } } ], - "execution_count": 1377 + "execution_count": 26 }, { "metadata": {}, @@ -2007,8 +2007,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.723407200Z", - "start_time": "2026-04-25T19:44:18.702757500Z" + "end_time": "2026-04-25T21:51:45.886996700Z", + "start_time": "2026-04-25T21:51:45.863335400Z" } }, "cell_type": "code", @@ -2019,13 +2019,13 @@ ], "id": "b867289f4b8dd0ae", "outputs": [], - "execution_count": 1378 + "execution_count": 27 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.754518Z", - "start_time": "2026-04-25T19:44:18.724412600Z" + "end_time": "2026-04-25T21:51:45.933449500Z", + "start_time": "2026-04-25T21:51:45.887996500Z" } }, "cell_type": "code", @@ -2036,13 +2036,13 @@ ], "id": "61b135564e36f71d", "outputs": [], - "execution_count": 1379 + "execution_count": 28 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.822773200Z", - "start_time": "2026-04-25T19:44:18.754518Z" + "end_time": "2026-04-25T21:51:46.003140500Z", + "start_time": "2026-04-25T21:51:45.934279400Z" } }, "cell_type": "code", @@ -2072,7 +2072,7 @@ } } ], - "execution_count": 1380 + "execution_count": 29 }, { "metadata": { @@ -2088,8 +2088,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.861171100Z", - "start_time": "2026-04-25T19:44:18.841312700Z" + "end_time": "2026-04-25T21:51:46.019678600Z", + "start_time": "2026-04-25T21:51:46.004137800Z" } }, "cell_type": "code", @@ -2100,13 +2100,13 @@ ], "id": "f7b09be17154ad47", "outputs": [], - "execution_count": 1381 + "execution_count": 30 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.934596400Z", - "start_time": "2026-04-25T19:44:18.862183800Z" + "end_time": "2026-04-25T21:51:46.087915900Z", + "start_time": "2026-04-25T21:51:46.020706600Z" } }, "cell_type": "code", @@ -2136,7 +2136,7 @@ } } ], - "execution_count": 1382 + "execution_count": 31 }, { "metadata": { @@ -2152,8 +2152,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:18.962338400Z", - "start_time": "2026-04-25T19:44:18.953819400Z" + "end_time": "2026-04-25T21:51:46.109359400Z", + "start_time": "2026-04-25T21:51:46.090423200Z" } }, "cell_type": "code", @@ -2164,13 +2164,13 @@ ], "id": "11024fb6674354a3", "outputs": [], - "execution_count": 1383 + "execution_count": 32 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.028616800Z", - "start_time": "2026-04-25T19:44:18.962338400Z" + "end_time": "2026-04-25T21:51:46.181461400Z", + "start_time": "2026-04-25T21:51:46.109359400Z" } }, "cell_type": "code", @@ -2200,13 +2200,13 @@ } } ], - "execution_count": 1384 + "execution_count": 33 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.050725Z", - "start_time": "2026-04-25T19:44:19.029616900Z" + "end_time": "2026-04-25T21:51:46.201052900Z", + "start_time": "2026-04-25T21:51:46.182965700Z" } }, "cell_type": "code", @@ -2284,18 +2284,18 @@ "" ] }, - "execution_count": 1385, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1385 + "execution_count": 34 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.163677100Z", - "start_time": "2026-04-25T19:44:19.051731700Z" + "end_time": "2026-04-25T21:51:46.342225700Z", + "start_time": "2026-04-25T21:51:46.202060700Z" } }, "cell_type": "code", @@ -2330,7 +2330,7 @@ } } ], - "execution_count": 1386 + "execution_count": 35 }, { "metadata": {}, @@ -2360,8 +2360,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.208235400Z", - "start_time": "2026-04-25T19:44:19.184219500Z" + "end_time": "2026-04-25T21:51:46.374597Z", + "start_time": "2026-04-25T21:51:46.357293300Z" } }, "cell_type": "code", @@ -2371,13 +2371,13 @@ ], "id": "ab09192a122e6e8f", "outputs": [], - "execution_count": 1387 + "execution_count": 36 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.221181900Z", - "start_time": "2026-04-25T19:44:19.208235400Z" + "end_time": "2026-04-25T21:51:46.383106300Z", + "start_time": "2026-04-25T21:51:46.375595900Z" } }, "cell_type": "code", @@ -2390,13 +2390,13 @@ ], "id": "3f65e25b63cc8e93", "outputs": [], - "execution_count": 1388 + "execution_count": 37 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.234922800Z", - "start_time": "2026-04-25T19:44:19.222186Z" + "end_time": "2026-04-25T21:51:46.391150500Z", + "start_time": "2026-04-25T21:51:46.384609800Z" } }, "cell_type": "code", @@ -2407,13 +2407,13 @@ ], "id": "75e6c5289568ef2f", "outputs": [], - "execution_count": 1389 + "execution_count": 38 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.244451400Z", - "start_time": "2026-04-25T19:44:19.235924700Z" + "end_time": "2026-04-25T21:51:46.397495600Z", + "start_time": "2026-04-25T21:51:46.391150500Z" } }, "cell_type": "code", @@ -2427,13 +2427,13 @@ ], "id": "983db24d45054c97", "outputs": [], - "execution_count": 1390 + "execution_count": 39 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.289378600Z", - "start_time": "2026-04-25T19:44:19.244451400Z" + "end_time": "2026-04-25T21:51:46.408753800Z", + "start_time": "2026-04-25T21:51:46.397495600Z" } }, "cell_type": "code", @@ -2487,18 +2487,18 @@ "" ] }, - "execution_count": 1391, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1391 + "execution_count": 40 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.325239300Z", - "start_time": "2026-04-25T19:44:19.290889Z" + "end_time": "2026-04-25T21:51:46.426292700Z", + "start_time": "2026-04-25T21:51:46.410257200Z" } }, "cell_type": "code", @@ -2512,13 +2512,13 @@ ], "id": "4f73fdfeefd697e2", "outputs": [], - "execution_count": 1392 + "execution_count": 41 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.413941900Z", - "start_time": "2026-04-25T19:44:19.326238200Z" + "end_time": "2026-04-25T21:51:46.536536Z", + "start_time": "2026-04-25T21:51:46.427293500Z" } }, "cell_type": "code", @@ -2546,26 +2546,26 @@ } } ], - "execution_count": 1393 + "execution_count": 42 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.447647200Z", - "start_time": "2026-04-25T19:44:19.414941700Z" + "end_time": "2026-04-25T21:51:46.555992900Z", + "start_time": "2026-04-25T21:51:46.538047Z" } }, "cell_type": "code", "source": "best_feature = feature_results_df.iloc[0]['Feature']", "id": "593913702f875fa0", "outputs": [], - "execution_count": 1394 + "execution_count": 43 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.453379600Z", - "start_time": "2026-04-25T19:44:19.447647200Z" + "end_time": "2026-04-25T21:51:46.570593200Z", + "start_time": "2026-04-25T21:51:46.556993200Z" } }, "cell_type": "code", @@ -2577,13 +2577,13 @@ ], "id": "2be649a00dbb9fc7", "outputs": [], - "execution_count": 1395 + "execution_count": 44 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.462732900Z", - "start_time": "2026-04-25T19:44:19.454377500Z" + "end_time": "2026-04-25T21:51:46.578403200Z", + "start_time": "2026-04-25T21:51:46.571767400Z" } }, "cell_type": "code", @@ -2594,13 +2594,13 @@ ], "id": "d36175ff718e84a1", "outputs": [], - "execution_count": 1396 + "execution_count": 45 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.531422600Z", - "start_time": "2026-04-25T19:44:19.462732900Z" + "end_time": "2026-04-25T21:51:46.667441500Z", + "start_time": "2026-04-25T21:51:46.583676400Z" } }, "cell_type": "code", @@ -2630,7 +2630,7 @@ } } ], - "execution_count": 1397 + "execution_count": 46 }, { "metadata": {}, @@ -2671,8 +2671,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.570442Z", - "start_time": "2026-04-25T19:44:19.550953600Z" + "end_time": "2026-04-25T21:51:46.685854300Z", + "start_time": "2026-04-25T21:51:46.669438600Z" } }, "cell_type": "code", @@ -2682,13 +2682,13 @@ ], "id": "137267551f08dae5", "outputs": [], - "execution_count": 1398 + "execution_count": 47 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.576644200Z", - "start_time": "2026-04-25T19:44:19.571448100Z" + "end_time": "2026-04-25T21:51:46.692396200Z", + "start_time": "2026-04-25T21:51:46.686853400Z" } }, "cell_type": "code", @@ -2698,26 +2698,26 @@ ], "id": "725e85ef4abe3948", "outputs": [], - "execution_count": 1399 + "execution_count": 48 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.584575600Z", - "start_time": "2026-04-25T19:44:19.577643200Z" + "end_time": "2026-04-25T21:51:46.701703900Z", + "start_time": "2026-04-25T21:51:46.692396200Z" } }, "cell_type": "code", "source": "df_g_encoded = pd.get_dummies(df_g, columns=['Category', 'Content Rating'])", "id": "7a6b3f84b1265599", "outputs": [], - "execution_count": 1400 + "execution_count": 49 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.592576300Z", - "start_time": "2026-04-25T19:44:19.584575600Z" + "end_time": "2026-04-25T21:51:46.707067300Z", + "start_time": "2026-04-25T21:51:46.701703900Z" } }, "cell_type": "code", @@ -2727,26 +2727,26 @@ ], "id": "679b52eb182f0e1c", "outputs": [], - "execution_count": 1401 + "execution_count": 50 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.624731700Z", - "start_time": "2026-04-25T19:44:19.593575800Z" + "end_time": "2026-04-25T21:51:46.714770Z", + "start_time": "2026-04-25T21:51:46.708066400Z" } }, "cell_type": "code", "source": "X_train_g, X_test_g, y_train_g, y_test_g = train_test_split(X_g, y_g, test_size=0.3, random_state=101)", "id": "35f87078cd8053fa", "outputs": [], - "execution_count": 1402 + "execution_count": 51 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.653376400Z", - "start_time": "2026-04-25T19:44:19.625734900Z" + "end_time": "2026-04-25T21:51:46.722825400Z", + "start_time": "2026-04-25T21:51:46.716277700Z" } }, "cell_type": "code", @@ -2771,20 +2771,20 @@ ], "id": "9cbccc4044fd76e", "outputs": [], - "execution_count": 1403 + "execution_count": 52 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.658275100Z", - "start_time": "2026-04-25T19:44:19.653376400Z" + "end_time": "2026-04-25T21:51:46.729756500Z", + "start_time": "2026-04-25T21:51:46.723329800Z" } }, "cell_type": "code", "source": "results_g = []", "id": "7bd72610ea9b4047", "outputs": [], - "execution_count": 1404 + "execution_count": 53 }, { "metadata": {}, @@ -2795,8 +2795,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.682617400Z", - "start_time": "2026-04-25T19:44:19.662317600Z" + "end_time": "2026-04-25T21:51:46.752987Z", + "start_time": "2026-04-25T21:51:46.730278200Z" } }, "cell_type": "code", @@ -2807,26 +2807,26 @@ ], "id": "5077d997183c52b7", "outputs": [], - "execution_count": 1405 + "execution_count": 54 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.689440300Z", - "start_time": "2026-04-25T19:44:19.683323700Z" + "end_time": "2026-04-25T21:51:46.758063100Z", + "start_time": "2026-04-25T21:51:46.753987300Z" } }, "cell_type": "code", "source": "residual_lin_g = y_test_g - y_pred_lin_g", "id": "dcf6fd613a1d2d79", "outputs": [], - "execution_count": 1406 + "execution_count": 55 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.778424200Z", - "start_time": "2026-04-25T19:44:19.689440300Z" + "end_time": "2026-04-25T21:51:46.833914100Z", + "start_time": "2026-04-25T21:51:46.758063100Z" } }, "cell_type": "code", @@ -2856,7 +2856,7 @@ } } ], - "execution_count": 1407 + "execution_count": 56 }, { "metadata": {}, @@ -2867,8 +2867,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.802343300Z", - "start_time": "2026-04-25T19:44:19.778424200Z" + "end_time": "2026-04-25T21:51:46.848065400Z", + "start_time": "2026-04-25T21:51:46.833914100Z" } }, "cell_type": "code", @@ -2879,13 +2879,13 @@ ], "id": "b5e9cdb3ef42c22f", "outputs": [], - "execution_count": 1408 + "execution_count": 57 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:19.956288100Z", - "start_time": "2026-04-25T19:44:19.802343300Z" + "end_time": "2026-04-25T21:51:47.004804300Z", + "start_time": "2026-04-25T21:51:46.849063Z" } }, "cell_type": "code", @@ -2896,13 +2896,13 @@ ], "id": "8d5313ca848e4519", "outputs": [], - "execution_count": 1409 + "execution_count": 58 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:20.033299900Z", - "start_time": "2026-04-25T19:44:19.957288Z" + "end_time": "2026-04-25T21:51:47.086837400Z", + "start_time": "2026-04-25T21:51:47.005802600Z" } }, "cell_type": "code", @@ -2932,7 +2932,7 @@ } } ], - "execution_count": 1410 + "execution_count": 59 }, { "metadata": {}, @@ -2943,8 +2943,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:20.052963600Z", - "start_time": "2026-04-25T19:44:20.034298900Z" + "end_time": "2026-04-25T21:51:47.106765300Z", + "start_time": "2026-04-25T21:51:47.087839Z" } }, "cell_type": "code", @@ -2955,13 +2955,13 @@ ], "id": "a31ad4ed704f4541", "outputs": [], - "execution_count": 1411 + "execution_count": 60 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:20.132935900Z", - "start_time": "2026-04-25T19:44:20.053963200Z" + "end_time": "2026-04-25T21:51:47.171902900Z", + "start_time": "2026-04-25T21:51:47.107767500Z" } }, "cell_type": "code", @@ -2991,7 +2991,7 @@ } } ], - "execution_count": 1412 + "execution_count": 61 }, { "metadata": {}, @@ -3002,8 +3002,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:20.178321Z", - "start_time": "2026-04-25T19:44:20.155420Z" + "end_time": "2026-04-25T21:51:47.193783100Z", + "start_time": "2026-04-25T21:51:47.173411200Z" } }, "cell_type": "code", @@ -3086,18 +3086,18 @@ "" ] }, - "execution_count": 1413, + "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 1413 + "execution_count": 62 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:20.196929500Z", - "start_time": "2026-04-25T19:44:20.180392100Z" + "end_time": "2026-04-25T21:51:47.209823600Z", + "start_time": "2026-04-25T21:51:47.194288200Z" } }, "cell_type": "code", @@ -3111,13 +3111,13 @@ ], "id": "a8b2b05314122ac3", "outputs": [], - "execution_count": 1414 + "execution_count": 63 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T19:44:20.322397800Z", - "start_time": "2026-04-25T19:44:20.197926Z" + "end_time": "2026-04-25T21:51:47.321383500Z", + "start_time": "2026-04-25T21:51:47.210842200Z" } }, "cell_type": "code", @@ -3145,7 +3145,7 @@ } } ], - "execution_count": 1415 + "execution_count": 64 } ], "metadata": { diff --git a/Q2.ipynb b/Q2.ipynb index c5e6b95..c376ad5 100644 --- a/Q2.ipynb +++ b/Q2.ipynb @@ -15,8 +15,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.826174300Z", - "start_time": "2026-04-25T21:15:54.817214200Z" + "end_time": "2026-04-25T22:14:44.706918300Z", + "start_time": "2026-04-25T22:14:44.683287200Z" } }, "cell_type": "code", @@ -27,25 +27,25 @@ "from sklearn.preprocessing import StandardScaler\n", "from sklearn.linear_model import LogisticRegression\n", "from sklearn.neighbors import KNeighborsClassifier\n", - "from sklearn.metrics import accuracy_score, f1_score, confusion_matrix, ConfusionMatrixDisplay\n", + "from sklearn.metrics import accuracy_score, f1_score, classification_report, confusion_matrix, ConfusionMatrixDisplay\n", "import matplotlib.pyplot as plt" ], "id": "76e70b2ed9af0b56", "outputs": [], - "execution_count": 19 + "execution_count": 148 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.842931600Z", - "start_time": "2026-04-25T21:15:54.827174Z" + "end_time": "2026-04-25T22:14:44.729001200Z", + "start_time": "2026-04-25T22:14:44.709018800Z" } }, "cell_type": "code", "source": "df = pd.read_csv('data/googleplaystore_new_new.csv')", "id": "f44380615d3aba25", "outputs": [], - "execution_count": 20 + "execution_count": 149 }, { "metadata": {}, @@ -63,8 +63,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.857539500Z", - "start_time": "2026-04-25T21:15:54.844931800Z" + "end_time": "2026-04-25T22:14:44.756069200Z", + "start_time": "2026-04-25T22:14:44.729001200Z" } }, "cell_type": "code", @@ -74,13 +74,13 @@ ], "id": "f6fd7137bf91f31e", "outputs": [], - "execution_count": 21 + "execution_count": 150 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.877630200Z", - "start_time": "2026-04-25T21:15:54.857539500Z" + "end_time": "2026-04-25T22:14:44.886179Z", + "start_time": "2026-04-25T22:14:44.784660200Z" } }, "cell_type": "code", @@ -90,52 +90,52 @@ ], "id": "b5daf475a5d5ca15", "outputs": [], - "execution_count": 22 + "execution_count": 151 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.890619Z", - "start_time": "2026-04-25T21:15:54.878630300Z" + "end_time": "2026-04-25T22:14:44.964846700Z", + "start_time": "2026-04-25T22:14:44.888695300Z" } }, "cell_type": "code", "source": "X = pd.get_dummies(X_raw, columns=['Content Rating'])", "id": "99a441c665dcc19b", "outputs": [], - "execution_count": 23 + "execution_count": 152 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.896884800Z", - "start_time": "2026-04-25T21:15:54.891625500Z" + "end_time": "2026-04-25T22:14:45.068746800Z", + "start_time": "2026-04-25T22:14:45.010546300Z" } }, "cell_type": "code", "source": "X_temp, X_test, y_temp, y_test = train_test_split(X, y, test_size=0.2, random_state=101)", "id": "c6eb622c0f7ec63c", "outputs": [], - "execution_count": 24 + "execution_count": 153 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.904746500Z", - "start_time": "2026-04-25T21:15:54.897883400Z" + "end_time": "2026-04-25T22:14:45.095344800Z", + "start_time": "2026-04-25T22:14:45.072252400Z" } }, "cell_type": "code", "source": "X_train, X_val, y_train, y_val = train_test_split(X_temp, y_temp, test_size=0.25, random_state=101)", "id": "89e8f117f057e0e2", "outputs": [], - "execution_count": 25 + "execution_count": 154 }, { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.914005600Z", - "start_time": "2026-04-25T21:15:54.905746300Z" + "end_time": "2026-04-25T22:14:45.113200900Z", + "start_time": "2026-04-25T22:14:45.096344500Z" } }, "cell_type": "code", @@ -147,7 +147,39 @@ ], "id": "d529991171fafb3e", "outputs": [], - "execution_count": 26 + "execution_count": 155 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-04-25T22:14:45.119344300Z", + "start_time": "2026-04-25T22:14:45.113200900Z" + } + }, + "cell_type": "code", + "source": [ + "def eval_metrics(y_true, y_pred, label=\"Model\"):\n", + " acc = accuracy_score(y_true, y_pred)\n", + " f1_w = f1_score(y_true, y_pred, average='weighted')\n", + " print(f\"{label} -> Accuracy: {acc:.4f} | Weighted F1: {f1_w:.4f}\")\n", + " return acc, f1_w" + ], + "id": "d44ab7b8266f66c4", + "outputs": [], + "execution_count": 156 + }, + { + "metadata": { + "ExecuteTime": { + "end_time": "2026-04-25T22:14:45.140904500Z", + "start_time": "2026-04-25T22:14:45.128360400Z" + } + }, + "cell_type": "code", + "source": "", + "id": "2f619e1e9117258e", + "outputs": [], + "execution_count": 156 }, { "metadata": {}, @@ -158,13 +190,13 @@ { "metadata": { "ExecuteTime": { - "end_time": "2026-04-25T21:15:54.935689400Z", - "start_time": "2026-04-25T21:15:54.915006600Z" + "end_time": "2026-04-25T22:14:45.162452500Z", + "start_time": "2026-04-25T22:14:45.142480200Z" } }, "cell_type": "code", "source": [ - "log_model = LogisticRegression(max_iter=1000)\n", + "log_model = LogisticRegression(max_iter=1000, random_state=101)\n", "log_model.fit(scaled_X_train, y_train)" ], "id": "84128fa4e7823565", @@ -172,10 +204,10 @@ { "data": { "text/plain": [ - "LogisticRegression(max_iter=1000)" + "LogisticRegression(max_iter=1000, random_state=101)" ], "text/html": [ - "
LogisticRegression(max_iter=1000)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.