2020-07-23

<section style="display: none;" data-tools="新媒体管家" data-label="powered by xmt.cn">


</section>
<p style="text-align: center;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.5" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_gif/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z942a023MFvicQ2Kd8oXNic4ibRRZyIMwH031U0t3v1zDiaeGPhbQyYc61g/?wx_fmt=gif" data-type="gif" data-w="800" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_gif/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z942a023MFvicQ2Kd8oXNic4ibRRZyIMwH031U0t3v1zDiaeGPhbQyYc61g/?wx_fmt=gif">
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="text-indent: 21pt;font-family: 宋体;font-size: 16px;">
</span>
</p>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="text-indent: 21pt;font-family: 宋体;font-size: 16px;">​相信大家都在淘宝购买过相关的商品。<mpchecktext contenteditable="false" id="1595491521532_0.6255523734265047">
</mpchecktext>比如某一天用户购买了一台台式主机后,淘宝会立刻给该用户推送与电脑相关的商品,例如电脑显示屏,键盘和鼠标等等。<mpchecktext contenteditable="false" id="1595491521533_0.27913958553839135">
</mpchecktext>这些推荐的物品完全是淘宝根据大量的点击数据去学习到的。<mpchecktext contenteditable="false" id="1595491521534_0.7241144618281035">
</mpchecktext></span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="text-indent: 21pt;font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="text-indent: 21pt;font-family: 宋体;">比如,在100个人中,有99个人在买了电脑之后,还会去购买鼠标,键盘,无线网卡等等。<mpchecktext contenteditable="false" id="1595491521535_0.09542750114577325">
</mpchecktext>也就是说,</span><span style="text-indent: 21pt;font-family: 宋体;color: rgb(77, 168, 238);">用户最近是否买了电脑是一个非常强的信号,暗示着如果用户最近买了电脑</span><span style="text-indent: 21pt;font-family: 宋体;">,那么用户再次购买电脑显示屏,键盘等物品时的概率非常高,那么这个时候推荐系统及时的去推荐这些物品给用户,用户可能很可能会购买这些物品,这些商铺也能提高自身的销量。<mpchecktext contenteditable="false" id="1595491521536_0.35301935459817524">
</mpchecktext>因此,可以通过特征工程生成很多个这样强关联的信号,提升推荐系统的性能。<mpchecktext contenteditable="false" id="1595491521537_0.32229531588976856">
</mpchecktext></span></span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="text-indent: 21pt;font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="text-indent: 21pt;font-family: 宋体;">除了电商领域,推荐系统还广泛的应用在电影推荐,兴趣推荐等等。<mpchecktext contenteditable="false" id="1595491521538_0.9425321787553453">
</mpchecktext>相信最近大家都看过大火的</span><span style="text-indent: 21pt;font-family: Calibri;"><隐秘的角落></span><span style="text-indent: 21pt;font-family: 宋体;">,可以堪称是今年最好看的国产剧。<mpchecktext contenteditable="false" id="1595491521539_0.8506786199549834">
</mpchecktext>在豆瓣上的评分如下:<mpchecktext contenteditable="false" id="1595491521540_0.2215451077661421">
</mpchecktext></span></span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="text-indent: 21pt;font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: Calibri;font-size: 16px;"><shape type="#_x0000_t75" filled="f" style="text-indent:0;left:0;width:415.3pt;height:228.65pt;">
<imagedata title="image1">
</imagedata>
</shape><img data-ratio="0.550641940085592" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZGXzqEwKp0icjxTxicibs4o0spWXibRmZR5b4koibbZ1hKNmDhVJMs0wGAgw/?wx_fmt=png" data-type="png" data-w="701" style="width:553.72998046875px;height:304.8699951171875px;" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZGXzqEwKp0icjxTxicibs4o0spWXibRmZR5b4koibbZ1hKNmDhVJMs0wGAgw/?wx_fmt=png"></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">


</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">看完这部剧之后,还觉得不过瘾怎么办?<mpchecktext contenteditable="false" id="1595491521541_0.7292352150514376">
</mpchecktext>往下翻,你就会惊喜的发现一系列的推荐:<mpchecktext contenteditable="false" id="1595491521542_0.7290884520585745">
</mpchecktext></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: Calibri;font-size: 16px;"><img data-ratio="0.6638537271448663" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZdDtibXxF2dgnKPyzz18hsDISeB7h4E1KawZaSNuJegEicZOKnj6Jibylw/?wx_fmt=png" data-type="png" data-w="711" style="width:553.72998046875px;height:367.5299987792969px;" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZdDtibXxF2dgnKPyzz18hsDISeB7h4E1KawZaSNuJegEicZOKnj6Jibylw/?wx_fmt=png"></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: 宋体;font-size: 16px;">是不是感觉推荐的电影都很符合自己的口味?<mpchecktext contenteditable="false" id="1595491521543_0.9954835170986134">
</mpchecktext><隐秘的角落>属于悬疑类的连续剧,而下面推荐的相关剧集也大多属于这个风格。<mpchecktext contenteditable="false" id="1595491521544_0.25257706867214935">
</mpchecktext></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="font-family: 宋体;">这个例子也同样引出了推荐系统中一个重要的分支——</span><span style="letter-spacing: 0px;text-indent: 0em;font-weight: bold;font-family: 宋体;color: rgb(77, 168, 238);">协同过滤<mpchecktext contenteditable="false" id="1595491521545_0.33400725384448315">
</mpchecktext></span></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">


</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="text-indent: 0em;font-family: 宋体;color: rgb(0, 0, 0);">它主要可以分为基于用户的,基于物品的和基于模型的协同过滤算法。<mpchecktext contenteditable="false" id="1595491521546_0.9858037128364041">
</mpchecktext>基于用户的协同过滤算法的核心思想是:<mpchecktext contenteditable="false" id="1595491521547_0.5885428485748083">
</mpchecktext></span><span style="text-indent: 0em;font-family: 宋体;color: rgb(77, 168, 238);">给当前用户推荐相似的用户看过的物品</span><span style="text-indent: 0em;font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521548_0.6274684417711525">
</mpchecktext></span></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="text-indent: 0em;font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;text-indent: 0em;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="text-indent: 0em;font-family: 宋体;font-size: 16px;">例如,用户A看过了<白夜追凶>和<无证之罪>,而资深悬疑剧爱好者不仅看过这两部剧,还看过了<非自然死亡>和<我们与恶的距离>。<mpchecktext contenteditable="false" id="1595491521549_0.068484443944403">
</mpchecktext>那么根据一定的相似度算法,在所有的用户中找到和用户A最相似的用户,比如我们找到了用户B,将用户B看过的另外两部剧推荐给了用户A,这样一次推荐过程就完成了。<mpchecktext contenteditable="false" id="1595491521550_0.6431926589028292">
</mpchecktext></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">


</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="font-family: 宋体;color: rgb(77, 168, 238);">推荐系统的另一个典型场景是广告点击率预估</span><span style="font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521551_0.9157129969899271">
</mpchecktext>在我们浏览手机的应用商店时,经常可以看到商店会给我们推荐某些应用,某些推荐的应用往往是广告主通过付费来进行推广。<mpchecktext contenteditable="false" id="1595491521552_0.15147500113263201">
</mpchecktext></span></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="font-family: 宋体;">为了提高广告投放的准确度,广告点击率预估模型需要评价用户点击某些应用的概率,将用户最可能点击的应用进行推送,达到准确的投放广告的目的。<mpchecktext contenteditable="false" id="1595491521553_0.216891167302391">
</mpchecktext></span><span style="font-family: 宋体;color: rgb(77, 168, 238);">一旦我们点击了其中的一个应用,商店就可以成功的向广告投放商进行收费,而广告主们也达到了应用推广的目的</span><span style="font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521554_0.01428938792615253">
</mpchecktext></span></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;text-align: center;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: 宋体;font-size: 16px;"><img data-ratio="1.7777777777777777" src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z9k0vhn6HibXib7lV9ypcohVROorNYYlDFsgAVjlnG7icAXTRM3lAq7O5w/?wx_fmt=jpeg" data-type="jpeg" data-w="432" style="width:35%;height:auto;" _src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z9k0vhn6HibXib7lV9ypcohVROorNYYlDFsgAVjlnG7icAXTRM3lAq7O5w/?wx_fmt=jpeg"></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;text-align: center;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="font-family: Calibri;">除了上述领域,</span><span style="font-family: Calibri;color: rgb(77, 168, 238);">推荐系统还广泛的应用在生活中的方方面面</span><span style="font-family: Calibri;">,可以说是机器学习在工业界中最成功的落地场景之一了。<mpchecktext contenteditable="false" id="1595491521555_0.9139107306696308">
</mpchecktext>美国著名的电影和电视节目提供商Netflix曾经发起了奖金为百万美元的推荐系统比赛,旨在提升推荐系统的准确度。<mpchecktext contenteditable="false" id="1595491521556_0.9963634113367776">
</mpchecktext></span><span style="font-family: Calibri;color: rgb(77, 168, 238);">在广告点击率预估的场景,性能提高了1%的模型往往可以为公司带来巨大的收入</span><span style="font-family: Calibri;">。<mpchecktext contenteditable="false" id="1595491521557_0.4460567705526448">
</mpchecktext></span></span>
</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: center;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;text-indent: 21pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;"><img data-ratio="1" src="https://mmbiz.qpic.cn/sz_mmbiz_gif/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZToYFCfJDJAibsGEiatEY1ItKbJicRJdJ22HOvCoicluomwebWzppqAk3Ng/?wx_fmt=gif" data-type="gif" data-w="240" style="width:20%;height:auto;" _src="https://mmbiz.qpic.cn/sz_mmbiz_gif/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZToYFCfJDJAibsGEiatEY1ItKbJicRJdJ22HOvCoicluomwebWzppqAk3Ng/?wx_fmt=gif"></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;text-indent: 21pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZpwGtXYFpb631hTrk0wDVuiauvLInJoe8ZTSEtqz3NYxic9RDV4ckiahhw/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZpwGtXYFpb631hTrk0wDVuiauvLInJoe8ZTSEtqz3NYxic9RDV4ckiahhw/?wx_fmt=png">
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;text-indent: 0em;">传统的推荐系统以协同过滤为代表,而随着深度学习的快速发展,越来越多的研究者尝试应用深度学习技术到推荐系统中。<mpchecktext contenteditable="false" id="1595491521558_0.41343210868856506">
</mpchecktext>在此我们主要介绍其中的Wide&Deep网络。<mpchecktext contenteditable="false" id="1595491521559_0.41433554234299685">
</mpchecktext></span>


</p>
<h3 style="margin-top: 13pt;margin-bottom: 13pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;break-after: avoid;font-size: 16pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 1px;">
<span style="font-size: 18px;"><strong><span style="font-family: 宋体;">总体流程<mpchecktext contenteditable="false" id="1595491521560_0.5873566370470085">
</mpchecktext></span></strong></span>
</h3>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">在此我们以APP商店中的推荐系统为例,其整体流程可以如下图所示<mpchecktext contenteditable="false" id="1595491521561_0.5709115780989085">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: normal;">
<img data-ratio="0.48764629388816644" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z3YfgSJNicCibt3Wra3NCMdS3qqBiaaAO3ukkaXloCjH1Jk6PXvIIialgXw/?wx_fmt=png" data-type="png" data-w="769" style="height: 270px;font-family: Calibri;font-size: 16px;letter-spacing: 0.5px;white-space: normal;width: 553.73px;" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z3YfgSJNicCibt3Wra3NCMdS3qqBiaaAO3ukkaXloCjH1Jk6PXvIIialgXw/?wx_fmt=png">
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: center;margin-left: 0pt;font-size: 10.5pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0px;line-height: normal;">
<span style="font-family: "Calibri Light";letter-spacing: 0.5px;font-size: 12px;"><strong>推荐系统流程图<mpchecktext contenteditable="false" id="1595491521562_0.3757896890338168">
</mpchecktext></strong></span>
</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">给定一个查询,这个查询可能是用户相关的特征,推荐系统首先会从数据库中检索到查询相关的APP,由于APP的数量非常巨大,因此我们可以取最相关的100个检索结果作为候选APP,这一过程通常叫作</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">粗排</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521563_0.6395355843349195">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">
然后将候选的100个APP送入排序模型中,此处的排序模型就是我们下面将要介绍的</span>
<span style="font-size: 16px;color: rgb(0, 0, 0);">Wide&Deep模型</span>
<span style="font-size: 16px;">,这一过程也被叫作</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">精排</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521564_0.23529303060617557">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">
排序完成后,我们可以将点击概率最高的APP放置于用户最容易注意到的地方。<mpchecktext contenteditable="false" id="1595491521565_0.5565327489677165">
</mpchecktext>无论用户是否点击了我们的推荐结果,我们都可以构造一个新的日志文件。<mpchecktext contenteditable="false" id="1595491521566_0.9512780018893234">
</mpchecktext></span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">在累积了一定数量的日志文件后,就可以继续微调排序模型,提高模型的准确程度</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521567_0.014898001300925001">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;break-after: avoid;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;text-indent: 0pt;font-size: 10pt;font-weight: normal;text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z50ekeDd6ME3ooXyTurzx9z8JZQL077sY1H1icH4eukqXlwT3kx06GNQ/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Z50ekeDd6ME3ooXyTurzx9z8JZQL077sY1H1icH4eukqXlwT3kx06GNQ/?wx_fmt=png">
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;text-indent: 0em;white-space: normal;font-size: 10.5pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">Wide&Deep模型自从被提出后就引起来非常大的关注。<mpchecktext contenteditable="false" id="1595491521568_0.6166093859588566">
</mpchecktext>正如其名,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">此模型主要可以分成两个部分,Wide部分和Deep部分</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521569_0.4982185221764919">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;text-indent: 0em;white-space: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<h3 style="margin-top: 13pt;margin-bottom: 13pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;break-after: avoid;font-size: 16pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 1px;">
<span style="font-family: Calibri;font-size: 18px;"><strong>Wide模型<mpchecktext contenteditable="false" id="1595491521570_0.7791825705968476">
</mpchecktext></strong></span>
</h3>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: normal;">
<span style="font-size: 16px;">Wide部分就是一个线性网络,和我们在初中学的多元线性方程是一样的,只不过其中的参数求解采用梯度下降的方式。<mpchecktext contenteditable="false" id="1595491521571_0.010065523151344902">
</mpchecktext>例如下式<mpchecktext contenteditable="false" id="1595491521572_0.30357879789528996">
</mpchecktext></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: normal;">
<span style="font-size: 16px;">
</span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;font-size: 10.5pt;text-align: center;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;text-indent: 0em;line-height: normal;">
<span style="font-family: Calibri;top: 2.8pt;font-size: 18px;"><strong>y=wx<mpchecktext contenteditable="false" id="1595491521573_0.32825578524402355">
</mpchecktext></strong></span>
</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;font-family: 宋体;">它的设计目的是</span>
<span style="font-family: 宋体;font-size: 16px;color: rgb(77, 168, 238);">为了记住数据中特定的特征组合方式</span>
<span style="font-size: 16px;font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521574_0.7815469287683945">
</mpchecktext>例如前面介绍购买电脑的场景,购买了电脑主机的用户,再次购买显示器,键盘等物件的概率特别高。<mpchecktext contenteditable="false" id="1595491521575_0.5283978112833949">
</mpchecktext>因此可以将用户最近是否购买了电脑作为输入模型的输入,也就是特征。<mpchecktext contenteditable="false" id="1595491521576_0.034765396121916314">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-weight: normal;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">假设</span>
<span style="font-size: 16px;color: rgb(0, 0, 0);">当前wide网络只有一个特征</span>
<span style="font-size: 16px;">,当该特征取1时,y=wx可以得到y=0.9(假设w的值是0.9),当该特征取0时,y=0。<mpchecktext contenteditable="false" id="1595491521577_0.8589743768217186">
</mpchecktext>y输出值越大,会增大模型对应用户点击概率的估计。<mpchecktext contenteditable="false" id="1595491521578_0.2556389060086466">
</mpchecktext></span>
</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">回到我们APP应用推荐的场景中,可以看到图右侧的Cross Product Transformation,就是我们的wide部分的输入。<mpchecktext contenteditable="false" id="1595491521579_0.35153278867519555">
</mpchecktext>Cross Product Transformation是指特征交叉,即将User Installed App和Impression APP进行组合。<mpchecktext contenteditable="false" id="1595491521580_0.22830166062060675">
</mpchecktext></span>
</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">例如用户手机已经安装了微信,且当前的待估计的APP为QQ,那么这个组合特征就是(User Installed App=’微信’,  Impression APP=’QQ’)。<mpchecktext contenteditable="false" id="1595491521581_0.4814490195421415">
</mpchecktext></span>
</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 1px;">
<span style="font-size: 18px;"><strong style="font-size: 16px;text-indent: 0pt;"><span style="font-size: 18px;font-family: Calibri;">Deep模型<mpchecktext contenteditable="false" id="1595491521582_0.48454028653919434">
</mpchecktext></span></strong></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<strong style="font-size: 16px;text-indent: 0pt;"><span style="font-family: Calibri;">
</span></strong>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">介绍完Wide部分,我们重新回来再看下Deep部分。<mpchecktext contenteditable="false" id="1595491521583_0.5407387402111272">
</mpchecktext></span>
<span style="color: rgb(77, 168, 238);font-size: 16px;">Deep部分的设计是为了模型具有较好的泛化能力</span>
<span style="font-size: 16px;color: rgb(0, 0, 0);">,在输入的数据没有在训练集中出现时,它依然能够保持相关性较好的输出</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521584_0.518570595723747">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">在下图中,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">Deep模型输入都是一些含义不是非常明显的特征</span>
<span style="font-size: 16px;">,例如设备类型,用户统计数据等类别特征(Categorical Features)。<mpchecktext contenteditable="false" id="1595491521585_0.9130945091243985">
</mpchecktext>类别特征一般属于高维特征。<mpchecktext contenteditable="false" id="1595491521586_0.17463496406949064">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">例如手机的种类可能存在成千上万个,因此我们通常把这些类别特征通过</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">嵌入(Embedding)</span>
<span style="font-size: 16px;">的方式,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">映射成低维空间的参数向量</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521587_0.3321784215471044">
</mpchecktext>这个向量可以被认为表示了原先这个类别特征的信息。<mpchecktext contenteditable="false" id="1595491521588_0.45890689491276815">
</mpchecktext>对于连续特征,其数值本身就具备一定的含义,因此可以直接将和其他嵌入向量进行拼接。<mpchecktext contenteditable="false" id="1595491521589_0.03564824598179883">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;break-after: avoid;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: normal;letter-spacing: 0px;">
<span style="font-family: Calibri;font-size: 16px;"><img data-ratio="0.48567870485678705" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZaZwn1a1OyEOJUxZQ8qKfVY3L5Eia3Jx2ibFQCNBlKX7TuthtU7MryJicw/?wx_fmt=png" data-type="png" data-w="803" style="width:553.72998046875px;height:268.92999267578125px;" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZaZwn1a1OyEOJUxZQ8qKfVY3L5Eia3Jx2ibFQCNBlKX7TuthtU7MryJicw/?wx_fmt=png"></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;text-indent: 0pt;font-size: 10pt;font-weight: normal;text-align: center;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: normal;letter-spacing: 0px;">
<span style="font-size: 14px;"><strong><span style="font-family: "Calibri Light";">2Wide&Deep模型图<mpchecktext contenteditable="false" id="1595491521590_0.21435550354895083">
</mpchecktext></span></strong></span>
</section>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 16px;letter-spacing: 0.5px;color: rgb(77, 168, 238);">在拼接完成后,可以得到大致为1200维度的向量</span>
<span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 16px;letter-spacing: 0.5px;">。<mpchecktext contenteditable="false" id="1595491521591_0.20305824849402532">
</mpchecktext>将其作为三层全连接层网络的输入,并且选择Relu作为激活函数,其中每层的输出维度分别为[1024, 512, 256]。<mpchecktext contenteditable="false" id="1595491521592_0.40081362589281455">
</mpchecktext></span>
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 16px;letter-spacing: 0.5px;">
</span>
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZicJbmxuv8vbtS0IUWLZsLsWLmY0mSSgzLmk8Tv6Ql2HTZS2kntPO3ew/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZicJbmxuv8vbtS0IUWLZsLsWLmY0mSSgzLmk8Tv6Ql2HTZS2kntPO3ew/?wx_fmt=png">
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">在广告点击率预估的场景中,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">模型的输出是一个0~1之间的值</span>
<span style="font-size: 16px;">,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">表示当前候选APP被点击的概率</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521593_0.7811395612533354">
</mpchecktext>因此可以采用逻辑回归函数,将Wide&Deep部分的输出压缩到0~1在之间。<mpchecktext contenteditable="false" id="1595491521594_0.6454734822599122">
</mpchecktext></span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">


</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">首先,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">Deep部分的输出是一个256维度的向量</span>
<span style="font-size: 16px;">,可以通过一个线性变换将其映射为维度为1的值,然后</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">和Wide部分的输出进行求和,将求和后的结果输入到逻辑回归函数中。<mpchecktext contenteditable="false" id="1595491521595_0.5259138217215569">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: Calibri;font-size: 16px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: Calibri;font-size: 16px;">
</span>
</p>
<p style="text-align: center;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zc0Fk07Wy7jZy9zFJRoEbDiaeomx47dePavD6NQPxHBxZZHeLupibhTYg/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zc0Fk07Wy7jZy9zFJRoEbDiaeomx47dePavD6NQPxHBxZZHeLupibhTYg/?wx_fmt=png">
</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">在介绍完模型之后,现在开始动手实践了,由于谷歌公司并没有将其在论文中使用的APP商店数据集进行公开,因此我们现在</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">采用Criteo公司发布在Kaggle的广告点击率预估数据集Criteo</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521596_0.0345083676694633">
</mpchecktext></span>
</p>
<p style="line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<section style="letter-spacing: 0.5px;line-height: normal;">
<span style="font-size: 16px;">对应的Mindpsore代码可以在此处找到:<mpchecktext contenteditable="false" id="1595491521597_0.4003900177930393">
</mpchecktext></span>
</section>
<section style="letter-spacing: 0px;line-height: normal;">
<span style="font-size: 12px;text-decoration: underline;color: rgb(25, 67, 156);">https://gitee.com/mindspore/mindspore/tree/master/model_zoo/wide_and_deep<mpchecktext contenteditable="false" id="1595491521598_0.5888733828509147">
</mpchecktext></span>
</section>
<section style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">其中包含了模型的定义、训练以及数据的预处理过程。<mpchecktext contenteditable="false" id="1595491521599_0.8297184877292527">
</mpchecktext></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">


</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">


</section>
<section style="text-align: center;letter-spacing: 0.5px;line-height: 1.5em;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZNWFfEd47icZXMS8NUnaSTvgEPGLwJsgqztNGLTzibD3RITRhGmTAgbibw/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZNWFfEd47icZXMS8NUnaSTvgEPGLwJsgqztNGLTzibD3RITRhGmTAgbibw/?wx_fmt=png">
</section>
<p style="text-align: justify;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="text-align: justify;font-size: 16px;">在模型定义前,我们需要对数据进行预处理。<mpchecktext contenteditable="false" id="1595491521600_0.31370116160281447">
</mpchecktext></span>
<span style="text-align: justify;font-size: 16px;color: rgb(77, 168, 238);">数据处理的目的是将数据集中的特征取值映射为数值id,并且去除一些出现次数过少的特征值</span>
<span style="text-align: justify;font-size: 16px;">,避免特征值出现次数过少,导致当特征值对应的参数向量的更新次数过少,影响模型的精度。<mpchecktext contenteditable="false" id="1595491521601_0.1400535888898924">
</mpchecktext>Criteo数据集由13类连续特征和26列类别特征,已经通过哈希方式映射为了32位数值。<mpchecktext contenteditable="false" id="1595491521602_0.027469570101304797">
</mpchecktext>对应的标签(label)的取值为0和1。<mpchecktext contenteditable="false" id="1595491521603_0.33448403395981896">
</mpchecktext></span>
</p>
<p style="text-align: justify;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">
</span>
</p>
<section style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">数据处理的核心思路如下图所示,针对类别特征,建立一个词表,里面记录着每次出现的特征取值的编号。<mpchecktext contenteditable="false" id="1595491521604_0.9503327169834963">
</mpchecktext>然后再遍历每一列的特征取值,将原始的特征值根据词表映射为对应的id。<mpchecktext contenteditable="false" id="1595491521605_0.4568711305554223">
</mpchecktext></span>
</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: Calibri;font-size: 16px;"><img data-ratio="0.4322396576319544" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZE2MTjVMfSQRic5pJ9HbI1Drrw1iaV7KppZfK6bEichaicKsicbp3986DnfQ/?wx_fmt=png" data-type="png" data-w="1402" style="width:553.72998046875px;height:239.3300018310547px;" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZE2MTjVMfSQRic5pJ9HbI1Drrw1iaV7KppZfK6bEichaicKsicbp3986DnfQ/?wx_fmt=png"></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;letter-spacing: 0.5px;">还记得之前提到过的低维嵌入过程吗?<mpchecktext contenteditable="false" id="1595491521606_0.22387692283379823">
</mpchecktext>映射操作是为了模型中的嵌入向量查找而准备的。<mpchecktext contenteditable="false" id="1595491521607_0.3794396131282576">
</mpchecktext>例如,输入数据中的A,B,C被映射为了0,1,2。<mpchecktext contenteditable="false" id="1595491521608_0.8596751114792767">
</mpchecktext>而0,1,2分别表示在嵌入矩阵中(Embedding Table)的第0行,第1行和第2行。<mpchecktext contenteditable="false" id="1595491521609_0.07472105979453136">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;letter-spacing: 0.5px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;color: rgb(77, 168, 238);">将Criteo数据集下载后解压</span>
<span style="font-size: 16px;">,可以看到train.txt和test.txt文件。<mpchecktext contenteditable="false" id="1595491521610_0.9955548280550606">
</mpchecktext>查看train.txt中的文件,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">可以看到其中某些行存在缺失</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521611_0.7292858768747217">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: Calibri;font-size: 16px;"><img data-ratio="0.13284804367606914" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zcgz9XPz046HSicl60h3XiciaWj89CXuZmtibfwngAlJIqA0pzlqmNsxlbA/?wx_fmt=png" data-type="png" data-w="1099" style="width:553.72998046875px;height:73.5199966430664px;" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zcgz9XPz046HSicl60h3XiciaWj89CXuZmtibfwngAlJIqA0pzlqmNsxlbA/?wx_fmt=png"></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: Calibri;font-size: 16px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;font-family: Calibri;">我们可以调用<mpchecktext contenteditable="false" id="1595491521612_0.418118260522949">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;font-family: Calibri;">
</span>
</p>
<pre class="code-snippet__js code-snippet code-snippet_nowrap">
<code><span class="code-snippet_outer">model_zoo/wide_and_deep/src/preprocess_data.py<mpchecktext contenteditable="false" id="1595491521613_0.05205307756937949">
</mpchecktext></span></code>
</pre>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;"><span style="font-family: Calibri;" lang="EN-US">进行数据的下载和处理</span><span style="font-family: 宋体;">,</span></span>
<span style="font-size: 16px;color: rgb(77, 168, 238);"><span style="font-family: 宋体;">对于缺失值,可以将其标记为OOV</span><span style="font-family: Calibri;">(Out Of Vocabulary)对应的id</span></span>
<span style="font-size: 16px;font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521614_0.2193681441461055">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zrp1W7cEcwlZficyWEpEwHtS7qx9pJV6nvkOW60oP9NNl3Em4llnicIUg/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zrp1W7cEcwlZficyWEpEwHtS7qx9pJV6nvkOW60oP9NNl3Em4llnicIUg/?wx_fmt=png">
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">介绍完数据处理后,我们在此开始</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">定义模型</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521615_0.8887462425029617">
</mpchecktext>模型的核心代码在mindspore仓库下<mpchecktext contenteditable="false" id="1595491521616_0.5841588145838044">
</mpchecktext></span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">
</span>
</p>
<pre class="code-snippet__js code-snippet code-snippet_nowrap">
<code><span class="code-snippet_outer">model_zoo/wide_and_deep/src/wide_and_deep.py<mpchecktext contenteditable="false" id="1595491521617_0.784860819060053">
</mpchecktext></span></code>
</pre>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;color: rgb(77, 168, 238);">
</span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="color: rgb(0, 0, 0);font-size: 16px;">在MindSpore中,网络的定义方式和Pytorch比较接近,先定义定义的操作,然后再construct函数中对调用对应的操作对输入进行处理。<mpchecktext contenteditable="false" id="1595491521618_0.32974386636848463">
</mpchecktext></span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">


</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">首先我们再回忆下</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">Wide&Deep网络</span>
<span style="font-size: 16px;">,它由一个Wide部分和Deep部分。<mpchecktext contenteditable="false" id="1595491521619_0.7208582330729274">
</mpchecktext>其中</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">Wide部分是一个线性网络</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521620_0.7959959689289937">
</mpchecktext></span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">
在实现上,我们将线性网络中的权重视为维度为1,通过嵌入矩阵查找的方式即可获得输入x对应的权重,然后将其和输入的mask相乘,将结果求和。<mpchecktext contenteditable="false" id="1595491521621_0.191038163225294">
</mpchecktext></span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">
</span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">值得注意的是,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">我们将连续特征和类别特征进行等同处理,因此这里的mask是为了将连续特征和类别特征进行区而设计的</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521622_0.30369802872677254">
</mpchecktext></span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">连续特征mask中的值即为连续特征值,类别特征mask中的值为1</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521623_0.596134292785284">
</mpchecktext>Wide部分的核心代码如下所示,我们定义个名为self.wide_w的权重,它的形状为[词表大小,1]。<mpchecktext contenteditable="false" id="1595491521624_0.6899780507690909">
</mpchecktext></span>
</p>
<p style="letter-spacing: 0.5px;line-height: 1.5em;">


</p>
<pre class="code-snippet__js code-snippet code-snippet_nowrap" data-lang="ruby">
<code><span class="code-snippet_outer">class WideDeepModel(nn.Cell):</span></code>
<code><span class="code-snippet_outer"> def init(self, config):</span></code>
<code><span class="code-snippet_outer"> super(WideDeepModel, self).init()</span></code>
<code><span class="code-snippet_outer"> …</span></code>
<code><span class="code-snippet_outer"> init_acts = [('Wide_w', [self.vocab_size, 1], self.emb_init),</span></code>
<code><span class="code-snippet_outer"> ('V_l2', [self.vocab_size, self.emb_dim], self.emb_init),</span></code>
<code><span class="code-snippet_outer"> ('Wide_b', [1], self.emb_init)]</span></code>
<code><span class="code-snippet_outer"> var_map = init_var_dict(self.init_args, init_acts)</span></code>
<code><span class="code-snippet_outer"> self.wide_w = var_map["Wide_w"]</span></code>
<code><span class="code-snippet_outer"> self.wide_b = var_map["Wide_b"]</span></code>
<code><span class="code-snippet_outer"> self.embeddinglookup = nn.EmbeddingLookup()</span></code>
<code><span class="code-snippet_outer"> self.mul = P.Mul()</span></code>
<code><span class="code-snippet_outer"> self.reduce_sum = P.ReduceSum(keep_dims=False)</span></code>
<code><span class="code-snippet_outer"> self.reshape = P.Reshape()</span></code>
<code><span class="code-snippet_outer"> self.square = P.Square()<mpchecktext contenteditable="false" id="1595491521625_0.533022001520425">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> def construct(self, id_hldr, wt_hldr):</span></code>
<code><span class="code-snippet_outer"> mask = self.reshape(wt_hldr, (self.batch_size, self.field_size, 1))</span></code>
<code><span class="code-snippet_outer"> # Wide layer</span></code>
<code><span class="code-snippet_outer"> wide_id_weight = self.embeddinglookup(self.wide_w, id_hldr, 0)</span></code>
<code><span class="code-snippet_outer"> wx = self.mul(wide_id_weight, mask)</span></code>
<code><span class="code-snippet_outer"> wide_out = self.reshape(self.reduce_sum(wx, 1) + self.wide_b, (-1, 1))</span></code>
<code><span class="code-snippet_outer"> out = wide_out<mpchecktext contenteditable="false" id="1595491521626_0.8040137239832756">
</mpchecktext></span></code>
</pre>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-family: Calibri;font-size: 16px;text-indent: 0pt;"> <mpchecktext contenteditable="false" id="1595491521627_0.45306220201784786">
</mpchecktext></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;">现在我们开始定义Deep部分。<mpchecktext contenteditable="false" id="1595491521628_0.09296508594142838">
</mpchecktext></span>
<span style="font-size: 16px;color: rgb(77, 168, 238);">Deep部分同样有一个嵌入矩阵查找</span>
<span style="font-size: 16px;">,以及5层的全连接层构成。<mpchecktext contenteditable="false" id="1595491521629_0.8505185533081938">
</mpchecktext></span>
</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: Calibri;font-size: 16px;">       <mpchecktext contenteditable="false" id="1595491521630_0.40822084572269834">
</mpchecktext></span>
</p>
<pre class="code-snippet__js code-snippet code-snippet_nowrap" data-lang="ruby">
<code><span class="code-snippet_outer">class WideDeepModel(nn.Cell):</span></code>
<code><span class="code-snippet_outer"> def init(self, config):</span></code>
<code><span class="code-snippet_outer"> super(WideDeepModel, self).init()</span></code>
<code><span class="code-snippet_outer"> …</span></code>
<code><span class="code-snippet_outer"> init_acts = [('Wide_w', [self.vocab_size, 1], self.emb_init),</span></code>
<code><span class="code-snippet_outer"> ('V_l2', [self.vocab_size, self.emb_dim], self.emb_init),</span></code>
<code><span class="code-snippet_outer"> ('Wide_b', [1], self.emb_init)]</span></code>
<code><span class="code-snippet_outer"> var_map = init_var_dict(self.init_args, init_acts)</span></code>
<code><span class="code-snippet_outer"> self.wide_w = var_map["Wide_w"]</span></code>
<code><span class="code-snippet_outer"> self.wide_b = var_map["Wide_b"]</span></code>
<code><span class="code-snippet_outer"> self.embedding_table = var_map["V_l2"]</span></code>
<code><span class="code-snippet_outer"> self.dense_layer_1 = DenseLayer(self.all_dim_list[0],</span></code>
<code><span class="code-snippet_outer"> self.all_dim_list[1],</span></code>
<code><span class="code-snippet_outer"> self.weight_bias_init,</span></code>
<code><span class="code-snippet_outer"> self.deep_layer_act,</span></code>
<code><span class="code-snippet_outer"> convert_dtype=True, drop_out=config.dropout_flag)</span></code>
<code><span class="code-snippet_outer"> self.dense_layer_2 = DenseLayer(self.all_dim_list[1],</span></code>
<code><span class="code-snippet_outer"> self.all_dim_list[2],</span></code>
<code><span class="code-snippet_outer"> self.weight_bias_init,</span></code>
<code><span class="code-snippet_outer"> self.deep_layer_act,</span></code>
<code><span class="code-snippet_outer"> convert_dtype=True, drop_out=config.dropout_flag)</span></code>
<code><span class="code-snippet_outer"> self.dense_layer_3 = DenseLayer(self.all_dim_list[2],</span></code>
<code><span class="code-snippet_outer"> self.all_dim_list[3],</span></code>
<code><span class="code-snippet_outer"> self.weight_bias_init,</span></code>
<code><span class="code-snippet_outer"> self.deep_layer_act,</span></code>
<code><span class="code-snippet_outer"> convert_dtype=True, drop_out=config.dropout_flag)</span></code>
<code><span class="code-snippet_outer"> self.dense_layer_4 = DenseLayer(self.all_dim_list[3],</span></code>
<code><span class="code-snippet_outer"> self.all_dim_list[4],</span></code>
<code><span class="code-snippet_outer"> self.weight_bias_init,</span></code>
<code><span class="code-snippet_outer"> self.deep_layer_act,</span></code>
<code><span class="code-snippet_outer"> convert_dtype=True, drop_out=config.dropout_flag)</span></code>
<code><span class="code-snippet_outer"> self.dense_layer_5 = DenseLayer(self.all_dim_list[4],</span></code>
<code><span class="code-snippet_outer"> self.all_dim_list[5],</span></code>
<code><span class="code-snippet_outer"> self.weight_bias_init,</span></code>
<code><span class="code-snippet_outer"> self.deep_layer_act,</span></code>
<code><span class="code-snippet_outer"> use_activation=False, convert_dtype=True, drop_out=config.dropout_flag)<mpchecktext contenteditable="false" id="1595491521631_0.31540606986635167">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> self.embeddinglookup = nn.EmbeddingLookup()</span></code>
<code><span class="code-snippet_outer"> self.mul = P.Mul()</span></code>
<code><span class="code-snippet_outer"> self.reduce_sum = P.ReduceSum(keep_dims=False)</span></code>
<code><span class="code-snippet_outer"> self.reshape = P.Reshape()</span></code>
<code><span class="code-snippet_outer"> self.square = P.Square()</span></code>
<code><span class="code-snippet_outer"> self.shape = P.Shape()</span></code>
<code><span class="code-snippet_outer"> self.tile = P.Tile()</span></code>
<code><span class="code-snippet_outer"> self.concat = P.Concat(axis=1)</span></code>
<code><span class="code-snippet_outer"> self.cast = P.Cast()<mpchecktext contenteditable="false" id="1595491521632_0.4011408530903695">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> def construct(self, id_hldr, wt_hldr):</span></code>
<code><span class="code-snippet_outer"> """</span></code>
<code><span class="code-snippet_outer"> Args:</span></code>
<code><span class="code-snippet_outer"> id_hldr: batch ids;</span></code>
<code><span class="code-snippet_outer"> wt_hldr: batch weights;</span></code>
<code><span class="code-snippet_outer"> """</span></code>
<code><span class="code-snippet_outer"> mask = self.reshape(wt_hldr, (self.batch_size, self.field_size, 1))</span></code>
<code><span class="code-snippet_outer"> # Wide layer</span></code>
<code><span class="code-snippet_outer"> wide_id_weight = self.embeddinglookup(self.wide_w, id_hldr, 0)</span></code>
<code><span class="code-snippet_outer"> wx = self.mul(wide_id_weight, mask)</span></code>
<code><span class="code-snippet_outer"> wide_out = self.reshape(self.reduce_sum(wx, 1) + self.wide_b, (-1, 1))</span></code>
<code><span class="code-snippet_outer"> # Deep layer</span></code>
<code><span class="code-snippet_outer"> deep_id_embs = self.embeddinglookup(self.embedding_table, id_hldr, 0)</span></code>
<code><span class="code-snippet_outer"> vx = self.mul(deep_id_embs, mask)</span></code>
<code><span class="code-snippet_outer"> deep_in = self.reshape(vx, (-1, self.field_size * self.emb_dim))</span></code>
<code><span class="code-snippet_outer"> deep_in = self.dense_layer_1(deep_in)</span></code>
<code><span class="code-snippet_outer"> deep_in = self.dense_layer_2(deep_in)</span></code>
<code><span class="code-snippet_outer"> deep_in = self.dense_layer_3(deep_in)</span></code>
<code><span class="code-snippet_outer"> deep_in = self.dense_layer_4(deep_in)</span></code>
<code><span class="code-snippet_outer"> deep_out = self.dense_layer_5(deep_in)</span></code>
<code><span class="code-snippet_outer"> out = wide_out + deep_out</span></code>
<code><span class="code-snippet_outer"> return out, self.embedding_table<mpchecktext contenteditable="false" id="1595491521633_0.04563167580958871">
</mpchecktext></span></code>
</pre>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">
</span>
</p>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="color: rgb(77, 168, 238);font-size: 16px;">我们采用交叉熵作为损失函数,Wide部分采用FTRL作为优化器</span>
<span style="font-size: 16px;">。<mpchecktext contenteditable="false" id="1595491521634_0.44376660721383443">
</mpchecktext>FTRL可以产生较好的稀疏权重,可以帮助筛选有价值的特征,并且可以压缩模型权重。<mpchecktext contenteditable="false" id="1595491521635_0.4155254440482379">
</mpchecktext>Deep采用Adam优化器。<mpchecktext contenteditable="false" id="1595491521636_0.37079385163273604">
</mpchecktext></span>
</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: 宋体;font-size: 16px;">
</span>
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZQSqk5ZYMWIicJ0iarUJrcD0gRqLbty6LeTfcO9EgfkPRgSdk6wpwggvQ/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZQSqk5ZYMWIicJ0iarUJrcD0gRqLbty6LeTfcO9EgfkPRgSdk6wpwggvQ/?wx_fmt=png">
</p>
<section style="text-align: justify;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;text-indent: 0em;"><span style="letter-spacing: 0.5px;font-size: 16px;"><span style="font-family:宋体;">在<span style="white-space:pre-wrap;font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;font-size: 14px;text-align: left;background-color: rgba(0, 0, 0, 0.03);">train_and_eval.py</span></span></span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;font-size: 16px;">中的定义了数据,模型的初始化以及训练过程,</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;font-size: 16px;color: rgb(77, 168, 238);">在定义完模型中,可以将初始化的网络送入Model类中</span><span style="font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;font-size: 16px;">,这个类和Tensorflow中Estimator比较接近,可以通过简单的接口实现网络的训练(model.train)和评估(model.eval)。<mpchecktext contenteditable="false" id="1595491521637_0.32891444885193355">
</mpchecktext></span></span>
</section>
<pre class="code-snippet__js code-snippet code-snippet_nowrap">
<code><span class="code-snippet_outer">model_zoo/wide_and_deep/train_and_eval.py<mpchecktext contenteditable="false" id="1595491521638_0.8007241218067571">
</mpchecktext></span></code>
</pre>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;"></span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">另外,此函数中定义了一些回调函数<mpchecktext contenteditable="false" id="1595491521639_0.4561272766649207">
</mpchecktext></span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="color: rgb(25, 67, 156);text-decoration: underline;font-size: 12px;">https://www.mindspore.cn/tutorial/-zhCN/master/advanced_use/customized_debugging_information.html<mpchecktext contenteditable="false" id="1595491521640_0.06552131892906488">
</mpchecktext></span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;text-indent: 0em;font-family: 宋体;">可以打印损失值等相关信息。<mpchecktext contenteditable="false" id="1595491521641_0.25631691777208765">
</mpchecktext>
</span>
</section>
<section style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">


</section>
<pre class="code-snippet__js code-snippet code-snippet_nowrap" data-lang="python">
<code><span class="code-snippet_outer">def test_train_eval(config):</span></code>
<code><span class="code-snippet_outer"> """</span></code>
<code><span class="code-snippet_outer"> test_train_eval</span></code>
<code><span class="code-snippet_outer"> """</span></code>
<code><span class="code-snippet_outer"> data_path = config.data_path</span></code>
<code><span class="code-snippet_outer"> batch_size = config.batch_size</span></code>
<code><span class="code-snippet_outer"> epochs = config.epochs</span></code>
<code><span class="code-snippet_outer"> ds_train = create_dataset(data_path, train_mode=True, epochs=epochs, batch_size=batch_size)</span></code>
<code><span class="code-snippet_outer"> ds_eval = create_dataset(data_path, train_mode=False, epochs=epochs + 1, batch_size=batch_size)</span></code>
<code><span class="code-snippet_outer"> print("ds_train.size: {}".format(ds_train.get_dataset_size()))</span></code>
<code><span class="code-snippet_outer"> print("ds_eval.size: {}".format(ds_eval.get_dataset_size()))<mpchecktext contenteditable="false" id="1595491521642_0.30555821926604376">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> net_builder = ModelBuilder()<mpchecktext contenteditable="false" id="1595491521643_0.9736738162578458">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> train_net, eval_net = net_builder.get_net(config)</span></code>
<code><span class="code-snippet_outer"> train_net.set_train()</span></code>
<code><span class="code-snippet_outer"> auc_metric = AUCMetric()<mpchecktext contenteditable="false" id="1595491521644_0.5805876421991347">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> model = Model(train_net, eval_network=eval_net, metrics={"auc": auc_metric})<mpchecktext contenteditable="false" id="1595491521645_0.3917814538148676">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> eval_callback = EvalCallBack(model, ds_eval, auc_metric, config)<mpchecktext contenteditable="false" id="1595491521646_0.5703433659749202">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> callback = LossCallBack(config=config)</span></code>
<code><span class="code-snippet_outer"> ckptconfig = CheckpointConfig(save_checkpoint_steps=ds_train.get_dataset_size(), keep_checkpoint_max=5)</span></code>
<code><span class="code-snippet_outer"> ckpoint_cb = ModelCheckpoint(prefix='widedeep_train', directory=config.ckpt_path, config=ckptconfig)<mpchecktext contenteditable="false" id="1595491521647_0.5985724627518798">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> out = model.eval(ds_eval)</span></code>
<code><span class="code-snippet_outer"> print("=====" * 5 + "model.eval() initialized: {}".format(out))</span></code>
<code><span class="code-snippet_outer"> model.train(epochs, ds_train,</span></code>
<code><span class="code-snippet_outer"> callbacks=[TimeMonitor(ds_train.get_dataset_size()), eval_callback, callback, ckpoint_cb])<mpchecktext contenteditable="false" id="1595491521648_0.273273385499504">
</mpchecktext></span></code>
</pre>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZujUZQpeQpMVfP8ZQLjpUmIfPeC2crwGW7B8FfKrlFgfayFl92wIWiaw/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZujUZQpeQpMVfP8ZQLjpUmIfPeC2crwGW7B8FfKrlFgfayFl92wIWiaw/?wx_fmt=png">
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;color: rgb(77, 168, 238);"><span lang="EN-US" style="text-indent: 0em;font-family: Calibri;">一旦训练完成后</span></span>
<span style="font-size: 16px;color: rgb(77, 168, 238);text-indent: 0em;font-family: Calibri;">,就可以装载模型参数进行评估。<mpchecktext contenteditable="false" id="1595491521649_0.57825032284277">
</mpchecktext></span>
<span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);font-size: 16px;"><span style="text-indent: 0em;font-family: 宋体;">评估网络和训练网络类似,只不过输出经过了一个</span><span style="text-indent: 0em;font-family: Calibri;">Sigmoid层</span></span><span style="color: rgb(0, 0, 0);font-size: 16px;text-indent: 0em;font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521650_0.39571448633964024">
</mpchecktext></span></span>
</p>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;text-indent: 0em;">


</section>
<pre class="code-snippet__js code-snippet code-snippet_nowrap" data-lang="ruby">
<code><span class="code-snippet_outer">class PredictWithSigmoid(nn.Cell):</span></code>
<code><span class="code-snippet_outer"> def init(self, network):</span></code>
<code><span class="code-snippet_outer"> super(PredictWithSigmoid, self).init()</span></code>
<code><span class="code-snippet_outer"> self.network = network</span></code>
<code><span class="code-snippet_outer"> self.sigmoid = P.Sigmoid()<mpchecktext contenteditable="false" id="1595491521651_0.8135663424621313">
</mpchecktext></span></code>
<code><span class="code-snippet_outer">​</span></code>
<code><span class="code-snippet_outer"> def construct(self, batch_ids, batch_wts, labels):</span></code>
<code><span class="code-snippet_outer"> logits, _, _, = self.network(batch_ids, batch_wts)</span></code>
<code><span class="code-snippet_outer"> pred_probs = self.sigmoid(logits)</span></code>
<code><span class="code-snippet_outer"> return logits, pred_probs, labels<mpchecktext contenteditable="false" id="1595491521652_0.4314559528062756">
</mpchecktext></span></code>
</pre>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;text-align: justify;margin-left: 5%;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">


</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;text-indent: 0em;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="text-indent: 0em;font-family: 宋体;font-size: 16px;color: rgb(77, 168, 238);">采用AUC作为评价指标</span>
<span style="font-size: 16px;text-indent: 0em;font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521653_0.5075784026538523">
</mpchecktext>AUC广泛的应用在分类模型的评估中,</span>
<span style="font-size: 16px;color: rgb(77, 168, 238);"><span style="text-indent: 0em;font-family: 宋体;">可以较好的反映模型学习的好坏,其值在0~</span><span style="text-indent: 0em;font-family: Calibri;">1之间</span><span style="text-indent: 0em;font-family: 宋体;">,值越高,模型的性能越好</span></span>
<span style="font-size: 16px;text-indent: 0em;font-family: 宋体;">。<mpchecktext contenteditable="false" id="1595491521654_0.2361147198557314">
</mpchecktext>
</span>
</p>
<section style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;text-indent: 0em;">


</section>
<p style="margin-top: 0pt;margin-bottom: 0pt;margin-left: 0pt;font-size: 10.5pt;font-weight: normal;text-align: justify;text-indent: 21pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">


</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<img class="rich_pages js_insertlocalimg" data-ratio="0.153125" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zr3nQGLHgqFQduOC7x3KdM1xnUp9bscZJHTKU0H0OWsYRqQSqcqSviaw/?wx_fmt=png" data-type="png" data-w="1280" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5Zr3nQGLHgqFQduOC7x3KdM1xnUp9bscZJHTKU0H0OWsYRqQSqcqSviaw/?wx_fmt=png">
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: 1.5em;">
<span style="font-size: 16px;"><span style="color: rgb(77, 168, 238);">本文内容介绍了推荐系统的原理和实践代码</span>。<mpchecktext contenteditable="false" id="1595491521655_0.3108364278742566">
</mpchecktext>首先讲述了推荐系统在我们生活中的应用场景,并且介绍了推荐系统的核心原理。<mpchecktext contenteditable="false" id="1595491521656_0.5460435115551427">
</mpchecktext>然后详细介绍了Wide&Deep网络以及相关的代码实践,期望可以帮助大家入门<mpchecktext contenteditable="false" id="1595491521657_0.9002820412351322">
</mpchecktext><img data-ratio="1" src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZnyWkry1l4tmS5tzibBMichlJtejy3wGicxPPmkOBdpso0kHv4B1PtLy7w/?wx_fmt=png" data-type="png" data-w="19" style="display:inline-block;width:20px;vertical-align:text-bottom;" _src="https://mmbiz.qpic.cn/sz_mmbiz_png/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZnyWkry1l4tmS5tzibBMichlJtejy3wGicxPPmkOBdpso0kHv4B1PtLy7w/?wx_fmt=png"></span>
</p>
<p style="text-align: justify;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-size: 16px;">
</span>
</p>
<h2 style="margin-top: 13pt;margin-bottom: 13pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;break-after: avoid;font-size: 16pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
</h2>
<p>
<span style="font-size: 16px;text-indent: 0pt;font-family: 宋体;">
</span>
</p>
<hr style="border-style: solid;border-width: 1px 0px 0px;border-color: rgba(0, 0, 0, 0.1);transform-origin: 0px 0px;transform: scale(1, 0.5);">
<p>参考文献
<mpchecktext contenteditable="false" id="1595491521658_0.2537673922628516">
</mpchecktext>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: normal;letter-spacing: 0px;">
<span style="font-family: Arial;color: rgb(34, 34, 34);background: rgb(255, 255, 255);font-size: 14px;">[1] Cheng H T, Koc L, Harmsen J, et al. Wide & deep learning for recommender systems[C]//Proceedings of the 1st workshop on deep learning for recommender systems. 2016: 7-10.<mpchecktext contenteditable="false" id="1595491521659_0.9547549872159344">
</mpchecktext></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: normal;letter-spacing: 0px;">
<span style="font-family: Arial;color: rgb(34, 34, 34);background: rgb(255, 255, 255);font-size: 14px;">[2]<span style="caret-color: rgb(25, 67, 156);color: rgb(25, 67, 156);font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;font-size: 12px;letter-spacing: 0.5px;text-decoration: underline;">https://www.mindspore.cn/tutorial/-zhCN/master/advanced_use/customized_debugging_information.html<mpchecktext contenteditable="false" id="1595491521660_0.14200408047701996">
</mpchecktext></span></span>
</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: normal;letter-spacing: 0px;">


</p>
<p style="margin-top: 0pt;margin-bottom: 0pt;text-align: justify;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;line-height: 1.5em;letter-spacing: 0.5px;">
<span style="font-family: Arial;color: rgb(34, 34, 34);background: rgb(255, 255, 255);font-size: 16px;">
</span>
</p>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: center;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-weight: normal;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.5px;line-height: normal;">
<span style="font-family: Arial;color: rgb(34, 34, 34);background: rgb(255, 255, 255);font-size: 16px;"><img data-ratio="1" src="https://mmbiz.qpic.cn/sz_mmbiz_gif/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZIsAd6NxHBtQU88StTygUhdbPicYg90wcJL7tEqToWdlo5n6hLFiavf9Q/?wx_fmt=gif" data-type="gif" data-w="240" style="width:15%;height:auto;" _src="https://mmbiz.qpic.cn/sz_mmbiz_gif/xfBicxTBmNWWYhNwiaTTcgiapMmtWvY9c5ZIsAd6NxHBtQU88StTygUhdbPicYg90wcJL7tEqToWdlo5n6hLFiavf9Q/?wx_fmt=gif"></span>
</section>
<section style="margin-top: 0pt;margin-bottom: 0pt;text-align: center;margin-left: 0pt;text-indent: 0pt;font-size: 10.5pt;font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0px;line-height: normal;">
<strong style="color: rgb(34, 34, 34);font-family: Arial;font-size: 12px;">长按下方二维码关注↓<mpchecktext contenteditable="false" id="1595491521661_0.560668513046289">
</mpchecktext></strong>
</section>
<p style="text-align: center;">
<img class="rich_pages" data-ratio="0.3975" data-s="300,640" src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/xfBicxTBmNWX6gdFbo3zCqEBzN5bMufIGKmPiaUuGS2EvbhZs1icKJSl1LJ5m667QD05Zwks7pZ1MHctdprj2S5aQ/?wx_fmt=jpeg" data-type="jpeg" data-w="800" style="" _src="https://mmbiz.qpic.cn/sz_mmbiz_jpg/xfBicxTBmNWX6gdFbo3zCqEBzN5bMufIGKmPiaUuGS2EvbhZs1icKJSl1LJ5m667QD05Zwks7pZ1MHctdprj2S5aQ/?wx_fmt=jpeg">
</p>
<section style="margin-top: 0pt; margin-bottom: 0pt; text-align: justify; margin-left: 0pt; text-indent: 0pt; font-size: 10.5pt; font-weight: normal; font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; letter-spacing: 0.5px; line-height: 1.5em;">


</section>

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,951评论 6 497
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,606评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 160,601评论 0 350
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,478评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,565评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,587评论 1 293
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,590评论 3 414
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,337评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,785评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,096评论 2 330
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,273评论 1 344
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,935评论 5 339
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,578评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,199评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,440评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,163评论 2 366
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,133评论 2 352