Skip to main content

linreg

Simple and flexible interface for basic linear regression.

Motivation

I wanted to do very basic linear regression between two arrays of data. It's a pain in the ass having to remember scikit-learn's interface for regression, remember matplotlib's interface for plotting, and also having to do things like np.array(x).reshape(1,-1) so that it works with sklearn

I wanted to create an interface that is as simple as possible and also relatively flexible with your input so that you don't have to open google every time you want to do some basic regression checking

Usage

linreg supports basic lists, numpy arrays, and pandas series

import linreg

x = [1,2,3]
y = [2,4,6]

linreg.linreg(x, y)

You can disable plotting with plot=False

If your data is a list of tuples, that works too

import linreg

xy = [
    (1,2),
    (2,4),
    (3,6)
]
linreg.linreg(xy)

If your data is flipped, such that each column is a data point (instead of each row), then you can transpose it:

import linreg

xy = [
    [1,2,3,4],
    [2,4,6,8]
]

linreg.linreg(xy, transpose=True)

If you forget to transpose in the above case, linreg will log a warning. It works by assuming that if you have more dimensions than data points, then you probably forgot to transpose.
You can suppress these warnings with warn=False

Metadata

Release files for linreg 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for linreg 0.1.2
File Size Uploaded
linreg-0.1.2.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for linreg 0.1.2
File Interpreter ABI Platform
linreg-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / linreg-0.1.2.tar.gz

Download URL linreg-0.1.2.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a8d90b4cfd9d34715575d0ca4aab0b4692c4f64bc59bc01645e8a60199a6b141
BLAKE2b-256 checksum
How to use checksums
c12813f524f9e68755724584dddaaf805798f17722705849e0f3c42a22a4998b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.9

Release files / linreg-0.1.2-py3-none-any.whl

Download URL linreg-0.1.2-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09ae956985da98f95fdcec7120f7454af4bc94c38a84f7cb503b625e47d113aa
BLAKE2b-256 checksum
How to use checksums
c563f8296cc60756e36b11ff9531b9bb8a751acb5bf6fbd4c5007cdcd1849d2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.9

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page