{"id":57714,"date":"2024-06-16T20:27:58","date_gmt":"2024-06-16T12:27:58","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=57714"},"modified":"2024-06-16T20:27:58","modified_gmt":"2024-06-16T12:27:58","slug":"xgboost%e4%b9%9f%e5%8f%af%e4%bb%a5%e7%94%a8%e4%ba%8e%e6%a8%a1%e5%9e%8b%e7%89%b9%e5%be%81%e6%8f%90%e5%8f%96%ef%bc%9f%e5%bf%ab%e6%9d%a5get%ef%bc%81","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=57714","title":{"rendered":"XGBoost\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6a21\u578b\u7279\u5f81\u63d0\u53d6\uff1f\u5feb\u6765get\uff01"},"content":{"rendered":"<p><html><br \/>\n<head><br \/>\n<title><\/title><br \/>\n<meta charset=\"utf-8\"><br \/>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover\"><\/p>\n<style>\n*{margin:0;padding:0}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.6}img{z-index:999;position:relative;max-width:100%;margin:10px 0;}body{letter-spacing:.034em}h1,h2,h3,h4,h5,h6{font-weight:400;font-size:16px}a{color:#576b95;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}td,th{word-wrap:break-word;padding:5px 10px;border:1px solid #DDD;}table{margin-bottom:10px;border-collapse:collapse;display:table;width:100%!important;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}.rich_media_area_primary{padding:20px 16px 12px;background-color:#fafafa}@media (max-width:375px){.rich_media_area_primary{padding:20px 60px 15px 60px}.rich_media_area_extra{padding:0 60px 21px 60px}}@media (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner,body{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media{padding:20px;overflow:hidden;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}@media screen and (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media_content{overflow:hidden;color:#333;font-size:17px;word-wrap:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-align:justify;position:relative;z-index:0}.rich_media_content *{max-width:100%!important;box-sizing:border-box!important;-webkit-box-sizing:border-box!important;word-wrap:break-word!important}.rich_media_content p{clear:both;min-height:1em}.rich_media_content em{font-style:italic}.rich_media_content fieldset{min-width:0}.rich_media_content .list-paddingleft-1,.rich_media_content .list-paddingleft-2,.rich_media_content .list-paddingleft-3{padding-left:2.2em}.rich_media_content .list-paddingleft-1 .list-paddingleft-2,.rich_media_content .list-paddingleft-2 .list-paddingleft-2,.rich_media_content .list-paddingleft-3 .list-paddingleft-2{padding-left:30px}.rich_media_content .list-paddingleft-1{padding-left:1.2em}.rich_media_content .list-paddingleft-3{padding-left:3.2em}.rich_media_content .code-snippet,.rich_media_content .code-snippet__fix{max-width:1000%!important}.rich_media_content .code-snippet *,.rich_media_content .code-snippet__fix *{max-width:1000%!important}.rich_media_title{font-size:22px;line-height:1.4;margin-bottom:13px;padding-bottom:13px;border-bottom:1px solid #e7e7eb;}@supports(-webkit-overflow-scrolling:touch){.rich_media_title{font-weight:700}}.rich_media_meta{display:inline-block;vertical-align:middle;padding:0 0 10px 0;font-size:15px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.rich_media_meta.icon_appmsg_tag{margin-right:0px}.rich_media_meta.meta_tag_text{margin-right:0}.rich_media_meta_list em{font-style:normal}.rich_media_meta_text{color:#a5a5a5;}p{margin:0;}.msgBox{margin-top:20px;padding-top:20px;padding-left:50px;overflow:hidden;border-top:2px dashed #09a2ff;}.msg{padding-top:7px;clear:both;}.msgBody{float:right;width:100%;margin-left:55px;padding-bottom:15px;border-bottom:1px dashed #e0e0e0;}.userHeadImg{float:left;margin-left:-50px;}.userHeadImg img{width:40px;height:40px;margin-right:10px;border-radius:3px;}.userName{color:#888888;line-height:24px;font-size:14px;margin:5px 0 5px 0;height:24px;}.replyBody,.autherBody{color:#565656;font-size:15px;}.replyIcon{border-left:4px solid #33ab01;margin-right:5px;}.ad{text-decoration:none;color:#d6d4d4;font-size:12px;}.msgBodyReply{padding-top:5px;}.userName span{float:right;color:#afafaf;font-size:14px;}code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;}.code-snippet__fix{font-size:14px;margin:10px 0;display:block;color:#333;position:relative;background-color:rgba(0,0,0,0.03);border:1px solid #f0f0f0;border-radius:2px;display:-webkit-box;display:-webkit-flex;display:flex;padding-left:25px;line-height:26px}.code-snippet__fix code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;font-family:Consolas,\"Liberation Mono\",Menlo,Courier,monospace}.code-snippet__comment,.code-snippet__quote{color:#afafaf;font-style:italic}.code-snippet__keyword,.code-snippet__selector-tag,.code-snippet__subst{color:#ca7d37}.code-snippet__number,.code-snippet__literal,.code-snippet__variable,.code-snippet__template-variable,.code-snippet__tag .code-snippet__attr{color:#0e9ce5}.code-snippet__string,.code-snippet__doctag{color:#d14}.code-snippet__title,.code-snippet__section,.code-snippet__selector-id{color:#d14}.code-snippet__subst{font-weight:normal}.code-snippet__type,.code-snippet__class .code-snippet__title{color:#0e9ce5}.code-snippet__tag,.code-snippet__name,.code-snippet__attribute{color:#0e9ce5;font-weight:normal}.code-snippet__regexp,.code-snippet__link{color:#ca7d37}.code-snippet__symbol,.code-snippet__bullet{color:#d14}.code-snippet__built_in,.code-snippet__builtin-name{color:#ca7d37}.code-snippet__meta{color:#afafaf}.code-snippet__deletion{background:#fdd}.code-snippet__addition{background:#dfd}.code-snippet__emphasis{font-style:italic}.code-snippet__strong{font-weight:bold}.account_avatar{width:40px;height:40px;padding:0;}.account_info{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;padding:20px 0;align-items:center}.flex_bd{padding-left:14px;}.account_nickname{display:inline-block;vertical-align:middle;line-height:1.2;color:#576b95;font-size:14px}.account_desc{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;color:rgba(0,0,0,0.3);font-size:14px;line-height:1.2;padding-top:.4em}.msg_source_url{text-align:left;word-break:break-all;margin-top:20px;}.msg_source_url a{padding-right:10px;}.msg_source_url .url_text{color:#a8a8a8;}.video-desc{font-size:14px;margin-top:15px;color:#6c6c6c;}.msg_source_url{text-align:left;}.original_primary_card_tips{color:rgba(0,0,0,0.3);line-height:1.4;font-size:15px;}.weui-flex__item{margin-bottom:20px;padding:20px 16px;margin-top:16px;line-height:1.4;align-items:center;background-color:#f7f7f7;border-radius:8px;position:relative;}.original_primary_desc{color:rgba(0,0,0,0.5);font-size:14px;padding-top:4px;width:auto;overflow:hidden;text-overflow:ellipsis;}.msgBodyReplyList{border-top:1px solid #e1e1e1;margin-top:10px;}.msgBodyReplyListTop{border-top:0;}.reply_like_num{float:right;font-size:14px;color:#c7c7c7;}.msgData{margin-top:20px;color:#626262;}.msgData span{font-size:14px;padding-right:15px;}.msgData .likes{float:right;padding-right:0;}.js_text_content p{font-size:18px;}.rich_media_meta_link{font-size:15px;}blockquote {padding-left: 10px;border-left: 3px solid #dbdbdb;color: rgba(0,0,0,0.5);font-size: 15px;padding-top: 4px;margin: 1em 0;}.video_iframe{width:500px;height:400px;}.blockquote_info{color:#b5b5b5;margin-top:10px;}#copyright_logo{color:#bdbdbd;}.rich_media_meta_list{margin-bottom:10px;}.reprint{background:#efefef;border-radius:5px;padding:8px;color:#1f1f1f;}.reprint a{word-break:break-all;}.topic{color:#8e8e8e;background:#f7f7f7;border-radius:5px;padding:10px 8px;}.topic a{padding-right:5px;}.topic p{margin-bottom:5px;}\n<\/style>\n<link href=\"https:\/\/www.juyifx.cn\/config\/css\/wxArticle.css\" rel=\"stylesheet\"\/>\n<\/head><script>\nvar data={\"mp\":\"\u751f\u4fe1\u679c\",\"title\":\"XGBoost\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6a21\u578b\u7279\u5f81\u63d0\u53d6\uff1f\u5feb\u6765get\uff01\",\"time\":\"2023-08-30 19:00:15\",\"timeStamp\":\"1693393215\"};\n<\/script><br \/>\n<body><\/p>\n<div class=\"rich_media\">\n<h1 class=\"rich_media_title\" id=\"activity-name\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=Mzg3OTg3MjQyNg==&#038;mid=2247491709&#038;idx=4&#038;sn=61e9a3a406c2cc34d4c3aced0b989489&#038;chksm=cf7f70b8f808f9ae1f92c97787524bc828e92d02f834fd75d683f8ca020bc3a87b57622f586d#rd\" target=\"_blank\" rel=\"noopener\">XGBoost\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6a21\u578b\u7279\u5f81\u63d0\u53d6\uff1f\u5feb\u6765get\uff01<\/a><\/h1>\n<div id=\"meta_content\" class=\"rich_media_meta_list\"><span class=\"rich_media_meta rich_media_meta_text\">\u5927\u6d77\u54e5&nbsp;&nbsp;<\/span><span class=\"rich_media_meta rich_media_meta_nickname\" id=\"profileBt\"><a href=\"javascript:void(0);\" class=\"wx_tap_link js_wx_tap_highlight weui-wa-hotarea\" id=\"js_name\">\u751f\u4fe1\u679c&nbsp;&nbsp;<\/a><\/span><em id=\"publish_time\" class=\"rich_media_meta rich_media_meta_text\">2023-08-30 19:00:15<\/em><\/div>\n<p><content><\/p>\n<div class=\"reprint\">\n<p>\u8f6c\u81ea\u516c\u4f17\u53f7\uff1a\u751f\u4fe1\u6ee9<br \/><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzkzMzUwODcwMg==&#038;mid=2247484822&#038;idx=1&#038;sn=79344542df90fd0f7c4c016efaf08fa4\" target=\"_blank\" title=\"\u9605\u8bfb\u539f\u6587\" rel=\"noopener\">http:\/\/mp.weixin.qq.com\/s?__biz=MzkzMzUwODcwMg==&#038;mid=2247484822&#038;idx=1&#038;sn=79344542df90fd0f7c4c016efaf08fa4<\/a><\/p>\n<\/div>\n<section style=\"font-size: 14px;line-height: 1.8;letter-spacing: 2px;padding: 0px 10px;box-sizing: border-box;font-style: normal;font-weight: 400;text-align: justify;margin-bottom: 24px;\">\n<section style=\"text-align: left;justify-content: flex-start;margin: 25px 0% 10px;display: flex;flex-flow: row;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;background-color: rgb(245, 241, 224);min-width: 10%;max-width: 100%;flex: 0 0 auto;height: auto;align-self: flex-start;box-sizing: border-box;\">\n<section style=\"display: flex;flex-flow: row;margin: -9px 0% 5px;justify-content: flex-start;box-sizing: border-box;\">\n<section style=\"display: inline-block;vertical-align: top;width: auto;flex: 0 0 0%;height: auto;line-height: 0;align-self: flex-start;border-width: 0px;margin: 5px 0px 0px 7px;box-sizing: border-box;\">\n<section style=\"text-align: center;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 2px;height: 10px;vertical-align: top;overflow: hidden;background-color: rgb(59, 149, 115);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<section style=\"text-align: center;margin: -6px 0% 4px;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 10px;height: 2px;vertical-align: top;overflow: hidden;background-color: rgb(59, 149, 115);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: top;width: auto;flex: 0 0 0%;height: auto;line-height: 0;border-width: 0px;margin: 0px 0px 0px 4px;box-sizing: border-box;\">\n<section style=\"text-align: center;margin: -4px 0% 0px;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 9px;height: 9px;vertical-align: top;overflow: hidden;border-width: 2px;border-radius: 47px;border-style: solid;border-color: rgb(59, 149, 115);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: top;width: auto;min-width: 10%;max-width: 100%;flex: 0 0 auto;height: auto;box-sizing: border-box;\">\n<section style=\"margin: 0px 0%;text-align: center;transform: translate3d(-1px, 0px, 0px);-webkit-transform: translate3d(-1px, 0px, 0px);-moz-transform: translate3d(-1px, 0px, 0px);-o-transform: translate3d(-1px, 0px, 0px);box-sizing: border-box;\">\n<section style=\"color: rgb(59, 149, 115);font-size: 17px;padding: 0px 11px;line-height: 1;text-align: justify;box-sizing: border-box;\">\n<p style=\"text-align: left;white-space: normal;margin: 0px;padding: 0px;box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">\u70b9\u51fb\u84dd\u5b57 \u5173\u6ce8\u6211\u4eec<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: top;width: auto;line-height: 0;flex: 0 0 0%;height: auto;box-sizing: border-box;\">\n<section style=\"text-align: center;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 16px;height: 12px;vertical-align: top;overflow: hidden;background-color: rgb(59, 149, 115);padding: 0px 2px;box-sizing: border-box;\">\n<section style=\"justify-content: center;display: flex;flex-flow: row;box-sizing: border-box;\">\n<section style=\"display: inline-block;vertical-align: top;width: 50%;align-self: flex-start;flex: 0 0 auto;box-sizing: border-box;\">\n<section style=\"margin: 4px 0% 0px;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 3px;height: 3px;vertical-align: top;overflow: hidden;border-width: 0px;border-radius: 155px;border-style: none;border-color: rgb(62, 62, 62);background-color: rgb(245, 245, 245);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: top;width: 50%;align-self: flex-start;flex: 0 0 auto;box-sizing: border-box;\">\n<section style=\"margin: 4px 0% 0px;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 3px;height: 3px;vertical-align: top;overflow: hidden;border-width: 0px;border-radius: 155px;border-style: none;border-color: rgb(62, 62, 62);background-color: rgb(245, 245, 245);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"text-align: center;transform: translate3d(3px, 0px, 0px);-webkit-transform: translate3d(3px, 0px, 0px);-moz-transform: translate3d(3px, 0px, 0px);-o-transform: translate3d(3px, 0px, 0px);box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 0px;height: 0px;vertical-align: top;overflow: hidden;border-style: solid;border-width: 0px 0px 4px 4px;border-color: rgba(255, 255, 255, 0) rgba(255, 255, 255, 0) rgba(255, 255, 255, 0) rgb(59, 149, 115);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"padding: 0px 10px;letter-spacing: 2px;line-height: 1.8;box-sizing: border-box;\">\n<p style=\"white-space: normal;margin: 0px;padding: 0px;box-sizing: border-box;\">&nbsp;\u55e8\uff01\u4eb2\u7231\u7684\u5c0f\u4f19\u4f34\u4eec\uff0c\u5927\u5bb6\u597d\uff01\u6211\u662f\u5927\u6d77\u54e5\u3002\u4eca\u5929\u5927\u6d77\u54e5\u8981\u548c\u5927\u5bb6\u804a\u804a\u673a\u5668\u5b66\u4e60\u9886\u57df\u91cc\u7684\u4e00\u9897\u95ea\u8000\u4e4b\u661f\u2728 \u2014\u2014XGBoost\u7b97\u6cd5\uff01<br style=\"box-sizing: border-box;\"  \/>XGBoost\uff0c\u5168\u79f0Extreme Gradient Boosting\uff0c\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u673a\u5668\u5b66\u4e60\u7b97\u6cd5\uff0c\u6211\u4eec\u90fd\u542c\u8bf4\u8fc7\u8fd9\u53e5\u8bdd\uff0cMachine learning is changing the world! &nbsp; &nbsp;\u800cXGBoost\u66f4\u5728\u5404\u79cd\u6570\u636e\u6316\u6398\u548c\u9884\u6d4b\u4efb\u52a1\u4e2d\u8868\u73b0\u51fa\u8272\uff0c\u5b83\u4ee5\u5176\u5353\u8d8a\u7684\u6027\u80fd\u548c\u51fa\u8272\u7684\u9c81\u68d2\u6027\uff0c\u6210\u4e3a\u4f17\u591a\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u673a\u5668\u5b66\u4e60\u4ece\u4e1a\u8005\u7684\u6700\u7231\u54e6\uff01\u8fd9\u4e2a\u7b97\u6cd5\u7684\u95ea\u4eae\u4e4b\u5904\u5728\u4e8e\u5b83\u7684\u68af\u5ea6\u63d0\u5347\u6846\u67b6\uff0c\u53ef\u4ee5\u5728\u5904\u7406\u5206\u7c7b\u548c\u56de\u5f52\u95ee\u9898\u65f6\u90fd\u8868\u73b0\u5f97\u76f8\u5f53\u51fa\u8272\u3002\u5b83\u4f1a\u901a\u8fc7\u591a\u8f6e\u8fed\u4ee3\uff0c\u9010\u6b65\u63d0\u5347\u9884\u6d4b\u6a21\u578b\u7684\u51c6\u786e\u6027\uff0c\u4e0d\u65ad\u4f18\u5316\u6a21\u578b\u8868\u73b0\u3002\u5c31\u50cf\u662f\u4e00\u4f4d\u806a\u660e\u7684\u5b66\u751f\uff0c\u4e0d\u65ad\u5438\u6536\u77e5\u8bc6\uff0c\u8fdb\u6b65\u7a81\u98de\u731b\u8fdb\uff01<br style=\"box-sizing: border-box;\"  \/>\u5176\u8fd8\u6709\u4e00\u4e2a\u4e3b\u8981\u7279\u70b9\uff0c\u5c31\u662f\u5b83\u5bf9\u4e8e\u590d\u6742\u7684\u6570\u636e\u96c6\u548c\u9ad8\u7ef4\u7279\u5f81\u7684\u9002\u5e94\u80fd\u529b\u975e\u5e38\u5f3a\u5927\u3002\u5b83\u4e0d\u5bb9\u6613\u53d7\u5230\u8fc7\u62df\u5408\u7684\u56f0\u6270\uff0c\u800c\u4e14\u80fd\u591f\u5904\u7406\u7f3a\u5931\u503c\u548c\u5f02\u5e38\u6570\u636e\uff0c\u4f7f\u5f97\u6570\u636e\u9884\u5904\u7406\u53d8\u5f97\u76f8\u5f53\u4fbf\u6377\u3002\u5c31\u50cf\u662f\u4e00\u4f4d\u6570\u636e\u7684\u9b54\u672f\u5e08\uff0c\u603b\u80fd\u4ece\u6df7\u6c8c\u7684\u6570\u636e\u4e2d\u627e\u5230\u89c4\u5f8b\uff01\u800c\u4e14\uff0cXGBoost\u7684\u6a21\u578b\u89e3\u91ca\u6027\u4e5f\u5f88\u5f3a\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u53ef\u4ee5\u66f4\u597d\u5730\u7406\u89e3\u6a21\u578b\u662f\u5982\u4f55\u505a\u51fa\u9884\u6d4b\u7684\uff0c\u4ece\u800c\u4e3a\u4e1a\u52a1\u51b3\u7b56\u63d0\u4f9b\u652f\u6301\u3002<br style=\"box-sizing: border-box;\"  \/>\u90a3\u4e48\u4ecb\u7ecd\u4e86\u8fd9\u4e48\u591a\uff0c\u5c31\u8ba9\u5927\u6d77\u54e5\u5e26\u9886\u5c0f\u4f19\u4f34\u4eec\u6765\u9886\u609f\u4e00\u4e0b\u8fd9\u4e2a\u7b97\u6cd5\u7684\u9b45\u529b\u5427\uff01<\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u9996\u5148\u52a0\u8f7dR\u5305<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">require(xgboost) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">require(Matrix) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">require(data.table) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">library(survival) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">data(cancer, package=<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"survival\"<\/span>) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">df &lt;- data.table(colon, keep.rownames = <span class=\"code-snippet__literal\" style=\"box-sizing: border-box;\">FALSE<\/span>) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">df&lt;-df[<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">1<\/span>:<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">100<\/span>,]<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u8fd9\u91cc\u6211\u4eec\u9009\u62e9\u524d\u4e00\u767e\u4e2a\u6570\u636e\u8fdb\u884c\u5904\u7406\uff0c\u5728\u4f7f\u7528\u81ea\u5df1\u6570\u636e\u7684\u65f6\u5019\u4e00\u5b9a\u8981\u5904\u7406\u7f3a\u5931\u503c &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">head(df)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.3707165109034268\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/1_9Hq0ht055NPLCTyiaqq7Xaq87CRCyw.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWhV8yPyvUicqTuYNzb7Viap5Jtas9Hq0ht055NPLCTyiaqq7Xaq87CRCyw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"642\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u628a\u7ed3\u5c40\u53d8\u91cf\u751f\u5b58\u72b6\u6001\u8f6c\u6362\u4e3a\u56e0\u5b50\u578b &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">df$status&lt;-factor(df$status,levels = <span class=\"code-snippet__built_in\" style=\"box-sizing: border-box;\">c<\/span>(<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">0<\/span>,<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">1<\/span>),labels = <span class=\"code-snippet__built_in\" style=\"box-sizing: border-box;\">c<\/span>(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"alive\"<\/span>,<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"dead\"<\/span>)) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u67e5\u770b\u6570\u636e\u7ed3\u6784 &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">str(df)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.47104851330203446\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/2_4E1pbtsR33mZB7aQHZibhoC7dUiczg.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWZpaBpLiaOS8UItrGKP5F15RQ6zR4E1pbtsR33mZB7aQHZibhoC7dUiczg\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"639\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u5c06\u5e74\u9f84\u65b0\u589e\u4e00\u4e2a\u53d8\u91cf\u4e3a\u4e8c\u5206\u7c7b\u53d8\u91cf &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">head(df[,AgeCat:= as.factor(ifelse(age &gt;=<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">65<\/span>, <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"Old\"<\/span>, <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"Young\"<\/span>))])<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.3898573692551506\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/3_PoCLNxD4fRibYQcYuMUMiaibMpbTMQ.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWSpuC1RdZNafa88b8vXSbFDJjuUwPoCLNxD4fRibYQcYuMUMiaibMpbTMQ\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"631\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u9009\u62e9\u9884\u6d4b\u7279\u5f81 &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">df&lt;-subset(df,select = <span class=\"code-snippet__built_in\" style=\"box-sizing: border-box;\">c<\/span>(-id,-study,-age,-time))<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u5b9e\u73b0XGBoost<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u5c06\u6570\u636e\u8f6c\u5316\u4e3a\u7a00\u758f\u77e9\u9635 &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">sparse_matrix &lt;- sparse.model.matrix(status~ ., data = df)[,-<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">1<\/span>] &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u67e5\u770b\u524d\u51e0\u884c &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">head(sparse_matrix) &nbsp;<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.2703150912106136\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/4_UKTAZibAnAcyC5wdGEfnVpvlcqL2zA.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWK75ZjpztpDtmclffVPNibVnBsibUKTAZibAnAcyC5wdGEfnVpvlcqL2zA\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"603\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.33386581469648563\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/5_r8HVcuhiaVHOAs3JmZfPU8eETdKibQ.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxW9BMTyibDOGtk2eSVKkOUSZyicEBNr8HVcuhiaVHOAs3JmZfPU8eETdKibQ\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"626\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">output_vector = df[,status] == <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"dead\"<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u5efa\u7acb\u6a21\u578b\uff01<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">bst &lt;- xgboost(data = sparse_matrix, label = output_vector, max_depth = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">4<\/span>, &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eta = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">1<\/span>, nthread = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">2<\/span>, nrounds =<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">10<\/span>,objective = <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"survival:cox\"<\/span>)<\/span><\/code><\/pre>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u5728\u8be5\u6a21\u578b\u4e2dnrounds\u662f\u8fed\u4ee3\u6b21\u6570\uff0c\u6570\u503c\u8d8a\u5927\u8fd0\u884c\u65f6\u95f4\u8d8a\u957f\u3002objective\u662f\u6a21\u578b\u7c7b\u578b\uff0c\u6211\u4eec\u5e38\u7528\u7684\u4e00\u822c\u662f\u4e8c\u5206\u7c7blogistics\u56de\u5f52\u548cCox\u56de\u5f52\uff0c\u8fd9\u91cc\u6211\u9009\u62e9\u540e\u8005\u3002<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u6bcf\u884c\u7684train-cox-nloglik\u4ee3\u8868\u6a21\u578b\u6548\u679c\uff0c\u4e00\u822c\u8d8a\u5c0f\u8d8a\u597d\u3002<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u4f46\u662f\u8981\u6ce8\u610f\uff0c\u5728\u8fd9\u91cc\u6211\u4eec\u89c2\u5bdf\u5230\u5728\u7b2c2\u6b21\u4e4b\u540e\u8be5\u503c\u9010\u6e10\u589e\u5927\uff0c\u8fd9\u8868\u793a\u6a21\u578b\u51fa\u73b0\u4e86\u8fc7\u5ea6\u62df\u5408\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u9009\u62e9\u8fed\u4ee3\u6b21\u65702\u6765\u6784\u5efa\u6a21\u578b<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">bst &lt;- xgboost(data = sparse_matrix, label = output_vector, max_depth = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">4<\/span>, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; eta = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">1<\/span>, nthread = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">2<\/span>, nrounds =<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">2<\/span>,objective = <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"survival:cox\"<\/span>)<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u7136\u540e\u5173\u952e\u7684\u4e00\u6b65\u5230\u4e86<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u63d0\u53d6\u53d8\u91cf\u91cd\u8981\u6027<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">importance &lt;- xgb.importance(feature_names = colnames(sparse_matrix), model = bst)<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">head(importance)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.3048128342245989\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/6_hEynrbOeCOK8vibHnBljHTp6L0VvDQ.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWqG4qiaWIibibTnQpocnzlH64GXsyhEynrbOeCOK8vibHnBljHTp6L0VvDQ\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"374\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">\u6211\u4eec\u5176\u5b9e\u518d\u6df1\u5165\u4e00\u70b9\u5206\u6790\u8fd9\u4e2a\u6a21\u578b\u3002\u6211\u4eec\u5df2\u7ecf\u53d1\u73b0\u54ea\u4e9b\u7279\u5f81\u53ef\u4ee5\u9884\u6d4b\u75be\u75c5\u7ed3\u5c40\u3002\u4f46\u6211\u4eec\u8fd8\u4e0d\u77e5\u9053\u8fd9\u4e9b\u7279\u5f81\u7684\u4f5c\u7528\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u60f3\u77e5\u9053\u4e0d\u540c\u6cbb\u7597\u65b9\u6848\u5bf9\u60a3\u8005\u9884\u540e\u662f\u5426\u6709\u5f71\u54cd\uff1f\u56e0\u6b64\uff0c\u6211\u4eec\u5728\u4e0a\u8ff0\u5206\u6790\u7684\u57fa\u7840\u4e0a\u6dfb\u52a0\u4e24\u4e2a\u53c2\u6570data\u548clabel\u6765\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898\u3002<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">importanceRaw &lt;- xgb.importance(feature_names = colnames(sparse_matrix), model = bst, data = sparse_matrix, label = output_vector) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">importanceClean &lt;- importanceRaw[,`:=`(Cover=<span class=\"code-snippet__literal\" style=\"box-sizing: border-box;\">NULL<\/span>, Frequency=<span class=\"code-snippet__literal\" style=\"box-sizing: border-box;\">NULL<\/span>)] &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">head(importanceClean) &nbsp;<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.565\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/7_On5RP2sq5XbCo879QLsPhcytMz0mwg.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWiaibN5UtAtTbyBAEsujnkY8lnGOn5RP2sq5XbCo879QLsPhcytMz0mwg\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"200\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u53ef\u4ee5\u770b\u5230\u6700\u91cd\u8981\u7684\u7279\u5f81\u5c31\u662f\u8fd9\u51e0\u4e2a\u4e86\uff01<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u7136\u540e\u6211\u4eec\u5bf9\u5176\u8fdb\u884c\u53ef\u89c6\u5316\u4e00\u4e0b<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">xgb.plot.importance(importanceClean, rel_to_first = <span class=\"code-snippet__literal\" style=\"box-sizing: border-box;\">TRUE<\/span>, xlab = <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"Relative importance\"<\/span>)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0417910447761194\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/8_a8xXibkHqouRlFgqxJ9BCO38zhCjkw.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWIWaGIdUibz9jL9RgEORfYcLJl6a8xXibkHqouRlFgqxJ9BCO38zhCjkw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"335\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<p style=\"white-space: normal;margin: 0px;padding: 0px;box-sizing: border-box;\">\u6839\u636e\u8be5\u7ed3\u679c\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u51fa\uff0c\u5bf9\u4e8e\u9884\u6d4b\u60a3\u8005\u9884\u540e\u6700\u91cd\u8981\u7684\u524d\u4e09\u4e2a\u53d8\u91cf\u5206\u522b\u4e3anodes\u3001surg\u548cobstruct\u3002<br style=\"box-sizing: border-box;\"  \/>\u96be\u9053\u5230\u8fd9\u91cc\u5c31\u5b8c\u4e86\u5417\uff1f<\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"r\"><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">\u5c0f\u4f19\u4f34\u4eec\u80af\u5b9a\u4e5f\u4f1a\u8bf4\uff0c\u8fd9\u4e2a\u56fe\u4e5f\u592a\u96be\u770b\u4e86\uff01\u5f3a\u70c8\u8981\u6c42\u753b<span style=\"display: none;line-height: 0px;\">\u200d<\/span>\u597d\u770b\u4e00\u70b9\uff01\u653e\u5fc3\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u7528ggplot2\u91cd\u65b0\u753b\u4e00\u4e2a\u91cd\u8981\u6027\u8bc4\u4f30\u56fe\u3002<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\"><br  \/><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u56e0\u4e3aimportanceClean\u662f\u4e00\u4e2adata.table\uff0c\u56e0\u6b64\u5148\u8f6c\u6362\u4e3a\u6570\u636e\u6846 &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">data&lt;-as.data.frame(importanceClean) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u63a5\u4e0b\u6765\u5f00\u59cb\u7ed8\u56fe\uff0c\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\uff1a&nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#1.\u5982\u679c\u6211\u4eec\u4ee5Feature\u4e3ax\uff0cGain\u4e3ay\u503c\u7ed8\u5236\u6761\u5f62\u56fe\uff0c\u7ed3\u679c\u80af\u5b9a\u548c\u539f\u56fe\u4e0d\u4e00\u6837\uff0c &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u6240\u4ee5\u9700\u8981\u5bf9\u5750\u6807\u8f74\u8fdb\u884c\u8f6c\u6362\uff1b&nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"><span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#2.\u4e0a\u6b21\u6211\u4eec\u4e5f\u8bf4\u5230\u53d8\u91cf\u6392\u5e8f\u7684\u4e8b\uff0c\u8fd9\u91cc\u8fd8\u662f\u7528reorder\u51fd\u6570\u5bf9y\u503c\u7531\u5927\u5230\u5c0f\u91cd\u65b0\u6392\u5e8f &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">p&lt;-ggplot(data=data,mapping=aes(x=reorder(Feature,Gain),y=Gain\/<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">0.551046708<\/span>,fill=Feature))+ &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp;geom_bar(stat = <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">'identity'<\/span>,width = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">0.8<\/span>,position=position_dodge(<span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">0.7<\/span>))+ &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp;scale_fill_brewer(palette =<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"Set1\"<\/span>)+ &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp;coord_flip()+<span class=\"code-snippet__comment\" style=\"box-sizing: border-box;\">#\u5750\u6807\u8f74\u53d8\u6362 &nbsp;<\/span><\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp;ylab(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"Variable relative importance\"<\/span>)+ &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp;xlab(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"\"<\/span>)+ &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp;theme_bw()+ &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\"> &nbsp;theme(legend.position = <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"\"<\/span>) &nbsp;<\/span><\/code><code style=\"box-sizing: border-box;\"><span class=\"code-snippet_outer\" style=\"box-sizing: border-box;\">ggsave(<span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"vip.png\"<\/span>,plot = p,width = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">4.5<\/span>,height = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">5<\/span>,dpi = <span class=\"code-snippet__number\" style=\"box-sizing: border-box;\">600<\/span>,units = <span class=\"code-snippet__string\" style=\"box-sizing: border-box;\">\"in\"<\/span>,device = png)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;box-sizing: border-box;\">\n<section style=\"max-width: 100%;vertical-align: middle;display: inline-block;line-height: 0;box-sizing: border-box;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0298507462686568\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/9_t9O55OaOXGkoxiaJoJGBhTGwa5HOcQ.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_png\/YHGRXkSxjSTuIdgGxzv1F4vBwGwljOxWop2Bdzg6CvMc9YeqIsUh34TRTt9O55OaOXGkoxiaJoJGBhTGwa5HOcQ\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"402\" style=\"vertical-align: middle;max-width: 100%;width: 100%;box-sizing: border-box;\"  data-recalc-dims=\"1\" \/><\/section>\n<\/section>\n<p style=\"white-space: normal;margin: 0px;padding: 0px;box-sizing: border-box;\">\u8fd9\u5c31\u5b8c\u7f8e\u4e86\uff01\u4e94\u4e2a\u7279\u5f81\u7528\u4e94\u79cd\u989c\u8272\u8868\u793a\uff0c\u597d\u770b\u53c8\u5b9e\u7528\uff01<\/p>\n<section style=\"display: flex;flex-flow: row;margin: 10px 0% 20px;text-align: left;justify-content: flex-start;box-sizing: border-box;\">\n<section style=\"display: inline-block;vertical-align: top;width: auto;flex: 0 0 0%;height: auto;align-self: flex-start;line-height: 0;box-sizing: border-box;\">\n<section style=\"text-align: right;margin: 0px 0% -20px;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 8px;height: 20px;vertical-align: top;overflow: hidden;border-width: 0px;border-style: none;border-color: rgb(62, 62, 62);background-color: rgb(245, 241, 224);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<section style=\"text-align: center;box-sizing: border-box;\">\n<section style=\"display: inline-block;width: 16px;height: 20px;vertical-align: top;overflow: hidden;border-width: 0px;border-radius: 21px 21px 0px 0px;border-style: none;border-color: rgb(62, 62, 62);background-color: rgb(231, 215, 173);box-sizing: border-box;\"><svg viewbox=\"0 0 1 1\" style=\"float:left;line-height:0;width:0;vertical-align:top;\"><\/svg><\/section>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: top;width: auto;background-color: rgb(245, 241, 224);flex: 100 100 0%;align-self: flex-start;height: auto;border-right: 0px rgb(62, 62, 62);border-top-right-radius: 12px;overflow: hidden;box-shadow: rgb(231, 215, 173) 0px 6px 0px;box-sizing: border-box;\">\n<section style=\"margin: 20px 0% 30px;box-sizing: border-box;\">\n<section style=\"padding: 0px 10px;box-sizing: border-box;\">\n<p style=\"margin: 0px;padding: 0px;box-sizing: border-box;\">\u603b\u7ed3\u65f6\u95f4\u5230\uff01\u53ef\u4ee5\u770b\u51faXGBoost\u7b97\u6cd5\u6574\u4f53\u4ee3\u7801\u5176\u5b9e\u5e76\u4e0d\u96be\uff0c\u4f46\u662f\u9700\u8981\u6211\u4eec\u7406\u89e3\u5176\u4e2d\u7684\u5404\u4e2a\u53c2\u6570\u7684\u610f\u4e49\uff0c\u7136\u540e\u8bad\u7ec3\u51fa\u5408\u9002\u6570\u636e\u7684\u6a21\u578b\u3002\u6240\u4ee5\uff0c\u5982\u679c\u5c0f\u4f19\u4f34\u6b63\u5728\u63a2\u7d22\u673a\u5668\u5b66\u4e60\u7684\u5965\u79d8\uff0c\u4e0d\u59a8\u7ed9XGBoost\u4e00\u4e2a\u673a\u4f1a\u3002\u6216\u8bb8\u5b83\u4f1a\u50cf\u4f60\u7684\u5f97\u529b\u52a9\u624b\uff0c\u52a9\u4f60\u5728\u6570\u636e\u7684\u6d77\u6d0b\u4e2d\u822a\u884c\uff0c\u627e\u5230\u5b9d\u85cf\uff01\u5feb\u53bb\u8bd5\u8bd5\u5427\uff01\uff08\u6700\u540e\u63a8\u8350\u4e00\u4e0b\u5927\u6d77\u54e5\u65b0\u5f00\u53d1\u7684\u96f6\u4ee3\u7801\u4e91\u751f\u4fe1\u5206\u6790\u5de5\u5177\u5e73\u53f0\u5305\u542b\u8d85\u591a\u96f6\u4ee3\u7801\u5c0f\u5de5\u5177\uff0c\u4e0a\u4f20\u6570\u636e\u4e00\u952e\u51fa\u56fe\uff0c\u611f\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u6b22\u8fce\u6765\u53c2\u89c2\u54df\uff0c<\/p>\n<p style=\"margin: 0px;padding: 0px;box-sizing: border-box;\">\u7f51\u5740\uff1ahttp:\/\/www.biocloudservice.com\/home.html\uff09<\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"border-bottom: 2px solid rgb(0, 150, 136);text-align: left;font-size: 12px;box-sizing: border-box;\">\n<p style=\"margin: 0px;padding: 0px;box-sizing: border-box;\"><a target=\"_blank\" href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzAwNjE0MDY3MQ==&amp;mid=2650761303&amp;idx=2&amp;sn=6f73471d1e82c56c0b2160d0fcd32d53&amp;scene=21#wechat_redirect\" textvalue=\"\" linktype=\"image\" imgurl=\"https:\/\/mmbiz.qpic.cn\/mmbiz_jpg\/YHGRXkSxjSSYqN0u6bwwXzLCBdlX9BXOYJyjlsib6bQ74Wibtria9gSC4sqocafb5YBQcZWdQRrtP2Xo7vaFWaecA\/0?wx_fmt=jpeg\" imgdata=\"[object Object]\" tab=\"innerlink\" data-linktype=\"1\" rel=\"noopener\"><span class=\"js_jump_icon h5_image_link\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-ratio=\"0.35083798882681566\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/10_ocafb5YBQcZWdQRrtP2Xo7vaFWaecA-2.jpg?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_jpg\/YHGRXkSxjSSYqN0u6bwwXzLCBdlX9BXOYJyjlsib6bQ74Wibtria9gSC4sqocafb5YBQcZWdQRrtP2Xo7vaFWaecA\/640?wx_fmt=jpeg'\" data-type=\"jpeg\" data-w=\"895\" style=\"\"  data-recalc-dims=\"1\" \/><\/span><\/a><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-galleryid=\"\" data-ratio=\"0.3488888888888889\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/11_07T3ukOr5mxE6sbTMZvYNklUgT3oKg-2.jpg?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/mmbiz_jpg\/YHGRXkSxjSSYqN0u6bwwXzLCBdlX9BXOYQlIrRTwqxXypnzYht7bhh3T07T3ukOr5mxE6sbTMZvYNklUgT3oKg\/640?wx_fmt=jpeg'\" data-type=\"jpeg\" data-w=\"900\" style=\"\"  data-recalc-dims=\"1\" \/><\/p>\n<p style=\"margin: 0px;padding: 0px;box-sizing: border-box;\"><br  \/><\/p>\n<p style=\"margin: 0px;padding: 0px;box-sizing: border-box;\">\u70b9\u51fb\u201c\u9605\u8bfb\u539f\u6587\u201d\u8fdb\u5165\u7f51\u5740<\/p>\n<\/section>\n<section style=\"margin-left: 8%;margin-right: 8%;line-height: 1.1em;box-sizing: border-box;\">\n<section style=\"width: 0px;display: inline-block;vertical-align: top;border-top: 1em solid rgb(0, 150, 136);border-left: 0.8em solid transparent !important;border-right: 0.8em solid transparent !important;box-sizing: border-box;\"><br  \/><\/section>\n<\/section>\n<section style=\"font-size: 11px;line-height: 0;padding: 0px;box-sizing: border-box;\"><br  \/><\/section>\n<\/section>\n<p style=\"display: none;margin-bottom: 24px;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<div class=\"msg_source_url\"><a href=\"http:\/\/www.biocloudservice.com\/home.html\" target=\"_blank\" rel=\"noopener\">\u9605\u8bfb\u539f\u6587<\/a><\/div>\n<p><\/content><\/p>\n<div class=\"msg_source_url\"><a href=\"http:\/\/www.biocloudservice.com\/home.html\" target=\"_blank\" rel=\"noopener\">\u9605\u8bfb\u539f\u6587<\/a><\/div>\n<\/div>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>XGBoost\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6a21\u578b\u7279\u5f81\u63d0\u53d6\uff1f\u5feb\u6765get\uff01 \u5927\u6d77\u54e5&nbsp;&nbsp;\u751f\u4fe1\u679c&nbsp;&#038;nbsp [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57714"}],"collection":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57714"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57714\/revisions"}],"predecessor-version":[{"id":57726,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/57714\/revisions\/57726"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57714"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}