项目作者: richardvecsey

项目描述 :
Linear Regression Model with only Python Standard Library
高级语言: Python
项目地址: git://github.com/richardvecsey/PyLinReg.git
创建时间: 2021-01-08T15:10:28Z
项目社区:https://github.com/richardvecsey/PyLinReg

开源协议:MIT License

下载


Generic badge
Generic badge
Downloads
PyPI - Downloads

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

  1. pip install pylinreg

How to Use

This code works as module not a script.

Import

  1. import pylinreg

Create linear regression model object

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

Get values of slope and intercept

  1. slope = Model.slope
  2. intercept = Model.intercept

Get prediction

  1. predictor = 6
  2. prediction = Model.make_prediction(predictor)

The prediction is 65.

Help

  1. 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