{"id":14989206,"url":"https://github.com/tbuli/symfit","last_synced_at":"2025-04-04T12:08:05.648Z","repository":{"id":20721309,"uuid":"24005390","full_name":"tBuLi/symfit","owner":"tBuLi","description":"Symbolic Fitting; fitting as it should be.","archived":false,"fork":false,"pushed_at":"2024-01-08T13:39:52.000Z","size":3557,"stargazers_count":241,"open_issues_count":84,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T12:08:00.224Z","etag":null,"topics":["curve-fitting","least-squares","python","scipy","sympy"],"latest_commit_sha":null,"homepage":"http://symfit.readthedocs.org","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/tBuLi.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","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":"AUTHORS.rst"}},"created_at":"2014-09-13T20:48:28.000Z","updated_at":"2025-03-03T11:43:29.000Z","dependencies_parsed_at":"2023-02-13T23:40:33.318Z","dependency_job_id":"ca0c677e-4435-4fa2-9cc9-4726ceaacc40","html_url":"https://github.com/tBuLi/symfit","commit_stats":{"total_commits":904,"total_committers":53,"mean_commits":"17.056603773584907","dds":0.6736725663716814,"last_synced_commit":"c6bf571a6d4f7a5d3512fdf0032b3e03bbe21d90"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tBuLi%2Fsymfit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tBuLi%2Fsymfit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tBuLi%2Fsymfit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tBuLi%2Fsymfit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tBuLi","download_url":"https://codeload.github.com/tBuLi/symfit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174419,"owners_count":20896078,"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":["curve-fitting","least-squares","python","scipy","sympy"],"created_at":"2024-09-24T14:17:51.916Z","updated_at":"2025-04-04T12:08:05.629Z","avatar_url":"https://github.com/tBuLi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://zenodo.org/badge/24005390.svg\n   :target: https://zenodo.org/badge/latestdoi/24005390\n.. image:: https://coveralls.io/repos/github/tBuLi/symfit/badge.svg?branch=master\n   :target: https://coveralls.io/github/tBuLi/symfit?branch=master\n\n\nPlease cite this DOI if ``symfit`` benefited your publication. Building this has been a lot of work, and as young researchers your citation means a lot to us.\nMartin Roelfs \u0026 Peter C Kroon, symfit. doi:10.5281/zenodo.1133336\n\nDocumentation\n=============\nhttp://symfit.readthedocs.org\n\nProject Goals\n=============\n\nThe goal of this project is simple: to make fitting in Python pythonic.\nWhat does pythonic fitting look like? Well, there's a simple test. If I can\ngive you pieces of example code and don't have to use any additional words to\nexplain what it does, it's pythonic.\n\n.. code-block:: python\n\n  from symfit import parameters, variables, Fit, Model\n  import numpy as np\n   \n  xdata = np.array([1.0, 2.0, 3.0, 4.0, 5.0])\n  ydata = np.array([2.3, 3.3, 4.1, 5.5, 6.7])\n  yerr = np.array([0.1, 0.1, 0.1, 0.1, 0.1])\n  \n  a, b = parameters('a, b')\n  x, y = variables('x, y')\n  model = Model({y: a * x + b})\n  \n  fit = Fit(model, x=xdata, y=ydata, sigma_y=yerr)\n  fit_result = fit.execute()\n\nCool right? So now that we have done a fit, how do we use the results?\n\n.. code-block:: python\n\n  import matplotlib.pyplot as plt\n  \n  yfit = model(x=xdata, **fit_result.params)[y]\n  plt.plot(xdata, yfit)\n  plt.show()\n\n.. figure:: http://symfit.readthedocs.org/en/latest/_images/linear_model_fit.png\n  :width: 600px\n  :alt: Linear Fit\n\nNeed I say more? How about I let another code example do the talking?\n\n.. code-block:: python\n\n  from symfit import parameters, Fit, Equality, GreaterThan\n  \n  x, y = parameters('x, y')\n  model = 2 * x * y + 2 * x - x**2 - 2 * y**2\n  constraints = [\n      Equality(x**3, y),\n      GreaterThan(y, 1),\n  ]\n  \n  fit = Fit(- model, constraints=constraints)\n  fit_result = fit.execute()\n\nI know what you are thinking. \"What if I need to fit to a system of Ordinary Differential Equations?\"\n\n.. code-block:: python\n\n  from symfit import variables, Parameter, ODEModel, Fit, D\n  import numpy as np\n  \n  tdata = np.array([10, 26, 44, 70, 120])\n  adata = 10e-4 * np.array([44, 34, 27, 20, 14])\n          \n  a, b, t = variables('a, b, t')\n  k = Parameter('k', 0.1)\n  \n  model_dict = {\n      D(a, t): - k * a**2,\n      D(b, t): k * a**2,\n  }\n  \n  ode_model = ODEModel(model_dict, initial={t: 0.0, a: 54 * 10e-4, b: 0.0})\n  \n  fit = Fit(ode_model, t=tdata, a=adata, b=None)\n  fit_result = fit.execute()\n\nFor more fitting delight, check the docs at http://symfit.readthedocs.org.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbuli%2Fsymfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbuli%2Fsymfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbuli%2Fsymfit/lists"}