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

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.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

pylinreg-1.0.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file pylinreg-1.0.0.tar.gz.

File metadata

  • Download URL: pylinreg-1.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for pylinreg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b43ffa248f1aecb3d1c44cf3e281930183c8fe09ba4ed13a4dd35af71f938a27
MD5 9fae02493c2b879f5a77dbf7b44f37c1
BLAKE2b-256 0fdd4ef0140fc77d2a9beb08847154422b4fd134fa0133905c75e85c88c297be

See more details on using hashes here.

File details

Details for the file pylinreg-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pylinreg-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1

File hashes

Hashes for pylinreg-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 867c3a72c24c569d3091b2d63c4a8893c7e2f9f62e3e257180450bd9136601d4
MD5 e267657cf927f8344233e6b950df538e
BLAKE2b-256 c1046bfe87df5f9f8c0d685a2807458ac0a88bb0383f5f5acf1d080630e28c5b

See more details on using hashes here.

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