SVD Based Linear Regression Python Library
Project description
py4svd-regressor
SVD Based Linear Regression Python Library
Getting Started
This project is simply an implementation of a Linear Regression algorithm based on SVD in python programming language
Prerequisites
Numpy
Installation
The easiest way to install py4svd-regressor is by using pip
pip install py4svd-regressor
Usage
2 public methods are provided namely learn and predict. The learn method used to train the model. It takes 2 arguments, the data, and its target. The predict method used to predict the given data, it takes 1 argument, it is the data user wanted to predict. It returns the resulting prediction. The weight and intercept are stored on attributes namely w and b respectively
from py4svd_regressor.regression import Svd_Regressor
from sklearn.datasets import make_regression
from matplotlib import pyplot
x, y = make_regression(n_samples=200, n_features=1, noise=5)
model = Svd_Regressor()
model.train(x, y)
pyplot.scatter(x, y)
pyplot.plot(x, model.w*x + model.b, color='red')
pyplot.show()
y_predict = model.predict(x)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py4svd_regressor-0.0.1.tar.gz.
File metadata
- Download URL: py4svd_regressor-0.0.1.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bfae5e8dc29a38f9cf04715fa85ab7c2980e4d56dd37780c8c7cbff1c6cea5a
|
|
| MD5 |
070a9829d8d6fb229936e731b36aa031
|
|
| BLAKE2b-256 |
02f0a705caf46b21b829ceecb6b339368a1b6217554c5a9786efb12ae4c1ed42
|
File details
Details for the file py4svd_regressor-0.0.1-py3-none-any.whl.
File metadata
- Download URL: py4svd_regressor-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bb6225013e1f4202ac4d61a33c97ab6e70c4e4935c7fbc3580d144da4c06e8e
|
|
| MD5 |
279f43db65de2c594999812565acc435
|
|
| BLAKE2b-256 |
a83be1a209db8964d77bbb16fe936ecb04e4ab3b3a1a78ceede3e9737d39f0fd
|