Skip to main content

SymFit's little brother

Project description

SlimFit

SymFit's little brother

Documentation: https://jhsmit.github.io/slimfit/

This project is inspired by SymFit and is functional, to some degree, but in currently in BETA

  • Free software: MIT license

Aims

  • Inspiration for a potential SymFit 2.0
  • Expectation-Maximization likelihood maximization

Quick Start

from sympy import symbols
from slimfit import Model, Fit, Parameter
import numpy as np

y, a, x, b = symbols('y a x b')

model = Model({y: a*x + b})
parameters = [
    Parameter(a, guess=2.5),
    Parameter(b, guess=1, lower_bound=0.)
]

xdata = np.linspace(0, 11, 25)
ydata = 0.5*xdata + 2.5
ydata += np.random.normal(0, scale= ydata / 10.0 + 0.2)
data = {'x': xdata, 'y': ydata}

fit = Fit(model, parameters, data)
result = fit.execute()

print(result.parameters)

>>> {'a': array(0.47572707), 'b': array(2.6199133)}

Installation

$ pip install slimfit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slimfit-0.1.4.tar.gz (1.4 MB view hashes)

Uploaded Source

Built Distribution

slimfit-0.1.4-py3-none-any.whl (34.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page