{"id":19728751,"url":"https://github.com/swharden/swarmfit","last_synced_at":"2025-08-17T20:10:46.544Z","repository":{"id":253139068,"uuid":"842575702","full_name":"swharden/SwarmFit","owner":"swharden","description":"A .NET package for fitting curves to data using particle swarm optimization","archived":false,"fork":false,"pushed_at":"2024-09-25T02:04:19.000Z","size":748,"stargazers_count":17,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-01T00:55:12.245Z","etag":null,"topics":["curve","curve-fitting","math","mathmatics","particle-swarm-optimization"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/SwarmFit/","language":"C#","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/swharden.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-08-14T16:20:10.000Z","updated_at":"2025-01-30T18:10:10.000Z","dependencies_parsed_at":"2024-08-14T18:29:39.260Z","dependency_job_id":"02ccada1-8389-478b-9242-025f6fe38b54","html_url":"https://github.com/swharden/SwarmFit","commit_stats":null,"previous_names":["swharden/swarmfit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/swharden/SwarmFit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swharden%2FSwarmFit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swharden%2FSwarmFit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swharden%2FSwarmFit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swharden%2FSwarmFit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swharden","download_url":"https://codeload.github.com/swharden/SwarmFit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swharden%2FSwarmFit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270899582,"owners_count":24664720,"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-08-17T02:00:09.016Z","response_time":129,"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":["curve","curve-fitting","math","mathmatics","particle-swarm-optimization"],"created_at":"2024-11-12T00:07:38.102Z","updated_at":"2025-08-17T20:10:46.517Z","avatar_url":"https://github.com/swharden.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwarmFit\n\n[![CI](https://github.com/swharden/SwarmFit/actions/workflows/ci.yaml/badge.svg)](https://github.com/swharden/SwarmFit/actions/workflows/ci.yaml)\n\n**SwarmFit is a .NET package for fitting curves to X/Y data** points using [particle swarm optimization](https://en.wikipedia.org/wiki/Particle_swarm_optimization). Unlike other gradient decent strategies, finding the derivative of the error function is not required. SwarmFit can be used to calculate best fit curves for arbitrary equations that use any number of parameters.\n\n![](dev/fit2.gif)\n\n## Quickstart\n\n```cs\n// data points to fit\ndouble[] xs = [1, 2, 3, 4, 5];\ndouble[] ys = [304, 229, 174, 134, 111];\n\n// a custom function to fit to the data using any number of parameters\nstatic double MyFitFunc(double x, double[] parameters)\n{\n\tdouble a = parameters[0];\n\tdouble b = parameters[1];\n\tdouble c = parameters[2];\n\treturn a + b * Math.Exp(x * c);\n}\n\n// the minimum and maximum value for each parameter\ndouble[] minVars = [-100, -5000, -10];\ndouble[] maxVars = [100, 5000, 10];\n\n// perform the fit with general purpose settings\ndouble[] solution = QuickFit.Solve(xs, ys, MyFitFunc, minVars, maxVars);\n\n// display the solution\ndouble a = solution[0];\ndouble b = solution[1];\ndouble c = solution[2];\nConsole.WriteLine($\"Y = {a} + {b} * e^(x * {c})\");\n```\n\n## Graphical Demo\n\nA sample application is included with this repository which generates random data and fits it using common curve functions. This application demonstrates advanced features such as fitter fine-tuning, iterative error logging, charting, etc.\n\n![](dev/example3.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswharden%2Fswarmfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswharden%2Fswarmfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswharden%2Fswarmfit/lists"}