Description Format Details Active bindings Methods Author(s) Examples
Performs a pca anlysis on a given dataset. The explained variance ratio is calculated and used to indicate the optimal number of components for a pca.
[R6::R6Class] object.
Performs a pca anlysis on a given dataset. The explained variance ratio is calculated and used to indicate the optimal number of components for a pca.
rslt_pca
Returns the instance variable rslt.pca (list)
df_pca
Returns the instance variable df_pca (tibble::tibble)
df_components
Returns the instance variable df_components (tibble::tibble)
nComp
Returns the instance varibale nComp (integer)
verbose
Returns the instance variable verbose (logical)
new()
Creates and returns a new componentAnalysis.pca object.
componentAnalysis.pca$new(verbose = FALSE)
verbose
Makes the class chatty. Default is FALSE. (logical)
A new R6 object of type componentAnalysis.pca. (pguXAI::componentAnalysis.pca)
finalize()
Clears the heap and indicates that instance of componentAnalysis.pca is removed from heap.
componentAnalysis.pca$finalize()
print()
Prints instance variables of a componentAnalysis.pca object.
componentAnalysis.pca$print()
string
train()
trains the model
componentAnalysis.pca$train(obj = "tbl_df")
obj
The data to be analyzed. (tibble::tibble)
evr_overview_plot()
Plots the explained variance ration of the analysis.
componentAnalysis.pca$evr_overview_plot()
(ggplot2::ggplot)
evr_detail_plot()
Plots the eigenvalues of the analysis.
componentAnalysis.pca$evr_detail_plot()
(ggplot2::ggplot)
cos2_corrplot()
Plots the quality of representation of the variables on factor map.
componentAnalysis.pca$cos2_corrplot()
(ggplot2::ggplot)
cos2_barplot()
Plots the quality of representation of the variables on factor map.
componentAnalysis.pca$cos2_barplot()
(ggplot2::ggplot)
contrib_corrplot()
Maps the attributes contribution to each component.
componentAnalysis.pca$contrib_corrplot()
(ggplot2::ggplot)
contrib_barplot()
Plots the quality of representation of the variables on factor map.
componentAnalysis.pca$contrib_barplot()
(ggplot2::ggplot)
clone()
The objects of this class are cloneable with this method.
componentAnalysis.pca$clone(deep = FALSE)
deep
Whether to make a deep clone.
Sebastian Malkusch, malkusch@med.uni-frankfurt.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | library(tidyverse)
library(pguXAI)
main = function(){
# load data set and remove class labels
df_data <- iris %>%
dplyr::select(-Species)
# define true class labels
classes_true <- iris$Species
# run principle component analysis
ca <- pguXAI::componentAnalysis.pca$new()
ca$train(obj=df_data)
# plot results
ca$evr_overview_plot()
ca$evr_detail_plot() %>%
show()
ca$cos2_corrplot() %>%
show()
ca$cos2_barplot()
ca$contrib_corrplot() %>%
show()
ca$contrib_barplot()
fin <- "done"
fin
}
main()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.