吴裕雄 python 机器学习——超大规模数据集降维IncrementalPCA模型
# -*- coding: utf-8 -*- import numpy as np
import matplotlib.pyplot as plt from sklearn import datasets,decomposition def load_data():
'''
加载用于降维的数据
'''
# 使用 scikit-learn 自带的 iris 数据集
iris=datasets.load_iris()
return iris.data,iris.target #超大规模数据集降维IncrementalPCA模型
def test_IncrementalPCA(*data):
X,y=data
# 使用默认的 n_components
pca=decomposition.IncrementalPCA(n_components=None,batch_size=10)
pca.partial_fit(X)
aa = pca.transform(X)
print('explained variance ratio : %s'% str(pca.explained_variance_ratio_))
print(pca.n_components_)
print(aa) # 产生用于降维的数据集
X,y=load_data()
# 调用 test_IncrementalPCA
test_IncrementalPCA(X,y)

吴裕雄 python 机器学习——超大规模数据集降维IncrementalPCA模型的更多相关文章
- 吴裕雄 python 机器学习——K均值聚类KMeans模型
import numpy as np import matplotlib.pyplot as plt from sklearn import cluster from sklearn.metrics ...
- 吴裕雄 python 机器学习——混合高斯聚类GMM模型
import numpy as np import matplotlib.pyplot as plt from sklearn import mixture from sklearn.metrics ...
- 吴裕雄 python 机器学习——支持向量机线性分类LinearSVC模型
import numpy as np import matplotlib.pyplot as plt from sklearn import datasets, linear_model,svm fr ...
- 吴裕雄 python 机器学习——数据预处理流水线Pipeline模型
from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn import neighbor ...
- 吴裕雄 python 机器学习——数据预处理正则化Normalizer模型
from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3, ...
- 吴裕雄 python 机器学习——数据预处理标准化MaxAbsScaler模型
from sklearn.preprocessing import MaxAbsScaler #数据预处理标准化MaxAbsScaler模型 def test_MaxAbsScaler(): X=[[ ...
- 吴裕雄 python 机器学习——数据预处理标准化StandardScaler模型
from sklearn.preprocessing import StandardScaler #数据预处理标准化StandardScaler模型 def test_StandardScaler() ...
- 吴裕雄 python 机器学习——数据预处理标准化MinMaxScaler模型
from sklearn.preprocessing import MinMaxScaler #数据预处理标准化MinMaxScaler模型 def test_MinMaxScaler(): X=[[ ...
- 吴裕雄 python 机器学习——数据预处理字典学习模型
from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型 def test_Diction ...
随机推荐
- [HNOI2003] 消防局的设立 - 树形dp
仍然是点覆盖集问题,但覆盖半径变成了\(2\) 延续上一题的思路,只是式子更加复杂了 想体验一下min_element大法于是不想优化了 #include <bits/stdc++.h> ...
- PP: Neural ordinary differential equations
Instead of specifying a discrete sequence of hidden layers, we parameterize the derivative of the hi ...
- (转)java中新生代和老年代
转自:http://blog.csdn.net/lojze_ly/article/details/49456255 聊聊JVM的年轻代 1.为什么会有年轻代 我们先来屡屡,为什么需要把堆分代?不分代不 ...
- 走进电影院观看VTK
VTK影院模型: 从这个模型去介绍VTK的应用,整个电影院就是VTK的显示窗口(vtkRenderWindow),舞台就是VTK的渲染场景(vtkRenderer),场景中有不同的演员就是VTK的各种 ...
- AntDesign(React)学习-1 创建环境
目录: AntDesign(React)学习-15 组件定义.connect.interface AntDesign(React)学习-14 使用UMI提供的antd模板 AntDesign(Reac ...
- K3修改字段名
在K3的BOS中,自定义字段之后我们往往会修改字段名,便于记忆和理解,但是修改字段名之后,只是数据库中的字段名被修改了,BOS中的字段标识并没有被修改,可以通过以下语句将标识和字段名改成一致. sel ...
- PP: Composite visual mapping for time series visualization
However: The conventional visual mapping maps each data attribute onto a single visual channel Purpo ...
- war文件—Web项目部署
war文件是什么? Web存档(war)文件包含Web应用程序的所有内容.它减少了传输文件所需要的时间. war文件的优点 节省时间:war文件将所有文件合并为一个单位. 所以在将文件从客户端传输到 ...
- VS2015+EF+MySql问题
1.出现框架不兼容问题: 解决方法:a.在web.config或者app.config中加入所示代码: b.引用mysqlConnector.net中的所有dll,一般路径在D:\Program Fi ...
- WEB-INF目录与META-INF目录的作用(转载)
/WEB-INF/web.xml Web应用程序配置文件,描述了 servlet 和其他的应用组件配置及命名规则. /WEB-INF/classes/包含了站点所有用的 class 文件,包括 ser ...