# -*- 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模型的更多相关文章

  1. 吴裕雄 python 机器学习——K均值聚类KMeans模型

    import numpy as np import matplotlib.pyplot as plt from sklearn import cluster from sklearn.metrics ...

  2. 吴裕雄 python 机器学习——混合高斯聚类GMM模型

    import numpy as np import matplotlib.pyplot as plt from sklearn import mixture from sklearn.metrics ...

  3. 吴裕雄 python 机器学习——支持向量机线性分类LinearSVC模型

    import numpy as np import matplotlib.pyplot as plt from sklearn import datasets, linear_model,svm fr ...

  4. 吴裕雄 python 机器学习——数据预处理流水线Pipeline模型

    from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn import neighbor ...

  5. 吴裕雄 python 机器学习——数据预处理正则化Normalizer模型

    from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3, ...

  6. 吴裕雄 python 机器学习——数据预处理标准化MaxAbsScaler模型

    from sklearn.preprocessing import MaxAbsScaler #数据预处理标准化MaxAbsScaler模型 def test_MaxAbsScaler(): X=[[ ...

  7. 吴裕雄 python 机器学习——数据预处理标准化StandardScaler模型

    from sklearn.preprocessing import StandardScaler #数据预处理标准化StandardScaler模型 def test_StandardScaler() ...

  8. 吴裕雄 python 机器学习——数据预处理标准化MinMaxScaler模型

    from sklearn.preprocessing import MinMaxScaler #数据预处理标准化MinMaxScaler模型 def test_MinMaxScaler(): X=[[ ...

  9. 吴裕雄 python 机器学习——数据预处理字典学习模型

    from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型 def test_Diction ...

随机推荐

  1. eclipse中配置maven环境

    一.配置setting.xml文件 1.首先将下载好的maven打开,打开文件夹,首先就需要对maven安装目录下有个config文件夹,在文件夹下有settings.xml文件.settings里面 ...

  2. 数字输出精度 - C语言

    1. 浮点型/双精度浮点型 double a=1234.5678; printf("%8.2lf\n",a);// 小数点前的数表示总位数,小数点也算一位 printf(" ...

  3. HTML页面学习

    HTML 文档结构 <!DOCTYPE html> 文档声明 <html lang="en"> 语言 <head> 网站配置信息 <met ...

  4. linux 关键字搜索文件

    在www目录下查找包含关键字’summer’,且后缀名为php文件的操作命令 find /www/ -name '*.php' |xargs grep '/Summer'

  5. 巨杉Talk | 拒绝数据碎片化,原生分布式数据库灵活应对数据管理需求

    2019年7月19-20日,以“运筹帷幄,数揽未来”为主题的DAMS中国数据智能管理峰会在上海青浦区成功举办.在DAMS峰会上,巨杉数据库为大家带来了题为“云架构下的分布式数据库设计与实践”的主题分享 ...

  6. 【音乐欣赏】《I Don't Even Care About You》 - Missio

    曲名:I Don't Even Care About You 作者:Missio [00:31.18]Depressed again [00:34.66]Morning comes too fast ...

  7. CentOS7利用docker安装MySQL5.7

    CentOS7利用docker安装MySQL5.7 前提条件 centos7 且内核版本高于3.10, 可通过以下命令查看内核版本 uname -r 利用yum 安装docker 安装一些必要的系统工 ...

  8. 金蝶云星空使用WebAPI来新增单据

    有很多客户需求在后台自动生成某张单据,金蝶云星空提供了WebApi,包含了保存,提交,审核,删除单据的接口,下面以生产订单的保存,提交,审核为例,说明一下应用WebApi后台自动生成生产订单的功能,下 ...

  9. word doc转pdf

    from win32com.client import constants, gencache # TODO pip install pywin32 -i http://mirrors.aliyun. ...

  10. 极客工具,PDF合并工具

    前言 这两天一番花两天的时间,重新用python和python图形化开发工具tkinter,完善了下PDF合并小工具,终于可以发布了. 工具目前基本功能已经完善,后期如果有反馈可以修复部分bug或完善 ...