{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/predictive-modeling-with-temporal-graphical","title":"Predictive Modeling with Temporal Graphical Representation on Electronic Health Records","arxiv_id":"2405.03943","date":"2024-05-07","proceeding":null,"authors":["Jiayuan Chen","Changchang Yin","Yuanlong Wang","Ping Zhang"],"abstract":"Deep learning-based predictive models, leveraging Electronic Health Records (EHR), are receiving increasing attention in healthcare. An effective representation of a patient's EHR should hierarchically encompass both the temporal relationships between historical visits and medical events, and the inherent structural information within these elements. Existing patient representation methods can be roughly categorized into sequential representation and graphical representation. The sequential representation methods focus only on the temporal relationships among longitudinal visits. On the other hand, the graphical representation approaches, while adept at extracting the graph-structured relationships between various medical events, fall short in effectively integrate temporal information. To capture both types of information, we model a patient's EHR as a novel temporal heterogeneous graph. This graph includes historical visits nodes and medical events nodes. It propagates structured information from medical event nodes to visit nodes and utilizes time-aware visit nodes to capture changes in the patient's health status. Furthermore, we introduce a novel temporal graph transformer (TRANS) that integrates temporal edge features, global positional encoding, and local structural encoding into heterogeneous graph convolution, capturing both temporal and structural information. We validate the effectiveness of TRANS through extensive experiments on three real-world datasets. The results show that our proposed approach achieves state-of-the-art performance.","url_abs":"https://arxiv.org/abs/2405.03943v1","url_pdf":"https://arxiv.org/pdf/2405.03943v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"predictive-modeling-with-temporal-graphical","repo_url":"https://github.com/the-real-jerrychen/trans","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"focus","method_name":"Focus"},{"method_slug":"graph-transformer","method_name":"Graph Transformer"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"lapeigen","method_name":"LapEigen"},{"method_slug":"laplacian-pe","method_name":"Laplacian PE"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.03943","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.03943"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/the-real-jerrychen/trans","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/The-Real-JerryChen/TRANS","reach":{"status":"ok"}}],"summary":{"ran":10},"by_repo_kind":{"official":{"samples":10,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":10,"samples":[{"code_sha256_prefix":"890dae1cdee3d6a9","entry":"Attention","repo":"The-Real-JerryChen/TRANS","repo_kind":"official","path":"models/Seqmodels.py","file_url":"https://github.com/The-Real-JerryChen/TRANS/blob/HEAD/models/Seqmodels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"890dae1cdee3d6a9"}},{"code_sha256_prefix":"aec89621438a6ffd","entry":"MultiHeadedAttention","repo":"The-Real-JerryChen/TRANS","repo_kind":"official","path":"models/Seqmodels.py","file_url":"https://github.com/The-Real-JerryChen/TRANS/blob/HEAD/models/Seqmodels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aec89621438a6ffd"}},{"code_sha256_prefix":"e1041c5cf014c687","entry":"PositionwiseFeedForward","repo":"The-Real-JerryChen/TRANS","repo_kind":"official","path":"models/Seqmodels.py","file_url":"https://github.com/The-Real-JerryChen/TRANS/blob/HEAD/models/Seqmodels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e1041c5cf014c687"}},{"code_sha256_prefix":"c155570232cc0f8c","entry":"SublayerConnection","repo":"The-Real-JerryChen/TRANS","repo_kind":"official","path":"models/Seqmodels.py","file_url":"https://github.com/The-Real-JerryChen/TRANS/blob/HEAD/models/Seqmodels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c155570232cc0f8c"}},{"code_sha256_prefix":"65bdef9d91c144b9","entry":"TransformerBlock","repo":"The-Real-JerryChen/TRANS","repo_kind":"official","path":"models/Seqmodels.py","file_url":"https://github.com/The-Real-JerryChen/TRANS/blob/HEAD/models/Seqmodels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"65bdef9d91c144b9"}},{"code_sha256_prefix":"c2885bbdafcf8e2b","entry":"TransformerLayer","repo":"The-Real-JerryChen/TRANS","repo_kind":"official","path":"models/Seqmodels.py","file_url":"https://github.com/The-Real-JerryChen/TRANS/blob/HEAD/models/Seqmodels.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c2885bbdafcf8e2b"}},{"code_sha256_prefix":"0d72f327e195b4f8","entry":"batch_to_multihot","repo":"the-real-jerrychen/trans","repo_kind":"official","path":"utils.py","file_url":"https://github.com/the-real-jerrychen/trans/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0d72f327e195b4f8"}},{"code_sha256_prefix":"1d25b1ebae4d2442","entry":"get_bounds_from_slice_dict","repo":"the-real-jerrychen/trans","repo_kind":"official","path":"models/HGT.py","file_url":"https://github.com/the-real-jerrychen/trans/blob/HEAD/models/HGT.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1d25b1ebae4d2442"}},{"code_sha256_prefix":"dd7ba655a14b62f2","entry":"get_last_visit_features_from_slices","repo":"the-real-jerrychen/trans","repo_kind":"official","path":"models/HGT.py","file_url":"https://github.com/the-real-jerrychen/trans/blob/HEAD/models/HGT.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dd7ba655a14b62f2"}},{"code_sha256_prefix":"d8a87bbbd68ad508","entry":"group","repo":"the-real-jerrychen/trans","repo_kind":"official","path":"layers/HGC.py","file_url":"https://github.com/the-real-jerrychen/trans/blob/HEAD/layers/HGC.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d8a87bbbd68ad508"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}