{"id":19199824,"url":"https://github.com/rose-stl-lab/mrtl-st","last_synced_at":"2026-01-24T00:05:21.023Z","repository":{"id":106638476,"uuid":"379400670","full_name":"Rose-STL-Lab/MRTL-ST","owner":"Rose-STL-Lab","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-02T04:21:44.000Z","size":278346,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T20:24:33.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rose-STL-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-22T21:05:56.000Z","updated_at":"2022-02-15T18:08:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf4247a6-b911-42b5-8b3e-5423d867386a","html_url":"https://github.com/Rose-STL-Lab/MRTL-ST","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FMRTL-ST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FMRTL-ST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FMRTL-ST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rose-STL-Lab%2FMRTL-ST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rose-STL-Lab","download_url":"https://codeload.github.com/Rose-STL-Lab/MRTL-ST/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253173094,"owners_count":21865628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T12:29:07.345Z","updated_at":"2026-01-24T00:05:20.941Z","avatar_url":"https://github.com/Rose-STL-Lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spatiotemporal Latent Factors for Basketball\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install the required libraries. Should include a requirements.txt file in the future.\n\n## Usage\n\nIt is recommended to run all scripts on a server/machine with \u003e128GB memory, \u003e4 CPUs, \u003e1 GPUs.\nFor UCSD Students, request access for a server on DataHub.\n\n## Branches \n\nEach branch creates one of the four types of models described in the paper:\n\ncodewithtimedim branch gives us a representation with time as one of the latent factor dimensions. \n\nevolving-time-dimension branch gives us a representation per each quarter, with temporal regularization, that results in dynamic performance profiles.\n\nplaystyle branch gives us a representation with playstyle as one of the latent factor dimensions. \n\ndifferent-playstyles branch gives us a representation per each playstyle.\n\n## Dataset\n\nThe spatial data we used is available [here](https://github.com/sealneaward/nba-movement-data).\n\nThe input files to the scripts are .pkl files. In order to generate such .pkl file, follow the following steps.\n\nStep 1:\nDecompress the .7z files into .json files. Each of these files represent one NBA basketball game.\n\nStep 2:\nCompile the .json files into a .pkl file by running `new_read_raw.py`:\n\npython new_read_raw.py \\\n    --input-dir $INPUT_DIR \\\n    --output-dir $OUTPUT_DIR\n\n## Pre-Processing\n\nThe data was regularized to a 40x50 court, and truncated to remove players with few to no shot attempts, as well as edge cases (like someone shooting from behind the basket). We also added the quarter number and playstyle (determined through a K-means clustering algorithm run on an [NBA](https://www.nba.com) dataset) number and name. Each player was also encoded an 'a' value used for training, similar to a player_id.\n\n## Training\nStep 1:\nRun `prepare_bball.py` to create the training dataset and set miscellaneous parameters for a single trial (logger, seed, etc.)\n\npython prepare_bball.py \\\n    --root-dir $RUN_DIR \\\n    --data-dir $DATA_DIR\n    \nStep 2:\nRun `run_bball_stop_cond.sh` (can be found `src/`) in with arguments to run a single experiment. This bash file is a helper script that runs `run_bball.py` with preset parameters.\n\nbash run_bball_stop_cond.sh \\\n    --root-dir $RUN_DIR \\\n    --data-dir $DATA_DIR \\\n\n```\n\nTo change which players to get a performance profile representation for, edit the player_ids array (or similar) to the 'a' value from the dataset being used corresponding to the desired player. For playstyle and different-playstyles, you must also switch the additional playstyle_id value for each player.\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frose-stl-lab%2Fmrtl-st","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frose-stl-lab%2Fmrtl-st","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frose-stl-lab%2Fmrtl-st/lists"}