{"id":15293519,"url":"https://github.com/denissimon/prediction-builder-swift","last_synced_at":"2025-04-13T14:09:21.082Z","repository":{"id":62451062,"uuid":"78985282","full_name":"denissimon/prediction-builder-swift","owner":"denissimon","description":"A library for machine learning that builds predictions using a linear regression.","archived":false,"fork":false,"pushed_at":"2024-01-20T20:44:04.000Z","size":103,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T14:09:13.262Z","etag":null,"topics":["carthage","cocoapods","ios","linear-regression","machine-learning","ml","prediction","regression","swift","swift-library","swift-package-manager","xcode"],"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/denissimon.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}},"created_at":"2017-01-15T01:44:23.000Z","updated_at":"2024-04-29T04:09:17.000Z","dependencies_parsed_at":"2023-12-26T12:12:46.022Z","dependency_job_id":"f4834dcf-af5e-4ea2-bdde-55a65c2cbfb6","html_url":"https://github.com/denissimon/prediction-builder-swift","commit_stats":{"total_commits":39,"total_committers":1,"mean_commits":39.0,"dds":0.0,"last_synced_commit":"3574e022a5e6ba3317dce15a7e0a6bb6cc525b6f"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denissimon","download_url":"https://codeload.github.com/denissimon/prediction-builder-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724629,"owners_count":21151561,"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":["carthage","cocoapods","ios","linear-regression","machine-learning","ml","prediction","regression","swift","swift-library","swift-package-manager","xcode"],"created_at":"2024-09-30T16:49:50.736Z","updated_at":"2025-04-13T14:09:21.056Z","avatar_url":"https://github.com/denissimon.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":["General-Purpose Machine Learning"],"readme":"PredictionBuilder\n=================\n\n[![Swift](https://img.shields.io/badge/Swift-5-orange.svg?style=flat)](https://swift.org)\n[![Platform](https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg)](https://developer.apple.com/swift/)\n\nPredictionBuilder is a library for machine learning that builds predictions using a linear regression.\n\nInstallation\n------------\n\n#### Swift Package Manager\n\nTo install PredictionBuilder using [Swift Package Manager](https://swift.org/package-manager):\n\n```txt\nXcode: File -\u003e Add Packages\nEnter Package URL: https://github.com/denissimon/prediction-builder-swift\n```\n\n#### CocoaPods\n\nTo install PredictionBuilder using [CocoaPods](https://cocoapods.org), add this line to your `Podfile`:\n\n```ruby\npod 'PredictionBuilder', '~\u003e 1.2'\n```\n\n#### Carthage\n\nTo install PredictionBuilder using [Carthage](https://github.com/Carthage/Carthage), add this line to your `Cartfile`:\n\n```ruby\ngithub \"denissimon/prediction-builder-swift\"\n```\n\n#### Manually\n\nCopy `PredictionBuilder.swift` into your project.\n\nExample\n-------\n\n```swift\nimport PredictionBuilder\n\nlet data: [[Double]] = [[1,20],[2,70],[2,45],[3,81],[5,73],[6,80],[7,110]]\nlet x: Double = 4.5\n\nlet prediction = PredictionBuilder()\n\nprediction.set(x: x, data: data)\n\n// What is the expected y value for a given x value?\ndo {\n    let result = try prediction.build() // y = 76.65\n} catch let msg {\n    print(msg)\n}\n```\n\nThe returned instance has the following properties:\n\n`result.lnModel` linear model that fits the data: \"29.56362+10.46364x\"\n\n`result.cor` correlation coefficient: 0.8348\n\n`result.x` given x value: 4.5\n\n`result.y` predicted y value: 76.65\n\nLicense\n-------\n\nLicensed under the [MIT License](https://github.com/denissimon/prediction-builder-swift/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenissimon%2Fprediction-builder-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenissimon%2Fprediction-builder-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenissimon%2Fprediction-builder-swift/lists"}