<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 方差閾值 > `VarianceThreshold`是一種簡單的特征選擇基線方法。它會刪除方差不符合某個閾值的所有要素。默認情況下,它會刪除所有零方差要素,即在所有樣本中具有相同值的要素。 ### 構造函數參數 `$threshold`(float) - 方差低于此閾值的要素將被刪除(默認為0.0) ``` use Phpml\FeatureSelection\VarianceThreshold; $transformer = new VarianceThreshold(0.15); ``` ***** ### 使用示例 例如,假設我們有一個具有布爾特征的數據集,并且我們希望刪除80%以上樣本中的一個或零(打開或關閉)的所有特征。布爾特征是伯努利隨機變量,這些變量的方差由下式給出 ``` Var\[X\] = p(1 - p) ``` 所以我們可以選擇使用閾值.8 *(1 - .8): ``` use Phpml\FeatureSelection\VarianceThreshold; $samples = [[0, 0, 1], [0, 1, 0], [1, 0, 0], [0, 1, 1], [0, 1, 0], [0, 1, 1]]; $transformer = new VarianceThreshold(0.8 * (1 - 0.8)); $transformer->fit($samples); $transformer->transform($samples); /* $samples = [[0, 1], [1, 0], [0, 0], [1, 1], [1, 0], [1, 1]]; */ ``` ## Pipeline `VarianceThreshold`實現了`Transformer`接口,因此它可以用作`pipeline`的一部分: ``` use Phpml\FeatureSelection\VarianceThreshold; use Phpml\Classification\SVC; use Phpml\FeatureExtraction\TfIdfTransformer; use Phpml\Pipeline; $transformers = [ new TfIdfTransformer(), new VarianceThreshold(0.1) ]; $estimator = new SVC(); $pipeline = new Pipeline($transformers, $estimator); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看