{"id":14958354,"url":"https://github.com/fbruzzesi/sklearn-smithy","last_synced_at":"2025-09-16T19:31:45.502Z","repository":{"id":240639949,"uuid":"799848384","full_name":"FBruzzesi/sklearn-smithy","owner":"FBruzzesi","description":"Toolkit to forge scikit-learn compatible estimators","archived":false,"fork":false,"pushed_at":"2025-08-01T00:20:04.000Z","size":959,"stargazers_count":19,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T18:38:04.550Z","etag":null,"topics":["cli","data-science","machine-learning","python","scikit-learn","webui"],"latest_commit_sha":null,"homepage":"https://sklearn-smithy.streamlit.app/","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/FBruzzesi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-05-13T08:10:39.000Z","updated_at":"2025-06-04T12:57:18.000Z","dependencies_parsed_at":"2024-06-15T21:22:30.802Z","dependency_job_id":"7d0bb50b-e9bc-45c2-9b59-c37b895d415d","html_url":"https://github.com/FBruzzesi/sklearn-smithy","commit_stats":{"total_commits":63,"total_committers":2,"mean_commits":31.5,"dds":0.2857142857142857,"last_synced_commit":"c47ac4e0aab2df204ae39e9237ddd9a5275ff085"},"previous_names":["fbruzzesi/sklearn-smithy"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/FBruzzesi/sklearn-smithy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FBruzzesi%2Fsklearn-smithy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FBruzzesi%2Fsklearn-smithy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FBruzzesi%2Fsklearn-smithy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FBruzzesi%2Fsklearn-smithy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FBruzzesi","download_url":"https://codeload.github.com/FBruzzesi/sklearn-smithy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FBruzzesi%2Fsklearn-smithy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275472475,"owners_count":25471273,"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-16T02:00:10.229Z","response_time":65,"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":["cli","data-science","machine-learning","python","scikit-learn","webui"],"created_at":"2024-09-24T13:16:49.670Z","updated_at":"2025-09-16T19:31:45.134Z","avatar_url":"https://github.com/FBruzzesi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/FBruzzesi/sklearn-smithy/main/docs/img/sksmith-logo.svg\" width=150 height=150 align=\"right\"\u003e\n\n# Scikit-learn Smithy\n\nScikit-learn smithy is a tool that helps you to forge scikit-learn compatible estimator with ease.\n\n---\n\n[WebUI](https://sklearn-smithy.streamlit.app/) | [Documentation](https://fbruzzesi.github.io/sklearn-smithy) | [Repository](https://github.com/fbruzzesi/sklearn-smithy) | [Issue Tracker](https://github.com/fbruzzesi/sklearn-smithy/issues)\n\n---\n\nHow can you use it?\n\n\u003cdetails\u003e\u003csummary\u003e✅ Directly from the browser via a Web UI. \u003c/summary\u003e\n\n\u003cbr\u003e\n\n- Available at [sklearn-smithy.streamlit.app](https://sklearn-smithy.streamlit.app/)\n- It requires no installation.\n- Powered by [streamlit](https://streamlit.io/)\n\n\u003cimg src=\"https://raw.githubusercontent.com/FBruzzesi/sklearn-smithy/main/docs/img/webui.png\" align=\"right\"\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e✅ As a CLI (command line interface) in the terminal.\u003c/summary\u003e\n\n\u003cbr\u003e\n\n- Available via the `smith forge` command.\n- It requires [installation](#installation): `python -m pip install sklearn-smithy`\n- Powered by [typer](https://typer.tiangolo.com/).\n\n\u003cimg src=\"https://raw.githubusercontent.com/FBruzzesi/sklearn-smithy/main/docs/img/cli.png\" align=\"right\"\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e✅ As a TUI (terminal user interface) in the terminal.\u003c/summary\u003e\n\n\u003cbr\u003e\n\n- Available via the `smith forge-tui` command.\n- It requires installing [extra dependencies](#extra-dependencies): `python -m pip install \"sklearn-smithy[textual]\"`\n- Powered by [textual](https://textual.textualize.io/).\n\n\u003cimg src=\"https://raw.githubusercontent.com/FBruzzesi/sklearn-smithy/main/docs/img/tui.png\" align=\"right\"\u003e\n\n\u003c/details\u003e\n\nAll these tools will prompt a series of questions regarding the estimator you want to create, and then it will generate the boilerplate code for you.\n\n## Why ❓\n\nWriting scikit-learn compatible estimators might be harder than expected.\n\nWhile everyone knows about the `fit` and `predict`, there are other behaviours, methods and attributes that\nscikit-learn might be expecting from your estimator depending on:\n\n- The type of estimator you're writing.\n- The signature of the estimator.\n- The signature of the `.fit(...)` method.\n\nScikit-learn Smithy to the rescue: this tool aims to help you crafting your own estimator by asking a few\nquestions about it, and then generating the boilerplate code.\n\nIn this way you will be able to fully focus on the core implementation logic, and not on nitty-gritty details\nof the scikit-learn API.\n\n### Sanity check\n\nOnce the core logic is implemented, the estimator should be ready to test against the _somewhat official_\n[`parametrize_with_checks`](https://scikit-learn.org/dev/modules/generated/sklearn.utils.estimator_checks.parametrize_with_checks.html#sklearn.utils.estimator_checks.parametrize_with_checks)\npytest compatible decorator:\n\n```py\nfrom sklearn.utils.estimator_checks import parametrize_with_checks\n\n@parametrize_with_checks([\n    YourAwesomeRegressor,\n    MoreAwesomeClassifier,\n    EvenMoreAwesomeTransformer,\n])\ndef test_sklearn_compatible_estimator(estimator, check):\n    check(estimator)\n```\n\nand it should be compatible with scikit-learn Pipeline, GridSearchCV, etc.\n\n### Official guide\n\nScikit-learn documentation on how to\n[develop estimators](https://scikit-learn.org/dev/developers/develop.html#developing-scikit-learn-estimators).\n\n## Supported estimators\n\nThe following types of scikit-learn estimator are supported:\n\n- ✅ Classifier\n- ✅ Regressor\n- ✅ Outlier Detector\n- ✅ Clusterer\n- ✅ Transformer\n  - ✅ Feature Selector\n- 🚧 Meta Estimator\n\n## Installation\n\nsklearn-smithy is available on [pypi](https://pypi.org/project/sklearn-smithy), so you can install it directly from there:\n\n```bash\npython -m pip install sklearn-smithy\n```\n\n**Remark:** The minimum Python version required is 3.10.\n\nThis will make the `smith` command available in your terminal, and you should be able to run the following:\n\n```bash\nsmith version\n```\n\n\u003e sklearn-smithy=...\n\n### Extra dependencies\n\nTo run the TUI, you need to install the `textual` dependency as well:\n\n```bash\npython -m pip install \"sklearn-smithy[textual]\"\n```\n\n## User guide 📚\n\nPlease refer to the dedicated [user guide](https://fbruzzesi.github.io/sklearn-smithy/user-guide/) documentation section.\n\n## Origin story\n\nThe idea for this tool originated from [scikit-lego #660](https://github.com/koaning/scikit-lego/pull/660), which I cannot better explain than quoting the PR description itself:\n\n\u003e So the story goes as the following:\n\u003e\n\u003e - The CI/CD fails for scikit-learn==1.5rc1 because of a change in the `check_estimator` internals\n\u003e - In the [scikit-learn issue](https://github.com/scikit-learn/scikit-learn/issues/28966) I got a better picture of how to run test for compatible components\n\u003e - In particular, [rolling your own estimator](https://scikit-learn.org/dev/developers/develop.html#rolling-your-own-estimator) suggests to use [`parametrize_with_checks`](https://scikit-learn.org/dev/modules/generated/sklearn.utils.estimator_checks.parametrize_with_checks.html#sklearn.utils.estimator_checks.parametrize_with_checks), and of course I thought \"that is a great idea to avoid dealing manually with each test\"\n\u003e - Say no more, I enter a rabbit hole to refactor all our tests - which would be fine\n\u003e - Except that these tests failures helped me figure out a few missing parts in the codebase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbruzzesi%2Fsklearn-smithy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbruzzesi%2Fsklearn-smithy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbruzzesi%2Fsklearn-smithy/lists"}