Skip to main content

POLINOMIAL REGRESSION ALGORITHM

pip3 install regressionAlgorithm

POLYNOMIAL ORDER 1

'formula'

from regressionAlgorithm import PolynomialOrderOne
import matplotlib.pyplot as plt

# value
x = [1,2,3,4,5]
y = [5,4,3,2,1]

# intial
rl = PolynomialOrderOne()
rl.fit(x,y)
rl.start()

# get data
print(rl.plot())
print(rl.line())

# data visualization

plt.figure(figsize=(10,7))
plt.scatter(x,y)
plt.plot(x, rl.line())
plt.savefig("visual.png")

# r squared
print(rl.r_squared()) # result 1.0

# r value
print(rl.r_value()) # result -1.0

graph.png

PREDICT Y VALUE

...
x = 10
# formula (y = a + b * x) = (y = a + b * 10)
print(rl.predict(x)) # result -4.0

POLYNOMIAL ORDER 2

'formula

from regressionAlgorithm import PolynomialOrderTwo
import matplotlib.pyplot as plt

# value
x = [1,2,3,4,5]
y = [5,4,3,2,1]

# intial
q = PolynomialOrderTwo()
q.fit(x,y)
q.start()

# result
print(q.plot())
print(q.r_square())

# data visualization
plt.figure(figsize=(10,7))
plt.scatter(x,y, color="blue")
plt.plot(x, k.draw_line(), color="red")
plt.savefig("quadratic.png")

quadratic.png

PREDICT Y VALUE

...
x_pred = 5

# formula y = a + b * x + c * square(x) -> y = a + b * x_red + c * square(x_pred)
print(q.predict(x_pred)) # result 0.9999999999997522

Metadata

Release files for regressionAlgorithm 0.1

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

Source distribution (sdist)

Source distribution for regressionAlgorithm 0.1
File Size Uploaded Provenance Actions
regressionAlgorithm-0.1.tar.gz 3.8 kB Without provenance Details for regressionAlgorithm-0.1.tar.gz

Release files / regressionAlgorithm-0.1.tar.gz

Download URL regressionAlgorithm-0.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
123a46c76093c5c11f40ced305d513646e96c84270eb5f39fbc6f0076da67b8f
BLAKE2b-256 checksum
How to use checksums
9ae04ebccd61b126f3808eaf433e7d4a4af51751ac9ec78697e94b03b204dfdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

Security for regressionAlgorithm 0.1

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

1 release file 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