farazjawed commited on
Commit
de76536
1 Parent(s): 7824374

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -3
README.md CHANGED
@@ -25,13 +25,34 @@ The project provides the following features:
25
  - Quarter number
26
  - Saving the extracted data into Parquet files for easy access and analysis.
27
 
28
- ## Usage
29
- 1. **Fetching Play-by-Play Data**: To fetch play-by-play data, use the provided `get_game_pbp()` function, which retrieves data from the Sportradar API and saves it into JSON files.
30
 
31
- 2. **Extracting Features**: Use the `get_game_pbp()` function to extract relevant features from the JSON files and create a DataFrame containing the extracted data.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  3. **Saving Data**: The extracted data can be saved into Parquet files using pandas' `to_parquet()` function for future analysis and usage.
34
 
 
 
 
 
 
 
 
 
35
  ## Potential Applications
36
  - Generating live commentary for NBA matches.
37
  - Performing in-depth analysis of player performance, team strategies, and game dynamics.
 
25
  - Quarter number
26
  - Saving the extracted data into Parquet files for easy access and analysis.
27
 
 
 
28
 
29
+ ## Format
30
+
31
+ - The data is in the form of .parquet files, with each file corresponding to one NBA game. We have data on a total of 179 NBA games in the 2023 season, this was the highest limit available on the Sportsradar API free tier.
32
+ - There is also a file called `_combined_dataframe.parquet` which has data for all of the games in one file, incase someone wants to use that.
33
+
34
+
35
+ ## Data Pipeline Code
36
+
37
+ - The file `api_fetch.ipynb` contains the code which was used to fetch data and create the source json files for each of the matches which were then used for creating clean parquet files having the relevant data which we need.
38
+ - If you need to look at a specific example of the json file you can do so by going in the `json_example` folder. It has the raw json data fetched for one example game. For full access of json files for each game (incase you want more data - on each player level or something, please reach out on [email protected]).
39
+
40
+
41
+ ## Explanation of my code in `dataset_creation.ipynb`
42
+ 1. **Fetching Play-by-Play Data**: To fetch play-by-play data, I made the function `get_game_pbp()` function, which retrieves data from the Sportradar API and saves it into JSON files.
43
+
44
+ 2. **Extracting Features**: Used the `get_game_pbp()` function to extract relevant features from the JSON files and create a DataFrame containing the extracted data.
45
 
46
  3. **Saving Data**: The extracted data can be saved into Parquet files using pandas' `to_parquet()` function for future analysis and usage.
47
 
48
+ ## How can you use it:
49
+
50
+ Run the following commands:
51
+
52
+ - `from datasets import load_dataset`
53
+
54
+ - `dataset = load_dataset("farazjawed/NBA_PLAY_BY_PLAY_DATA_2023")`
55
+
56
  ## Potential Applications
57
  - Generating live commentary for NBA matches.
58
  - Performing in-depth analysis of player performance, team strategies, and game dynamics.