Skip to content

Instantly share code, notes, and snippets.

View deekb's full-sized avatar
💻

Derek Baier deekb

💻
View GitHub Profile
@deekb
deekb / LinearRegressor.py
Last active December 17, 2023 19:15
A class for fitting linear regression models to data points andpredicting or extrapolating values based on the fitted model.
"""
LinearRegressor
This module defines a LinearRegressor class for fitting linear regression models to data points and
predicting or extrapolating values based on the fitted model.
Author: Derek Michael Baier
Author Email: derek.m.baier@gmail.com
Disclaimer:
@deekb
deekb / PID.py
Created July 9, 2023 12:18
A simple, tunable PID with instructions written in python
"""
PID can be confusing, it's okay if you don't understand it and still want to use it,
I hope this mini-guide gives you enough information on PID to start using it in your own projects:
PID Explained:
PID (Proportional-Integral-Derivative) is a control algorithm used in engineering and robotics.
It adjusts its output based on the error signal, which represents the deviation from the desired setpoint.
The gains, namely Kp, Ki, and Kd, determine the contribution of each component.
PID gains are prefixed with a "K" to indicate that they are coefficients or constants used to scale the effect of each component.
Such effects are explained below, as well as a guide on tuning their gains.