harbor run -t bespokelabs/sparse-elsa-item-embeddings-8nnzharbor download bespokelabs/sparse-elsa-item-embeddings-8nnzBuild compact item embeddings that retrieve a user's held-out items from their known interactions.
/app/data/train.npz holds a binarized user-item interaction matrix. scipy.sparse.load_npz
loads it as a csr_matrix of shape (48366, 10000), dtype float32, every stored value 1.0.
Rows are users, columns are items. Item ids are anonymized and carry no meaning outside this
matrix.
Retrieval uses one item-embedding matrix A with 10,000 rows and d columns, applied through a
fixed rule. Let A_norm be A with every row rescaled to unit L2 norm (an all-zero row stays
all-zero), and let x be a user's binary interaction vector over the 10,000 items:
r = x @ A_norm @ A_norm.T - x
Items are recommended to that user in order of descending r.
Build A to serve that rule as well as you can, under a hard storage budget:
A1 <= d <= 65536; you choose d in that range, and its value neither rewards nor penalizes you directly/app/output/solution.py, exposing:
def build_item_embeddings(X_train, n_items, max_nnz_per_item, max_dims, seed):
...
It's called exactly once, positionally, so parameter names are yours to choose:
X_train - a scipy.sparse.csr_matrix, float32, with sorted indices, identical in content and
layout to /app/data/train.npzn_items = 10000, max_nnz_per_item = 8, max_dims = 65536seed - a fixed integer, the same on every graded runReturn value:
scipy.sparse matrix (any format) or a 2-D numpy.ndarray(10000, d)Submission format:
/app/output/ is everything that crosses over to gradingsolution.py, plus every module, weight file, and config it reads at run time, must live inside
/app/output/solution, with its own directory first on sys.path__file__, never by an absolute path under /app/app exists at grade time - /app/data/ in particular is gone, so pull
anything you need from the training data out of X_train, not the fileRuntime environment:
solutionA is scoredMetric: mean nDCG@100 over sealed evaluation rows.
Evaluation rows:
/app/data/train.npz nor /app/data/val.npzPer-row score, with x the input part:
r as defined abover to $-\infty$ on the items already in that row's input partr, breaking ties by ascending item index, and keep the top 100k is the number
of held-out itemsFinal score: the per-row values, averaged uniformly. Higher is strictly better, with no cutoff where further improvement stops mattering. A submission that does no better than a trivial baseline earns nothing.
A submission scores 0 if any of the following holds:
/app/output/solution.py is missing or fails to importbuild_item_embeddingsndarrayd is outside 1 .. 65536/app/data/val.npz - csr_matrix (2500, 10000), same format as the training matrix: 2,500
further users, disjoint from the 48,366 training users and from the 2,500 evaluation users.
Nothing about the evaluation rows themselves is available locally./app/check_contract.py - runs your entry point the way grading does and reports the shape,
the per-row nonzero counts, d, and the wall clock it used. It computes no metric.Packages installed: numpy, scipy, scikit-learn, CPU torch.
Filesystem: /app/output and /tmp are writable; /app/data is read-only.