{"id":1233,"date":"2023-07-27T04:52:33","date_gmt":"2023-07-27T04:52:33","guid":{"rendered":"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/"},"modified":"2023-07-27T04:52:33","modified_gmt":"2023-07-27T04:52:33","slug":"r%e1%84%8b%e1%85%b4-xgboost","status":"publish","type":"post","link":"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/","title":{"rendered":"R\uc758 xgboost: \ub2e8\uacc4\ubcc4 \uc608"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/ko\/\u1106\u1165\u1109\u1175\u11ab\u1105\u1165\u1102\u1175\u11bc-\u1100\u1161\u11bc\u1112\u116a\/\" target=\"_blank\" rel=\"noopener noreferrer\">\ubd80\uc2a4\ud305\uc740<\/a> \uc608\uce21 \uc815\ud655\ub3c4\uac00 \ub192\uc740 \ubaa8\ub378\uc744 \uc0dd\uc131\ud558\ub294 \uac83\uc73c\ub85c \uc785\uc99d\ub41c \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uc2e4\uc81c\ub85c \ubd80\uc2a4\ud305\uc744 \uad6c\ud604\ud558\ub294 \uac00\uc7a5 \uc77c\ubc18\uc801\uc778 \ubc29\ubc95 \uc911 \ud558\ub098\ub294 &#8220;\uadf9\ub2e8\uc801 \uacbd\uc0ac \ubd80\uc2a4\ud305&#8221;\uc758 \uc57d\uc790\uc778 <strong>XGBoost\ub97c<\/strong> \uc0ac\uc6a9\ud558\ub294 \uac83\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 R\uc5d0\uc11c \ud5a5\uc0c1\ub41c \ubaa8\ub378\uc744 \ub9de\ucd94\uae30 \uc704\ud574 XGBoost\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/span><\/p>\n<h3> <strong><span style=\"color: #000000;\">1\ub2e8\uacc4: \ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \ub85c\ub4dc<\/span><\/strong><\/h3>\n<p> <span style=\"color: #000000;\">\uba3c\uc800 \ud544\uc694\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \ub85c\ub4dc\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\">library<\/span> (xgboost) <span style=\"color: #008080;\">#for fitting the xgboost model<\/span>\n<span style=\"color: #993300;\">library<\/span> (caret) <span style=\"color: #008080;\">#for general data preparation and model fitting<\/span>\n<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>2\ub2e8\uacc4: \ub370\uc774\ud130 \ub85c\ub4dc<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\uc774 \uc608\uc5d0\uc11c\ub294 <strong>MASS<\/strong> \ud328\ud0a4\uc9c0\uc758 <strong>Boston<\/strong> \ub370\uc774\ud130 \uc138\ud2b8\uc5d0 \ud5a5\uc0c1\ub41c \ud68c\uadc0 \ubaa8\ub378\uc744 \uc801\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uc774 \ub370\uc774\ud130 \uc138\ud2b8\uc5d0\ub294 \ubcf4\uc2a4\ud1a4 \uc8fc\ubcc0\uc758 \ub2e4\uc591\ud55c \uc778\uad6c \uc870\uc0ac \uad6c\uc5ed\uc5d0 \uc788\ub294 \uc8fc\ud0dd\uc758 \uc911\uc559\uac12\uc744 \ub098\ud0c0\ub0b4\ub294 <strong>mdev<\/strong> \ub77c\ub294 \uc751\ub2f5 <a href=\"https:\/\/statorials.org\/ko\/\u1107\u1167\u11ab\u1109\u116e-\u1109\u1165\u11af\u1106\u1167\u11bc-\u110b\u1173\u11bc\u1103\u1161\u11b8\/\" target=\"_blank\" rel=\"noopener noreferrer\">\ubcc0\uc218<\/a> \ub97c \uc608\uce21\ud558\ub294 \ub370 \uc0ac\uc6a9\ud560 13\uac1c\uc758 \uc608\uce21 \ubcc0\uc218\uac00 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#load the data\n<\/span>data = MASS::Boston\n\n<span style=\"color: #008080;\">#view the structure of the data\n<\/span>str(data) \n\n'data.frame': 506 obs. of 14 variables:\n $ crim: num 0.00632 0.02731 0.02729 0.03237 0.06905 ...\n $ zn : num 18 0 0 0 0 0 12.5 12.5 12.5 12.5 ...\n $ indus: num 2.31 7.07 7.07 2.18 2.18 2.18 7.87 7.87 7.87 7.87 ...\n $chas: int 0 0 0 0 0 0 0 0 0 0 ...\n $ nox: num 0.538 0.469 0.469 0.458 0.458 0.458 0.524 0.524 0.524 0.524 ...\n $rm: num 6.58 6.42 7.18 7 7.15 ...\n $ age: num 65.2 78.9 61.1 45.8 54.2 58.7 66.6 96.1 100 85.9 ...\n $ dis: num 4.09 4.97 4.97 6.06 6.06 ...\n $rad: int 1 2 2 3 3 3 5 5 5 5 ...\n $ tax: num 296 242 242 222 222 222 311 311 311 311 ...\n $ptratio: num 15.3 17.8 17.8 18.7 18.7 18.7 15.2 15.2 15.2 15.2 ...\n $ black: num 397 397 393 395 397 ...\n $ lstat: num 4.98 9.14 4.03 2.94 5.33 ...\n $ medv: num 24 21.6 34.7 33.4 36.2 28.7 22.9 27.1 16.5 18.9 ...\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\ub370\uc774\ud130\uc138\ud2b8\uc5d0 \ucd1d 506\uac1c\uc758 <a href=\"https:\/\/statorials.org\/ko\/\u1110\u1169\u11bc\u1100\u1168\u110b\u1166\u1109\u1165\u110b\u1174-\u1100\u116a\u11ab\u110e\u1161\u11af\/\" target=\"_blank\" rel=\"noopener noreferrer\">\uad00\uce21\uac12<\/a> \uacfc 14\uac1c\uc758 \ubcc0\uc218\uac00 \ud3ec\ud568\ub418\uc5b4 \uc788\uc74c\uc744 \uc54c \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>3\ub2e8\uacc4: \ub370\uc774\ud130 \uc900\ube44<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\ub2e4\uc74c\uc73c\ub85c \uce90\ub7ff \ud328\ud0a4\uc9c0\uc758 <strong>createDataPartition()<\/strong> \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6d0\ubcf8 \ub370\uc774\ud130 \uc138\ud2b8\ub97c \ud6c8\ub828 \ubc0f \ud14c\uc2a4\ud2b8 \uc138\ud2b8\ub85c \ubd84\ud560\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uc774 \uc608\uc5d0\uc11c\ub294 \uc6d0\ub798 \ub370\uc774\ud130 \uc138\ud2b8\uc758 80%\ub97c \ud6c8\ub828 \uc138\ud2b8\uc758 \uc77c\ubd80\ub85c \uc0ac\uc6a9\ud558\ub3c4\ub85d \uc120\ud0dd\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">xgboost \ud328\ud0a4\uc9c0\ub3c4 \ud589\ub82c \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\ubbc0\ub85c <strong>data.matrix()<\/strong> \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc608\uce21 \ubcc0\uc218\ub97c \ubcf4\uc720\ud569\ub2c8\ub2e4.<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#make this example reproducible\n<\/span>set.seed(0)\n\n<span style=\"color: #008080;\">#split into training (80%) and testing set (20%)\n<\/span>parts = createDataPartition(data$medv, p = <span style=\"color: #008000;\">.8<\/span> , list = <span style=\"color: #008000;\">F<\/span> )\ntrain = data[parts, ]\ntest = data[-parts, ]\n\n<span style=\"color: #008080;\">#define predictor and response variables in training set\n<\/span>train_x = data. <span style=\"color: #3366ff;\">matrix<\/span> (train[, -13])\ntrain_y = train[,13]\n\n<span style=\"color: #008080;\">#define predictor and response variables in testing set\n<\/span>test_x = data. <span style=\"color: #3366ff;\">matrix<\/span> (test[, -13])\ntest_y = test[, 13]\n\n<span style=\"color: #008080;\">#define final training and testing sets\n<\/span>xgb_train = xgb. <span style=\"color: #3366ff;\">DMatrix<\/span> (data = train_x, label = train_y)\nxgb_test = xgb. <span style=\"color: #3366ff;\">DMatrix<\/span> (data = test_x, label = test_y)\n<\/span><\/span><\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>4\ub2e8\uacc4: \ubaa8\ub378 \uc870\uc815<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\ub2e4\uc74c\uc73c\ub85c, \uac01 \ubd80\uc2a4\ud305 \uc8fc\uae30\uc5d0 \ub300\ud55c \ud6c8\ub828 \ubc0f \ud14c\uc2a4\ud2b8 RMSE(\ud3c9\uade0 \uc81c\uacf1 \uc624\ucc28)\ub97c \ud45c\uc2dc\ud558\ub294 <strong>xgb.train()<\/strong> \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec XGBoost \ubaa8\ub378\uc744 \uc870\uc815\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uc774 \uc608\uc5d0\uc11c\ub294 70\uac1c\uc758 \ub77c\uc6b4\ub4dc\ub97c \uc0ac\uc6a9\ud558\uae30\ub85c \uc120\ud0dd\ud588\uc9c0\ub9cc \ud6e8\uc52c \ub354 \ud070 \ub370\uc774\ud130 \uc138\ud2b8\uc758 \uacbd\uc6b0 \uc218\ubc31 \ub610\ub294 \uc218\ucc9c \uac1c\uc758 \ub77c\uc6b4\ub4dc\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \ub4dc\ubb38 \uc77c\uc774 \uc544\ub2d9\ub2c8\ub2e4. \ub77c\uc6b4\ub4dc\uac00 \ub9ce\uc744\uc218\ub85d \uc2e4\ud589 \uc2dc\uac04\uc774 \uae38\uc5b4\uc9c4\ub2e4\ub294 \uc810\uc744 \uba85\uc2ec\ud558\uc138\uc694.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\ub610\ud55c <strong>max.degree<\/strong> \uc778\uc218\ub294 \uac1c\ubcc4 \uc758\uc0ac\uacb0\uc815 \ud2b8\ub9ac\uc758 \uac1c\ubc1c \uae4a\uc774\ub97c \uc9c0\uc815\ud569\ub2c8\ub2e4. \uc6b0\ub9ac\ub294 \uc77c\ubc18\uc801\uc73c\ub85c \ub354 \uc791\uc740 \ub098\ubb34\ub97c \ud0a4\uc6b0\uae30 \uc704\ud574 \uc774 \uc22b\uc790\ub97c 2\ub098 3\uacfc \uac19\uc774 \uc544\uc8fc \ub0ae\uc740 \uc22b\uc790\ub85c \uc120\ud0dd\ud569\ub2c8\ub2e4. \uc774 \uc811\uadfc \ubc29\uc2dd\uc740 \ubcf4\ub2e4 \uc815\ud655\ud55c \ubaa8\ub378\uc744 \uc0dd\uc131\ud558\ub294 \uacbd\ud5a5\uc774 \uc788\ub294 \uac83\uc73c\ub85c \ub098\ud0c0\ub0ac\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#define watchlist\n<\/span>watchlist = list(train=xgb_train, test=xgb_test)\n\n<span style=\"color: #008080;\">#fit XGBoost model and display training and testing data at each round\n<\/span>model = xgb.train(data = xgb_train, max.depth = <span style=\"color: #008000;\">3<\/span> , watchlist=watchlist, nrounds = <span style=\"color: #008000;\">70<\/span> )\n\n[1] train-rmse:10.167523 test-rmse:10.839775 \n[2] train-rmse:7.521903 test-rmse:8.329679 \n[3] train-rmse:5.702393 test-rmse:6.691415 \n[4] train-rmse:4.463687 test-rmse:5.631310 \n[5] train-rmse:3.666278 test-rmse:4.878750 \n[6] train-rmse:3.159799 test-rmse:4.485698 \n[7] train-rmse:2.855133 test-rmse:4.230533 \n[8] train-rmse:2.603367 test-rmse:4.099881 \n[9] train-rmse:2.445718 test-rmse:4.084360 \n[10] train-rmse:2.327318 test-rmse:3.993562 \n[11] train-rmse:2.267629 test-rmse:3.944454 \n[12] train-rmse:2.189527 test-rmse:3.930808 \n[13] train-rmse:2.119130 test-rmse:3.865036 \n[14] train-rmse:2.086450 test-rmse:3.875088 \n[15] train-rmse:2.038356 test-rmse:3.881442 \n[16] train-rmse:2.010995 test-rmse:3.883322 \n[17] train-rmse:1.949505 test-rmse:3.844382 \n[18] train-rmse:1.911711 test-rmse:3.809830 \n[19] train-rmse:1.888488 test-rmse:3.809830 \n[20] train-rmse:1.832443 test-rmse:3.758502 \n[21] train-rmse:1.816150 test-rmse:3.770216 \n[22] train-rmse:1.801369 test-rmse:3.770474 \n[23] train-rmse:1.788891 test-rmse:3.766608 \n[24] train-rmse:1.751795 test-rmse:3.749583 \n[25] train-rmse:1.713306 test-rmse:3.720173 \n[26] train-rmse:1.672227 test-rmse:3.675086 \n[27] train-rmse:1.648323 test-rmse:3.675977 \n[28] train-rmse:1.609927 test-rmse:3.745338 \n[29] train-rmse:1.594891 test-rmse:3.756049 \n[30] train-rmse:1.578573 test-rmse:3.760104 \n[31] train-rmse:1.559810 test-rmse:3.727940 \n[32] train-rmse:1.547852 test-rmse:3.731702 \n[33] train-rmse:1.534589 test-rmse:3.729761 \n[34] train-rmse:1.520566 test-rmse:3.742681 \n[35] train-rmse:1.495155 test-rmse:3.732993 \n[36] train-rmse:1.467939 test-rmse:3.738329 \n[37] train-rmse:1.446343 test-rmse:3.713748 \n[38] train-rmse:1.435368 test-rmse:3.709469 \n[39] train-rmse:1.401356 test-rmse:3.710637 \n[40] train-rmse:1.390318 test-rmse:3.709461 \n[41] train-rmse:1.372635 test-rmse:3.708049 \n[42] train-rmse:1.367977 test-rmse:3.707429 \n[43] train-rmse:1.359531 test-rmse:3.711663 \n[44] train-rmse:1.335347 test-rmse:3.709101 \n[45] train-rmse:1.331750 test-rmse:3.712490 \n[46] train-rmse:1.313087 test-rmse:3.722981 \n[47] train-rmse:1.284392 test-rmse:3.712840 \n[48] train-rmse:1.257714 test-rmse:3.697482 \n[49] train-rmse:1.248218 test-rmse:3.700167 \n[50] train-rmse:1.243377 test-rmse:3.697914 \n[51] train-rmse:1.231956 test-rmse:3.695797 \n[52] train-rmse:1.219341 test-rmse:3.696277 \n[53] train-rmse:1.207413 test-rmse:3.691465 \n[54] train-rmse:1.197197 test-rmse:3.692108 \n[55] train-rmse:1.171748 test-rmse:3.683577 \n[56] train-rmse:1.156332 test-rmse:3.674458 \n[57] train-rmse:1.147686 test-rmse:3.686367 \n[58] train-rmse:1.143572 test-rmse:3.686375 \n[59] train-rmse:1.129780 test-rmse:3.679791 \n[60] train-rmse:1.111257 test-rmse:3.679022 \n[61] train-rmse:1.093541 test-rmse:3.699670 \n[62] train-rmse:1.083934 test-rmse:3.708187 \n[63] train-rmse:1.067109 test-rmse:3.712538 \n[64] train-rmse:1.053887 test-rmse:3.722480 \n[65] train-rmse:1.042127 test-rmse:3.720720 \n[66] train-rmse:1.031617 test-rmse:3.721224 \n[67] train-rmse:1.016274 test-rmse:3.699549 \n[68] train-rmse:1.008184 test-rmse:3.709522 \n[69] train-rmse:0.999220 test-rmse:3.708000 \n[70] train-rmse:0.985907 test-rmse:3.705192 \n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\uacb0\uacfc\uc5d0\uc11c \ucd5c\uc18c \ud14c\uc2a4\ud2b8 RMSE\uac00 <strong>56<\/strong> \ub77c\uc6b4\ub4dc\uc5d0\uc11c \ub2ec\uc131\ub418\uc5c8\uc74c\uc744 \uc54c \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uc9c0\uc810\uc744 \ub118\uc5b4\uc11c\uba74 \ud14c\uc2a4\ud2b8 RMSE\uac00 \uc99d\uac00\ud558\uae30 \uc2dc\uc791\ud558\uc5ec <a href=\"https:\/\/statorials.org\/ko\/\u1106\u1165\u1109\u1175\u11ab\u1105\u1165\u1102\u1175\u11bc-\u1100\u116a\u110c\u1165\u11a8\u1112\u1161\u11b8\/\" target=\"_blank\" rel=\"noopener noreferrer\">\ud6c8\ub828 \ub370\uc774\ud130\uac00 \uacfc\uc801\ud569\ub418\uace0 \uc788\uc74c\uc744<\/a> \ub098\ud0c0\ub0c5\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\ub530\ub77c\uc11c \ucd5c\uc885 XGBoost \ubaa8\ub378\uc744 56\ub77c\uc6b4\ub4dc\ub97c \uc0ac\uc6a9\ud558\ub3c4\ub85d \uc124\uc815\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#define final model\n<\/span>final = xgboost(data = xgb_train, max.depth = <span style=\"color: #008000;\">3<\/span> , nrounds = <span style=\"color: #008000;\">56<\/span> , verbose = <span style=\"color: #008000;\">0<\/span> )<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\ucc38\uace0: <strong>verbose=0<\/strong> \uc778\uc218\ub294 R\uc5d0\uac8c \uac01 \ub77c\uc6b4\ub4dc\uc5d0 \ub300\ud55c \ud6c8\ub828 \ubc0f \ud14c\uc2a4\ud2b8 \uc624\ub958\ub97c \ud45c\uc2dc\ud558\uc9c0 \uc54a\ub3c4\ub85d \uc9c0\uc2dc\ud569\ub2c8\ub2e4.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>5\ub2e8\uacc4: \ubaa8\ub378\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc608\uce21\ud558\uae30<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\ub9c8\uc9c0\ub9c9\uc73c\ub85c \uac1c\uc120\ub41c \ucd5c\uc885 \ubaa8\ub378\uc744 \uc0ac\uc6a9\ud558\uc5ec \ud14c\uc2a4\ud2b8 \uc138\ud2b8\uc5d0\uc11c \ubcf4\uc2a4\ud134 \uc8fc\ud0dd\uc758 \uc911\uc559\uac12\uc744 \uc608\uce21\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uadf8\ub7f0 \ub2e4\uc74c \ubaa8\ub378\uc5d0 \ub300\ud574 \ub2e4\uc74c\uacfc \uac19\uc740 \uc815\ud655\ub3c4 \uce21\uc815\ud56d\ubaa9\uc744 \uacc4\uc0b0\ud569\ub2c8\ub2e4.<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>MSE:<\/strong> \ud3c9\uade0 \uc81c\uacf1 \uc624\ucc28<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>MAE:<\/strong> \ud3c9\uade0 \uc808\ub300 \uc624\ucc28<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>RMSE:<\/strong> \uc81c\uacf1\ud3c9\uade0\uc81c\uacf1\uadfc \uc624\ub958<\/span><\/li>\n<\/ul>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\"><span style=\"color: #000000;\">mean((test_y - pred_y)^2)<\/span> #mse\n<span style=\"color: #000000;\">caret::MAE(test_y, pred_y)<\/span> #mae\n<span style=\"color: #000000;\">caret::RMSE(test_y, pred_y)<\/span> #rmse\n\n<\/span>[1] 13.50164\n[1] 2.409426\n[1] 3.674457<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\ud3c9\uade0 \uc81c\uacf1 \uc624\ucc28\ub294 <strong>3.674457<\/strong> \uc785\ub2c8\ub2e4. \uc774\ub294 \uc8fc\ud0dd \uc911\uc559\uac12\uc5d0 \ub300\ud55c \uc608\uce21\uacfc \ud14c\uc2a4\ud2b8 \uc138\ud2b8\uc5d0\uc11c \uad00\ucc30\ub41c \uc2e4\uc81c \uc8fc\ud0dd \uac00\uce58 \uac04\uc758 \ud3c9\uade0 \ucc28\uc774\ub97c \ub098\ud0c0\ub0c5\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uc6d0\ud558\ub294 \uacbd\uc6b0 \uc774 RMSE\ub97c <a href=\"https:\/\/statorials.org\/ko\/\u1103\u1161\u110c\u116e\u11bc-\u1109\u1165\u11ab\u1112\u1167\u11bc-\u1112\u116c\u1100\u1171-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">\ub2e4\uc911 \uc120\ud615 \ud68c\uadc0<\/a> , <a href=\"https:\/\/statorials.org\/ko\/r\u110b\u1174-\u110f\u1173\u1105\u1166\u1109\u1173\u1110\u1173-\u1112\u116c\u1100\u1171\/\" target=\"_blank\" rel=\"noopener noreferrer\">\ub2a5\uc120 \ud68c\uadc0<\/a> , <a href=\"https:\/\/statorials.org\/ko\/r\u110b\u1174-\u110c\u116e\u1109\u1165\u11bc\u1107\u116e\u11ab-\u1112\u116c\u1100\u1171\/\" target=\"_blank\" rel=\"noopener noreferrer\">\uc8fc\uc131\ubd84 \ud68c\uadc0<\/a> \ub4f1\uacfc \uac19\uc740 \ub2e4\ub978 \ubaa8\ub378\uacfc \ube44\uad50\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5b4\ub5a4 \ubaa8\ub378\uc774 \uac00\uc7a5 \uc815\ud655\ud55c \uc608\uce21\uc744 \uc0dd\uc131\ud558\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p> <span style=\"color: #000000;\">\uc774 \uc608\uc81c\uc5d0 \uc0ac\uc6a9\ub41c \uc804\uccb4 R \ucf54\ub4dc\ub294 <a href=\"https:\/\/github.com\/Statorials\/R-Guides\/blob\/main\/xgboost.R\" target=\"_blank\" rel=\"noopener noreferrer\">\uc5ec\uae30\uc5d0\uc11c<\/a> \ucc3e\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ubd80\uc2a4\ud305\uc740 \uc608\uce21 \uc815\ud655\ub3c4\uac00 \ub192\uc740 \ubaa8\ub378\uc744 \uc0dd\uc131\ud558\ub294 \uac83\uc73c\ub85c \uc785\uc99d\ub41c \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc785\ub2c8\ub2e4. \uc2e4\uc81c\ub85c \ubd80\uc2a4\ud305\uc744 \uad6c\ud604\ud558\ub294 \uac00\uc7a5 \uc77c\ubc18\uc801\uc778 \ubc29\ubc95 \uc911 \ud558\ub098\ub294 &#8220;\uadf9\ub2e8\uc801 \uacbd\uc0ac \ubd80\uc2a4\ud305&#8221;\uc758 \uc57d\uc790\uc778 XGBoost\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 R\uc5d0\uc11c \ud5a5\uc0c1\ub41c \ubaa8\ub378\uc744 \ub9de\ucd94\uae30 \uc704\ud574 XGBoost\ub97c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. 1\ub2e8\uacc4: \ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \ub85c\ub4dc \uba3c\uc800 \ud544\uc694\ud55c \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \ub85c\ub4dc\ud558\uaca0\uc2b5\ub2c8\ub2e4. library (xgboost) #for fitting the xgboost model [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-1233","post","type-post","status-publish","format-standard","hentry","category-20"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>R\uc758 XGBoost: \ub2e8\uacc4\ubcc4 \uc608<\/title>\n<meta name=\"description\" content=\"\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc778 R\uc5d0\uc11c XGBoost\ub97c \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/ko\/r\u110b\u1174-xgboost\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R\uc758 XGBoost: \ub2e8\uacc4\ubcc4 \uc608\" \/>\n<meta property=\"og:description\" content=\"\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc778 R\uc5d0\uc11c XGBoost\ub97c \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/ko\/r\u110b\u1174-xgboost\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T04:52:33+00:00\" \/>\n<meta name=\"author\" content=\"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/\",\"url\":\"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/\",\"name\":\"R\uc758 XGBoost: \ub2e8\uacc4\ubcc4 \uc608\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/ko\/#website\"},\"datePublished\":\"2023-07-27T04:52:33+00:00\",\"dateModified\":\"2023-07-27T04:52:33+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/ko\/#\/schema\/person\/600556789b7d79cbaa9d9f0c721b74f4\"},\"description\":\"\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc778 R\uc5d0\uc11c XGBoost\ub97c \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\uc9d1\",\"item\":\"https:\/\/statorials.org\/ko\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"R\uc758 xgboost: \ub2e8\uacc4\ubcc4 \uc608\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/ko\/#website\",\"url\":\"https:\/\/statorials.org\/ko\/\",\"name\":\"Statorials\",\"description\":\"\ud1b5\uacc4 \ud65c\uc6a9 \ub2a5\ub825\uc744 \uc704\ud55c \uac00\uc774\ub4dc!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/ko\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/ko\/#\/schema\/person\/600556789b7d79cbaa9d9f0c721b74f4\",\"name\":\"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/statorials.org\/ko\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/ko\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/ko\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8\"},\"description\":\"\uc548\ub155\ud558\uc138\uc694. \uc800\ub294 \ud1b5\uacc4\ud559 \uad50\uc218\ub97c \ud1f4\uc9c1\ud558\uace0 \uc804\uc784 \ud1b5\uacc4 \uad50\uc0ac\ub85c \ubcc0\uc2e0\ud55c \ubca4\uc790\ubbfc\uc785\ub2c8\ub2e4. \ud1b5\uacc4 \ubd84\uc57c\uc758 \uad11\ubc94\uc704\ud55c \uacbd\ud5d8\uacfc \uc804\ubb38 \uc9c0\uc2dd\uc744 \ubc14\ud0d5\uc73c\ub85c Statorials\ub97c \ud1b5\ud574 \ud559\uc0dd\ub4e4\uc5d0\uac8c \ud798\uc744 \uc2e4\uc5b4\uc8fc\uae30 \uc704\ud574 \uc9c0\uc2dd\uc744 \uacf5\uc720\ud558\uace0 \uc2f6\uc2b5\ub2c8\ub2e4. \ub354 \uc54c\uc544\ubcf4\uae30\",\"sameAs\":[\"https:\/\/statorials.org\/ko\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"R\uc758 XGBoost: \ub2e8\uacc4\ubcc4 \uc608","description":"\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc778 R\uc5d0\uc11c XGBoost\ub97c \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/ko\/r\u110b\u1174-xgboost\/","og_locale":"ko_KR","og_type":"article","og_title":"R\uc758 XGBoost: \ub2e8\uacc4\ubcc4 \uc608","og_description":"\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc778 R\uc5d0\uc11c XGBoost\ub97c \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.","og_url":"https:\/\/statorials.org\/ko\/r\u110b\u1174-xgboost\/","og_site_name":"Statorials","article_published_time":"2023-07-27T04:52:33+00:00","author":"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8","Est. reading time":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/","url":"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/","name":"R\uc758 XGBoost: \ub2e8\uacc4\ubcc4 \uc608","isPartOf":{"@id":"https:\/\/statorials.org\/ko\/#website"},"datePublished":"2023-07-27T04:52:33+00:00","dateModified":"2023-07-27T04:52:33+00:00","author":{"@id":"https:\/\/statorials.org\/ko\/#\/schema\/person\/600556789b7d79cbaa9d9f0c721b74f4"},"description":"\uc774 \ud29c\ud1a0\ub9ac\uc5bc\uc5d0\uc11c\ub294 \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 \uae30\uacc4 \ud559\uc2b5 \uae30\uc220\uc778 R\uc5d0\uc11c XGBoost\ub97c \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud55c \ub2e8\uacc4\ubcc4 \uc608\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4.","breadcrumb":{"@id":"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/ko\/r%e1%84%8b%e1%85%b4-xgboost\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\uc9d1","item":"https:\/\/statorials.org\/ko\/"},{"@type":"ListItem","position":2,"name":"R\uc758 xgboost: \ub2e8\uacc4\ubcc4 \uc608"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/ko\/#website","url":"https:\/\/statorials.org\/ko\/","name":"Statorials","description":"\ud1b5\uacc4 \ud65c\uc6a9 \ub2a5\ub825\uc744 \uc704\ud55c \uac00\uc774\ub4dc!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/ko\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/statorials.org\/ko\/#\/schema\/person\/600556789b7d79cbaa9d9f0c721b74f4","name":"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/statorials.org\/ko\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/ko\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/ko\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\ubca4\uc790\ubbfc \uc564\ub354\uc2a8"},"description":"\uc548\ub155\ud558\uc138\uc694. \uc800\ub294 \ud1b5\uacc4\ud559 \uad50\uc218\ub97c \ud1f4\uc9c1\ud558\uace0 \uc804\uc784 \ud1b5\uacc4 \uad50\uc0ac\ub85c \ubcc0\uc2e0\ud55c \ubca4\uc790\ubbfc\uc785\ub2c8\ub2e4. \ud1b5\uacc4 \ubd84\uc57c\uc758 \uad11\ubc94\uc704\ud55c \uacbd\ud5d8\uacfc \uc804\ubb38 \uc9c0\uc2dd\uc744 \ubc14\ud0d5\uc73c\ub85c Statorials\ub97c \ud1b5\ud574 \ud559\uc0dd\ub4e4\uc5d0\uac8c \ud798\uc744 \uc2e4\uc5b4\uc8fc\uae30 \uc704\ud574 \uc9c0\uc2dd\uc744 \uacf5\uc720\ud558\uace0 \uc2f6\uc2b5\ub2c8\ub2e4. \ub354 \uc54c\uc544\ubcf4\uae30","sameAs":["https:\/\/statorials.org\/ko"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/posts\/1233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/comments?post=1233"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/posts\/1233\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/media?parent=1233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/categories?post=1233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/ko\/wp-json\/wp\/v2\/tags?post=1233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}