吴裕雄 python 机器学习——数据预处理字典学习模型
from sklearn.decomposition import DictionaryLearning #数据预处理字典学习DictionaryLearning模型
def test_DictionaryLearning():
X=[[1,2,3,4,5],
[6,7,8,9,10],
[10,9,8,7,6,],
[5,4,3,2,1]]
print("before transform:",X)
dct=DictionaryLearning(n_components=3)
dct.fit(X)
print("components is :",dct.components_)
print("after transform:",dct.transform(X)) # 调用 test_DictionaryLearning
test_DictionaryLearning()

from sklearn.decomposition import MiniBatchDictionaryLearning #数据预处理字典学习MiniBatchDictionaryLearning模型
def test_MiniBatchDictionaryLearning():
X=[[1,2,3,4,5],
[6,7,8,9,10],
[10,9,8,7,6,],
[5,4,3,2,1]]
print("before transform:",X)
dct=DictionaryLearning(n_components=3)
dct.fit(X)
print("components is :",dct.components_)
print("after transform:",dct.transform(X)) # 调用 test_MiniBatchDictionaryLearning
test_MiniBatchDictionaryLearning()

吴裕雄 python 机器学习——数据预处理字典学习模型的更多相关文章
- 吴裕雄 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 机器学习——数据预处理流水线Pipeline模型
from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn import neighbor ...
- 吴裕雄 python 机器学习——数据预处理过滤式特征选取SelectPercentile模型
from sklearn.feature_selection import SelectPercentile,f_classif #数据预处理过滤式特征选取SelectPercentile模型 def ...
- 吴裕雄 python 机器学习——数据预处理过滤式特征选取VarianceThreshold模型
from sklearn.feature_selection import VarianceThreshold #数据预处理过滤式特征选取VarianceThreshold模型 def test_Va ...
- 吴裕雄 python 机器学习——数据预处理二元化OneHotEncoder模型
from sklearn.preprocessing import OneHotEncoder #数据预处理二元化OneHotEncoder模型 def test_OneHotEncoder(): X ...
- 吴裕雄 python 机器学习——数据预处理二元化Binarizer模型
from sklearn.preprocessing import Binarizer #数据预处理二元化Binarizer模型 def test_Binarizer(): X=[[1,2,3,4,5 ...
随机推荐
- Git - 08. git branch
概述 简单描述以下, git branch 讲解的目的, 只是方便新手入门, 基本都是最简单的操作 所以东西可能不全 一是 我不理解 二是 有的东西出现, 可能会让新手产生误解 准备 os win10 ...
- 转载:android audio flinger
https://blog.csdn.net/innost/article/details/6142812 https://blog.csdn.net/zyuanyun/article/details/ ...
- [CF705B] Spider Man - 博弈论
[CF705B] Description ICG 游戏有若干个环,每次操作将一个环断成非空的两部分,节点数总和不变.集合初态为空,每次向集合中添加一个环,询问当前集合用于游戏的胜负. \(n \le ...
- docker usage (2)
1. docker command docker start postgres docker container ls --all docker image ls --all docker ps -a ...
- too old
The working copy at “” is too old (format 10) to work with client version ‘1.9.7(r18000392)’ 原因:svn版 ...
- Codeforces Hello2020 A-E简要题解
contest链接:https://codeforces.com/contest/1284 A. New Year and Naming 思路:签到,字符串存一下,取余拼接. #include< ...
- TCP/IP详解,卷1:协议--IP:网际协议
引言 I P 是 T C P / I P 协议族中最为核心的协议.所有的 T C P.U D P.I C M P 及 I G M P 数据都以 I P 数据 报格式传输(见图 1 - 4).许多刚开始 ...
- 路飞-后台home模块
home模块 创建home模块 """ 前提:在 luffy 虚拟环境下 1.终端从项目根目录进入apps目录 >: cd luffyapi & cd ap ...
- 测试理论 - Test Double
概述 简述 test double mock, fake 之类的东西 背景 最近在看 google 软件测试之道 妈的 13 年的老书了 书里有提到 mock, fake, stub 刚好, 我又不太 ...
- ansible笔记(7):常用模块之包管理模块
1.yum_repository模块 用于远程管理远程主机上的yum仓库. 参数解析: name:必须参数,用于指定要操作的唯一的仓库ID,也就是.repo配置文件中每个仓库对应的“中括号”内的仓库I ...