import numpy as np META = { 'name': 'laplacian_coherence_graph', 'domain': 'graph-nn', 'description': 'Synthetic weakly coupled two-community graph node classification.' } def get_dataset(seed, n_train, n_test): rng = np.random.default_rng(seed) n = n_train + n_test y = (np.arange(n) >= n // 2).astype(np.int64) x = rng.normal(0, .7, (n, 8)).astype(np.float32) s = 2*y - 1 x[:, 0] = .18*s x[:, 1] = .12*s flip = rng.random(n) < .12 y[flip] = 1 - y[flip] return {'xtr': x[:n_train], 'ytr': y[:n_train], 'xte': x[n_train:], 'yte': y[n_train:], 'task': 'classification', 'metric': 'err', 'out_dim': 2}