MinMaxScaler.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:AutoML-Challenge 作者: postech-mlg-exbrain 项目源码 文件源码
def transform(self, X):
        """Scaling features of X according to feature_range.

        Parameters
        ----------
        X : array-like with shape [n_samples, n_features]
            Input data that will be transformed.
        """
        check_is_fitted(self, 'scale_')

        X = check_array(X, accept_sparse="csc", copy=self.copy,
                        dtype=np.float32)

        if sparse.issparse(X):
            for i in range(X.shape[1]):
                X.data[X.indptr[i]:X.indptr[i + 1]] *= self.scale_[i]
                X.data[X.indptr[i]:X.indptr[i + 1]] += self.min_[i]
        else:
            X *= self.scale_
            X += self.min_
        return X
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号