{"id":1234,"date":"2023-07-27T04:52:33","date_gmt":"2023-07-27T04:52:33","guid":{"rendered":"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/"},"modified":"2023-07-27T04:52:33","modified_gmt":"2023-07-27T04:52:33","slug":"xgboost-%e0%b9%83%e0%b8%99-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/","title":{"rendered":"Xgboost \u0e43\u0e19 r: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/th\/\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1b\u0e23\u0e30\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e20\u0e32\u0e1e<\/a> \u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e1e\u0e34\u0e2a\u0e39\u0e08\u0e19\u0e4c\u0e41\u0e25\u0e49\u0e27\u0e27\u0e48\u0e32\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e21\u0e35\u0e04\u0e27\u0e32\u0e21\u0e41\u0e21\u0e48\u0e19\u0e22\u0e33\u0e43\u0e19\u0e01\u0e32\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22\u0e2a\u0e39\u0e07<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e27\u0e34\u0e18\u0e35\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e17\u0e35\u0e48\u0e1e\u0e1a\u0e1a\u0e48\u0e2d\u0e22\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14\u0e43\u0e19\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e01\u0e32\u0e23\u0e1a\u0e39\u0e2a\u0e15\u0e4c\u0e43\u0e19\u0e17\u0e32\u0e07\u0e1b\u0e0f\u0e34\u0e1a\u0e31\u0e15\u0e34\u0e04\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49 <strong>XGBoost<\/strong> \u0e22\u0e48\u0e2d\u0e21\u0e32\u0e08\u0e32\u0e01 &#8220;\u0e01\u0e32\u0e23\u0e40\u0e23\u0e48\u0e07\u0e04\u0e27\u0e32\u0e21\u0e40\u0e23\u0e47\u0e27\u0e41\u0e1a\u0e1a\u0e44\u0e25\u0e48\u0e23\u0e30\u0e14\u0e31\u0e1a\u0e2a\u0e35\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e38\u0e14&#8221;<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e43\u0e0a\u0e49 XGBoost \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e1e\u0e2d\u0e14\u0e35\u0e01\u0e31\u0e1a\u0e42\u0e21\u0e40\u0e14\u0e25\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e31\u0e1a\u0e1b\u0e23\u0e38\u0e07\u0e43\u0e19 R<\/span><\/p>\n<h3> <strong><span style=\"color: #000000;\">\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 1: \u0e42\u0e2b\u0e25\u0e14\u0e41\u0e1e\u0e47\u0e04\u0e40\u0e01\u0e08\u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19<\/span><\/strong><\/h3>\n<p> <span style=\"color: #000000;\">\u0e02\u0e31\u0e49\u0e19\u0e41\u0e23\u0e01 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e42\u0e2b\u0e25\u0e14\u0e44\u0e25\u0e1a\u0e23\u0e32\u0e23\u0e35\u0e48\u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19<\/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>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 2: \u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e31\u0e1a\u0e1b\u0e23\u0e38\u0e07\u0e43\u0e2b\u0e49\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e01\u0e31\u0e1a\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 <strong>Boston<\/strong> \u0e08\u0e32\u0e01\u0e41\u0e1e\u0e47\u0e04\u0e40\u0e01\u0e08 <strong>MASS<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e35\u0e49\u0e21\u0e35\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22 13 \u0e15\u0e31\u0e27\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e17\u0e33\u0e19\u0e32\u0e22 <a href=\"https:\/\/statorials.org\/th\/\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e17\u0e35\u0e48\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e01\u0e32\u0e23\u0e15\u0e2d\u0e1a\u0e2a\u0e19\u0e2d\u0e07\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e15\u0e2d\u0e1a\u0e2a\u0e19\u0e2d\u0e07<\/a> \u0e17\u0e35\u0e48\u0e40\u0e23\u0e35\u0e22\u0e01\u0e27\u0e48\u0e32 <strong>mdev<\/strong> \u0e0b\u0e36\u0e48\u0e07\u0e41\u0e2a\u0e14\u0e07\u0e16\u0e36\u0e07\u0e04\u0e48\u0e32\u0e21\u0e31\u0e18\u0e22\u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1a\u0e49\u0e32\u0e19\u0e43\u0e19\u0e1e\u0e37\u0e49\u0e19\u0e17\u0e35\u0e48\u0e2a\u0e33\u0e23\u0e27\u0e08\u0e2a\u0e33\u0e21\u0e30\u0e42\u0e19\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e15\u0e48\u0e32\u0e07\u0e46 \u0e17\u0e31\u0e48\u0e27\u0e1a\u0e2d\u0e2a\u0e15\u0e31\u0e19<\/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;\">\u0e40\u0e23\u0e32\u0e08\u0e30\u0e40\u0e2b\u0e47\u0e19\u0e27\u0e48\u0e32\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e14\u0e49\u0e27\u0e22 <a href=\"https:\/\/statorials.org\/th\/\u0e01\u0e32\u0e23\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15\u0e43\u0e19\u0e2a\u0e16\u0e34\u0e15\u0e34\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e01\u0e32\u0e23\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15<\/a> 506 \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 \u0e41\u0e25\u0e30\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 14 \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 3: \u0e40\u0e15\u0e23\u0e35\u0e22\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e15\u0e48\u0e2d\u0e44\u0e1b \u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <strong>createDataPartition()<\/strong> \u0e08\u0e32\u0e01\u0e41\u0e1e\u0e47\u0e04\u0e40\u0e01\u0e08\u0e04\u0e32\u0e40\u0e23\u0e47\u0e15\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e41\u0e22\u0e01\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e14\u0e31\u0e49\u0e07\u0e40\u0e14\u0e34\u0e21\u0e2d\u0e2d\u0e01\u0e40\u0e1b\u0e47\u0e19\u0e0a\u0e38\u0e14\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e43\u0e0a\u0e49 80% \u0e02\u0e2d\u0e07\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e14\u0e31\u0e49\u0e07\u0e40\u0e14\u0e34\u0e21\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e02\u0e2d\u0e07\u0e0a\u0e38\u0e14\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e42\u0e1b\u0e23\u0e14\u0e17\u0e23\u0e32\u0e1a\u0e27\u0e48\u0e32\u0e41\u0e1e\u0e47\u0e04\u0e40\u0e01\u0e08 xgboost \u0e22\u0e31\u0e07\u0e43\u0e0a\u0e49\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e40\u0e21\u0e17\u0e23\u0e34\u0e01\u0e0b\u0e4c \u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <strong>data.matrix()<\/strong> \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e01\u0e47\u0e1a\u0e15\u0e31\u0e27\u0e41\u0e1b\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22\u0e02\u0e2d\u0e07\u0e40\u0e23\u0e32<\/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>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 4: \u0e1b\u0e23\u0e31\u0e1a\u0e42\u0e21\u0e40\u0e14\u0e25<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e15\u0e48\u0e2d\u0e44\u0e1b \u0e40\u0e23\u0e32\u0e08\u0e30\u0e1b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e07\u0e42\u0e21\u0e40\u0e14\u0e25 XGBoost \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19 <strong>xgb.train()<\/strong> \u0e0b\u0e36\u0e48\u0e07\u0e41\u0e2a\u0e14\u0e07\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a RMSE (\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2a\u0e2d\u0e07\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22) \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e25\u0e30\u0e23\u0e2d\u0e1a\u0e01\u0e32\u0e23\u0e1a\u0e39\u0e2a\u0e15\u0e4c<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e42\u0e1b\u0e23\u0e14\u0e17\u0e23\u0e32\u0e1a\u0e27\u0e48\u0e32\u0e40\u0e23\u0e32\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e43\u0e0a\u0e49 70 \u0e23\u0e2d\u0e1a\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 \u0e41\u0e15\u0e48\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e43\u0e2b\u0e0d\u0e48\u0e01\u0e27\u0e48\u0e32\u0e21\u0e32\u0e01 \u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e41\u0e1b\u0e25\u0e01\u0e17\u0e35\u0e48\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e2b\u0e25\u0e32\u0e22\u0e23\u0e49\u0e2d\u0e22\u0e2b\u0e23\u0e37\u0e2d\u0e2b\u0e25\u0e32\u0e22\u0e1e\u0e31\u0e19\u0e23\u0e2d\u0e1a \u0e40\u0e1e\u0e35\u0e22\u0e07\u0e08\u0e33\u0e44\u0e27\u0e49\u0e27\u0e48\u0e32\u0e22\u0e34\u0e48\u0e07\u0e21\u0e35\u0e23\u0e2d\u0e1a\u0e21\u0e32\u0e01\u0e40\u0e17\u0e48\u0e32\u0e44\u0e2b\u0e23\u0e48 \u0e23\u0e31\u0e19\u0e44\u0e17\u0e21\u0e4c\u0e01\u0e47\u0e08\u0e30\u0e22\u0e34\u0e48\u0e07\u0e19\u0e32\u0e19\u0e02\u0e36\u0e49\u0e19\u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e42\u0e1b\u0e23\u0e14\u0e17\u0e23\u0e32\u0e1a\u0e27\u0e48\u0e32\u0e2d\u0e32\u0e23\u0e4c\u0e01\u0e34\u0e27\u0e40\u0e21\u0e19\u0e15\u0e4c <strong>max.degree<\/strong> \u0e23\u0e30\u0e1a\u0e38\u0e04\u0e27\u0e32\u0e21\u0e25\u0e36\u0e01\u0e02\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e1e\u0e31\u0e12\u0e19\u0e32\u0e41\u0e1c\u0e19\u0e1c\u0e31\u0e07\u0e01\u0e32\u0e23\u0e15\u0e31\u0e14\u0e2a\u0e34\u0e19\u0e43\u0e08\u0e41\u0e15\u0e48\u0e25\u0e30\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 \u0e40\u0e23\u0e32\u0e21\u0e31\u0e01\u0e08\u0e30\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e08\u0e33\u0e19\u0e27\u0e19\u0e19\u0e35\u0e49\u0e04\u0e48\u0e2d\u0e19\u0e02\u0e49\u0e32\u0e07\u0e15\u0e48\u0e33 \u0e40\u0e0a\u0e48\u0e19 2 \u0e2b\u0e23\u0e37\u0e2d 3 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e17\u0e35\u0e48\u0e08\u0e30\u0e1b\u0e25\u0e39\u0e01\u0e15\u0e49\u0e19\u0e44\u0e21\u0e49\u0e43\u0e2b\u0e49\u0e40\u0e25\u0e47\u0e01\u0e25\u0e07 \u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e19\u0e35\u0e49\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e2b\u0e49\u0e40\u0e2b\u0e47\u0e19\u0e27\u0e48\u0e32\u0e21\u0e35\u0e41\u0e19\u0e27\u0e42\u0e19\u0e49\u0e21\u0e17\u0e35\u0e48\u0e08\u0e30\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e41\u0e21\u0e48\u0e19\u0e22\u0e33\u0e22\u0e34\u0e48\u0e07\u0e02\u0e36\u0e49\u0e19<\/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;\">\u0e08\u0e32\u0e01\u0e1c\u0e25\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e08\u0e30\u0e40\u0e2b\u0e47\u0e19\u0e44\u0e14\u0e49\u0e27\u0e48\u0e32\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a RMSE \u0e02\u0e31\u0e49\u0e19\u0e15\u0e48\u0e33\u0e17\u0e33\u0e44\u0e14\u0e49\u0e17\u0e35\u0e48 <strong>56<\/strong> \u0e23\u0e2d\u0e1a \u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e08\u0e38\u0e14\u0e19\u0e35\u0e49 \u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a RMSE \u0e08\u0e30\u0e40\u0e23\u0e34\u0e48\u0e21\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e02\u0e36\u0e49\u0e19 \u0e0b\u0e36\u0e48\u0e07\u0e1a\u0e48\u0e07\u0e0a\u0e35\u0e49\u0e27\u0e48\u0e32\u0e40\u0e23\u0e32 <a href=\"https:\/\/statorials.org\/th\/\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e32\u0e01\u0e40\u0e01\u0e34\u0e19\u0e44\u0e1b\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e01\u0e33\u0e25\u0e31\u0e07\u0e1b\u0e23\u0e31\u0e1a\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01\u0e2d\u0e1a\u0e23\u0e21\u0e21\u0e32\u0e01\u0e40\u0e01\u0e34\u0e19\u0e44\u0e1b<\/a><\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e42\u0e21\u0e40\u0e14\u0e25 XGBoost \u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e43\u0e2b\u0e49\u0e43\u0e0a\u0e49 56 \u0e23\u0e2d\u0e1a:<\/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;\">\u0e2b\u0e21\u0e32\u0e22\u0e40\u0e2b\u0e15\u0e38: \u0e2d\u0e32\u0e23\u0e4c\u0e01\u0e34\u0e27\u0e40\u0e21\u0e19\u0e15\u0e4c <strong>verbose=0<\/strong> \u0e08\u0e30\u0e1a\u0e2d\u0e01 R \u0e27\u0e48\u0e32\u0e2d\u0e22\u0e48\u0e32\u0e41\u0e2a\u0e14\u0e07\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14\u0e43\u0e19\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01\u0e41\u0e25\u0e30\u0e01\u0e32\u0e23\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e25\u0e30\u0e23\u0e2d\u0e1a<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e17\u0e35\u0e48 5: \u0e43\u0e0a\u0e49\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e32\u0e14\u0e01\u0e32\u0e23\u0e13\u0e4c<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e19\u0e35\u0e49 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e41\u0e1a\u0e1a\u0e08\u0e33\u0e25\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e1b\u0e23\u0e31\u0e1a\u0e1b\u0e23\u0e38\u0e07\u0e02\u0e31\u0e49\u0e19\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e32\u0e14\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e04\u0e48\u0e32\u0e21\u0e31\u0e18\u0e22\u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1a\u0e49\u0e32\u0e19\u0e43\u0e19\u0e1a\u0e2d\u0e2a\u0e15\u0e31\u0e19\u0e43\u0e19\u0e0a\u0e38\u0e14\u0e17\u0e14\u0e2a\u0e2d\u0e1a<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e04\u0e33\u0e19\u0e27\u0e13\u0e40\u0e21\u0e15\u0e23\u0e34\u0e01\u0e04\u0e27\u0e32\u0e21\u0e41\u0e21\u0e48\u0e19\u0e22\u0e33\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e42\u0e21\u0e40\u0e14\u0e25:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>MSE:<\/strong> \u0e04\u0e48\u0e32\u0e04\u0e25\u0e32\u0e14\u0e40\u0e04\u0e25\u0e37\u0e48\u0e2d\u0e19\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2a\u0e2d\u0e07\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>\u0e41\u0e21\u0e48:<\/strong> \u0e2b\u0e21\u0e32\u0e22\u0e16\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14\u0e2a\u0e31\u0e21\u0e1a\u0e39\u0e23\u0e13\u0e4c<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>RMSE:<\/strong> \u0e02\u0e49\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14\u0e23\u0e39\u0e17\u0e04\u0e48\u0e32\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2a\u0e2d\u0e07<\/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;\">\u0e04\u0e48\u0e32\u0e04\u0e25\u0e32\u0e14\u0e40\u0e04\u0e25\u0e37\u0e48\u0e2d\u0e19\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2a\u0e2d\u0e07\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22\u0e01\u0e25\u0e32\u0e22\u0e40\u0e1b\u0e47\u0e19 <strong>3.674457<\/strong> \u0e19\u0e35\u0e48\u0e41\u0e2a\u0e14\u0e07\u0e16\u0e36\u0e07\u0e04\u0e27\u0e32\u0e21\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e42\u0e14\u0e22\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e17\u0e33\u0e19\u0e32\u0e22\u0e17\u0e35\u0e48\u0e17\u0e33\u0e01\u0e31\u0e1a\u0e04\u0e48\u0e32\u0e21\u0e31\u0e18\u0e22\u0e10\u0e32\u0e19\u0e02\u0e2d\u0e07\u0e1a\u0e49\u0e32\u0e19\u0e01\u0e31\u0e1a\u0e04\u0e48\u0e32\u0e1a\u0e49\u0e32\u0e19\u0e08\u0e23\u0e34\u0e07\u0e17\u0e35\u0e48\u0e2a\u0e31\u0e07\u0e40\u0e01\u0e15\u0e44\u0e14\u0e49\u0e43\u0e19\u0e0a\u0e38\u0e14\u0e17\u0e14\u0e2a\u0e2d\u0e1a<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e2b\u0e32\u0e01\u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e1b\u0e23\u0e35\u0e22\u0e1a\u0e40\u0e17\u0e35\u0e22\u0e1a RMSE \u0e19\u0e35\u0e49\u0e01\u0e31\u0e1a\u0e42\u0e21\u0e40\u0e14\u0e25\u0e2d\u0e37\u0e48\u0e19\u0e46 \u0e40\u0e0a\u0e48\u0e19 <a href=\"https:\/\/statorials.org\/th\/\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e40\u0e0a\u0e34\u0e07\u0e40\u0e2a\u0e49\u0e19\u0e1e\u0e2b\u0e38\u0e04\u0e39\u0e13-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Multiple Linear Regression<\/a> , <a href=\"https:\/\/statorials.org\/th\/\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e22\u0e2d\u0e14\u0e43\u0e19-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Ridge Regression<\/a> , <a href=\"https:\/\/statorials.org\/th\/\u0e01\u0e32\u0e23\u0e16\u0e14\u0e16\u0e2d\u0e22\u0e2d\u0e07\u0e04\u0e4c\u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e2b\u0e25\u0e31\u0e01\u0e43\u0e19-r\/\" target=\"_blank\" rel=\"noopener noreferrer\">Principal Component Regression<\/a> \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e19 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e14\u0e39\u0e27\u0e48\u0e32\u0e42\u0e21\u0e40\u0e14\u0e25\u0e43\u0e14\u0e43\u0e2b\u0e49\u0e01\u0e32\u0e23\u0e04\u0e32\u0e14\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e17\u0e35\u0e48\u0e41\u0e21\u0e48\u0e19\u0e22\u0e33\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14<\/span><\/p>\n<p> <span style=\"color: #000000;\">\u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e42\u0e04\u0e49\u0e14 R \u0e41\u0e1a\u0e1a\u0e40\u0e15\u0e47\u0e21\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e19\u0e35\u0e49 <a href=\"https:\/\/github.com\/Statorials\/R-Guides\/blob\/main\/xgboost.R\" target=\"_blank\" rel=\"noopener noreferrer\">\u0e44\u0e14\u0e49 \u0e17\u0e35\u0e48\u0e19\u0e35\u0e48<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e01\u0e32\u0e23\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1b\u0e23\u0e30\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e20\u0e32\u0e1e \u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e44 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1234","post","type-post","status-publish","format-standard","hentry","category-3"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>XGBoost \u0e43\u0e19 R: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19<\/title>\n<meta name=\"description\" content=\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 XGBoost \u0e43\u0e19 R \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e22\u0e2d\u0e14\u0e19\u0e34\u0e22\u0e21\" \/>\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\/th\/xgboost-\u0e43\u0e19-r\/\" \/>\n<meta property=\"og:locale\" content=\"th_TH\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"XGBoost \u0e43\u0e19 R: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\" \/>\n<meta property=\"og:description\" content=\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 XGBoost \u0e43\u0e19 R \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e22\u0e2d\u0e14\u0e19\u0e34\u0e22\u0e21\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/th\/xgboost-\u0e43\u0e19-r\/\" \/>\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=\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u0e19\u0e32\u0e17\u0e35\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/\",\"url\":\"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/\",\"name\":\"XGBoost \u0e43\u0e19 R: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/th\/#website\"},\"datePublished\":\"2023-07-27T04:52:33+00:00\",\"dateModified\":\"2023-07-27T04:52:33+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332\"},\"description\":\"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 XGBoost \u0e43\u0e19 R \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e22\u0e2d\u0e14\u0e19\u0e34\u0e22\u0e21\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/#breadcrumb\"},\"inLanguage\":\"th\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0e1a\u0e49\u0e32\u0e19\",\"item\":\"https:\/\/statorials.org\/th\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Xgboost \u0e43\u0e19 r: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/th\/#website\",\"url\":\"https:\/\/statorials.org\/th\/\",\"name\":\"Statorials\",\"description\":\"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e32\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/th\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"th\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332\",\"name\":\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"th\",\"@id\":\"https:\/\/statorials.org\/th\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19\"},\"description\":\"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 \u0e09\u0e31\u0e19\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e28\u0e32\u0e2a\u0e15\u0e23\u0e32\u0e08\u0e32\u0e23\u0e22\u0e4c\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e40\u0e01\u0e29\u0e35\u0e22\u0e13\u0e2d\u0e32\u0e22\u0e38\u0e41\u0e25\u0e49\u0e27 \u0e41\u0e25\u0e30\u0e1c\u0e31\u0e19\u0e15\u0e31\u0e27\u0e21\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e23\u0e39\u0e2a\u0e2d\u0e19\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e42\u0e14\u0e22\u0e40\u0e09\u0e1e\u0e32\u0e30 \u0e14\u0e49\u0e27\u0e22\u0e1b\u0e23\u0e30\u0e2a\u0e1a\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e41\u0e25\u0e30\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e17\u0e35\u0e48\u0e01\u0e27\u0e49\u0e32\u0e07\u0e02\u0e27\u0e32\u0e07\u0e43\u0e19\u0e2a\u0e32\u0e02\u0e32\u0e2a\u0e16\u0e34\u0e15\u0e34 \u0e09\u0e31\u0e19\u0e01\u0e23\u0e30\u0e15\u0e37\u0e2d\u0e23\u0e37\u0e2d\u0e23\u0e49\u0e19\u0e17\u0e35\u0e48\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e1b\u0e31\u0e19\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e2a\u0e23\u0e34\u0e21\u0e28\u0e31\u0e01\u0e22\u0e20\u0e32\u0e1e\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19 Statorials. \u0e23\u0e39\u0e49\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\",\"sameAs\":[\"https:\/\/statorials.org\/th\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"XGBoost \u0e43\u0e19 R: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19","description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 XGBoost \u0e43\u0e19 R \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e22\u0e2d\u0e14\u0e19\u0e34\u0e22\u0e21","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\/th\/xgboost-\u0e43\u0e19-r\/","og_locale":"th_TH","og_type":"article","og_title":"XGBoost \u0e43\u0e19 R: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19","og_description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 XGBoost \u0e43\u0e19 R \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e22\u0e2d\u0e14\u0e19\u0e34\u0e22\u0e21","og_url":"https:\/\/statorials.org\/th\/xgboost-\u0e43\u0e19-r\/","og_site_name":"Statorials","article_published_time":"2023-07-27T04:52:33+00:00","author":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","twitter_card":"summary_large_image","twitter_misc":{"Written by":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","Est. reading time":"2 \u0e19\u0e32\u0e17\u0e35"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/","url":"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/","name":"XGBoost \u0e43\u0e19 R: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19","isPartOf":{"@id":"https:\/\/statorials.org\/th\/#website"},"datePublished":"2023-07-27T04:52:33+00:00","dateModified":"2023-07-27T04:52:33+00:00","author":{"@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332"},"description":"\u0e1a\u0e17\u0e0a\u0e48\u0e27\u0e22\u0e2a\u0e2d\u0e19\u0e19\u0e35\u0e49\u0e43\u0e2b\u0e49\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e27\u0e34\u0e18\u0e35\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 XGBoost \u0e43\u0e19 R \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e22\u0e2d\u0e14\u0e19\u0e34\u0e22\u0e21","breadcrumb":{"@id":"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/#breadcrumb"},"inLanguage":"th","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/th\/xgboost-%e0%b9%83%e0%b8%99-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0e1a\u0e49\u0e32\u0e19","item":"https:\/\/statorials.org\/th\/"},{"@type":"ListItem","position":2,"name":"Xgboost \u0e43\u0e19 r: \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e25\u0e30\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/th\/#website","url":"https:\/\/statorials.org\/th\/","name":"Statorials","description":"\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e01\u0e31\u0e1a\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e32\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/th\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"th"},{"@type":"Person","@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/7c9bb3d0f799d0f1b17883495e1de332","name":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19","image":{"@type":"ImageObject","inLanguage":"th","@id":"https:\/\/statorials.org\/th\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/th\/wp-content\/uploads\/2023\/11\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u0e14\u0e23.\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e41\u0e2d\u0e19\u0e40\u0e14\u0e2d\u0e23\u0e4c\u0e2a\u0e31\u0e19"},"description":"\u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 \u0e09\u0e31\u0e19\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1a\u0e19\u0e08\u0e32\u0e21\u0e34\u0e19 \u0e28\u0e32\u0e2a\u0e15\u0e23\u0e32\u0e08\u0e32\u0e23\u0e22\u0e4c\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e40\u0e01\u0e29\u0e35\u0e22\u0e13\u0e2d\u0e32\u0e22\u0e38\u0e41\u0e25\u0e49\u0e27 \u0e41\u0e25\u0e30\u0e1c\u0e31\u0e19\u0e15\u0e31\u0e27\u0e21\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e23\u0e39\u0e2a\u0e2d\u0e19\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e42\u0e14\u0e22\u0e40\u0e09\u0e1e\u0e32\u0e30 \u0e14\u0e49\u0e27\u0e22\u0e1b\u0e23\u0e30\u0e2a\u0e1a\u0e01\u0e32\u0e23\u0e13\u0e4c\u0e41\u0e25\u0e30\u0e04\u0e27\u0e32\u0e21\u0e40\u0e0a\u0e35\u0e48\u0e22\u0e27\u0e0a\u0e32\u0e0d\u0e17\u0e35\u0e48\u0e01\u0e27\u0e49\u0e32\u0e07\u0e02\u0e27\u0e32\u0e07\u0e43\u0e19\u0e2a\u0e32\u0e02\u0e32\u0e2a\u0e16\u0e34\u0e15\u0e34 \u0e09\u0e31\u0e19\u0e01\u0e23\u0e30\u0e15\u0e37\u0e2d\u0e23\u0e37\u0e2d\u0e23\u0e49\u0e19\u0e17\u0e35\u0e48\u0e08\u0e30\u0e41\u0e1a\u0e48\u0e07\u0e1b\u0e31\u0e19\u0e04\u0e27\u0e32\u0e21\u0e23\u0e39\u0e49\u0e02\u0e2d\u0e07\u0e09\u0e31\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e2a\u0e23\u0e34\u0e21\u0e28\u0e31\u0e01\u0e22\u0e20\u0e32\u0e1e\u0e19\u0e31\u0e01\u0e40\u0e23\u0e35\u0e22\u0e19\u0e1c\u0e48\u0e32\u0e19 Statorials. \u0e23\u0e39\u0e49\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21","sameAs":["https:\/\/statorials.org\/th"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts\/1234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/comments?post=1234"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/posts\/1234\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/media?parent=1234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/categories?post=1234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/th\/wp-json\/wp\/v2\/tags?post=1234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}