library(“ggplot2“)
library(“gridExtra“)
library(ggbiplot)
library(“corrplot“)
library(factoextra)
#conversion of row number
data=rownames(GGE)=c(“Me“,“E6“,“E2“,“E4“,“KB“,“HUl“,“kat“,“Dan“,“EA2“,“Ts“,
“E0“,“E5“,“DI“,“E8“,“E39“,“ET1“,“BO“,“Ab“,“Si“)
pca =prcomp(GGE[,c(2:11)], center = TRUE,scale. = TRUE)
print(pca)
# to get eigen value
= get_eigenvalue(pca)
#to get scree plot
fviz_eig(pca, addlabels = TRUE, ylim = c(0, 50))
## PCA results for variables
var=get_pca_var(pca)
# to see the most contributing variables for each dimension
corrplot(var$cos2, =FALSE)
#to see the most contributing variables for both dimension
fviz_cos2(pca, choice = “var“, axes = 1:2)
# to draw a bar plot of variable contributions
# Contributions of variables to PC1
a=fviz_contrib(pca, choice = “var“, axes = 1)# top= 5 to limit to five var.
# Contributions of variables to PC2
b=fviz_contrib(pca, choice = “var“, axes = 2)
(a,b, ncol=2, top=’Contribution of the variables to the first two PCs’)
# Total contribution on PC1 and PC2
fviz_contrib(pca, choice = “ind“, axes = 1:2)
#Graph of variables
fviz_pca_var(pca,
= “cos2“,
= c(“red“, “blue“, “green“),
repel = TRUE)
#Biplot of individuals and variables
fviz_pca_biplot(pca, repel = TRUE,
= “blue“,
= “red“)
#########################################################################
#Plotting PCA
ggbiplot(pca)
#This will name each point with the name of the genotypes
ggbiplot(pca,labels=rownames(GGE))
# plot using PC1 and PC2
ggbiplot(pca,ellipse=TRUE,choices=c(1,2),labels=rownames(GGE), groups=GGE$ENV)
# scale the samples
ggbiplot(pca,ellipse=TRUE, = 2, = 4.5,
labels=rownames(GGE), groups=GGE$ENV)
#remove the arrows altogether
ggbiplot(pca,ellipse=TRUE, = 1, = 1,=FALSE,
labels=rownames(GGE), groups=GGE$ENV)
# final biplot by Customize ggbiplot
aa=ggbiplot(pca,ellipse=TRUE, = 1, = 1, labels=rownames(GGE), groups=GGE$ENV)
scale_colour_manual(name=“Location“, values= c(“blue“, “red“, “green“,“pink“))
ggtitle(“PCA of wakjira“)
theme_minimal()
theme( = “bottom“)
aa
ggsave(filename = ““, plot = aa,width = 22, height = 15, dpi = 2500, units = “cm“)
1 view
818
233
5 years ago 00:16:16 22
Метод главных компонент(Principal component analysis)
5 years ago 00:07:37 9
Principal Component Analysis (PCA) 1 [Python]
5 years ago 00:07:56 11
Principal Component Analysis (PCA) 2 [Python]
4 years ago 01:04:29 12
Introduction to Machine Learning - 10 - Principal component analysis
2 years ago 00:26:34 2
Principal Component Analysis (PCA)
5 years ago 00:22:29 3
Principal Component Analysis Demystified
5 years ago 00:08:41 2
Principal Component Analysis (PCA) in Python
4 years ago 00:22:11 1
Robust Principal Component Analysis (RPCA)
5 years ago 00:15:43 9
XGBoost and Principal Component Analysis | Practical Machine Learning with Scikit-Learn #3
1 year ago 00:29:42 1
Principal Component analysis (PCA) in R
4 years ago 00:03:31 5
Principal Component Analysis (PCA) - Step by Step
6 years ago 00:14:08 17
Machine Learning: Dimensionality Reduction With Principal Component Analysis
5 years ago 00:21:58 5
StatQuest: Principal Component Analysis (PCA), Step-by-Step
2 years ago 00:03:05 1
Getting Started with Orange 09: Principal Component Analysis
6 years ago 00:32:02 4
PCA with Python Principal Component Analysis Machine Learning KGP Talkie
7 years ago 01:05:23 11
. Lecture 7. Part 1. Principal Component Analysis. Theory and practice
3 years ago 00:09:18 1
#25. Метод главных компонент (Principal Component Analysis) | Машинное обучение
5 years ago 00:15:32 3
Principal Component Analysis machine learning Algorithm Part 1 in Python
5 years ago 00:31:10 4
PCA In Machine Learning | Principal Component Analysis | Machine Learning Tutorial | Simplilearn
6 years ago 00:17:17 6
PCA (Principal Component Analysis) in Python - Machine Learning From Scratch 11 - Python Tutorial
10 years ago 00:06:04 34
Factor Analysis in SPSS (Principal Components Analysis) - Part 1
5 years ago 00:21:04 1
Machine Learning in Python: Principal Component Analysis (PCA) for Handling High-Dimensional Data
10 years ago 00:02:53 2
Factor Analysis in SPSS (Principal Components Analysis) - Part 6 of 6
10 years ago 00:05:45 4
Factor Analysis in SPSS (Principal Components Analysis) - Part 3 of 6