我有一个森林多边形数据集,我正在尝试使用混淆矩阵将字段分类与地图分类进行比较。我能找到的唯一一个可以在更大的数据集(超过 2 个分类选项)上运行并且可以比较文本值的包位于“mda”包中。我已经运行了包'mda'并使用了'confusion'的代码。
随包提供的示例是...
data(iris)
irisfit <- fda(Species ~ ., data = iris)
confusion(predict(irisfit, iris), iris$Species)
Setosa Versicolor Virginica
Setosa 50 0 0
Versicolor 0 48 1
Virginica 0 2 49
attr(, "error"):
[1] 0.02
我简单地运行我的
data(Habitat)
confusion(Habitat$Field,Habitat$Map)
这给了我一个与提供的代码示例类似(但不那么整洁)的混淆矩阵输出。在这一点上,我迷路了。我有 2 个结果。
attr(,"error")
[1] 0.3448276
attr(,"mismatch")
[1] 0.889313
错误我理解,不匹配但是,我似乎在网上或包装随附的文献中找不到任何提示。我怀疑有这么高的“不匹配”值是好的,但我不知道如何解释它。我认为这可能是一个相当具体的问题,也许只能由以前使用过这个包的人来回答,但如果有人知道,或者有如何找到的提示,我将不胜感激。
谢谢,艾登
编辑- 包括我的数据集的剪辑,显示可能不匹配的内容(怀疑这意味着一致的错误分类)。显示最一致的错误分类的剪辑。
structure(list(Field = structure(c(7L, 7L, 7L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 8L), .Label = c("Black Spruce ", "Clearcut ",
"Deciduous ", "Jack Pine ", "Lowland Conifer ", "Marshwillow ",
"Mixed Conifer ", "Open Muskeg ", "Rock ", "Treed Muskeg ", "Upland Conifer ",
"Young Conifer", "Young Deciduous"), class = "factor"), Map = structure(c(7L,
7L, 7L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 13L, 13L, 13L, 6L), .Label = c("Black Spruce", "Clearcut", "Deciduous", "Jack Pine", "Lowland Conifer", "Marshwillow",
"Mixed Conifer", "Open Muskeg", "Rock", "Treed Muskeg", "Upland Conifer",
"Young Conifer", "Young Deciduous"), class = "factor")), .Names = c("Field",
"Map"), row.names = 143:156, class = "data.frame")