upca.py 文件源码

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

项目:UVA 作者: chiachun 项目源码 文件源码
def fit(self, X, STANDARDIZE=True, n=10):
      if not isinstance(X, np.ndarray):
          X =  to_array(X)
      assert(X.ndim == 2), "Input array must have two dimensions."
      if not check_standardized(X):
          if STANDARDIZE:
              X = preprocessing.scale(X)
              print "Standardize input data for fit."
          else:
              print "WARNING: data is not standardized and you switch off STANDARDIZE option.",
              print "Make sure this is what you intended."
      self.model = PCA(n_components=n)
      self.model.fit(X)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号