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

integration-stats.tcl 1.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
  1. table gender "cluster-genders.parquet"
  2. table isbn_cluster "isbn-clusters.parquet"
  3. table loc "../loc-mds/book-isbn-ids.parquet"
  4. table bx_action "../bx/bx-cluster-actions.parquet"
  5. table bx_rating "../bx/bx-cluster-ratings.parquet"
  6. table az_rating "../az2014/az-cluster-ratings.parquet"
  7. table gr_rating "../goodreads/gr-cluster-ratings.parquet"
  8. table gr_action "../goodreads/gr-cluster-actions.parquet"
  9. table nodes "cluster-graph-nodes.parquet"
  10. query {
  11. SELECT node_type, COUNT(cluster)
  12. FROM nodes
  13. GROUP BY node_type
  14. ORDER BY node_type
  15. }
  16. set full_query ""
  17. proc add-query {query} {
  18. global full_query
  19. if {$full_query eq ""} {
  20. set full_query $query
  21. } else {
  22. set full_query "$full_query UNION ALL $query"
  23. }
  24. }
  25. add-query {
  26. SELECT 'LOC-MDS' as dataset, gender, COUNT(DISTINCT cluster) AS n_books, COUNT(NULL) AS n_actions
  27. FROM loc
  28. JOIN isbn_cluster USING (isbn_id)
  29. JOIN gender USING (cluster)
  30. GROUP BY gender
  31. }
  32. add-query {
  33. SELECT 'BX-I' as dataset, gender, COUNT(DISTINCT item) AS n_books, COUNT(item) AS n_actions
  34. FROM bx_action
  35. JOIN gender ON (item = cluster)
  36. GROUP BY gender
  37. }
  38. add-query {
  39. SELECT 'BX-E' as dataset, gender, COUNT(DISTINCT item) AS n_books, COUNT(item) AS n_actions
  40. FROM bx_rating
  41. JOIN gender ON (item = cluster)
  42. GROUP BY gender
  43. }
  44. add-query {
  45. SELECT 'AZ' as dataset, gender, COUNT(DISTINCT item) AS n_books, COUNT(item) AS n_actions
  46. FROM az_rating
  47. JOIN gender ON (item = cluster)
  48. GROUP BY gender
  49. }
  50. add-query {
  51. SELECT 'GR-I' as dataset, gender, COUNT(DISTINCT item) AS n_books, COUNT(item) AS n_actions
  52. FROM gr_action
  53. JOIN gender ON (item = cluster)
  54. GROUP BY gender
  55. }
  56. add-query {
  57. SELECT 'GR-E' as dataset, gender, COUNT(DISTINCT item) AS n_books, COUNT(item) AS n_actions
  58. FROM gr_rating
  59. JOIN gender ON (item = cluster)
  60. GROUP BY gender
  61. }
  62. save-results "gender-stats.csv" $full_query
Tip!

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

Comments

Loading...