本文整理汇总了Python中sklearn.decomposition.PCA.noise_variance_方法的典型用法代码示例。如果您正苦于以下问题:Python PCA.noise_variance_方法的具体用法?Python PCA.noise_variance_怎么用?Python PCA.noise_variance_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.decomposition.PCA
的用法示例。
在下文中一共展示了PCA.noise_variance_方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load
# 需要导入模块: from sklearn.decomposition import PCA [as 别名]
# 或者: from sklearn.decomposition.PCA import noise_variance_ [as 别名]
def load(self, filename='pca.nc'):
"""
Read sklearn PCA parameters from a netcdf file
"""
infile = netCDF4.Dataset(filename, 'r')
self.locations = [json.loads(string) for string in list(infile.variables['location'])]
self.pcas = []
id = 0
for location in self.locations:
n_components = infile.variables['n_components'][id]
components = infile.variables['components'][id]
mean = infile.variables['means'][id]
explained_variance_ratio = infile.variables['explained_variance_ratio'][id]
noise_variance = infile.variables['noise_variance'][id]
pca = PCA(n_components=n_components)
pca.components_ = components
pca.mean_ = mean
pca.explained_variance_ratio_ = explained_variance_ratio
pca.noise_variance_ = noise_variance
self.pcas.append(pca)
id += 1