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 details)

Uploaded Source

Built Distribution

pylinreg-1.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pylinreg-1.0.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.4

File hashes

Hashes for pylinreg-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3d567834354bc8ef253865a6d5f63f536d822244b6aab924a89852f0b5bb7e72
MD5 cb3944ee9d4ac11b82e2000f1b34aed3
BLAKE2b-256 d4eecdde9bfc1dd560ad1f94fb27078121c3c4f9996a5be3cdafad665f82e178

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pylinreg-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.4

File hashes

Hashes for pylinreg-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 870a7161182ad3253fbcc816da623508e8a0bfff9409f380c7f12d2b7df32977
MD5 08805018e5a3d9f994c9f1f4a118cb28
BLAKE2b-256 3b0b793d5b9f55b8ab2d028a36613625a082fe70f2eb2e23dbe0a131d51f6d6a

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