Skip to main content




GitHub Release PyPI - Downloads PyPI - Python Version GitHub repo size Read the Docs GitHub License

Multiple linear regression by gradient descent.

Installation

To install mlr-gd you can use pip:

$ python -m pip install mlr-gd

Alternatively, you can install it by cloning the GitHub repository:

$ git clone https://github.com/DrSolidDevil/mlr-gd.git
$ cd mlr-gd
$ pip install .

To import the package into your script:

import melar


Example

import numpy as np
import melar

# y = x1 + 0.5*x2
x = np.array([[1, 3, 5, 8], [1, 2, 3, 6]])
y = np.array([1.5, 4, 6.5, 11])

learning_rate = 0.01
generations = 100


model = melar.LinearRegression(weights_amount=2)
model.train(x, y, learning_rate, generations, do_print=True)
print(f"Weights: {model.weights}, Bias: {model.bias}")
Gen: 0, Cost: 95.4852602406095
Gen: 1, Cost: 5.593624864417041
Gen: 2, Cost: 0.3286224504551768
Gen: 3, Cost: 0.020244781001893267
...
Gen: 99, Cost: 0.0007438760098695897
Training Complete
Weights: [0.94643617 0.57630021], Bias: -0.003265101149422934

Metadata

Release files for mlr-gd 0.3.0

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

Source distribution (sdist)

Source distribution for mlr-gd 0.3.0
File Size Uploaded Provenance Actions
mlr_gd-0.3.0.tar.gz 10.2 kB Without provenance Details for mlr_gd-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlr-gd 0.3.0
File Interpreter ABI Platform Actions
mlr_gd-0.3.0-py3-none-any.whl Python 3 none any Details for mlr_gd-0.3.0-py3-none-any.whl

Total release size: 17.1 kB

Release files / mlr_gd-0.3.0.tar.gz

Download URL mlr_gd-0.3.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a125b1b2a722d723418cbae4fc2be8d8c11dca26ef8cd6b560006cf435610a43
BLAKE2b-256 checksum
How to use checksums
6218111a9df023ca8899ed18ae50f1719a2158d71625f7fb28f2f07b8b83ca42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Release files / mlr_gd-0.3.0-py3-none-any.whl

Download URL mlr_gd-0.3.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9992fdc754dd5fae55876db09a2b5da5a47e823b32ef434c219bffd2c4dc76d
BLAKE2b-256 checksum
How to use checksums
9fc415b79fab642fb620c2c3f9c419c16b0313658514cf57b11cea89ffc91ace
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.1

Security for mlr-gd 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

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