Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
データセット: アイリス LDA (線形判別分析) モデルのデータセットで混同行列を計算する方法は?
>iris.lda = lda(Species ~ . , data = iris) >table(predict(iris.lda, type="class"), iris$Species) Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?
これを試してみてください
library(MASS) iris.lda <- lda(Species ~ . , data = iris) table(predict(iris.lda, type="class")$class, iris$Species) setosa versicolor virginica setosa 50 0 0 versicolor 0 48 1 virginica 0 2 49