{"id":34882011,"url":"https://github.com/hadarshavit/asf","last_synced_at":"2026-03-27T04:07:47.075Z","repository":{"id":269638424,"uuid":"847956124","full_name":"hadarshavit/asf","owner":"hadarshavit","description":"ASF is a flexible Python library for algorithm selection","archived":false,"fork":false,"pushed_at":"2026-03-18T10:52:50.000Z","size":3810,"stargazers_count":9,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-19T01:48:10.623Z","etag":null,"topics":["algorithm-selection","machine-learning","python"],"latest_commit_sha":null,"homepage":"https://hadarshavit.github.io/asf/","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/hadarshavit.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":".github/CODEOWNERS","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":"2024-08-26T21:39:36.000Z","updated_at":"2026-03-05T16:18:54.000Z","dependencies_parsed_at":"2025-12-19T00:04:53.046Z","dependency_job_id":null,"html_url":"https://github.com/hadarshavit/asf","commit_stats":null,"previous_names":["hadarshavit/asf"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/hadarshavit/asf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadarshavit%2Fasf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadarshavit%2Fasf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadarshavit%2Fasf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadarshavit%2Fasf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hadarshavit","download_url":"https://codeload.github.com/hadarshavit/asf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadarshavit%2Fasf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31018554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["algorithm-selection","machine-learning","python"],"created_at":"2025-12-26T02:18:41.990Z","updated_at":"2026-03-27T04:07:47.068Z","avatar_url":"https://github.com/hadarshavit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI - Version](https://img.shields.io/pypi/v/asf-lib)](https://pypi.org/project/asf-lib/)\n[![Python versions](https://img.shields.io/pypi/pyversions/asf-lib)](https://pypi.org/project/asf-lib/)\n[![License](https://img.shields.io/pypi/l/asf-lib?color=informational)](LICENSE)\n[![Python application](https://github.com/hadarshavit/asf/actions/workflows/tests.yml/badge.svg)](https://github.com/hadarshavit/asf/actions/workflows/tests.yml)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14957286.svg)](https://doi.org/10.5281/zenodo.14957286)\n[![codecov](https://codecov.io/gh/hadarshavit/asf/graph/badge.svg?token=WOQ37XYZWG)](https://codecov.io/gh/hadarshavit/asf)\n\n# Algorithm Selection Framework (ASF)\n\nASF is a lightweight yet powerful Python library for algorithm selection and empirical performance prediction. \nIt implements various algorithm selection methods, along with algorithm pre-selection, pre-solving schedules and more features to easily create algorithm selection pipeline.\nASF is a modular framework that allows easy extensions to tailor made an algorithm selector for every use-case.\nWhile ASF includes several built-in machine learning models through scikit-learn and XGBoost, it supports every model that complies with the scikit-learn API.\nASF also implements empirical performance prediction, allowing to use different performance scalings.\n\nASF is written in Python 3 and is intended to use with Python 3.10+. It requires only scikit-learn, NumPy and Pandas as basic requirements. More advanced features (such as hyperparameter optimisation) requires additional dependencies. \n\nYou can find full documentation in: https://hadarshavit.github.io/asf/\n## Installation\n\nASF is written in Python3 and requires Python version 3.10+.\nThe basic installation is lightweight and requires only NumPy, Pandas and scikit-learn.\n\nASF is currently tested on Linux machines. Mac and Windows (official) support will be released in the near future.\n\nTo install the base version run \n```bash\npip install asf\n```\n\n### Additional options\n\nAdditional options include:\n\n- XGBoost model suppot `pip install asf[xgb]`\n- PyTorch-based models `pip install asf[nn]`\n- ASlib scenarios reading `pip install asf[aslib]`\n\n## Quick start\n\nThe first step is to define a the data. It can be either NumPy array or Pandas DataFrame.\nThe data contains of (at least) two matrices. The first defines the instance features with a row for every instance and each column defines one feature.\nThe second is the performance data, for which every row describes an instance and each column the performance of a single algorithm.\n\nHere, we define some toy data on three instances, three features and three algorithms.\n\n```python\ndata = np.array(\n    [\n        [10, 5, 1],\n        [20, 10, 2],\n        [15, 8, 1.5],\n    ]\n)\nfeatures = pd.DataFrame(data, columns=[\"feature1\", \"feature2\", \"feature3\"])\nperformance = np.array(\n    [\n        [120, 100, 110],\n        [140, 150, 130],\n        [180, 170, 190],\n    ]\n)\nperformance = pd.DataFrame(data, columns=[\"algo1\", \"algo2\", \"algo3\"])\n\n```\n\nWe can then define a selector:\n```python\nfrom asf.selectors import PairwiseClassifier\nfrom sklearn.ensemble import RandomForestClassifier\n\nselector = PairwiseClassifier(model_class=RandomForestClassifier)\n\nselector.fit(features, performance)\n```\n\nNext, we can use the selector to predict on unseen dta:\n```\nselector.predict(features)\n```\nCurrently, ASF always returns the prediction in the ASlib format: a dictionary which has the instance id (row index, in case of a numpy array or the index of the row for a pandas dataframe) as keys and an array of tuples (predicted algorithm, budget).\nThe selectors has only one tuple in the array, which is the selected algorithm. \nAn example output is:\n```\n{\n    0: [('algo2', None)], \n    1: [('algo3', None)], \n    2: [('algo2', None)]\n}\n```\n\nThe budget is set by default to None. To change the budget, you can pass it as an argument for the selector initialisation.\nSimilarly, ASF minimises the performance by default. To change it, pass `maximize=True` to the selector.\n\n\n\n\n## Cite Us\n\nIf you use ASF, please cite the Zenodo DOI. We are currently working on publishing a paper on ASF, but by then a Zenodo citation will do it. \n\n```bibtex\n@software{ASF,\n\tauthor = {Hadar Shavit and Holger Hoos},\n\tdoi = {10.5281/zenodo.15288151},\n\ttitle = {ASF: Algorithm Selection Framework},\n\turl = {https://doi.org/10.5281/zenodo.15288151},\n\tyear = {in progress},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadarshavit%2Fasf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadarshavit%2Fasf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadarshavit%2Fasf/lists"}