{"id":17987954,"url":"https://github.com/hollance/sefr-swift","last_synced_at":"2025-03-25T22:33:00.063Z","repository":{"id":138081746,"uuid":"328675849","full_name":"hollance/sefr-swift","owner":"hollance","description":"The SEFR classifier implemented in Swift","archived":false,"fork":false,"pushed_at":"2021-01-11T13:48:32.000Z","size":3932,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-20T21:23:36.763Z","etag":null,"topics":["classifier","machine-learning","machine-learning-algorithms","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/hollance.png","metadata":{"files":{"readme":"README.markdown","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}},"created_at":"2021-01-11T13:39:49.000Z","updated_at":"2023-06-09T13:35:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"65003f21-e905-4f9a-aceb-c3005c119b6b","html_url":"https://github.com/hollance/sefr-swift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollance%2Fsefr-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollance%2Fsefr-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollance%2Fsefr-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hollance%2Fsefr-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hollance","download_url":"https://codeload.github.com/hollance/sefr-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245555683,"owners_count":20634777,"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","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":["classifier","machine-learning","machine-learning-algorithms","swift"],"created_at":"2024-10-29T19:10:13.331Z","updated_at":"2025-03-25T22:33:00.039Z","avatar_url":"https://github.com/hollance.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SEFR in Swift\n\nThis is the source code that accompanies my blog post [The SEFR classifier](https://machinethink.net/blog/sefr-classifier-in-swift/).\n\nSEFR is a binary classifier. To use it on a binary classfication task:\n\n```swift\nlet sefr = SEFR()\nsefr.fit(examples: X_train, targets: y_train)\nlet y_pred = sefr.predict(examples: X_test)\n```\n\nYou can use it for multiclass tasks by using a simple wrapper that performs one-vs-rest:\n\n```swift\nlet model = SEFRMulticlass()\nmodel.fit(examples: X_train, targets: y_train)\nlet y_pred = model.predict(examples: X_test)\n```\n\nThe demo program is a simple Swift script that runs on macOS. It uses the Vision framework to generate \"feature prints\" for a set of training and test images. Each feature print consists of 2048 numbers. It trains SEFR on these feature prints.\n\nTo run the demo program, open a Terminal on macOS and type:\n\n```bash\n$ cat SEFR.swift Demo.swift | swift -\n```\n\n## Credits\n\nThe images used in the dataset were hand-picked from [Google Open Images Dataset V6](https://storage.googleapis.com/openimages/web/index.html). For full credits and license terms, [see here](Image%20Credits.txt).\n\nThe source code is [licensed as MIT](LICENSE).\n\nMy implementation is based on the following sources:\n\n- [SEFR: A Fast Linear-Time Classifier for Ultra-Low Power Devices](https://arxiv.org/abs/2006.04620)\n- [Original Python implementation](https://github.com/sefr-classifier/sefr)\n- [Multiclass version in Python](https://github.com/alankrantas/sefr_multiclass_classifier)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollance%2Fsefr-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhollance%2Fsefr-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhollance%2Fsefr-swift/lists"}