
[译]sklearn.decomposition.TruncatedSVD
发布日期:2021-05-07 14:32:30
浏览次数:36
分类:原创文章
本文共 1399 字,大约阅读时间需要 4 分钟。
class sklearn.decomposition.TruncatedSVD(n_components=2, algorithm=’randomized’, n_iter=5, random_state=None, tol=0.0)
采用阶段奇异值分解SVD降维。
与PCA相比,这种方式再计算SVD之前不指定数据中心。这意味着他可以有效的处理scipy.sparse稀疏矩阵。
特别的, truncated SVD作用于sklearn.feature_extraction.text向量化后返回的 term count/tf-idf矩阵。在这种情况下又被成为LSA( latent semantic analysis)
这种估计支持两种算法:快速随机SVD;更有效的用ARPACK 作为本征求解的朴素算法。
-
Parameters
Parameters | 数据类型 | 意义 |
---|---|---|
n_components | int, default = 2 | 目标输出维度,必须少于特征维数,默认数据是为了可视化;对于LSA推荐100 |
algorithm | string, default = “randomized” | SVD求解用,arpack或者randomized |
n_iter | int, optional (default 5) | randomized SVD solver的迭代次数,ARPACK不可用 |
random_state | int, RandomState instance or None, optional, default = None | int:随机数发生器种子 RandomState instance:random_state是随机数发生器 None:np.random采用的RandomState实例 |
tol | float, optional | ARPACK的公差 0:machine precision randomized SVD solver忽略 |
-
Attributes
Attributes | 数据类型 | 意义 |
---|---|---|
components_ | array, shape (n_components, n_features) | |
explained_variance_ | array, shape (n_components,) | 公差 |
explained_variance_ratio_ | array, shape (n_components,) | |
singular_values_ | array, shape (n_components,) | 每个选定components的奇异值 |
-
Method
Method | 意义 |
---|---|
(self, X[, y]) | 通过X拟合LSI |
(self, X[, y]) | Fit LSI model to X and perform dimensionality reduction on X. |
(self[, deep]) | Get parameters for this estimator. |
(self, X) | Transform X back to its original space. |
(self, **params) | Set the parameters of this estimator. |
(self, X) | Perform dimensionality reduction on X. |
发表评论
最新留言
感谢大佬
[***.8.128.20]2025年04月01日 07时12分15秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
HTML基础,块级元素/行内元素/行内块元素辨析【2分钟掌握】
2021-05-08
STM8 GPIO模式
2021-05-08
omnet++
2021-05-08
23种设计模式一:单例模式
2021-05-08
Qt中的析构函数
2021-05-08
C语言实现dijkstra(adjacence matrix)
2021-05-08
三层框架+sql server数据库 实战教学-徐新帅-专题视频课程
2021-05-08
【单片机开发】智能小车工程(经验总结)
2021-05-08
【单片机开发】基于stm32的掌上游戏机设计 (项目规划)
2021-05-08
C++&&STL
2021-05-08
子集(LeetCode 78)
2021-05-08
微信js-sdk使用简述(分享,扫码功能等)
2021-05-08
mxsrvs支持thinkphp3.2伪静态
2021-05-08
c++中ifstream及ofstream超详细说明
2021-05-08
vuex modules
2021-05-08
sleep、wait、yield、join——简介
2021-05-08
web项目配置
2021-05-08
基于单片机简易信号误差分析设计-全套资料
2021-05-08
基于单片机简易脉搏测量仪系统设计-毕设课设资料
2021-05-08
Javascript中String支持使用正则表达式的四种方法
2021-05-08