<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      理解 sklearn.preprocessing.MinMaxScaler

      公式

      非常有用的工具,可以把數據集的不同特征縮放到固定范圍。

      先從簡單的說起,[0,1]縮放,公式

      \(X_{scaled} = \frac{x-x_{min}}{x_{max}-x_{min}}\)

      MinMaxScaler可以縮放到任意范圍[MIN,MAX],因此更一般化的公式是

      \(X_{std} = \frac{x-x_{min}}{x_{max}-x_{min}}\)
      \(X_{scaled} = \frac{X_{std}}{MAX-MIN} + MIN\)

      \(MIN\)\(MAX\)為0和1時,公式等價于[0,1]縮放。

      代碼

      再來看源代碼。

      def transform(self, X):
              """Scale features of X according to feature_range.
              Parameters
              ----------
              X : array-like of shape (n_samples, n_features)
                  Input data that will be transformed.
              Returns
              -------
              Xt : array-like of shape (n_samples, n_features)
                  Transformed data.
              """
              check_is_fitted(self)
      
              X = check_array(X, copy=self.copy, dtype=FLOAT_DTYPES,
                              force_all_finite="allow-nan")
      
              X *= self.scale_
              X += self.min_
              return X
      
      """
          min_ : ndarray of shape (n_features,)
              Per feature adjustment for minimum. Equivalent to
              ``min - X.min(axis=0) * self.scale_``
          scale_ : ndarray of shape (n_features,)
              Per feature relative scaling of the data. Equivalent to
              ``(max - min) / (X.max(axis=0) - X.min(axis=0))``
              .. versionadded:: 0.17
                 *scale_* attribute.
          data_min_ : ndarray of shape (n_features,)
              Per feature minimum seen in the data
              .. versionadded:: 0.17
                 *data_min_*
          data_max_ : ndarray of shape (n_features,)
              Per feature maximum seen in the data
              .. versionadded:: 0.17
                 *data_max_*
      """
      

      這里的scale_相當于\(\frac{MAX-MIN}{x_{max}-x_{min}}\),所以min_相當于\(MIN-x_{min}*\frac{MAX-MIN}{x_{max}-x_{min}}\),這兩個參數主要是方便以下逆變換

          def inverse_transform(self, X):
              """Undo the scaling of X according to feature_range.
              Parameters
              ----------
              X : array-like of shape (n_samples, n_features)
                  Input data that will be transformed. It cannot be sparse.
              Returns
              -------
              Xt : array-like of shape (n_samples, n_features)
                  Transformed data.
              """
              check_is_fitted(self)
      
              X = check_array(X, copy=self.copy, dtype=FLOAT_DTYPES,
                              force_all_finite="allow-nan")
      
              X -= self.min_
              X /= self.scale_
              return X
      
      posted @ 2020-12-03 22:29  2021年的順遂平安君  閱讀(1595)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 国产一区二区三区亚洲精品| 亚洲男人AV天堂午夜在| 亚洲av第二区国产精品| 九九re线精品视频在线观看视频| 99精品热在线在线观看视| 亚洲一区二区中文av| 国产又黄又爽又不遮挡视频| 国产精品免费中文字幕| 亚洲av高清一区二区三| 超碰成人人人做人人爽| 久久精品国产亚洲av麻豆小说| 国产一区二区三区十八禁| 国产精品久久久久aaaa| 亚洲精品美女一区二区| 亚洲天码中文字幕第一页| 国产福利萌白酱在线观看视频| 婷婷五月综合丁香在线| 四虎在线成人免费观看| 玉门市| 国产深夜福利视频在线| 欧美极品色午夜在线视频| 波多野结衣乳喷高潮视频| 国产美女久久久亚洲综合| 国产免费无遮挡吃奶视频| 人妻激情另类乱人伦人妻| 深夜福利成人免费在线观看| 精品国产精品中文字幕| 福州市| 亚洲国产一区二区三区亚瑟| 安乡县| 在线中文字幕国产一区| 亚洲国产欧美一区二区好看电影| 亚洲男女内射在线播放| 国产一区国产二区在线视频| 久久99久国产精品66| 国产无遮挡吃胸膜奶免费看 | 日韩放荡少妇无码视频| 亚洲人妻精品中文字幕| 一区二区三区一级黄色片| 99久久国产露脸国语对白| 亚洲国产一区二区三区最新|