preproc.py 文件源码

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

项目:Lyssandra 作者: ektormak 项目源码 文件源码
def fit(self, X, y=None):
        # X = array2d(X)
        n_samples, n_features = X.shape
        X = as_float_array(X, copy=self.copy)
        # substracts the mean for each feature vector
        self.mean_ = np.mean(X, axis=0)
        X -= self.mean_
        eigs, eigv = eigh(np.dot(X.T, X) / n_samples + \
                          self.bias * np.identity(n_features))
        components = np.dot(eigv * np.sqrt(1.0 / eigs), eigv.T)
        self.components_ = components
        # Order the explained variance from greatest to least
        self.explained_variance_ = eigs[::-1]
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号