2021-07-22

  • 首页
                                </a>
                                
                                
                              </li><li class="active " title="阅读深度、前沿文章">
                                <a data-report-click="{&quot;mod&quot;:&quot;popu_336&quot;,&quot;dest&quot;:&quot;https://blog.csdn.net/&quot;,&quot;spm&quot;:&quot;3001.4477&quot;}" data-report-query="spm=3001.4477" href="https://blog.csdn.net/">
                                  博客
                                  
                                  
                                </a>
                                
                                
                              </li><li class="" title="马上开始系统学习">
                                <a data-report-click="{&quot;mod&quot;:&quot;popu_336&quot;,&quot;dest&quot;:&quot;https://edu.csdn.net/&quot;,&quot;spm&quot;:&quot;3001.4482&quot;}" data-report-query="spm=3001.4482" href="https://edu.csdn.net/">
                                  专栏课程
                                  
                                  
                                </a>
                                
                                
                              </li><li class="" title="获取源码、文档、学习资源">
                                <a data-report-click="{&quot;mod&quot;:&quot;popu_336&quot;,&quot;dest&quot;:&quot;https://download.csdn.net/&quot;,&quot;spm&quot;:&quot;3001.4483&quot;}" data-report-query="spm=3001.4483" href="https://download.csdn.net/">
                                  下载
                                  
                                  
                                </a>
                                
                                
                              </li><li class="" title="技术问题,有问必答">
                                <a data-report-click="{&quot;mod&quot;:&quot;popu_336&quot;,&quot;dest&quot;:&quot;https://ask.csdn.net/&quot;,&quot;spm&quot;:&quot;3001.4492&quot;}" data-report-query="spm=3001.4492" href="https://ask.csdn.net/">
                                  问答
                                  
                                  
                                </a>
                                
                                
                              </li><li class="" title="找到志同道合的伙伴">
                                <a data-report-click="{&quot;mod&quot;:&quot;popu_336&quot;,&quot;dest&quot;:&quot;https://www.csdn.net/c/&quot;,&quot;spm&quot;:&quot;3001.6068&quot;}" data-report-query="spm=3001.6068" href="https://www.csdn.net/c/">
                                  社区
                                  
                                  
                                </a>
                                
                                
                              </li><li class="" title="安装你的浏览器助手">
                                <a data-report-click="{&quot;spm&quot;:&quot;3001.6135&quot;,&quot;dist&quot;:&quot;https://t.csdnimg.cn/OSqE&quot;}" data-report-query="spm=3001.6135" href="https://t.csdnimg.cn/OSqE">
                                  插件
                                  
                                  
                                </a>
                                
                                
                              </li><li class="" title="认证你的技术能力">
                                <a data-report-click="{&quot;mod&quot;:&quot;popu_336&quot;,&quot;dest&quot;:&quot;https://ac.csdn.net/&quot;,&quot;spm&quot;:&quot;3001.5716&quot;}" data-report-query="spm=3001.5716" href="https://ac.csdn.net/">
                                  认证
                                  
                                  
                                </a>
                                
                                
                              </li></ul>
                        </div>
                        <div class="toolbar-container-middle">
                          <div class="toolbar-search onlySearch"><div class="toolbar-search-container">
                    <input id="toolbar-search-input" autocomplete="off" type="text" value="" placeholder="信息论">
                    <button id="toolbar-search-button"></button>
                    <input type="password" autocomplete="new-password" readonly="" disabled="true" style="display: none; position:absolute;left:-9999999px;width:0;height:0;">
                  </div></div>
                        </div>
                        <div class="toolbar-container-right">
                          <div class="toolbar-btns onlyUser"><div class="toolbar-btn toolbar-btn-login csdn-toolbar-fl toolbar-subMenu-box">
                      <a class="hasAvatar" data-report-click="{&quot;spm&quot;: &quot;3001.5343&quot;}" data-report-query="spm=3001.5343" href="https://blog.csdn.net/weixin_42612518"><img src="https://profile.csdnimg.cn/E/B/8/2_weixin_42612518"></a>
                      <div id="csdn-toolbar-profile" class="csdn-toolbar-plugin">
            <div class="csdn-profile-top">
              <a class="csdn-profile-avatar" data-report-click="{&quot;spm&quot;: &quot;3001.5343&quot;}" data-report-query="spm=3001.5343" href="https://blog.csdn.net/weixin_42612518"><img src="https://profile.csdnimg.cn/E/B/8/0_weixin_42612518"></a>
              <p class="csdn-profile-nickName">Alex龙雅</p>
              <a data-report-click="{&quot;spm&quot;: &quot;3001.5344&quot;}" data-report-query="spm=3001.5344" href="https://mall.csdn.net/vip" class="csdn-profile-no-vip"></a>
            </div>
            <div class="csdn-profile-mid">
              <a data-report-click="{&quot;spm&quot;: &quot;3001.5347&quot;}" data-report-query="spm=3001.5347" href="https://blog.csdn.net/weixin_42612518?type=sub&amp;subType=fans"><i class="csdn-profile-fansCount">42</i>粉丝</a>
              <a data-report-click="{&quot;spm&quot;: &quot;3001.5348&quot;}" data-report-query="spm=3001.5348" href="https://blog.csdn.net/weixin_42612518?type=sub"><i class="csdn-profile-followCount">5</i>关注</a>
              <a data-report-click="{&quot;spm&quot;: &quot;3001.5349&quot;}" data-report-query="spm=3001.5349" href="https://blog.csdn.net/weixin_42612518"><i class="csdn-profile-likeCount">39</i>获赞</a>
            </div>
            <div class="csdn-profile-bottom">
              <ul class="csdn-border-bottom">
                <li class=""><a href="https://i.csdn.net/#/user-center/profile" data-report-click="{&quot;dest&quot;:&quot;https://i.csdn.net/#/user-center/profile&quot;,&quot;spm&quot;:&quot;3001.5111&quot;}" data-report-query="spm=3001.5111"><i class="csdn-profile-icon csdn-profile-icon-person"></i>个人中心</a></li><li class=""><a href="https://mp.csdn.net/mp_blog/manage/article?spm=1011.2124.3001.5298" data-report-click="{&quot;dest&quot;:&quot;https://mp.csdn.net/mp_blog/manage/article?spm=1011.2124.3001.5298&quot;,&quot;spm&quot;:&quot;3001.5448&quot;}" data-report-query="spm=3001.5448"><i class="csdn-profile-icon csdn-profile-icon-pages"></i>内容管理</a></li><li class=""><a href="https://edu.csdn.net/" data-report-click="{&quot;dest&quot;:&quot;https://edu.csdn.net/&quot;,&quot;spm&quot;:&quot;3001.5350&quot;}" data-report-query="spm=3001.5350"><i class="csdn-profile-icon csdn-profile-icon-study"></i>学习平台</a></li><li class=""><a href="https://mall.csdn.net/myorder" data-report-click="{&quot;dest&quot;:&quot;https://mall.csdn.net/myorder&quot;,&quot;spm&quot;:&quot;3001.5137&quot;}" data-report-query="spm=3001.5137"><i class="csdn-profile-icon csdn-profile-icon-order"></i>我的订单</a></li><li class="pb-8 csdn-border-bottom"><a href="https://i.csdn.net/#/wallet/index" data-report-click="{&quot;dest&quot;:&quot;https://i.csdn.net/#/wallet/index&quot;,&quot;spm&quot;:&quot;3001.5136&quot;}" data-report-query="spm=3001.5136"><i class="csdn-profile-icon csdn-profile-icon-wallet"></i>我的钱包</a></li><li class="pt-8 pb-8 csdn-border-bottom"><a href="https://i.csdn.net/#/uc/reward" data-report-click="{&quot;dest&quot;:&quot;https://i.csdn.net/#/uc/reward&quot;,&quot;spm&quot;:&quot;3001.5351&quot;}" data-report-query="spm=3001.5351"><i class="csdn-profile-icon csdn-profile-icon-draw"></i>签到抽奖</a></li><li class="pt-8 csdn-profile-logout"><a href="javascript:;" data-report-click="{&quot;spm&quot;:&quot;3001.5139&quot;}" data-report-query="spm=3001.5139"><i class="csdn-profile-icon csdn-profile-icon-logout"></i>退出</a></li>
              </ul>
            </div>
          </div></div>
                    <div class="toolbar-btn toolbar-btn-vip csdn-toolbar-fl">
                      <a data-report-click="{&quot;mod&quot;:&quot;popu_336&quot;,&quot;dest&quot;:&quot;https://mall.csdn.net/vip&quot;,&quot;spm&quot;:&quot;3001.4496&quot;}" data-report-query="spm=3001.4496" href="https://mall.csdn.net/vip">会员中心 </a>
                    <div id="csdn-plugin-vip" style="display: none;">
                        <div class="csdn-plugin-vip-header">
                            会员特权
                        </div>
                        <div class="csdn-plugin-vip-body">
                            <a href="https://download.csdn.net/?utm_source=vip_xz_862637798_yy"><i class="csdn-plugin-vip-icon csdn-plugin-vip-icon-download"></i><br>资源下载</a>
                            <a href="https://edu.csdn.net/course?channelType=3&amp;utm_source=vip_jpk_862637798_yy"><i class="csdn-plugin-vip-icon csdn-plugin-vip-icon-class"></i><br>千节精品课</a>
                            <a href="https://book.csdn.net/?utm_source=vip_dzs_862637798_yy"><i class="csdn-plugin-vip-icon csdn-plugin-vip-icon-book"></i><br>千本电子书</a>
                            <a href="https://so.csdn.net/so/search?q=&amp;t=vip&amp;s=0&amp;pnt=-1&amp;ct=100&amp;utm_source=vip_jswz_862637798_yy"><i class="csdn-plugin-vip-icon csdn-plugin-vip-icon-pages"></i><br>VIP技术文章</a>
                        </div>
                        <div class="csdn-plugin-vip-footer">
                            <a data-report-click="{&quot;spm&quot;: &quot;3001.5400&quot;}" data-report-query="spm=3001.5400" class="csdn-plugin-vip-footer-btn" href="https://mall.csdn.net/vip">
                              开通会员
                            </a>
                            <a data-report-click="{&quot;spm&quot;: &quot;3001.5401&quot;}" data-report-query="spm=3001.5401" class="csdn-plugin-vip-footer-link" href="https://www.csdn.net/vip">
                              查看完整会员权益<i></i>
                            </a>
                        </div>
                    </div></div>
                    <div class="toolbar-btn toolbar-btn-collect csdn-toolbar-fl">
                      <a data-report-click="{&quot;spm&quot;:&quot;3001.4506&quot;}" data-report-query="spm=3001.4506" href="https://i.csdn.net/#/user-center/collection-list?type=1">收藏</a>
                    
          <div id="csdn-toolbar-collection" class="csdn-toolbar-plugin" style="display: none;">
            <div class="toolbar-collection-left csdn-toolbar-scroll-box">
              <ul>
          <li class="collection-folder-active">
            <div class="toolbar-collection-folder-name">默认收藏夹</div>
            <div class="toolbar-collection-folder-count">9</div>
          </li>
        </ul>
            </div>
            <div class="toolbar-collection-right">
              <ul class="csdn-toolbar-scroll-box">
          <li>
            <a href="https://fff2zrx.blog.csdn.net/article/details/79303083" target="_blank">
              <span class="toolbar-collection-type">博客</span>
              <span class="toolbar-collection-title">matlab中cell数组用法</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/Tonywu2018/article/details/91490158" target="_blank">
              <span class="toolbar-collection-type">博客</span>
              <span class="toolbar-collection-title">详解独立成分分析</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/Cratial/article/details/88918132" target="_blank">
              <span class="toolbar-collection-type">博客</span>
              <span class="toolbar-collection-title">多尺度熵---Understanding Multiscale Entropy</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/xiwan0902/article/details/72280352" target="_blank">
              <span class="toolbar-collection-type">博客</span>
              <span class="toolbar-collection-title">5种常用的相关分析方法</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/qq_37885346/article/details/80542740" target="_blank">
              <span class="toolbar-collection-type toolbar-collection-otherType">其他</span>
              <span class="toolbar-collection-title">matlab_格兰杰因果关系检验 - qq_37885346的博客</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/zengxiantao1994/article/details/72787849" target="_blank">
              <span class="toolbar-collection-type toolbar-collection-otherType">其他</span>
              <span class="toolbar-collection-title">极大似然估计详解 - 知行流浪</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/yuhq3/article/details/78585774" target="_blank">
              <span class="toolbar-collection-type toolbar-collection-otherType">其他</span>
              <span class="toolbar-collection-title">Matlab多目标跟踪示例(一):Motion-Based Multiple Object Tracking</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/qq_25819827/article/details/53445567" target="_blank">
              <span class="toolbar-collection-type toolbar-collection-otherType">其他</span>
              <span class="toolbar-collection-title">用MATLAB实现对运动物体识别与跟踪</span>
            </a>
          </li>
        
          <li>
            <a href="https://blog.csdn.net/shmilymdt/article/details/48245519" target="_blank">
              <span class="toolbar-collection-type toolbar-collection-otherType">其他</span>
              <span class="toolbar-collection-title">matlab读取视频VideoReader类</span>
            </a>
          </li>
        </ul>
            </div>
            <div class="csdn-toolbar-plugin-triangle"></div>
          </div>
        </div>
                     <div class="toolbar-btn csdn-toolbar-fl"><a data-report-click="{&quot;spm&quot;:&quot;3001.4507&quot;}" data-report-query="spm=3001.4507" href="https://blog.csdn.net/nav/watchers">动态</a></div>
                    <div class="toolbar-btn toolbar-btn-msg csdn-toolbar-fl">
                      <div class="toolbar-subMenu-box">
                        <a data-report-click="{&quot;spm&quot;:&quot;3001.4508&quot;}" data-report-query="spm=3001.4508" id="toolbar-remind" href="https://i.csdn.net/#/msg/index"><span class="pos-rel">消息</span></a>
                      <div class="toolbar-subMenu">
                          <a data-type="comment" href="https://i.csdn.net/#/msg/index"><span class="pos-rel">评论</span></a>
                          <a data-type="attention" href="https://i.csdn.net/#/msg/attention"><span class="pos-rel">关注</span></a>         
                          <a data-type="like" href="https://i.csdn.net/#/msg/like"><span class="pos-rel">点赞</span></a>
                          <a data-type="chat" href="https://im.csdn.net/im/main.html"><span class="pos-rel">私信</span></a>
                          <a data-type="notice" href="https://i.csdn.net/#/msg/notice"><span class="pos-rel">系统通知</span></a>
                          <a href="https://i.csdn.net/#/msg/setting">消息设置</a>
                     </div></div>
                      <div class="toolbar-msg-box"></div>
                    </div>
                    <div class="toolbar-btn toolbar-btn-write csdn-toolbar-fl toolbar-subMenu-box">
                      <a data-report-click="{&quot;spm&quot;:&quot;3001.4503&quot;}" data-report-query="spm=3001.4503" href="https://mp.csdn.net"><i></i>创作中心</a>
                    </div></div>
                        </div>
                      </div>
                    </div>
                  </div>
        <script>
            var toolbarSearchExt = '{"landingWord":[],"queryWord":"信息熵","tag":["信息论","信息熵","人工智能"],"title":"一文看懂信息熵的本质&mdash;&mdash;谈谈自己对信息熵的理解"}';
        </script>
    <script src="https://g.csdnimg.cn/common/csdn-toolbar/csdn-toolbar.js" type="text/javascript"></script>
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
    </script>
    

一文看懂信息熵的本质——谈谈自己对信息熵的理解

信息融合 专栏收录该内容
2 篇文章 0 订阅

一、序言

    初次看到信息熵的公式有很多不理解的地方,只知道信息熵如何进行计算,却不懂得公式背后的原理,我通过查阅了一些资料,加深了对信息熵的理解,现在将这些理解分享给大家。如有疑问欢迎评论,若对你有帮助,麻烦点个赞。未经允许、请勿转载。(本文适合只知道信息熵的公式,但是不明白其中原理的人进行阅读)

二、什么是信息熵

    正如我们想要衡量某个物体的质量引入了克这个单位、我们想衡量时间,我们设计一秒钟这么长。香农老人家想要量化一条消息中带有的“信息量”的大小,提出了信息熵。
那么,首先明确一个问题,什么样的消息算作“信息量大”呢?什么样的消息又算作“信息量小呢”?举个例子昨天小明和我说:“今天罗志祥又和周扬青秀恩爱了!”,我就觉得这有啥的,他们天天秀恩爱。也就是说小明的这条消息并不能给我带来很大的信息量。
BUT今天小明和我说:”周扬青怒锤罗志祥!!!罗志祥人设崩塌!!!“,我就会很惊讶,因为这条消息给我的信息量很大。(类似的信息量很大的消息还有:小明告诉我今天太阳会从西边升起)
我们用信息熵来描述一个事件混乱程度的大小(一个事件我们一定知道结果,那么这个事件的混乱程度就是0;一个时间充满随机性,我们猜不到或者很难猜到结果,那么他的混乱度就很大)
引用下面一个在箱子里面摸球的例子,我们来更具体的了解信息熵。
(此例引自:Youtube的一个视频
在这里插入图片描述
图左侧中有一个装有四个球的封闭箱子(这个箱子里面有三个红球、一个蓝球),现在我们从箱子中随机取出一个球,记录它的颜色后再放回箱子中,重复四次操作。如果你依次取出的序列为右上角所示(第一次取到红色、第二次取到红色、第三次取到红色、第四次取到蓝色),则你可以获得奖金;否则你就输了。大家用初中数学来算一算,我赢得奖金的概率是

     P
    
    
     (
    
    
     x
    
    
     )
    
    
     =
    
    
     
      3
     
     
      4
     
    
    
     ∗
    
    
     
      3
     
     
      4
     
    
    
     ∗
    
    
     
      3
     
     
      4
     
    
    
     ∗
    
    
     
      1
     
     
      4
     
    
    
     =
    
    
     
      27
     
     
      256
     
    
   
   
     P(x)=\frac{3}{4}*\frac{3}{4}*\frac{3}{4}*\frac{1}{4}=\frac{27}{256} 
   
  
 </span><span class="katex-html"><span class="base"><span class="strut" style="height: 0.68em; vertical-align: 0em;"></span><span class="mord mathdefault" style="margin-right: 0.13em;">P</span><span class="mord cjk_fallback">(</span><span class="mord mathdefault">x</span><span class="mord cjk_fallback">)</span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">3</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">3</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">3</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">2</span><span class="mord">5</span><span class="mord">6</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">2</span><span class="mord">7</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></span><br>   现在明确了这个游戏的规则,那么我们分析一下如下几个箱子与赢得奖金的情况,分别计算一下获胜概率<br> <img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200423165753935.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NjI0MDMw,size_16,color_FFFFFF,t_70"><br> <img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200423165836890.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NjI0MDMw,size_16,color_FFFFFF,t_70"><br> <img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200423165853642.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NjI0MDMw,size_16,color_FFFFFF,t_70"><br> (每个图的左边是这个箱子的红球与蓝球初始条件,右侧是获胜所要求的序列,大家自己算算这个概率和图上写的一样吗?)<br> <img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200423170009974.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NjI0MDMw,size_16,color_FFFFFF,t_70"><br> 我们来分析一下这三种状态的游戏,第一次由于箱子内全是红球、该箱子的随机性很弱,也就是说还没摸我就知道结果了。这种状态带来的信息量很小;第三个箱子随机性很强,也就是说,对于结果我们充满未知。这个状态的信息量很大。我们算出的这个概率越接近1时候,这个信息熵应该越接近0;算出的这个概率越小的时候,信息熵反而应该越大。我们需要找到这么一个公式来满足这一点。(暂停思考一下,有哪些公式可以满足)<br>  <strong>该可以很轻松的想到,用刚才P(winning)的概率取倒数可以吗?</strong> 答案是,只考虑刚才的问题,是可以的。但取倒数这个方式还是存在一些问题,比如第三个箱子取0.0625的倒数,算出来的这个信息量为16,如果这个P(winning)概率算出结果很小时,取倒数后就会变得非常大,所以我们认为这个乘法的规则并不是很好(换言之,我们希望曲线平滑一些)。香农发现log函数可以很好的解决这个问题。 因为log(a*b) = log(a)+log(b);而恰巧像抽箱子的独立事件P(AB) = P(A)*P(B)。【原因不止于此,后面我们还会再详细讨论】。<br> 所以香农取了一个-log(x)这么一个函数来表示某一状态的信息量大小,因为x是概率事件取[0,1],所以log(x)是一个递增的恒负的值,取一个负号,-log(x)是一个恒正、递减的函数,正好符合我们的预期。<br> <img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/2020042410083693.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NjI0MDMw,size_16,color_FFFFFF,t_70"></p> 

表的第四列就是我们用log计算出的结果。而我们刚刚是依次计算的每一个球的结果,为了表示系统的平均信息量。我们除4得到最终的信息熵。
在这里插入图片描述
我们来将这个模型一般化,m个红球n个蓝球,信息熵表示如上图所示。
我们可以再将模型一般化一些,如果这个箱子里有多种不同颜色的球,我们就公式变成了如下的样子:

      H
     
     
      
       (
      
      
       x
      
      
       )
      
     
    
    
     =
    
    
     −
    
    
     
      ∑
     
     
      
       i
      
      
       =
      
      
       1
      
     
     
      n
     
    
    
     
      P
     
     
      
       (
      
      
       
        x
       
       
        i
       
      
      
       )
      
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     P
    
    
     (
    
    
     
      x
     
     
      i
     
    
    
     )
    
    
     )
     
   
   
     H_{(x)}= -\sum_{i=1}^{n}P_{(x_i)}*log(P(x_i))\, 
   
  
 </span><span class="katex-html"><span class="base"><span class="strut" style="height: 1.03em; vertical-align: -0.35em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right: 0.08em;">H</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 0.34em;"><span style="top: -2.51em; margin-right: 0.05em; margin-left: -0.08em;"><span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">x</span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.35em;"></span></span></span></span></span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 2.92em; vertical-align: -1.27em;"></span><span class="mord">−</span><span class="mspace" style="margin-right: 0.16em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.65em;"><span style="top: -1.87em; margin-left: 0em;"><span class="pstrut" style="height: 3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span><span class="mrel mtight">=</span><span class="mord mtight">1</span></span></span></span><span style="top: -3.05em;"><span class="pstrut" style="height: 3.05em;"></span><span class="mop op-symbol large-op">∑</span></span><span style="top: -4.3em; margin-left: 0em;"><span class="pstrut" style="height: 3.05em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">n</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 1.27em;"></span></span></span></span><span class="mspace" style="margin-right: 0.16em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right: 0.13em;">P</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 0.34em;"><span style="top: -2.51em; margin-right: 0.05em; margin-left: -0.13em;"><span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mtight"><span class="mord mathdefault mtight">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 0.32em;"><span style="top: -2.35em; margin-right: 0.07em; margin-left: 0em;"><span class="pstrut" style="height: 2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.14em;"></span></span></span></span></span><span class="mclose mtight">)</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.35em;"></span></span></span></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right: 0.13em;">P</span><span class="mopen">(</span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 0.31em;"><span style="top: -2.55em; margin-right: 0.05em; margin-left: 0em;"><span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.15em;"></span></span></span></span></span><span class="mclose">)</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.16em;"></span></span></span></span></span></span><br> 这就是信息熵。<strong>也就是说,我们规定拿出一枚硬币,随意投出后,他可能是正面也可能是反面,它的信息熵是单位1(用刚才的方法来算算是不是1)。就像我们在这节开始所提到的,我们知道一个物体是几千克。是因为我们有一个1kg的砝码作为参考。我们能感受到时间流逝了多少秒,是因为我们规定了秒的单位。</strong></p> 

三、为什么是log

 这章我们会再用一个例子来讲解,为什么是信息熵为什么要用log?还是以一个游戏为例。在这里插入图片描述
在上述的8个字母中,任取一个字母(我们不知道取的是什么,但我们知道初始的8个字母是什么),现在让你来猜这个字母是什么。
利用我们刚刚学过的信息熵,我们可以知道第一个序列的信息熵很低、第三个最高。我们可以计算出如下结果
在这里插入图片描述
(这个信息熵大家自己算一下,和上面计算的方式完全一样)
重点来了: 下面我们用一种提问的方式,来解决这个问题。你可以像系统提问(比如:这个字符是A吗?),系统会给你回答,你根据回答继续进行提问,直到猜到结果为止。以第二个序列为例;系统选了D,让你来猜。你会这样提问:
Q1:这个字符是A吗? Answer:不是
你就知道,这个答案只能是B,C,D中的一个,你就会继续提问:
Q2:这个字符是B吗? Answer:不是
你就会继续问:
Q3:这个字符是C吗?Answer:不是
好了,你不会再继续问下去了,因为这个答案一定是D。
也就是说通过这种方式,如果答案是A,你会猜1次,答案是B你会猜两次,答案是C或者D,你会猜三次。平均猜测次数为

     E
    
    
     (
    
    
     x
    
    
     )
    
    
     =
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     1
    
    
     +
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     2
    
    
     +
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     3
    
    
     +
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     3
    
    
     =
    
    
     2.25
    
    
     次
    
   
   
     E(x)=\frac{1}{4}*1+\frac{1}{4}*2+\frac{1}{4}*3+\frac{1}{4}*3=2.25次 
   
  
 </span><span class="katex-html"><span class="base"><span class="strut" style="height: 0.68em; vertical-align: 0em;"></span><span class="mord mathdefault" style="margin-right: 0.05em;">E</span><span class="mord cjk_fallback">(</span><span class="mord mathdefault">x</span><span class="mord cjk_fallback">)</span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 0.72em; vertical-align: -0.08em;"></span><span class="mord">1</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 0.72em; vertical-align: -0.08em;"></span><span class="mord">2</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 0.72em; vertical-align: -0.08em;"></span><span class="mord">3</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 0.64em; vertical-align: 0em;"></span><span class="mord">3</span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 0.64em; vertical-align: 0em;"></span><span class="mord">2</span><span class="mord">.</span><span class="mord">2</span><span class="mord">5</span><span class="mord cjk_fallback">次</span></span></span></span></span></span><br> 显然,你可以选择一种更精妙的提问方式,来缩减平均猜测的次数<br> 你可以这样进行提问:<br> Q1:这个字符是A或B吗? Answer:不是<br> Q2:那么这个字符是C吗? Answer:不是<br> 好了,那么我知道这个字符是D了。也就是通过这种方式,我们不管是哪一个字符,我们只需要问两次就可以解决问题,我们用一种更直观的树来表示,如下图所示<br> <img alt="在这里插入图片描述" src="https://img-blog.csdnimg.cn/20200424101310790.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM1NjI0MDMw,size_16,color_FFFFFF,t_70"><br> <strong>恰巧,这种提问二选一的过程,恰巧是个抛硬币的过程。由于我们类似的等价于抛了两次硬币,我们可以知道,这个过程的信息熵是2。我们再用信息熵的公式试一试</strong><br> <span class="katex--display"><span class="katex-display"><span class="katex"><span class="katex-mathml">
 
  
   
    
     H
    
    
     (
    
    
     x
    
    
     )
    
    
     =
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     4
    
    
     )
    
    
     +
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     4
    
    
     )
    
    
     +
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     4
    
    
     )
    
    
     +
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     4
    
    
     )
    
    
     =
    
    
     2
    
   
   
     H(x)=\frac{1}{4}*log(4)+\frac{1}{4}*log(4)+\frac{1}{4}*log(4)+\frac{1}{4}*log(4)=2 
   
  
 </span><span class="katex-html"><span class="base"><span class="strut" style="height: 0.68em; vertical-align: 0em;"></span><span class="mord mathdefault" style="margin-right: 0.08em;">H</span><span class="mord cjk_fallback">(</span><span class="mord mathdefault">x</span><span class="mord cjk_fallback">)</span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">4</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">4</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">4</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">4</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 0.64em; vertical-align: 0em;"></span><span class="mord">2</span></span></span></span></span></span><br> (这里我们把符号直接化进log中了)</p> 

大家发现没有,log(x)是不是恰巧等于x需要询问的次数呢?!!!这也是这个公式的精妙所在,在离散数学中我们学过,一个树的高度等于log(节点数),这个log(x)恰巧是询问的高度,也就是投硬币的次数!这原来就是使用log的原因
上面的例子中A,B,C,D都是等概率出现的;下面我们将这个过程一般化,看一看当每个随机变量不等概率时的运算过程
在这里插入图片描述

我们看如上的序列,其中A出现的概率要等于BCD之和。所以我们为了让我们的提问次数最小化,我们要尽力讲每次提问的YorN分成等概率,也就是我们要问的第一个问题是:
Q1:这个字符是A吗?
如果不是,我们知道是B,C,D但是B的概率等于C和D之和,我们就再问:
Q2:这个字符是B吗?
如果不是,这时候C和D等概率,我们随便问一个即可:
Q3:这个字符是C吗?
好了,现在得出了结论。
问出A需要1次,B2次,C和D都是三次。
我们用信息熵来计算一下。

     H
    
    
     (
    
    
     x
    
    
     )
    
    
     =
    
    
     
      1
     
     
      2
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     2
    
    
     )
    
    
     +
    
    
     
      1
     
     
      4
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     4
    
    
     )
    
    
     +
    
    
     
      1
     
     
      8
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     8
    
    
     )
    
    
     +
    
    
     
      1
     
     
      8
     
    
    
     ∗
    
    
     l
    
    
     o
    
    
     g
    
    
     (
    
    
     8
    
    
     )
    
   
   
     H(x)=\frac{1}{2}*log(2)+\frac{1}{4}*log(4)+\frac{1}{8}*log(8)+\frac{1}{8}*log(8) 
   
  
 </span><span class="katex-html"><span class="base"><span class="strut" style="height: 0.68em; vertical-align: 0em;"></span><span class="mord mathdefault" style="margin-right: 0.08em;">H</span><span class="mord cjk_fallback">(</span><span class="mord mathdefault">x</span><span class="mord cjk_fallback">)</span><span class="mspace" style="margin-right: 0.27em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.27em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">2</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">2</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">4</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">4</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">8</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">8</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 2em; vertical-align: -0.68em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height: 1.32em;"><span style="top: -2.31em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">8</span></span></span><span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span><span style="top: -3.67em;"><span class="pstrut" style="height: 3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height: 0.68em;"></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right: 0.22em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right: 0.22em;"></span></span><span class="base"><span class="strut" style="height: 1em; vertical-align: -0.25em;"></span><span class="mord mathdefault" style="margin-right: 0.01em;">l</span><span class="mord mathdefault">o</span><span class="mord mathdefault" style="margin-right: 0.03em;">g</span><span class="mopen">(</span><span class="mord">8</span><span class="mclose">)</span></span></span></span></span></span><br> 每一个log(x)恰巧对应着他所在的叶子在树的第几层,也就是他需要询问的次数,前面乘上一个概率,是不是发现这个公式提出的非常巧妙!!</p> 

同时,在二进制计算机中,一个比特为0或1,其实就代表了一个二元问题的回答。也就是说,在计算机中,对于这个事件进行编码,所需要的平均码长为H(x)个比特。

三、结语

 通过上述过程,相信大家能清楚的理解信息熵。本文并没有一些数学上详细的证明,暂时留个坑以后填。如果大家有什么问题,欢迎在评论区交流,如果觉得有用麻烦点个赞~
参考资料:
[1]https://www.youtube.com/watch?v=ErfnhcEV1O8
[2]https://blog.csdn.net/v_JULY_v/article/details/40508465

打赏
文章很值,打赏犒劳作者一下
计算 信息熵的公式:n是类别数,p(xi)是第i类的概率

假设数据集有m行,即m个样本,每一行最后一列为该样本的标签,计算数据集信息熵的代码如下:

from math import log
def calcShannonEnt(dataSet):
numEntries = len(dataSet) # 样本数
labelCounts = {} # 该数据集每个类别的频数
for featVec in dataSet: # 对每一行样本
currentLabel = featVec[-1] # 该样本的标签
if currentLabel not in labelC


信息量和 信息熵的概念最早是出现在通信理论中的,其概念最早是由 信息论鼻祖香农在其经典的paper《A Mathematical Theory of Communication》中提出的。如今,这些概念不仅仅是通信领域中的基础概念,也被广泛的应用到了其他的领域中,比如机器学习。如果跳出历史语境,跳出逻辑背景,那么这些概念是很抽象的,所以本 旨在结合历史语境,给这些概念提供一个相对直观的解...
  <textarea class="comment-content" name="comment_content" id="comment_content" placeholder="优质评论可以帮助作者获得更高权重" maxlength="1000"></textarea>
		<div class="comment-emoticon"><img class="comment-emoticon-img" data-url="https://csdnimg.cn/release/blogv2/dist/pc/img/" src="https://csdnimg.cn/release/blogv2/dist/pc/img/emoticon.png" alt="表情包"></div> 
  <span class="comment-emoticon-tip">插入表情</span>
  <div class="comment-emoticon-box" style="display: none;">
    <div class="comment-emoticon-img-box">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:001.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/001.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:002.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/002.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:003.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/003.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:004.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/004.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:005.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/005.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:006.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/006.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:007.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/007.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:008.png[/face]" src="https://i-blog.csdnimg.cn/blog_migrate/27c20afc0e17c9b94fdf931b1b2a13f0.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:009.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/009.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:010.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/010.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:011.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/011.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:012.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/012.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:013.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/013.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:014.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/014.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:015.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/015.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:016.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/016.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:017.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/017.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:018.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/018.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:019.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/019.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:020.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/020.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:021.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/021.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:022.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/022.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:023.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/023.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:024.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/024.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:025.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/025.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:026.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/026.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:027.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/027.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:028.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/028.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:029.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/029.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:030.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/030.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:031.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/031.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:032.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/032.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:033.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/033.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:034.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/034.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:035.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/035.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:036.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/036.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:037.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/037.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:038.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/038.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:039.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/039.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:040.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/040.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:041.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/041.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:042.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/042.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:043.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/043.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:044.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/044.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:045.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/045.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:046.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/046.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:047.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/047.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:048.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/048.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:049.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/049.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:050.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/050.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:051.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/051.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:052.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/052.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:053.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/053.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:054.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/054.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:055.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/055.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:056.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/056.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:057.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/057.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:058.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/058.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:059.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/059.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:060.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/060.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:061.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/061.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:062.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/062.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:063.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/063.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:064.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/064.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:065.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/065.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:066.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/066.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:067.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/067.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:068.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/068.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:069.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/069.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:070.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/070.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:071.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/071.png">
        <img class="emoticon-monkey-img" data-emoticon="[face]emoji:072.png[/face]" src="https://g.csdnimg.cn/static/face/emoji/072.png">
    </div>
  </div>
  <div class="opt-box">
			<div id="ubbtools" class="add_code">
				<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
			</div>
			<input type="hidden" id="comment_replyId" name="comment_replyId">
			<input type="hidden" id="article_id" name="article_id" value="105704098">
			<input type="hidden" id="comment_userId" name="comment_userId" value="">
			<input type="hidden" id="commentId" name="commentId" value="">
			<div class="dropdown" id="myDrap">
				<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
					<div class="txt-selected text-truncate">添加代码片</div>
					<svg class="icon d-block" width="200px" height="100.00px" viewBox="0 0 2048 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M597.33333292 298.666667h853.333334L1023.99999992 725.333333 597.33333292 298.666667z"></path></svg>
				</a>
				<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
					<li><a data-code="html">HTML/XML</a></li>
					<li><a data-code="objc">objective-c</a></li>
					<li><a data-code="ruby">Ruby</a></li>
					<li><a data-code="php">PHP</a></li>
					<li><a data-code="csharp">C</a></li>
					<li><a data-code="cpp">C++</a></li>
					<li><a data-code="javascript">JavaScript</a></li>
					<li><a data-code="python">Python</a></li>
					<li><a data-code="java">Java</a></li>
					<li><a data-code="css">CSS</a></li>
					<li><a data-code="sql">SQL</a></li>
					<li><a data-code="plain">其它</a></li>
				</ul>
			</div>
			<div class="right-box" id="rightBox" data-type="2">
						<span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
						<a data-report-click="{&quot;mod&quot;:&quot;1582594662_003&quot;,&quot;spm&quot;:&quot;1001.2101.3001.4227&quot;,&quot;ab&quot;:&quot;new&quot;}"><input type="submit" class="btn btn-sm btn-comment" value="发表评论"></a>
			</div>
		</div>
	</form>
	<input type="button" class="bt-comment-show" value="评论">
</div>
<div class="comment-list-container" style="display: block;">
	<a id="comments"></a>
	<div class="comment-list-box"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="15235812" data-replyname="FlappyCD"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/FlappyCD"><img src="https://profile.csdnimg.cn/0/D/9/3_flappycd" username="FlappyCD" alt="FlappyCD" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/FlappyCD"><span class="name ">FlappyCD</span></a><span class="colon">:</span><span class="floor-num"></span><span class="new-comment">支持</span><span class="date" title="2021-03-03 17:32:58">4 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15235812"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span>1</span></div></div></div></li><li class="replay-box" style="display:block"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="16934220" data-replyname="qq_35624030"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_35624030"><img src="https://profile.csdnimg.cn/7/5/3/3_qq_35624030" username="qq_35624030" alt="qq_35624030" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_35624030"><span class="name mr-8">StudentWang_<img class="is_bloger" src="https://csdnimg.cn/release/blogv2/dist/components/img/bloger@2x.png"></span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">感谢支持</span><span class="date" title="2021-06-10 13:10:11">1 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="16934220"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="comment-line-box d-flex" data-commentid="15377818" data-replyname="qq_35624030"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_35624030"><img src="https://profile.csdnimg.cn/7/5/3/3_qq_35624030" username="qq_35624030" alt="qq_35624030" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_35624030"><span class="name mr-8">StudentWang_<img class="is_bloger" src="https://csdnimg.cn/release/blogv2/dist/components/img/bloger@2x.png"></span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">非常感谢!</span><span class="date" title="2021-03-11 19:13:35">4 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15377818"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li></ul></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="12002481" data-replyname="m0_37422217"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/m0_37422217"><img src="https://profile.csdnimg.cn/B/2/A/3_m0_37422217" username="m0_37422217" alt="m0_37422217" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/m0_37422217"><span class="name ">安财小山羊</span></a><span class="colon">:</span><span class="floor-num"></span><span class="new-comment">写的很棒,很有收获</span><span class="date" title="2020-04-24 12:52:44">1 年前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="12002481"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span>1</span></div></div></div></li><li class="replay-box" style="display:block"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="12002566" data-replyname="qq_35624030"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_35624030"><img src="https://profile.csdnimg.cn/7/5/3/3_qq_35624030" username="qq_35624030" alt="qq_35624030" class="avatar"></a>        <div class="right-box reply-box">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_35624030"><span class="name mr-8">StudentWang_<img class="is_bloger" src="https://csdnimg.cn/release/blogv2/dist/components/img/bloger@2x.png"></span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">感谢支持</span><span class="date" title="2020-04-24 13:02:36">1 年前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="12002566"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li></ul></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="17648755" data-replyname="m0_52402667"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/m0_52402667"><img src="https://profile.csdnimg.cn/5/D/0/3_m0_52402667" username="m0_52402667" alt="m0_52402667" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/m0_52402667"><span class="name ">2002小雨点</span></a><span class="colon">:</span><span class="floor-num"></span><span class="new-comment">感谢博主,解释的很清晰</span><span class="date" title="2021-07-22 16:10:49">24 分钟前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="17648755"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="16800273" data-replyname="qq_45704942"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_45704942"><img src="https://profile.csdnimg.cn/4/9/2/3_qq_45704942" username="qq_45704942" alt="qq_45704942" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_45704942"><span class="name ">敲代码的小提琴手</span></a><span class="colon">:</span><span class="floor-num"></span><span class="new-comment">这个决策树的引出 妙啊<img src="//g.csdnimg.cn/static/face/emoji/003.png" alt="表情包"></span><span class="date" title="2021-06-03 13:07:39">1 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="16800273"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="replay-box" style="display:block"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="16850280" data-replyname="qq_35624030"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_35624030"><img src="https://profile.csdnimg.cn/7/5/3/3_qq_35624030" username="qq_35624030" alt="qq_35624030" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_35624030"><span class="name mr-8">StudentWang_<img class="is_bloger" src="https://csdnimg.cn/release/blogv2/dist/components/img/bloger@2x.png"></span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">感谢支持</span><span class="date" title="2021-06-06 10:13:34">1 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="16850280"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li></ul></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="15931033" data-replyname="qq_42018029"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_42018029"><img src="https://profile.csdnimg.cn/F/9/C/3_qq_42018029" username="qq_42018029" alt="qq_42018029" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_42018029"><span class="name ">6qishi</span></a><span class="colon">:</span><span class="floor-num"></span><span class="new-comment">谢谢作者,一下就搞明白了<img src="//g.csdnimg.cn/static/face/monkey2/003.png" alt="表情包"></span><span class="date" title="2021-04-14 21:15:53">3 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15931033"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="replay-box" style="display:block"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="15948388" data-replyname="qq_35624030"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_35624030"><img src="https://profile.csdnimg.cn/7/5/3/3_qq_35624030" username="qq_35624030" alt="qq_35624030" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_35624030"><span class="name mr-8">StudentWang_<img class="is_bloger" src="https://csdnimg.cn/release/blogv2/dist/components/img/bloger@2x.png"></span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">能帮到你就很好了~加油</span><span class="date" title="2021-04-15 20:51:20">3 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15948388"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li></ul></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="15588525" data-replyname="qinghuanduji"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qinghuanduji"><img src="https://profile.csdnimg.cn/2/0/9/3_qinghuanduji" username="qinghuanduji" alt="qinghuanduji" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qinghuanduji"><span class="name ">人间不想清醒</span></a><span class="colon">:</span><span class="floor-num"></span><span class="new-comment">博主太强了,解释的很清楚,小白想请教一下比如排列熵这些是不是信息熵的一种呀,该怎么查找这些熵资料呢(感觉都无从获得不同熵的名字来进行查找)</span><span class="date" title="2021-03-24 16:07:28">4 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15588525"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="replay-box" style="display:block"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="15887145" data-replyname="qinghuanduji"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qinghuanduji"><img src="https://profile.csdnimg.cn/2/0/9/3_qinghuanduji" username="qinghuanduji" alt="qinghuanduji" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qinghuanduji"><span class="name mr-8">人间不想清醒</span></a><span class="text">回复</span><span class="nick-name">Zhi Zhao</span><span class="colon">:</span><span class="text"></span><span class="new-comment">马上到,大佬<img src="//g.csdnimg.cn/static/face/monkey2/002.png" alt="表情包"></span><span class="date" title="2021-04-12 15:45:05">3 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15887145"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="comment-line-box d-flex" data-commentid="15878833" data-replyname="weixin_45317919"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/weixin_45317919"><img src="https://profile.csdnimg.cn/D/3/8/3_weixin_45317919" username="weixin_45317919" alt="weixin_45317919" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/weixin_45317919"><span class="name mr-8">Zhi Zhao</span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">来我的主页看看吧<img src="//g.csdnimg.cn/static/face/monkey2/004.png" alt="表情包">,有各种熵的讲解</span><span class="date" title="2021-04-12 07:59:26">3 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15878833"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="comment-line-box d-flex" data-commentid="15593056" data-replyname="qinghuanduji"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qinghuanduji"><img src="https://profile.csdnimg.cn/2/0/9/3_qinghuanduji" username="qinghuanduji" alt="qinghuanduji" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qinghuanduji"><span class="name mr-8">人间不想清醒</span></a><span class="text">回复</span><span class="nick-name">StudentWang_</span><span class="colon">:</span><span class="text"></span><span class="new-comment">好的,谢谢博主的回复</span><span class="date" title="2021-03-24 20:35:44">4 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15593056"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="comment-line-box d-flex" data-commentid="15590387" data-replyname="qq_35624030"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_35624030"><img src="https://profile.csdnimg.cn/7/5/3/3_qq_35624030" username="qq_35624030" alt="qq_35624030" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_35624030"><span class="name mr-8">StudentWang_<img class="is_bloger" src="https://csdnimg.cn/release/blogv2/dist/components/img/bloger@2x.png"></span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">不好意思哈。我本身并不是做这块的,只是用到了信息熵所以学了一下。对于信息论的这些并不是很清楚,可以看看知乎、CSDN上其他博主的学习路线</span><span class="date" title="2021-03-24 17:28:23">4 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15590387"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li></ul></li></ul><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="15515215" data-replyname="Java_Development_Kit"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/Java_Development_Kit"><img src="https://profile.csdnimg.cn/E/E/E/3_java_development_kit" username="Java_Development_Kit" alt="Java_Development_Kit" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/Java_Development_Kit"><span class="name ">原来很简单</span></a><span class="colon">:</span><span class="floor-num"></span><span class="new-comment">这个公式妙啊<img src="//g.csdnimg.cn/static/face/monkey2/057.png" alt="表情包"></span><span class="date" title="2021-03-19 19:16:48">4 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15515215"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li><li class="replay-box" style="display:block"><ul class="comment-list"><li class="comment-line-box d-flex" data-commentid="15590365" data-replyname="qq_35624030"><div style="display: flex;width: 100%;">      <a target="_blank" href="https://blog.csdn.net/qq_35624030"><img src="https://profile.csdnimg.cn/7/5/3/3_qq_35624030" username="qq_35624030" alt="qq_35624030" class="avatar"></a>        <div class="right-box ">          <div class="new-info-box clearfix">            <a target="_blank" href="https://blog.csdn.net/qq_35624030"><span class="name mr-8">StudentWang_<img class="is_bloger" src="https://csdnimg.cn/release/blogv2/dist/components/img/bloger@2x.png"></span></a><span class="text">回复</span><span class="colon">:</span><span class="text"></span><span class="new-comment">是的~细细品味很有意思</span><span class="date" title="2021-03-24 17:27:38">4 月前</span><span class="new-opt-floating"><a class="btn-bt  btn-reply" data-type="reply" data-flag="true">回复</a><a class="btn-bt  btn-report"><img class="btn-report-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentMore.png" title=""><span data-type="report" class="hide-report">举报</span></a></span></div><div class="comment-like " data-commentid="15590365"><img class="comment-like-img unclickImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentUnHeart.png" title="点赞"><img class="comment-like-img comment-like-img-hover" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><img class="comment-like-img clickedImg" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentActiveHeart.png" title="点赞"><span></span></div></div></div></li></ul></li></ul></div>
	<div id="commentPage" class="pagination-box d-none" style="display: block;"><div id="Paging_04570656664931554" class="ui-paging-container"><ul><li class="js-page-first js-page-action ui-pager ui-pager-disabled"></li><li class="js-page-prev js-page-action ui-pager ui-pager-disabled">&lt;</li><li data-page="1" class="ui-pager focus">1</li><li class="js-page-next js-page-action ui-pager ui-pager-disabled">&gt;</li><li class="js-page-last js-page-action ui-pager ui-pager-disabled"></li></ul></div></div>
	
</div>
相关推荐
信息熵(entropy)的 理解_hahaxq的博客
7-13
最近在看数据挖掘的内容,看视频的时候,里面讲到了一些 信息熵的东西,突然让我对于之前 信息熵的迷惑瞬间消散。写这个的目的只是抛砖引玉,辅助看到 信息熵的朋友加深一点点…点. 理解,水平实在有限,尽量保证正确 ...
(十一)通俗易懂 理解—— 信息熵_Dreamdreams8的博客
6-27
因此,也就引出了最大熵模型的 本质,它要解决的问题就是已知X,计算Y的概率,且尽可能让Y的概率最大(实践中,X可能是某单词的上下 信息,Y是该单词翻译成me,I,us、we的各自概率),从而根据已有信息,尽可能最准确的推测未知信息,这就是...
在热工领域,熵是衡量体系混乱度的参数。越混乱,熵越大,反之则熵越小。 信息熵则应该是借鉴了熵的定义,用于去衡量一个事件所携带的信息的混乱性。实质就是根据一个事件发生的概率来衡量对该事件背后信息的揭示程度。例如,当发生概率为1时(认定事件百分之百发生),那么无论重复多少次该事件,该事件都会发生,那么可以认定我们对该事件背后隐藏的信息已经了如指掌,即该事件的 信息熵为0(事件背后的信息很清晰,一点都不混乱...
信息是个很抽象的概念。人们常常说信息很多,或者信息较少,但却很难说清楚信息到底有多少。比如一本五十万字的中 书到底有多少信息量。直到1948年,香农提出了“ 信息熵”的概念,才解决了对信息的量化度量问题。    公式为:H(x)=E[I(xi)]=E[ log(2,1/p(xi)) ]=-∑p(xi)log(2,p(xi)) (i=1,2,..n)该值越大表示信息量越大    在一个系统中,该系
一看就懂的 信息熵_weixin_46570773的博客
6-19
其他平台(知乎/B站)也是同名「图灵的猫」,不要迷路哦~ 图和... 一 看懂 信息熵本质—— 谈谈自己对 信息熵理解 qq_35624030的博客 2712
信息熵理解_CYJ2014go的博客
6-19
信息熵理解 信息熵理解及推导过程 cjh_jinduoxia的博客 8272 信息量 理解信息熵公式的推导 爱学习的大孩子 1万+
信息熵的公式

先抛出信息熵公式如下:

其中P(xi)代表随机事件X为xi的概率,下面来逐步介绍信息熵的公式来源!

2  信息量

信息量是对信息的度量,就跟时间的度量是秒一样,当我们考虑一个离散的随机变量x的时候,当我们观察到的这个变量的一个具体值的时候,我们接收到了多少信息呢?

多少信息用信息量来衡


在补《 信息熵基础》,此书理论清晰,后面还有一堆要命的习题,加深 理解和应用,实乃佳作。其中一些题目对我来说确实不易,记录巩固一下,也和大家交流一下。 章目录一、硬币称重问题描述二、解答2.1第一问2.2第二问2.1.1第一次称重方案2.1.2 最后一次称重方案2.1.3 第二次称重方案2.1.3.1 相等2.1.3.2 不相等三、总结四、参考 献 一、硬币称重问题描述

n枚硬币,可能有一枚假币,…


点击上方“潜心的Python小屋”关注我们,第一时间推送优质 章。前言大家好,我是潜心。休整(偷懒)一星期后,我决定还是写一些关于机器学习的笔记,单纯写Python 档确实有点无聊。因为...
信息是我们一直在谈论的东西,但信息这个概念本身依然比较抽象。在百度百科中的定义:信息,泛指人类社会传播的一切内容,指音讯、消息、通信系统传输和处理的对象。

但信息可不可以被量化,怎样量化?答案当然是有的,那就是“信息熵”。早在1948年,香农(Shannon)在他著名的《通信的数学原理》论中指出:“信息是用来消除随机不确定性的东西”,并提出了“信息熵”的概念(借用了热力学中熵的概念),来解


一.决策树

二.信息熵

三.基尼系数

四.CART与超参数

五.决策树解决回归问题

一.决策树

决策树(Decision Tree)是在已知各种情况发生概率的基础上,通过构成决策树来求取净现值的期望值大于等于零的概率,评价项目风险,判断其可行性的决策分析方法,是直观运用概率分析的一种图解法。

sklearn中调用决策树

from sklearn.tree import De…


<br />摘自:http://www.wljx.sdu.edu.cn/wlwz/reading/r_infor/shang7.htm<br /> <br />在很多情况下,对一些随机事件,我们并不了解其概率分布,所掌握的只是与随机事件有关的一个或几个随机变量的平均值。<br />按最大 信息熵原理,我们从全部相容的分布中挑选这样的分布,它是在某些约束条件下(通常是给定的某些随机变量的平均值)使 信息熵达到极大值的分布。这一原理是由杨乃斯提出的。这是因为 信息熵取得极大值时对应的一组概率分布出现的概率占绝对优势。
熵在 信息论中的定义如下:    如果有一个系统S内存在多个事件S = {E1,...,En}, 每个事件的机率分布 P = {p1, ..., pn},则每个事件本身的讯息为    Ie = − log2pi   (对数以2为底,单位是位元(bit))    Ie = − lnpi   (对数以e为底,单位是纳特/nats)    如英语有26个字母,假如每个字母在 章中出现次数平均的话,
用matlab写的一个求决策属性 信息熵的小程序
上次说了有关熵、条件熵、相对熵、互信息的概念及其之间的关系。为了更好的了解熵,这次谈一谈熵的通俗 理解。1. 公式及其含义 2.信息量 3. 由信息量想到的 4. 信息熵 1. 公式及其含义熵的公式:熵的含义:样本集合不纯度,熵越小,集合不纯度越低; 知识的不确定性,熵越小,不确定性越小; 系统的复杂度,熵越大,系统越复杂。(系统越复杂,出现不同情况越多,信息量越大,熵越大。)2.
熵的概念是由德国物理学家克劳修斯于1865年所提出。熵最初是被用在热力学方面的,由热力学第二定律可以推出熵增的结论,然后熵是用来对一个系统可以达到的状态数的一个度量,能达到的状态数越多熵越大。 信息熵也基本是很类似的,是香农1948年的一篇论 《A Mathematical Theory of Communication》提出了 信息熵的概念,并且以后 信息论也被作为一门单独的学科。

信息


—  主要内容 1.       信源的分类与描述 2.       离散信源的 信息熵和互信息 3.       离散序列信源的熵 4.       连续信源的熵与互信息 5.       冗余度 2.1 信源的分类与描述 —  信源的定义 产生消息(符号)、消息序列和连续消息的来源。 信源的基本特性是具有随机不确定性 l  分类 1.       时间          
仅仅是我个人的 理解,发现错误请告诉我一下。

前几天虽然看完了吴军先生的《数学之美》,但一直搞不懂信息熵所以连带着也没搞懂 最大熵的原理,直到今天白天看了TopLanguage的一个讨论信息论的帖子
再经过晚上散步时思考才顿悟信息熵的意义。

信息是个很抽象的概念。人们常常说信息很多,或者信息较少,但却很难说清楚信息到底有多少。比如一本五十万字的中书到底有多少信息量…


本人并没有真正接触过 信息论,对 信息熵也只能算是道听途说,但是基于对《信号与系统》这个学科的兴趣和 理解力,本人惊叹 信息熵的实用性,经常以理论指引的方式用于物理理论的 理解和算法的通俗化思考。比如,本人写过的《压缩算法引申》。 信息熵可以称得上伟大的论著,对很多领域的现象都能给予很好的概括性论述。   信息熵的直观 理解     要 理解 信息熵,其实并不难,因为生活中无处不是 信息熵的体现。比如,假设你是
http://blog.csdn.net/pipisorry/article/details/51695283

这篇章主要讲:熵, 联合熵(joint entropy),条件熵(conditional entropy),相对熵(relative entropy,KL 距离),互信息(mutual information),交叉熵(cross entropy),困惑度(perplexity)。



熵,是一个热力学的概念。但在历史的发展中,造就了它非常丰富的内涵,进入了很多学科的视野。本 会在数理层面对它进行一个解读,厘清它在逻辑上到底是什么。

1 混乱的熵

很多科普章中,都提到熵是用来度量混乱的。比如下面这幅动图,单词“Entropy”(熵的英)可见的时候,熵最小,这个时候最有秩序;而被打乱的时候,熵开始增大,直到最后一片混乱,熵变成最大:

熵之所以很重要,是因为它总结了宇宙…


信息熵、相对熵理论定义阐述。
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值