lukeslp commited on
Commit
4c7a7d0
·
verified ·
1 Parent(s): aca55b7

Add GitHub link, analysis notebook, set public

Browse files
HUGGINGFACE_README.md ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - graph-ml
5
+ - feature-extraction
6
+ language:
7
+ - en
8
+ tags:
9
+ - steam
10
+ - games
11
+ - network-analysis
12
+ - co-review
13
+ - graph-data
14
+ - gaming
15
+ - social-network
16
+ pretty_name: Steam Co-Review Network
17
+ size_categories:
18
+ - 1M<n<10M
19
+ dataset_info:
20
+ features:
21
+ - name: nodes
22
+ dtype: list
23
+ - name: links
24
+ dtype: list
25
+ - name: meta
26
+ dtype: dict
27
+ ---
28
+
29
+ # Steam Co-Review Network
30
+
31
+ Two Steam games share an edge when multiple users reviewed both. Built from 128 million user reviews across 80,000 games (2012-2024), this dataset maps how the Steam catalog is connected through player overlap.
32
+
33
+ ## Files
34
+
35
+ ### steam_network_full.json
36
+
37
+ The complete co-review graph with minimal filtering:
38
+
39
+ - 48,362 game nodes (every game with 10+ reviews)
40
+ - 33,041,298 weighted edges (2+ shared reviewers per pair)
41
+ - Per-node cap of 50 neighbors (densest connections preserved)
42
+ - Edge weights range from 2 to 420,410 shared reviewers
43
+
44
+ **Node format:**
45
+ ```json
46
+ {
47
+ "id": "620",
48
+ "title": "Portal 2",
49
+ "year": "2011",
50
+ "rating": "Overwhelmingly Positive",
51
+ "ratio": 97,
52
+ "reviews": 263842,
53
+ "price": 9.99
54
+ }
55
+ ```
56
+
57
+ **Link format:**
58
+ ```json
59
+ {"source": 0, "target": 42, "weight": 1523}
60
+ ```
61
+
62
+ Source and target are indices into the nodes array. Weight is the number of users who reviewed both games.
63
+
64
+ ### steam_all_2005.json
65
+
66
+ 82,928 games released 2005-2025. Packed as arrays for compact JSON:
67
+
68
+ ```
69
+ [name, year, ratio, reviews, price, ratingIdx, genreIdxs, tagIdxs, developer]
70
+ [0] [1] [2] [3] [4] [5] [6] [7] [8]
71
+ ```
72
+
73
+ Genres and tags are stored as index arrays referencing top-level `genres[]` and `tags[]` lookup tables in the same file.
74
+
75
+ ### steam_force_layout.json
76
+
77
+ Genre-aware pre-computed layout positions for the top ~9K nodes, clustered by primary genre with hub games as anchors. Use as warm-start coordinates for force-directed visualization.
78
+
79
+ ## Sources
80
+
81
+ - **Game metadata**: [FronkonGames Steam Games Dataset](https://huggingface.co/datasets/FronkonGames/steam-games-dataset) — Jan 2026 snapshot, 122K games
82
+ - **User reviews**: [artermiloff Steam Reviews 2024](https://www.kaggle.com/datasets/artermiloff/steam-games-reviews-2024) — 128M reviews across 80K games, one CSV per game, 2012-June 2024
83
+
84
+ ## Pipeline
85
+
86
+ 1. Load game metadata from FronkonGames enriched CSV
87
+ 2. Scan 30K+ per-game review CSVs, extract steamid-to-game mappings
88
+ 3. For each user who reviewed 2+ games, generate all game pairs
89
+ 4. Count shared reviewers per pair to produce edge weights
90
+ 5. Filter: minimum 2 shared reviewers (no neighbor cap)
91
+
92
+ Full pipeline: [github.com/lukeslp/steam-network-data](https://github.com/lukeslp/steam-network-data)
93
+
94
+ ## Use Cases
95
+
96
+ - **Graph ML**: Node classification (predict genre/rating from network position), link prediction, community detection
97
+ - **Recommendation systems**: Games connected by high edge weights share audiences
98
+ - **Market analysis**: Which genres cluster together? Where are the gaps?
99
+ - **Visualization**: Force-directed layouts, chord diagrams, genre timelines of the Steam ecosystem
100
+
101
+ ## Live Visualization
102
+
103
+ [dr.eamer.dev/datavis/interactive/steam/](https://dr.eamer.dev/datavis/interactive/steam/)
104
+
105
+ Four interactive Canvas-rendered views: universe scatter, chord diagram, force-directed network, and genre timeline.
106
+
107
+ ## Distribution
108
+
109
+ - **GitHub**: [lukeslp/steam-network-data](https://github.com/lukeslp/steam-network-data)
110
+ - **Kaggle**: [lucassteuber/steam-universe-network](https://www.kaggle.com/datasets/lucassteuber/steam-universe-network)
111
+
112
+ ## Author
113
+
114
+ Luke Steuber — [lukesteuber.com](https://lukesteuber.com) — [@lukesteuber.com on Bluesky](https://bsky.app/profile/lukesteuber.com)
README.md CHANGED
@@ -1,109 +1,41 @@
1
- ---
2
- license: cc-by-4.0
3
- task_categories:
4
- - graph-ml
5
- - feature-extraction
6
- language:
7
- - en
8
- tags:
9
- - steam
10
- - games
11
- - network-analysis
12
- - co-review
13
- - graph-data
14
- - gaming
15
- - social-network
16
- pretty_name: Steam Co-Review Network
17
- size_categories:
18
- - 1M<n<10M
19
- dataset_info:
20
- features:
21
- - name: nodes
22
- dtype: list
23
- - name: links
24
- dtype: list
25
- - name: meta
26
- dtype: dict
27
- ---
28
-
29
  # Steam Co-Review Network
30
 
31
- Two Steam games share an edge when multiple users reviewed both. Built from 128 million user reviews across 80,000 games (2012-2024), this dataset maps how the Steam catalog is connected through player overlap.
32
-
33
- ## Files
34
-
35
- ### steam_network_full.json
36
-
37
- The complete co-review graph with minimal filtering:
38
-
39
- - 48,362 game nodes (every game with 10+ reviews)
40
- - 33,041,298 weighted edges (2+ shared reviewers per pair)
41
- - Per-node cap of 50 neighbors (densest connections preserved)
42
- - Edge weights range from 2 to 694,377 shared reviewers
43
-
44
- **Node format:**
45
- ```json
46
- {
47
- "id": "620",
48
- "title": "Portal 2",
49
- "year": "2011",
50
- "rating": "Overwhelmingly Positive",
51
- "ratio": 97,
52
- "reviews": 263842,
53
- "price": 9.99
54
- }
55
- ```
56
-
57
- **Link format:**
58
- ```json
59
- {"source": 0, "target": 42, "weight": 1523}
60
- ```
61
-
62
- Source and target are indices into the nodes array. Weight is the number of users who reviewed both games.
63
 
64
- ### steam_all_2005.json
65
 
66
- 82,928 games released 2005-2025. Packed as arrays for compact JSON:
67
-
68
- ```
69
- [name, year, ratio, reviews, price, ratingIdx, genreIdxs, tagIdxs, developer]
70
- [0] [1] [2] [3] [4] [5] [6] [7] [8]
71
- ```
72
-
73
- Genres and tags are stored as index arrays referencing top-level `genres[]` and `tags[]` lookup tables in the same file.
74
 
75
- ### steam_force_layout.json
 
 
 
 
76
 
77
- Genre-aware pre-computed layout positions for the top ~9K nodes, clustered by primary genre with hub games as anchors. Use as warm-start coordinates for force-directed visualization.
78
 
79
- ## Sources
80
 
81
- - **Game metadata**: [FronkonGames Steam Games Dataset](https://huggingface.co/datasets/FronkonGames/steam-games-dataset) — Jan 2026 snapshot, 122K games
82
- - **User reviews**: [artermiloff Steam Reviews 2024](https://www.kaggle.com/datasets/artermiloff/steam-games-reviews-2024) — 128M reviews across 80K games, one CSV per game, 2012-June 2024
83
 
84
  ## Pipeline
85
 
86
- 1. Load game metadata from FronkonGames enriched CSV
87
- 2. Scan 30K+ per-game review CSVs, extract steamid-to-game mappings
88
- 3. For each user who reviewed 2+ games, generate all game pairs
89
- 4. Count shared reviewers per pair to produce edge weights
90
- 5. Filter: minimum 2 shared reviewers (no neighbor cap)
91
-
92
- Full pipeline: [github.com/lukeslp/steam-game-network](https://github.com/lukeslp/steam-game-network)
93
-
94
- ## Use Cases
95
 
96
- - **Graph ML**: Node classification (predict genre/rating from network position), link prediction, community detection
97
- - **Recommendation systems**: Games connected by high edge weights share audiences
98
- - **Market analysis**: Which genres cluster together? Where are the gaps?
99
- - **Visualization**: Force-directed layouts, chord diagrams, genre timelines of the Steam ecosystem
100
 
101
- ## Live Visualization
 
 
102
 
103
- [dr.eamer.dev/datavis/interactive/steam/](https://dr.eamer.dev/datavis/interactive/steam/)
104
 
105
- Four interactive Canvas-rendered views: universe scatter, chord diagram, force-directed network, and genre timeline.
106
 
107
  ## Author
108
 
109
- Luke Steuber — [lukesteuber.com](https://lukesteuber.com) — [@lukesteuber.com on Bluesky](https://bsky.app/profile/lukesteuber.com)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Steam Co-Review Network
2
 
3
+ Graph dataset connecting 82,000+ Steam games through shared user reviews. Two games share an edge when multiple users reviewed both.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ Built from 128 million user reviews across 80,000 games (2012-2024), sourced from the [artermiloff Steam Reviews 2024](https://www.kaggle.com/datasets/artermiloff/steam-games-reviews-2024) dataset and [FronkonGames](https://huggingface.co/datasets/FronkonGames/steam-games-dataset) game metadata.
6
 
7
+ ## Files
 
 
 
 
 
 
 
8
 
9
+ | File | Description | Size |
10
+ |------|-------------|------|
11
+ | `steam_network_full.json` | Full co-review graph (48K nodes, 33M weighted edges) | 1.4 GB |
12
+ | `steam_all_2005.json` | 82,928 game catalog with genres, tags, ratings | 6.2 MB |
13
+ | `steam_force_layout.json` | Genre-aware pre-computed layout positions (9K nodes) | 252 KB |
14
 
15
+ ## Live Visualization
16
 
17
+ **[dr.eamer.dev/datavis/interactive/steam/](https://dr.eamer.dev/datavis/interactive/steam/)**
18
 
19
+ Four interactive Canvas-rendered views: universe scatter plot, chord diagram, force-directed network, and genre timeline.
 
20
 
21
  ## Pipeline
22
 
23
+ ```bash
24
+ python3 build_network_full.py # Scan 128M reviews, build co-review edges
25
+ python3 enrich_data.py # Build game catalog from FronkonGames CSV
26
+ python3 compute_layout.py # Genre-aware force layout (needs networkx)
27
+ ```
 
 
 
 
28
 
29
+ ## Platforms
 
 
 
30
 
31
+ - **GitHub**: [lukeslp/steam-network-data](https://github.com/lukeslp/steam-network-data)
32
+ - **Kaggle**: [lucassteuber/steam-universe-network](https://www.kaggle.com/datasets/lucassteuber/steam-universe-network)
33
+ - **HuggingFace**: [lukeslp/steam-co-review-network](https://huggingface.co/datasets/lukeslp/steam-co-review-network)
34
 
35
+ ## License
36
 
37
+ CC-BY-4.0
38
 
39
  ## Author
40
 
41
+ Luke Steuber — [lukesteuber.com](https://lukesteuber.com)
dataset-metadata.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "title": "Steam Co-Review Network (82K Games)",
3
+ "id": "lucassteuber/steam-universe-network",
4
+ "subtitle": "82K games connected by 128M shared user reviews",
5
+ "description": "# Steam Co-Review Network\n\nTwo Steam games share an edge when multiple users reviewed both. Built from 128 million user reviews across 80,000 games (2012-2024), this dataset maps how the Steam catalog is connected through player overlap.\n\n## What's Inside\n\n### steam_network_full.json (1.4 GB)\nThe complete co-review graph — 48,362 nodes, 33 million weighted edges:\n- Every game with 10+ reviews included as a node\n- Edges kept when 2+ users reviewed both games\n- No per-node neighbor cap — full topology preserved\n- Edge weights range from 2 to 420,410 shared reviewers\n\n### steam_all_2005.json (game catalog)\n82,928 games released 2005-2025 with:\n- Title, release year, positive review ratio, total review count\n- Price, developer, rating category\n- Genre indices and tag indices (referencing lookup tables in the file)\n\nPacked as arrays for compact JSON: `[name, year, ratio, reviews, price, ratingIdx, genreIdxs, tagIdxs, developer]`\n\n### steam_force_layout.json (precomputed layout)\nFruchterman-Reingold positions for the top ~9K nodes. Use as warm-start coordinates for force-directed visualization.\n\n## Sources\n\n- **Game metadata**: [FronkonGames Steam Games Dataset](https://huggingface.co/datasets/FronkonGames/steam-games-dataset) (Jan 2026 snapshot, 122K games)\n- **User reviews**: [artermiloff Steam Reviews 2024](https://www.kaggle.com/datasets/artermiloff/steam-games-reviews-2024) (128M reviews across 80K games, one CSV per game, 2012-June 2024)\n\n## How It Was Built\n\n1. Load game metadata from FronkonGames enriched CSV\n2. Scan 30K+ per-game review CSVs, extract user-game pairs\n3. For each user who reviewed 2+ games, generate all game pairs\n4. Count shared reviewers per pair to get edge weights\n5. Filter by minimum shared reviewers\n\nFull pipeline code: [github.com/lukeslp/steam-game-network](https://github.com/lukeslp/steam-game-network)\n\n## Live Visualization\n\n[dr.eamer.dev/datavis/interactive/steam-network/](https://dr.eamer.dev/datavis/interactive/steam-network/)\n\nSix interactive views: scatter plot, chord diagram, force-directed network, streamgraph, heatmap, and treemap. All Canvas-rendered for performance at 80K+ data points.\n\n## License\n\nCC-BY-4.0\n\n## Author\n\nLuke Steuber — [lukesteuber.com](https://lukesteuber.com)",
6
+ "isPrivate": false,
7
+ "keywords": ["games", "network-analysis", "steam", "graph-data", "gaming"],
8
+ "licenses": [{"name": "CC-BY-4.0"}]
9
+ }
steam_analysis.ipynb ADDED
@@ -0,0 +1,398 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 5,
4
+ "metadata": {
5
+ "kernelspec": {
6
+ "display_name": "Python 3",
7
+ "language": "python",
8
+ "name": "python3"
9
+ },
10
+ "language_info": {
11
+ "name": "python",
12
+ "version": "3.11.0"
13
+ }
14
+ },
15
+ "cells": [
16
+ {
17
+ "cell_type": "markdown",
18
+ "id": "intro",
19
+ "metadata": {},
20
+ "source": [
21
+ "# Steam Game Network: Catalog Analysis\n",
22
+ "\n",
23
+ "Exploratory analysis of 82,928 Steam games (2005\u20132025) from `steam_all_2005.json`.\n",
24
+ "Uses the packed array format: `[name, year, ratio, reviews, price, ratingIdx, genreIdxs, tagIdxs, developer]`\n",
25
+ "\n",
26
+ "**Dataset**: [github.com/lukeslp/steam-network-data](https://github.com/lukeslp/steam-network-data) \n",
27
+ "**Live viz**: [dr.eamer.dev/datavis/interactive/steam/](https://dr.eamer.dev/datavis/interactive/steam/)"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "code",
32
+ "execution_count": null,
33
+ "id": "imports",
34
+ "metadata": {},
35
+ "outputs": [],
36
+ "source": [
37
+ "import json\n",
38
+ "import pandas as pd\n",
39
+ "import matplotlib.pyplot as plt\n",
40
+ "import matplotlib.ticker as mticker\n",
41
+ "import numpy as np\n",
42
+ "from collections import Counter\n",
43
+ "\n",
44
+ "plt.style.use('seaborn-v0_8-whitegrid')\n",
45
+ "plt.rcParams['figure.figsize'] = (14, 5)\n",
46
+ "plt.rcParams['font.size'] = 11\n",
47
+ "STEAM_BLUE = '#1b2838'\n",
48
+ "STEAM_LIGHT = '#66c0f4'\n",
49
+ "print('Libraries loaded')"
50
+ ]
51
+ },
52
+ {
53
+ "cell_type": "markdown",
54
+ "id": "load-h",
55
+ "metadata": {},
56
+ "source": [
57
+ "## 1. Load Catalog"
58
+ ]
59
+ },
60
+ {
61
+ "cell_type": "code",
62
+ "execution_count": null,
63
+ "id": "load",
64
+ "metadata": {},
65
+ "outputs": [],
66
+ "source": [
67
+ "with open('steam_all_2005.json') as f:\n",
68
+ " catalog = json.load(f)\n",
69
+ "\n",
70
+ "genres = catalog['genres'] # index -> genre name\n",
71
+ "tags = catalog['tags'] # index -> tag name\n",
72
+ "ratings = catalog['ratings'] # index -> rating label\n",
73
+ "games_raw = catalog['games']\n",
74
+ "\n",
75
+ "# Unpack array format\n",
76
+ "# [name, year, ratio, reviews, price, ratingIdx, genreIdxs, tagIdxs, developer]\n",
77
+ "records = []\n",
78
+ "for g in games_raw:\n",
79
+ " if len(g) < 9:\n",
80
+ " continue\n",
81
+ " records.append({\n",
82
+ " 'name': g[0],\n",
83
+ " 'year': g[1],\n",
84
+ " 'ratio': g[2],\n",
85
+ " 'reviews': g[3],\n",
86
+ " 'price': g[4],\n",
87
+ " 'rating': ratings[g[5]] if g[5] is not None and g[5] < len(ratings) else 'Unknown',\n",
88
+ " 'genres': [genres[i] for i in (g[6] or []) if i < len(genres)],\n",
89
+ " 'tags': [tags[i] for i in (g[7] or []) if i < len(tags)],\n",
90
+ " 'developer': g[8],\n",
91
+ " })\n",
92
+ "\n",
93
+ "df = pd.DataFrame(records)\n",
94
+ "print(f'Games loaded: {len(df):,}')\n",
95
+ "print(f'Years: {df.year.min()} - {df.year.max()}')\n",
96
+ "print(f'Genres: {len(genres)}, Tags: {len(tags)}, Ratings: {len(ratings)}')\n",
97
+ "df.head(3)"
98
+ ]
99
+ },
100
+ {
101
+ "cell_type": "markdown",
102
+ "id": "year-h",
103
+ "metadata": {},
104
+ "source": [
105
+ "## 2. Release Year Trend (2005\u20132025)"
106
+ ]
107
+ },
108
+ {
109
+ "cell_type": "code",
110
+ "execution_count": null,
111
+ "id": "year",
112
+ "metadata": {},
113
+ "outputs": [],
114
+ "source": [
115
+ "year_counts = df[df['year'].between(2005, 2025)]['year'].value_counts().sort_index()\n",
116
+ "\n",
117
+ "fig, ax = plt.subplots(figsize=(14, 5))\n",
118
+ "ax.bar(year_counts.index, year_counts.values, color=STEAM_LIGHT, edgecolor=STEAM_BLUE, linewidth=0.5)\n",
119
+ "ax.set_title('Steam Games Released per Year (2005\u20132025)', fontsize=14, fontweight='bold', pad=12)\n",
120
+ "ax.set_xlabel('Year')\n",
121
+ "ax.set_ylabel('Games Released')\n",
122
+ "ax.yaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f'{x:,.0f}'))\n",
123
+ "plt.xticks(year_counts.index, rotation=45)\n",
124
+ "plt.tight_layout()\n",
125
+ "plt.show()\n",
126
+ "print(year_counts.to_string())"
127
+ ]
128
+ },
129
+ {
130
+ "cell_type": "markdown",
131
+ "id": "rating-h",
132
+ "metadata": {},
133
+ "source": [
134
+ "## 3. Rating Distribution"
135
+ ]
136
+ },
137
+ {
138
+ "cell_type": "code",
139
+ "execution_count": null,
140
+ "id": "rating",
141
+ "metadata": {},
142
+ "outputs": [],
143
+ "source": [
144
+ "rating_order = [\n",
145
+ " 'Overwhelmingly Positive', 'Very Positive', 'Positive', 'Mostly Positive',\n",
146
+ " 'Mixed', 'Mostly Negative', 'Negative', 'Very Negative', 'Overwhelmingly Negative', 'Unknown'\n",
147
+ "]\n",
148
+ "rating_counts = df['rating'].value_counts()\n",
149
+ "ordered = pd.Series({r: rating_counts.get(r, 0) for r in rating_order if r in rating_counts.index})\n",
150
+ "\n",
151
+ "colors_map = {\n",
152
+ " 'Overwhelmingly Positive': '#1a9850', 'Very Positive': '#52ae32',\n",
153
+ " 'Positive': '#91cf60', 'Mostly Positive': '#d9ef8b',\n",
154
+ " 'Mixed': '#fee08b',\n",
155
+ " 'Mostly Negative': '#fc8d59', 'Negative': '#e34a33',\n",
156
+ " 'Very Negative': '#b30000', 'Overwhelmingly Negative': '#7f0000', 'Unknown': '#cccccc'\n",
157
+ "}\n",
158
+ "colors = [colors_map.get(r, '#999') for r in ordered.index]\n",
159
+ "\n",
160
+ "fig, ax = plt.subplots(figsize=(14, 5))\n",
161
+ "bars = ax.bar(ordered.index, ordered.values, color=colors, edgecolor='white', linewidth=0.5)\n",
162
+ "ax.set_title('Games by Review Rating', fontsize=14, fontweight='bold', pad=12)\n",
163
+ "ax.set_ylabel('Game Count')\n",
164
+ "ax.yaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f'{x:,.0f}'))\n",
165
+ "plt.xticks(rotation=30, ha='right')\n",
166
+ "for bar, val in zip(bars, ordered.values):\n",
167
+ " ax.text(bar.get_x() + bar.get_width()/2, bar.get_height() + 50, f'{val:,}', ha='center', fontsize=8)\n",
168
+ "plt.tight_layout()\n",
169
+ "plt.show()"
170
+ ]
171
+ },
172
+ {
173
+ "cell_type": "markdown",
174
+ "id": "genre-h",
175
+ "metadata": {},
176
+ "source": [
177
+ "## 4. Top Genres by Game Count and Review Volume"
178
+ ]
179
+ },
180
+ {
181
+ "cell_type": "code",
182
+ "execution_count": null,
183
+ "id": "genres",
184
+ "metadata": {},
185
+ "outputs": [],
186
+ "source": [
187
+ "genre_counts = Counter(g for genres_list in df['genres'] for g in genres_list)\n",
188
+ "genre_review_vol = {}\n",
189
+ "for _, row in df.iterrows():\n",
190
+ " for g in row['genres']:\n",
191
+ " genre_review_vol[g] = genre_review_vol.get(g, 0) + (row['reviews'] or 0)\n",
192
+ "\n",
193
+ "top_n = 15\n",
194
+ "top_genres_count = pd.Series(genre_counts).nlargest(top_n).sort_values()\n",
195
+ "top_genres_vol = pd.Series(genre_review_vol).nlargest(top_n).sort_values()\n",
196
+ "\n",
197
+ "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 7))\n",
198
+ "top_genres_count.plot.barh(ax=ax1, color=STEAM_LIGHT, edgecolor=STEAM_BLUE, linewidth=0.5)\n",
199
+ "ax1.set_title('Top Genres by Game Count', fontsize=13, fontweight='bold')\n",
200
+ "ax1.xaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f'{x:,.0f}'))\n",
201
+ "ax1.set_xlabel('Games')\n",
202
+ "\n",
203
+ "top_genres_vol.plot.barh(ax=ax2, color='#FF6B35', edgecolor='white', linewidth=0.5)\n",
204
+ "ax2.set_title('Top Genres by Total Review Volume', fontsize=13, fontweight='bold')\n",
205
+ "ax2.xaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f'{x/1e6:.0f}M'))\n",
206
+ "ax2.set_xlabel('Total Reviews')\n",
207
+ "\n",
208
+ "plt.tight_layout()\n",
209
+ "plt.show()"
210
+ ]
211
+ },
212
+ {
213
+ "cell_type": "markdown",
214
+ "id": "price-h",
215
+ "metadata": {},
216
+ "source": [
217
+ "## 5. Price Distribution"
218
+ ]
219
+ },
220
+ {
221
+ "cell_type": "code",
222
+ "execution_count": null,
223
+ "id": "price",
224
+ "metadata": {},
225
+ "outputs": [],
226
+ "source": [
227
+ "df_priced = df.dropna(subset=['price'])\n",
228
+ "free = (df_priced['price'] == 0).sum()\n",
229
+ "paid = (df_priced['price'] > 0).sum()\n",
230
+ "\n",
231
+ "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5))\n",
232
+ "\n",
233
+ "# Free vs paid pie\n",
234
+ "ax1.pie([free, paid], labels=['Free', 'Paid'], autopct='%1.1f%%', colors=['#4CAF50', STEAM_LIGHT], startangle=90)\n",
235
+ "ax1.set_title(f'Free vs Paid (n={len(df_priced):,})', fontsize=13, fontweight='bold')\n",
236
+ "\n",
237
+ "# Paid price histogram\n",
238
+ "paid_prices = df_priced[df_priced['price'] > 0]['price'].clip(0, 60)\n",
239
+ "ax2.hist(paid_prices, bins=40, color=STEAM_LIGHT, edgecolor=STEAM_BLUE, linewidth=0.3)\n",
240
+ "ax2.set_title('Paid Game Price Distribution', fontsize=13, fontweight='bold')\n",
241
+ "ax2.set_xlabel('Price (USD)')\n",
242
+ "ax2.set_ylabel('Count')\n",
243
+ "ax2.yaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f'{x:,.0f}'))\n",
244
+ "\n",
245
+ "plt.tight_layout()\n",
246
+ "plt.show()\n",
247
+ "print(f'Free games: {free:,} ({free/len(df_priced)*100:.1f}%)')\n",
248
+ "print(f'Paid games: {paid:,} ({paid/len(df_priced)*100:.1f}%)')\n",
249
+ "print(f'Median paid price: ${paid_prices.median():.2f}')\n",
250
+ "print(f'Mean paid price: ${paid_prices.mean():.2f}')"
251
+ ]
252
+ },
253
+ {
254
+ "cell_type": "markdown",
255
+ "id": "top25-h",
256
+ "metadata": {},
257
+ "source": [
258
+ "## 6. Top 25 Games by Review Count"
259
+ ]
260
+ },
261
+ {
262
+ "cell_type": "code",
263
+ "execution_count": null,
264
+ "id": "top25",
265
+ "metadata": {},
266
+ "outputs": [],
267
+ "source": [
268
+ "top25 = df.nlargest(25, 'reviews')[['name', 'year', 'reviews', 'ratio', 'rating', 'price']].copy()\n",
269
+ "top25['reviews_M'] = (top25['reviews'] / 1e6).round(2)\n",
270
+ "top25['price_str'] = top25['price'].apply(lambda x: 'Free' if x == 0 else f'${x:.2f}' if pd.notna(x) else 'N/A')\n",
271
+ "\n",
272
+ "fig, ax = plt.subplots(figsize=(14, 9))\n",
273
+ "colors = [('#1a9850' if 'Positive' in r else '#e34a33' if 'Negative' in r else '#fee08b') for r in top25['rating']]\n",
274
+ "bars = ax.barh(top25['name'][::-1], top25['reviews'][::-1], color=colors[::-1], edgecolor='white', linewidth=0.3)\n",
275
+ "ax.set_title('Top 25 Steam Games by Total Review Count', fontsize=14, fontweight='bold', pad=12)\n",
276
+ "ax.set_xlabel('Total Reviews')\n",
277
+ "ax.xaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f'{x/1e6:.1f}M'))\n",
278
+ "\n",
279
+ "for bar, (_, row) in zip(bars[::-1], top25.iterrows()):\n",
280
+ " ax.text(bar.get_width() + 5000, bar.get_y() + bar.get_height()/2,\n",
281
+ " f'{row[\"ratio\"]:.0f}% pos | {row[\"price_str\"]}', va='center', fontsize=8)\n",
282
+ "\n",
283
+ "plt.tight_layout()\n",
284
+ "plt.show()\n",
285
+ "\n",
286
+ "print(top25[['name','year','reviews_M','ratio','price_str']].to_string(index=False))"
287
+ ]
288
+ },
289
+ {
290
+ "cell_type": "markdown",
291
+ "id": "genre-evo-h",
292
+ "metadata": {},
293
+ "source": [
294
+ "## 7. Genre Evolution Over Time (Stacked Area)"
295
+ ]
296
+ },
297
+ {
298
+ "cell_type": "code",
299
+ "execution_count": null,
300
+ "id": "genre-evo",
301
+ "metadata": {},
302
+ "outputs": [],
303
+ "source": [
304
+ "top_genres = [g for g, _ in Counter(g for genres_list in df['genres'] for g in genres_list).most_common(8)]\n",
305
+ "df_year = df[df['year'].between(2005, 2025)].copy()\n",
306
+ "\n",
307
+ "genre_year = pd.DataFrame(index=range(2005, 2026), columns=top_genres, data=0)\n",
308
+ "for _, row in df_year.iterrows():\n",
309
+ " for g in row['genres']:\n",
310
+ " if g in genre_year.columns:\n",
311
+ " genre_year.loc[row['year'], g] += 1\n",
312
+ "\n",
313
+ "fig, ax = plt.subplots(figsize=(14, 6))\n",
314
+ "genre_year.plot.area(ax=ax, alpha=0.8, cmap='tab10')\n",
315
+ "ax.set_title('Genre Composition by Year (Game Count)', fontsize=14, fontweight='bold', pad=12)\n",
316
+ "ax.set_xlabel('Year')\n",
317
+ "ax.set_ylabel('Games Released')\n",
318
+ "ax.yaxis.set_major_formatter(mticker.FuncFormatter(lambda x, _: f'{x:,.0f}'))\n",
319
+ "ax.legend(loc='upper left', fontsize=9, ncol=2)\n",
320
+ "plt.tight_layout()\n",
321
+ "plt.show()"
322
+ ]
323
+ },
324
+ {
325
+ "cell_type": "markdown",
326
+ "id": "tags-h",
327
+ "metadata": {},
328
+ "source": [
329
+ "## 8. Tag Co-occurrence Heatmap (Top 20 Tags)"
330
+ ]
331
+ },
332
+ {
333
+ "cell_type": "code",
334
+ "execution_count": null,
335
+ "id": "tag-heatmap",
336
+ "metadata": {},
337
+ "outputs": [],
338
+ "source": [
339
+ "tag_counts = Counter(t for tags_list in df['tags'] for t in tags_list)\n",
340
+ "top20_tags = [t for t, _ in tag_counts.most_common(20)]\n",
341
+ "\n",
342
+ "cooccur = np.zeros((20, 20), dtype=int)\n",
343
+ "for tags_list in df['tags']:\n",
344
+ " relevant = [t for t in tags_list if t in top20_tags]\n",
345
+ " for i, t1 in enumerate(top20_tags):\n",
346
+ " if t1 in relevant:\n",
347
+ " for j, t2 in enumerate(top20_tags):\n",
348
+ " if t2 in relevant:\n",
349
+ " cooccur[i, j] += 1\n",
350
+ "\n",
351
+ "# Normalize diagonal to 1 for readability\n",
352
+ "diag = np.diag(cooccur)\n",
353
+ "cooccur_norm = cooccur / diag[:, None]\n",
354
+ "np.fill_diagonal(cooccur_norm, 1.0)\n",
355
+ "\n",
356
+ "fig, ax = plt.subplots(figsize=(12, 10))\n",
357
+ "im = ax.imshow(cooccur_norm, cmap='YlOrRd', aspect='auto', vmin=0, vmax=0.8)\n",
358
+ "ax.set_xticks(range(20))\n",
359
+ "ax.set_yticks(range(20))\n",
360
+ "ax.set_xticklabels(top20_tags, rotation=45, ha='right', fontsize=8)\n",
361
+ "ax.set_yticklabels(top20_tags, fontsize=8)\n",
362
+ "ax.set_title('Tag Co-occurrence (normalized by row tag frequency)', fontsize=13, fontweight='bold', pad=12)\n",
363
+ "plt.colorbar(im, ax=ax, shrink=0.8, label='Co-occurrence rate')\n",
364
+ "plt.tight_layout()\n",
365
+ "plt.show()"
366
+ ]
367
+ },
368
+ {
369
+ "cell_type": "markdown",
370
+ "id": "summary-h",
371
+ "metadata": {},
372
+ "source": [
373
+ "## Summary Statistics"
374
+ ]
375
+ },
376
+ {
377
+ "cell_type": "code",
378
+ "execution_count": null,
379
+ "id": "summary",
380
+ "metadata": {},
381
+ "outputs": [],
382
+ "source": [
383
+ "print('=== Steam Catalog Summary ===')\n",
384
+ "print(f'Total games: {len(df):,}')\n",
385
+ "print(f'Year range: {df.year.min()} - {df.year.max()}')\n",
386
+ "print(f'Unique developers: {df.developer.nunique():,}')\n",
387
+ "print(f'\\nTop rating categories:')\n",
388
+ "for rating, count in df.rating.value_counts().head(6).items():\n",
389
+ " print(f' {rating}: {count:,} ({count/len(df)*100:.1f}%)')\n",
390
+ "print(f'\\nReviews:')\n",
391
+ "print(f' Total: {df.reviews.sum():,.0f}')\n",
392
+ "print(f' Median per game: {df.reviews.median():,.0f}')\n",
393
+ "print(f' Games with 0 reviews: {(df.reviews == 0).sum():,}')\n",
394
+ "print(f' Games with 100K+ reviews: {(df.reviews >= 100000).sum():,}')"
395
+ ]
396
+ }
397
+ ]
398
+ }
steam_force_layout.json CHANGED
The diff for this file is too large to render. See raw diff