- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我现在关注下一个主题:How can I use PCA/SVD in Python for feature selection AND identification?现在,我们使用 PCA 方法在 Python 中分解我们的数据集,并为此使用 sklearn.decomposition.PCA
使用属性 components_
我们得到所有组件。现在我们有非常相似的目标:只想取前几个组件(这部分不是问题),看看每个 PCA 组件的输入特征比例是多少(要知道,哪些特征对我们来说非常重要)。怎么可能呢?另一个问题是,python lybrary是否有另一个主成分分析的实现?
最佳答案
what the input features proportions has every PCA component (to know, which features are much important for us). How is possible to do it?
components_
数组的形状为 (n_components, n_features)
所以 components_[i, j]
已经给了你(有符号的)权重特征 j
对组件 i
的贡献。
如果你想获得对组件 i
贡献最大的 3 个特征的索引而不考虑符号,你可以这样做:
numpy.abs(pca.component_[i]).argsort()[::-1][:3]
注意:[::-1]
表示法可以颠倒数组的顺序:
>>> import numpy as np
>>> np.array([1, 2, 3])[::-1]
array([3, 2, 1])
Another question is, has the python library another implementations of Principal Component Analysis?
PCA 只是中心数据集的截断奇异值分解。如果您愿意,可以直接使用 numpy.linalg.svd
。看看 soure code of the scikit-learn implementation of PCA了解详情。
关于python - 用python : features relevances进行PCA分解,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22348668/
根据 http://msdn.microsoft.com/en-us/library/ms733025.aspx XmlWriterTraceListener 不是线程安全的。 (我知道 Micros
我的副业是为一些政治科学家编写/改进一个研究项目网络应用程序。该应用程序收集与美国最高法院相关的文章并对它们进行分析,经过近一年半的时间,我们拥有了一个包含大约 10,000 篇文章(并且还在不断增加
我正在具有 16G RAM 的 Debian 9 云服务器上运行程序。我担心该程序可能会增加内存压力,因此我让它在循环中运行“free -h”命令。当内存消耗最大时,我在程序结束时得到以下输出:
我正在尝试编写一个搜索方法,用于搜索文章的全文,并按搜索词在全文中出现的次数对结果进行排序。像这样的事情: def search term = params[:term] @articles
在我的应用程序 (PHP/MySQL/JS) 中,我有一个内置的搜索功能。其中一个搜索条件包含各种选项的复选框,因此,一些结果会比其他结果更相关,如果它们包含更多或更少的每个选项。 i.e. Opti
我有一个要从中搜索的表。该表位于 InnoDB 中。我用过LIKE '%$keyword%' 用于搜索,但我想根据匹配的相关性缩短它们。 喜欢关键字“xyz” 应该显示结果作为 (1) xyz abc
为了节省带宽并避免自己生成图片/图表,我计划使用 Google 的图表 API: http://code.google.com/apis/chart/ 它的工作原理是简单地发出(可能很长)GET(或
在输入几个词的情况下,我想要一个实用程序来返回一组不同的相关术语、短语或概念。需要注意的是,它需要有一个大的术语图才能开始,否则该功能将不会很有用。 例如,提交“棒球”将返回 ["shortstop"
我有一张餐厅的 opening_hours 表: SELECT * FROM opening_hours; +----+---------------+------------+----------+
尝试在我的本地主机中查看页面时出现此错误。网站以前工作过。代码文件未预编译。我已经清理了 asp.net 临时文件夹,并为 wwwroot 和 Temporary ASP.NET Files 文件夹授
我正在处理 Windows 窗体应用程序。我想在 ListView 上应用过滤器。要求是在搜索文件夹中具有给定名称的文件时在 Windows 中实现搜索功能。 原来Windows使用的是Relevan
据我了解,为了Elasticsearch要执行涉及“相关性分数”的“模糊”查询,它必须遍历并计算所有可能匹配项(可能包括数千或数百万行)的相关性,即使查询的“限制”仅为“10”。 Elasticsea
Thinking sphinx 文档说它会根据相关性自动对结果进行排序。它的相关性指标是什么?我们如何为系统定义我们自己的相关性指标? 示例:我有一个数据库,其中一个条目是 Windows XP,它包
我刚刚通过 android studio 创建了一个 apk,它让我可以选择创建我自己的 key ,我做了但随后问我它是什么类型的构建,即调试或发布。还列出了不存在的口味。 这个信息设置在哪里,在 g
我正在使用 C#。在许多情况下,我编写的代码可以受益于位于“不相关”dll 中的非常简单的类/方法。例如,我正在编写一些没有 UI 的算法,但它可以从 System.Drawing 中的 Point
我有一个 Rails View ,允许将多个 PanelItem 添加到页面上的多个面板中。 型号 class Page 'append', class: 'btn
我正在 Firebase/firestore 上开发一个 Web 应用,用户可以在其中登录并撰写自己的帖子。数据存储方式如下: -用户信息存储在collection('user').doc('uid'
我从 flickr api 获得了一些不相关且低(主观)图像质量。我注意到 haiku Deck 等网站使用 flickr api 并且获得了相关结果 我正在使用flickrnet API。下面是我正
在 ElasticSearch 5.5.0 中,我正在浏览“more_like_this”子句但无法找到相关文档。我在 ElasticSearch 中有以下数据,“描述”字段有大量大小超过 100 万
我的 IOS 应用被拒绝,提供的原因是- From Apple 3 PERFORMANCE: ACCURATE METADATA DESIGN: PREAMBLE Performance - 2.3
我是一名优秀的程序员,十分优秀!