{"id":31211498,"url":"https://github.com/cyberagentailab/thresholded-lasso-bandit","last_synced_at":"2025-09-21T05:27:38.789Z","repository":{"id":109618301,"uuid":"500512760","full_name":"CyberAgentAILab/thresholded-lasso-bandit","owner":"CyberAgentAILab","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-22T06:50:19.000Z","size":15,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-10T07:42:53.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyberAgentAILab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-06-06T16:36:46.000Z","updated_at":"2025-05-02T07:49:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9ed4d75-1532-46a6-a079-25f73b82ce79","html_url":"https://github.com/CyberAgentAILab/thresholded-lasso-bandit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CyberAgentAILab/thresholded-lasso-bandit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Fthresholded-lasso-bandit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Fthresholded-lasso-bandit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Fthresholded-lasso-bandit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Fthresholded-lasso-bandit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberAgentAILab","download_url":"https://codeload.github.com/CyberAgentAILab/thresholded-lasso-bandit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberAgentAILab%2Fthresholded-lasso-bandit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276195623,"owners_count":25601151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-21T05:27:36.191Z","updated_at":"2025-09-21T05:27:38.782Z","avatar_url":"https://github.com/CyberAgentAILab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thresholded Lasso Bandit\nCode for reproducing results in the paper \"[Thresholded Lasso Bandit](https://arxiv.org/abs/2010.11994)\".\n\n## About\nIn this paper, we revisit the regret minimization problem in sparse stochastic contextual linear bandits, where feature vectors may be of large dimension $d$, but where the reward function depends on a few, say $s_0\\ll d$, of these features only.\nWe present Thresholded Lasso bandit, an algorithm that (i) estimates the vector defining the reward function as well as its sparse support, i.e., significant feature elements, using the Lasso framework with thresholding, and (ii) selects an arm greedily according to this estimate projected on its support.\nThe algorithm does not require prior knowledge of the sparsity index $s_0$ and can be parameter-free.\nFor this simple algorithm, we establish non-asymptotic regret upper bounds scaling as $\\mathcal{O}( \\log d + \\sqrt{T} )$ in general, and as $\\mathcal{O}( \\log d + \\log T)$ under the so-called margin condition (a probabilistic condition on the separation of the arm rewards).\nThe regret of previous algorithms scales as $\\mathcal{O}( \\log d + \\sqrt{T \\log (d T)})$ and $\\mathcal{O}( \\log T \\log d)$ in the two settings, respectively.\nThrough numerical experiments, we confirm that our algorithm outperforms existing methods. \n\n## Installation\nThis code is written in Python 3.\nTo install the required dependencies, execute the following command:\n```bash\n$ pip install -r requirements.txt\n```\n\n### For Docker User\nBuild the container:\n```bash\n$ docker build -t thresholded-lasso-bandit .\n```\nAfter build finished, run the container:\n```bash\n$ docker run -it thresholded-lasso-bandit\n```\n\n## Run Experiments\nIn order to investigate the performance of TH Lasso bandit on features drawn from a Gaussian distribution, execute the following command:\n```bash\n$ python run_gaussian_experiment.py\n```\nIn this experiment, the following options can be specified:\n* `--K`: Number of arms. The default value is `2`.\n* `--T`: Number of rounds to be played. The default value is `1000`.\n* `--d`: Dimension of feature vectors. The default value is `1000`.\n* `--s0`: Sparsity index. The default value is `20`.\n* `--x_max`: Maximum l2-norm of feature vectors. The default value is `10`.\n* `--rho_sq`: Correlation level between feature vectors of arms. The default value is `0.7`.\n* `--num_trial`: Number of trials to run experiments. The default value is `20`.\n\nTo evaluate TH Lasso bandit via an experiment with a feature distribution other than the Gaussian distribution (uniform, elliptical, hard instance), execute the following command:\n```bash\n$ python run_uniform_experiment.py\n``` \n```bash\n$ python run_elliptical_experiment.py\n``` \n```bash\n$ python run_hard_instance_experiment.py\n``` \n\n## Citation\nIf you use our code in your work, please cite our paper:\n```\n@InProceedings{ariu2022thlassobandit,\n  title = \t {Thresholded Lasso Bandit},\n  author =       {Ariu, Kaito and Abe, Kenshi and Proutiere, Alexandre},\n  booktitle = \t {Proceedings of the 39th International Conference on Machine Learning},\n  pages = \t {878--928},\n  year = \t {2022},\n  volume = \t {162}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberagentailab%2Fthresholded-lasso-bandit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberagentailab%2Fthresholded-lasso-bandit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberagentailab%2Fthresholded-lasso-bandit/lists"}