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)
评论列表
文章目录