gpt4 book ai didi

r - 在R中提取LDA(线性判别分析)数据

转载 作者:行者123 更新时间:2023-12-05 04:17:22 24 4
gpt4 key购买 nike

当我运行这条线时

my.lda<-lda(Group ~ X1+X2+X3+X4, data = df)

我得到一个以这一行结尾的长输出

Proportion of trace:

LD1 LD2 LD3 LD4

0.8750 0.0958 0.0286 0.0006

如何将迹线的 LD1 和 LD2 比例存储在单独的变量中?

谢谢

最佳答案

尝试:

prop.table(my.lda$svd^2)

根据文档,lda(...)$svd 是一个向量

the singular values, which give the ratio of the between- and within-group standard deviations on the linear discriminant variables. Their squares are the canonical F-statistics.

关于r - 在R中提取LDA(线性判别分析)数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23163157/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com