当前位置:网站首页>R语言 pca主成分分析的主要方法
R语言 pca主成分分析的主要方法
2022-08-01 20:58:00 【matlab_python22】
实践分析
(一)与棒球数据集有关的;练习
1)首先,过滤掉所有击球数少于100的击球手。接下来,使用z分数标准化所有的数值变量。
2)现在,假设我们有兴趣根据数据集中的其他数值变量来估计本垒打的数量。所有其他数值变量都是我们的预测变量。进行主成分分析
3)根据a.特征值准则需要提取多少分量?b.方差比例解释标准?
4)使用讲过的四种方法确定主成分数目
(二)使用wine_quality_training数据集,
可在教科书网站上找到,用于剩余的练习。数据包括一些来自葡萄牙的葡萄酒的化学数据。目标变量是质量。记住在维度缩减分析中忽略目标变量。除非另有说明,只能使用白葡萄酒进行分析
1)规范预测因素。
2).构建预测因子的矩阵图。提供一个表,显示每个预测器与其他预测器的相关系数。
3)主成分分析应用到预测,使用讲过的四种方法确定主成分数目
协方差阵中的Q阵就表示了我们想要找的最佳的坐标系转换,它能够使得转换后的每个轴的方差最大化中间的对角线就是新坐标系中的不同轴上的方差,并且从大到小排列,Q的每一列就是对应的坐标轴
这里需要选取home run作为变量,剩下的作为研究对象进行PCA操作。
选择安装模块psych后,进行principal(train.house[,c(2:9)],nfactors=8,rotate="none", scores=TRUE) 的类似操作就可以得到PCA的具体内容。
图4-1 过滤之前的数据图
图4-2 去除小于100的变量后的结果图
采用两个方法,一个是手动选择,一个是编程选择。方法1d2 <- ww[-
图4-10 主成分的结果展示图
图4-11 贡献率的曲线图
边栏推荐
- Godaddy域名解析速度慢问题以及如何使用DNSPod解析解决
- Buttons with good user experience should not have hover state on mobile phones
- 【Social Media Marketing】How to know if your WhatsApp is blocked?
- Go 语言中常见的坑
- 【Kaggle】Classify Leaves
- Pytorch框架学习记录10——线性层
- LinkedList source code sharing
- [Multi-task model] Progressive Layered Extraction: A Novel Multi-Task Learning Model for Personalized (RecSys'20)
- idea实用快捷键合集——持续更新
- 和我一起写一个音乐播放器,听一首最伟大的作品
猜你喜欢
New graduate students, great experience in reading English literature, worthy of your collection
SIPp installation and use
数据库内核面试中我不会的问题(1)
【个人作品】无线网络图传模块
Interview Blitz 70: What are sticky packs and half packs?How to deal with it?
【个人作品】记之-串口日志记录工具
KDD2022 | Self-Supervised Hypergraph Transformer Recommendation System
扣减库存方案
Based on FPGA in any number of bytes (single-byte or multibyte) serial port (UART) to send (including source engineering)
算法---解码方法(Kotlin)
随机推荐
Telnet弱口令渗透测试
响应式织梦模板美容整形类网站
tiup mirror clone
Redis does check-in statistics
和我一起写一个音乐播放器,听一首最伟大的作品
【Untitled】
徒步,治好了我的精神内耗
Questions I don't know in database kernel interview(1)
2022年秋招,软件测试开发最全面试攻略,吃透16个技术栈
[Personal Work] Remember - Serial Logging Tool
tiup mirror
Excel advanced drawing techniques, 100 (22) - how to respectively the irregular data
[Energy Conservation Institute] Ankerui Food and Beverage Fume Monitoring Cloud Platform Helps Fight Air Pollution
kubernetes各名词缩写
Pytorch框架学习记录10——线性层
【节能学院】安科瑞餐饮油烟监测云平台助力大气污染攻坚战
The configuration manual for the secondary development of the XE training system of the missing moment document system
Application of Acrel-5010 online monitoring system for key energy consumption unit energy consumption in Hunan Sanli Group
Little data on how to learn?Jida latest small learning data review, 26 PDF page covers the 269 - page document small data learning theory, method and application are expounded
98. Embedded controller EC actual combat EC development board development completed