Skip to main content

Linear Regression Model with only Python Standard Library based on Ordinary Least Squares (OLS) Method

Project description

Generic badge Generic badge

PyLinReg

Linear Regression Model with only Python Standard Library based on Ordinary Least Squares (OLS) Method

Quickstart

Requirements

This module use Python Standard Library only. Python version should be higher than 3.6

Install

pip install pylinreg

How to Use

This code works as module not a script.

Import

import pylinreg

Create linear regression model object

predictors = [1, 2, 3, 4, 5]
targets = [15, 25, 35, 45, 55]
Model = pylinreg.LinearModel(predictors, targets)

Get values of slope and intercept

slope = Model.slope
intercept = Model.intercept

Get prediction

predictor = 6
prediction = Model.make_prediction(predictor)

The prediction is 65.

Help

help(pylinreg)

Examples

Examples are available in the test.py

License

The content of this repository is licensed under MIT license. For more details, check LICENSE

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

pylinreg-1.0.1.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

pylinreg-1.0.1-py3-none-any.whl (6.4 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