def _calculate(self, X, y, categorical, metafeatures, helpers):
import sklearn.decomposition
pca = sklearn.decomposition.PCA(copy=True)
rs = np.random.RandomState(42)
indices = np.arange(X.shape[0])
for i in range(10):
try:
rs.shuffle(indices)
pca.fit(X[indices])
return pca
except LinAlgError as e:
pass
self.logger.warning("Failed to compute a Principle Component Analysis")
return None
评论列表
文章目录