Skip to main content

PolyTrend

PolyTrend is a Python package aimed at facilitating polynomial trend fitting, visualization, and extrapolation. It offers a comprehensive set of functionalities to analyze and interpret data using polynomial regression techniques. Below, we provide an overview of the package along with additional formatting and explanations relevant for PyPI.

Introduction

PolyTrend is designed to approximate and plot a polynomial function onto given data, thereby aiding in the analysis of trends and patterns within datasets. Its development contributes to various fields including interpolation, polynomial regression, and approximation theory.

Key Functionalities

PolyTrend offers the following key functionalities:

  • polyplot(): This method plots the polynomial fit based on specified degrees of the polynomial and the provided data.
  • polyfind(): This method calculates the best-fit polynomial function by evaluating different polynomial degrees and selecting the one with the lowest Bayesian Information Criterion (BIC) score.
  • polygraph(): This method visualizes the polynomial function, the known data points, and any extrapolated data points if provided.

Usage

Users can utilize PolyTrend to perform the following tasks:

  1. Data Analysis: Analyze trends and patterns within datasets using polynomial regression techniques.
  2. Visualization: Visualize polynomial fits alongside original data points to gain insights into the relationship between variables.
  3. Extrapolation: Extrapolate future values based on the fitted polynomial function, enabling predictive modeling tasks.

Dependencies

PolyTrend relies on the following libraries for its computations and visualizations:

  • NumPy
  • pandas
  • Matplotlib
  • scikit-learn

Additional Resources

For further details on polynomial regression, refer to this wiki.

Installation

PolyTrend can be installed via pip:

pip install polytrend

Example Usage

import random
import polytrend as pt

# sample input
degrees = [1, 2, 3]
data = [
    (float(x), float(0.5 * x**2 - 2 * x + 1 + random.uniform(-1000, 1000)))
    for x in range(0, 100)
]

# Fit polynomial and visualize
pt.polyplot(degrees, data, extrapolate_data=[112, 140])

Feedback and Contributions

Feedback and contributions to PolyTrend are welcomed and encouraged. Please feel free to submit any issues or pull requests via the GitHub repository.

License

PolyTrend is licensed under the GNU GPL License. See the LICENSE file for details.

Metadata

Release files for polytrend 1.0.9

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

Source distribution (sdist)

Source distribution for polytrend 1.0.9
File Size Uploaded
polytrend-1.0.9.tar.gz 19.1 kB Details

Built distribution (wheel)

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

Total release size: 38.4 kB

Release files / polytrend-1.0.9.tar.gz

Download URL polytrend-1.0.9.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
eb5d4e07ebc89b2aee074520595b5d92cfab8c902f46977c5c660c469015f6ca
BLAKE2b-256 checksum
How to use checksums
fcda17981a0bc7d5d9904e57aaa3edc33af176ad325dfc7344cedbf82e2711c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / polytrend-1.0.9-py3-none-any.whl

Download URL polytrend-1.0.9-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d67beb45ee975f2983ab91e4f536a2c9337d89ee65bb1ca05053212063b49f9
BLAKE2b-256 checksum
How to use checksums
289ed432f391def5d13b2cd0ff7d8aec15dc3756f52bdb0ba5617b6a711b2544
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.8

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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