Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

confusion.json 2.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
  1. {
  2. "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  3. "data": {
  4. "values": "<DVC_METRIC_DATA>"
  5. },
  6. "title": "<DVC_METRIC_TITLE>",
  7. "facet": {
  8. "field": "rev",
  9. "type": "nominal"
  10. },
  11. "spec": {
  12. "transform": [
  13. {
  14. "aggregate": [
  15. {
  16. "op": "count",
  17. "as": "xy_count"
  18. }
  19. ],
  20. "groupby": [
  21. "<DVC_METRIC_Y>",
  22. "<DVC_METRIC_X>"
  23. ]
  24. },
  25. {
  26. "impute": "xy_count",
  27. "groupby": [
  28. "rev",
  29. "<DVC_METRIC_Y>"
  30. ],
  31. "key": "<DVC_METRIC_X>",
  32. "value": 0
  33. },
  34. {
  35. "impute": "xy_count",
  36. "groupby": [
  37. "rev",
  38. "<DVC_METRIC_X>"
  39. ],
  40. "key": "<DVC_METRIC_Y>",
  41. "value": 0
  42. },
  43. {
  44. "joinaggregate": [
  45. {
  46. "op": "max",
  47. "field": "xy_count",
  48. "as": "max_count"
  49. }
  50. ],
  51. "groupby": []
  52. },
  53. {
  54. "calculate": "datum.xy_count / datum.max_count",
  55. "as": "percent_of_max"
  56. }
  57. ],
  58. "encoding": {
  59. "x": {
  60. "field": "<DVC_METRIC_X>",
  61. "type": "nominal",
  62. "sort": "ascending",
  63. "title": "<DVC_METRIC_X_LABEL>"
  64. },
  65. "y": {
  66. "field": "<DVC_METRIC_Y>",
  67. "type": "nominal",
  68. "sort": "ascending",
  69. "title": "<DVC_METRIC_Y_LABEL>"
  70. }
  71. },
  72. "layer": [
  73. {
  74. "mark": "rect",
  75. "width": 300,
  76. "height": 300,
  77. "encoding": {
  78. "color": {
  79. "field": "xy_count",
  80. "type": "quantitative",
  81. "title": "",
  82. "scale": {
  83. "domainMin": 0,
  84. "nice": true
  85. }
  86. }
  87. }
  88. },
  89. {
  90. "mark": "text",
  91. "encoding": {
  92. "text": {
  93. "field": "xy_count",
  94. "type": "quantitative"
  95. },
  96. "color": {
  97. "condition": {
  98. "test": "datum.percent_of_max > 0.5",
  99. "value": "white"
  100. },
  101. "value": "black"
  102. }
  103. }
  104. }
  105. ]
  106. }
  107. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...