目录

MoonBanditBench

MoonBanditBench is a MoonBit library for strategy comparison and result export.

Project links:

It currently includes:

  • epsilon-greedy
  • UCB1
  • Thompson Sampling for Bernoulli rewards
  • LinUCB for contextual bandits
  • regret curve export as CSV
  • a small demo runner and tests

Why this topic

This project fits the OSC2026/MoonBit competition well because it is:

  • technically clear
  • easy to explain in a demo
  • expandable into recommendation, ads, and A/B testing
  • large enough to show engineering quality without becoming too narrow

Repository layout

  • bandit.mbt: Bernoulli bandit environment and classic algorithms
  • contextual.mbt: linear contextual bandit environment and LinUCB
  • report.mbt: regret trace and CSV export helpers
  • cmd/main/main.mbt: demo entry point
  • bandit_test.mbt and contextual_test.mbt: smoke tests

Usage

Run the demo:

moon run cmd/main

Run tests:

moon test

Output

The demo prints:

  • a one-line summary for each algorithm
  • a CSV preview for regret-curve export

The CSV format is designed so it can be copied into spreadsheets or plotting tools.

Competition notes

This repository is intentionally kept in a public, readable shape:

  • Apache-2.0 license
  • source code written in MoonBit
  • readable README
  • runnable example
  • tests included

Source provenance

All MoonBit source in this repository was written for this project from scratch.

The algorithm choices are standard bandit methods widely used in the literature and practice, but no upstream implementation code was copied.

Next expansion ideas

  • add offline evaluation on logged data
  • add epsilon-decay and softmax exploration
  • add a richer contextual model for recommendation ranking
  • add experiment assignment utilities for A/B testing
  • add charts or HTML export for regret curves

GitHub

After publishing the repository, replace this note with the actual GitHub URL used for review.

关于

MoonBanditBench 是一个 MoonBit 示例项目,包含多种算法实现与结果展示。

55.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号