二元评分的交叉列联
table() 函数会统计一个或多个向量中不同取值组合的出现次数。输出表格的方向取决于输入向量的指定顺序。例如,在下表中:
table(currency, country)
country
currency UK USA
$ 0 1
£ 1 0
因为在 table() 函数中 currency 位于第一个位置,所以行按 currency 编制索引。
本练习是课程的一部分
R 异常检测入门
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Tabulate agreement of label and binary isolation score
table(___, ___)
# Tabulate agreement of label and binary LOF score