{"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/n-gram-graph-a-novel-molecule-representation","title":"N-Gram Graph: Simple Unsupervised Representation for Graphs, with Applications to Molecules","arxiv_id":"1806.09206","date":"2018-06-24","proceeding":"NeurIPS 2019 12","authors":["Shengchao Liu","Mehmet Furkan Demirel","YIngyu Liang"],"abstract":"Machine learning techniques have recently been adopted in various applications in medicine, biology, chemistry, and material engineering. An important task is to predict the properties of molecules, which serves as the main subroutine in many downstream applications such as virtual screening and drug design. Despite the increasing interest, the key challenge is to construct proper representations of molecules for learning algorithms. This paper introduces the N-gram graph, a simple unsupervised representation for molecules. The method first embeds the vertices in the molecule graph. It then constructs a compact representation for the graph by assembling the vertex embeddings in short walks in the graph, which we show is equivalent to a simple graph neural network that needs no training. The representations can thus be efficiently computed and then used with supervised learning methods for prediction. Experiments on 60 tasks from 10 benchmark datasets demonstrate its advantages over both popular graph neural networks and traditional representation methods. This is complemented by theoretical analysis showing its strong representation and prediction power.","url_abs":"https://arxiv.org/abs/1806.09206v2","url_pdf":"https://arxiv.org/pdf/1806.09206v2.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":"n-gram-graph-a-novel-molecule-representation","repo_url":"https://github.com/chao1224/n_gram_graph","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"drug-design","task_name":"Drug Design"},{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"molecular-property-prediction","task_name":"Molecular Property Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/molecular-property-prediction-on-bace-1","task":"Molecular Property Prediction","dataset":"BACE","model":"N-GramXGB","rank_in_archive_order":13,"of":20,"metrics":{"ROC-AUC":"79.1"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-bace-1","task":"Molecular Property Prediction","dataset":"BACE","model":"N-GramRF","rank_in_archive_order":14,"of":20,"metrics":{"ROC-AUC":"77.9"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-bbbp-1","task":"Molecular Property Prediction","dataset":"BBBP","model":"N-GramRF","rank_in_archive_order":21,"of":29,"metrics":{"ROC-AUC":"69.7"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-bbbp-1","task":"Molecular Property Prediction","dataset":"BBBP","model":"N-GramXGB","rank_in_archive_order":23,"of":29,"metrics":{"ROC-AUC":"69.1"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-freesolv","task":"Molecular Property Prediction","dataset":"FreeSolv","model":"N-GramRF","rank_in_archive_order":20,"of":22,"metrics":{"RMSE":"2.688"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-freesolv","task":"Molecular Property Prediction","dataset":"FreeSolv","model":"N-GramXGB","rank_in_archive_order":22,"of":22,"metrics":{"RMSE":"5.061"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on","task":"Molecular Property Prediction","dataset":"Lipophilicity","model":"N-GramRF","rank_in_archive_order":10,"of":13,"metrics":{"RMSE":"0.812"},"uses_additional_data":true},{"leaderboard":"/sota/molecular-property-prediction-on","task":"Molecular Property Prediction","dataset":"Lipophilicity","model":"N-GramXGB","rank_in_archive_order":13,"of":13,"metrics":{"RMSE":"2.072"},"uses_additional_data":true},{"leaderboard":"/sota/molecular-property-prediction-on-qm7","task":"Molecular Property Prediction","dataset":"QM7","model":"N-GramXGB","rank_in_archive_order":3,"of":8,"metrics":{"MAE":"81.9"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-qm7","task":"Molecular Property Prediction","dataset":"QM7","model":"N-GramRF","rank_in_archive_order":5,"of":8,"metrics":{"MAE":"92.8"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-qm8","task":"Molecular Property Prediction","dataset":"QM8","model":"N-GramXGB","rank_in_archive_order":5,"of":8,"metrics":{"MAE":"0.0215"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-qm8","task":"Molecular Property Prediction","dataset":"QM8","model":"N-GramRF","rank_in_archive_order":8,"of":8,"metrics":{"MAE":"0.0236"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-qm9","task":"Molecular Property Prediction","dataset":"QM9","model":"N-GramXGB","rank_in_archive_order":5,"of":8,"metrics":{"MAE":"0.00964"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-qm9","task":"Molecular Property Prediction","dataset":"QM9","model":"N-GramRF","rank_in_archive_order":8,"of":8,"metrics":{"MAE":"0.01037"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-sider-1","task":"Molecular Property Prediction","dataset":"SIDER","model":"N-GramRF","rank_in_archive_order":6,"of":19,"metrics":{"ROC-AUC":"66.8"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-sider-1","task":"Molecular Property Prediction","dataset":"SIDER","model":"N-GramXGB","rank_in_archive_order":8,"of":19,"metrics":{"ROC-AUC":"65.5"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-tox21-1","task":"Molecular Property Prediction","dataset":"Tox21","model":"N-GramXGB","rank_in_archive_order":12,"of":20,"metrics":{"ROC-AUC":"75.8"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-tox21-1","task":"Molecular Property Prediction","dataset":"Tox21","model":"N-GramRF","rank_in_archive_order":13,"of":20,"metrics":{"ROC-AUC":"74.3"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-clintox-1","task":"Molecular Property Prediction","dataset":"clintox","model":"N-GramXGB","rank_in_archive_order":9,"of":20,"metrics":{"ROC-AUC":"87.5"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-clintox-1","task":"Molecular Property Prediction","dataset":"clintox","model":"N-GramRF","rank_in_archive_order":15,"of":20,"metrics":{"ROC-AUC":"77.5"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/1806.09206","atlas_url":"https://app.syntology.ai/?focus=1806.09206","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1806.09206"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/chao1224/n_gram_graph","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":14},"by_repo_kind":{"official":{"samples":14,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"a84d48d3f4da50b2","entry":"eval_precision_auc_single","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/model/xgboost_classification.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/model/xgboost_classification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a84d48d3f4da50b2"}},{"code_sha256_prefix":"ec25e146522eae7c","entry":"eval_roc_auc_single","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/model/xgboost_classification.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/model/xgboost_classification.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ec25e146522eae7c"}},{"code_sha256_prefix":"a624692f0d5c694f","entry":"extract_atom_features","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"datasets/graph_util.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/datasets/graph_util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a624692f0d5c694f"}},{"code_sha256_prefix":"54f60a5f224a43de","entry":"extract_feature_and_label","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/util.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"54f60a5f224a43de"}},{"code_sha256_prefix":"d2486ecb7758cb18","entry":"extract_feature_and_label_npy","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/util.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d2486ecb7758cb18"}},{"code_sha256_prefix":"13577a7f893cffe2","entry":"get_data","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/embedding/graph_embedding.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/embedding/graph_embedding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"13577a7f893cffe2"}},{"code_sha256_prefix":"a71541d7e492251e","entry":"get_data","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/embedding/node_embedding.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/embedding/node_embedding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a71541d7e492251e"}},{"code_sha256_prefix":"b1f9ec0171283338","entry":"get_walk_representation","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/embedding/graph_embedding.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/embedding/graph_embedding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b1f9ec0171283338"}},{"code_sha256_prefix":"d8aa3b46875f660f","entry":"one_of_k_encoding","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"datasets/graph_util.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/datasets/graph_util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d8aa3b46875f660f"}},{"code_sha256_prefix":"a0a187fc6d7c1fbb","entry":"one_of_k_encoding_unk","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"datasets/graph_util.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/datasets/graph_util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a0a187fc6d7c1fbb"}},{"code_sha256_prefix":"722ce4106fe14cb6","entry":"precision_auc_single","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/evaluation.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"722ce4106fe14cb6"}},{"code_sha256_prefix":"3ad2ab861692ccfa","entry":"read_merged_data","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/util.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3ad2ab861692ccfa"}},{"code_sha256_prefix":"4e1ae6888f565413","entry":"rms_score","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/evaluation.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4e1ae6888f565413"}},{"code_sha256_prefix":"5b8eaedcb343dbd7","entry":"roc_auc_single","repo":"chao1224/n_gram_graph","repo_kind":"official","path":"n_gram_graph/evaluation.py","file_url":"https://github.com/chao1224/n_gram_graph/blob/HEAD/n_gram_graph/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5b8eaedcb343dbd7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}