我在 Google 表格中有一个这种形式的表格:
+---------+------------+--------+
| item_id | prediction | actual |
+---------+------------+--------+
| 1 | 1 | 1 |
| 2 | 1 | 1 |
| 3 | 1 | 0 |
| 4 | 0 | 1 |
| 5 | 0 | 0 |
| 6 | 1 | 1 |
+---------+------------+--------+
Run Code Online (Sandbox Code Playgroud)
我想知道是否有一种自动方法来获取此类摘要,以及符合该行/列组合中指定条件的项目计数:
+----------+--------------+--------------+-------+
| | prediction=0 | prediction=1 | total |
+----------+--------------+--------------+-------+
| actual=0 | 1 | 1 | 2 |
| actual=1 | 1 | …Run Code Online (Sandbox Code Playgroud)