SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1806.09206 · 2018

N-Gram Graph: Simple Unsupervised Representation for Graphs, with Applications to Molecules

arXiv · PDF · Open in the Atlas

Code that ran

5 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 9 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1806.09206.json · badge: /api/ran/1806.09206.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
chao1224/n_gram_graph canonical (classifier label)
classifier basis: census
5 ran · 9 no recorded run
FunctionStatusWhere it lives
one_of_k_encoding Ran
ran on a synthesized input
chao1224/n_gram_graph/datasets/graph_util.py
code served (permissive licence) · get_code("d8aa3b46875f660f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned map. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function one_of_k_encoding takes:
# - x: an element to encode
# - allowable_set: a set/list of allowed values
# It checks if x is in allowable_set, then returns a one-hot encoding

x_value = "carbon"
allowable_set_value = ["carbon", "nitrogen", "oxygen", "sulfur"]

ARGS = {
    "x": x_value,
    "allowable_set": allowable_set_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type map — a map output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a map output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
one_of_k_encoding_unk Ran
ran on a synthesized input
chao1224/n_gram_graph/datasets/graph_util.py
code served (permissive licence) · get_code("a0a187fc6d7c1fbb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned map. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging

# Set up logging to see info messages
logging.basicConfig(level=logging.INFO)

# Define arguments for one_of_k_encoding_unk
x = "carbon"
allowable_set = ["nitrogen", "oxygen", "sulfur", "carbon"]

ARGS = {
    "x": x,
    "allowable_set": allowable_set,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type map — a map output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a map output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
precision_auc_single Ran
ran on a synthesized input
chao1224/n_gram_graph/n_gram_graph/evaluation.py
code served (permissive licence) · get_code("722ce4106fe14cb6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from sklearn.metrics import average_precision_score

# The function takes two parameters:
# 1. predicted: array-like of predicted scores/probabilities
# 2. actual: array-like of true binary labels

# Create small numpy arrays suitable for average_precision_score
np.random.seed(0)

# Generate predicted scores (continuous values between 0 and 1)
predicted = np.array([0.1, 0.4, 0.35, 0.8, 0.9, 0.2])

# Generate actual binary labels (0 or 1)
actual = np.array([0, 0, 1, 1, 1, 0])

ARGS = {
    "predicted": predicted,
    "actual": actual
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rms_score Ran
ran on a synthesized input
chao1224/n_gram_graph/n_gram_graph/evaluation.py
code served (permissive licence) · get_code("4e1ae6888f565413")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from sklearn.metrics import mean_squared_error

def rms_score(y_true, y_pred):
    """Computes RMS error."""
    return np.sqrt(mean_squared_error(y_true, y_pred))

# Create small sample data
np.random.seed(0)
y_true = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
y_pred = np.array([1.1, 2.2, 2.9, 4.1, 4.8])

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
roc_auc_single Ran
ran on a synthesized input
chao1224/n_gram_graph/n_gram_graph/evaluation.py
code served (permissive licence) · get_code("5b8eaedcb343dbd7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

# Set seed for reproducibility
torch.manual_seed(0)
np.random.seed(0)

# Create sample predicted and actual values for binary classification
# predicted should be probability scores (between 0 and 1)
# actual should be binary labels (0 or 1)

predicted = np.array([0.1, 0.9, 0.8, 0.2])
actual = np.array([0, 1, 1, 0])

ARGS = {
    "predicted": predicted,
    "actual": actual,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eval_precision_auc_single Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/model/xgboost_classification.py
code served (permissive licence) · get_code("a84d48d3f4da50b2")
How it ran

no invocation recorded.

eval_roc_auc_single Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/model/xgboost_classification.py
code served (permissive licence) · get_code("ec25e146522eae7c")
How it ran

no invocation recorded.

extract_atom_features Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/datasets/graph_util.py
code served (permissive licence) · get_code("a624692f0d5c694f")
How it ran

no invocation recorded.

extract_feature_and_label Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/util.py
code served (permissive licence) · get_code("54f60a5f224a43de")
How it ran

no invocation recorded.

extract_feature_and_label_npy Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/util.py
code served (permissive licence) · get_code("d2486ecb7758cb18")
How it ran

no invocation recorded.

get_data Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/embedding/graph_embedding.py
code served (permissive licence) · get_code("13577a7f893cffe2")
How it ran

no invocation recorded.

get_data Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/embedding/node_embedding.py
code served (permissive licence) · get_code("a71541d7e492251e")
How it ran

no invocation recorded.

get_walk_representation Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/embedding/graph_embedding.py
code served (permissive licence) · get_code("b1f9ec0171283338")
How it ran

no invocation recorded.

read_merged_data Not yet run
unverified (harvested, no recorded run)
chao1224/n_gram_graph/n_gram_graph/util.py
code served (permissive licence) · get_code("3ad2ab861692ccfa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 14 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1806.09206")
get_code_for_paper("1806.09206")
have("1806.09206")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1806.09206.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1806.09206.svg)](https://syntology.ai/paper/1806.09206)

Connect an agent — have() is free.