# Dimension reduction without using any hyperparameters
data(swiss)
df<-swiss
p<-ndr(df)
summary(p)
plot(p)
biplot(p)
# Dimension reduction with using hyperparameters
# min_R=0.1 # The mininal square correlation must be grater than 0.1
p<-ndr(df,min_R = 0.1)
summary(p)
plot(p)
# min_evalue=0.1 # Minimal evector centalities must be greater than 0.1
p<-ndr(df,min_evalue = 0.1)
summary(p)
plot(p)
# minimal and common communality value must be greater than 0.25
p<-ndr(df,min_communality = 0.25,
com_communalities = 0.25)
# Print factor matrix
cor(p$scores)
plot(p)
# Use factor rotation
p<-ndr(df,min_communality = 0.25,
com_communalities = 0.25,use_rotation=TRUE)
# Print factor matrix
cor(p$scores)
biplot(p)
# Data reduction - clustering
# Distance is Euclidean's distance
# covar=TRUE means only the distance matrix is considered.
q<-ndr(1-normalize(as.matrix(dist(df))),covar=TRUE)
summary(q)
plot(q)
Run the code above in your browser using DataLab