{"id":34044860,"url":"https://github.com/nikolas-virionis/polynomial-regression","last_synced_at":"2026-04-06T01:05:55.671Z","repository":{"id":45191195,"uuid":"442436006","full_name":"nikolas-virionis/polynomial-regression","owner":"nikolas-virionis","description":"Python package that analyses the given datasets and comes up with the best regression representation with either the smallest polynomial degree possible, to be the most reliable without overfitting or other models such as exponentials and logarithms","archived":false,"fork":false,"pushed_at":"2023-03-04T18:14:22.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T16:12:18.818Z","etag":null,"topics":["data-analysis","exponential-regression","flexibility","logarithmic-regression","logistic-regression","polynomial-regression","python","sinusoisdal-regression","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikolas-virionis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-28T11:02:17.000Z","updated_at":"2023-01-17T14:45:08.000Z","dependencies_parsed_at":"2023-01-21T20:18:42.636Z","dependency_job_id":null,"html_url":"https://github.com/nikolas-virionis/polynomial-regression","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/nikolas-virionis/polynomial-regression","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolas-virionis%2Fpolynomial-regression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolas-virionis%2Fpolynomial-regression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolas-virionis%2Fpolynomial-regression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolas-virionis%2Fpolynomial-regression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikolas-virionis","download_url":"https://codeload.github.com/nikolas-virionis/polynomial-regression/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikolas-virionis%2Fpolynomial-regression/sbom","scorecard":{"id":687572,"data":{"date":"2025-08-11","repo":{"name":"github.com/nikolas-virionis/polynomial-regression","commit":"3d4a0ac9058d07e8d069c16c6b3afb6b27443f4e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T01:20:51.701Z","repository_id":45191195,"created_at":"2025-08-22T01:20:51.701Z","updated_at":"2025-08-22T01:20:51.701Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31455474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","exponential-regression","flexibility","logarithmic-regression","logistic-regression","polynomial-regression","python","sinusoisdal-regression","statistics"],"created_at":"2025-12-13T23:02:50.791Z","updated_at":"2026-04-06T01:05:55.666Z","avatar_url":"https://github.com/nikolas-virionis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Polynomial Regression\r\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/polynomial-regression-model?style=plastic)\r\n![PyPI](https://img.shields.io/pypi/v/polynomial-regression-model?style=plastic)\r\n![GitHub repo size](https://img.shields.io/github/repo-size/nikolas-virionis/polynomial-regression)\r\n![GitHub last commit](https://img.shields.io/github/last-commit/nikolas-virionis/polynomial-regression?style=plastic)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/polynomial-regression-model?style=plastic)\u003cbr\u003e\r\n\r\nPython package that analyses the given datasets and comes up with the best regression representation with either the smallest polynomial degree possible, to be the most reliable without overfitting or other models such as exponentials and logarithms\r\n\r\n\u003cimg alt=\"python logo\" src=\"https://miro.medium.com/max/1400/1*-1ttHqMEzjjXduNdtIBKjQ.png\" width = \"45%\"\u003e\r\n\r\n- [Polynomial Regression](#polynomial-regression)\r\n  - [Setup](#setup)\r\n    - [Requirements:](#requirements)\r\n  - [Methods](#methods)\r\n    - [Correlation](#correlation)\r\n  - [Results](#results)\r\n- [Contributing](#contributing)\r\n  - [PR Template](#pr-template)\r\n  - [Commits](#commits)\r\n\r\n## Setup\r\n\r\n### Requirements:\r\n  - Python installed\u003cbr\u003e\r\n The ideal version, to run the package is 3.9.x, the version in which the package was built over,\u003cbr\u003e however,\r\n older versions of python 3 shouldn't have any issues, as the package does not use any \u003cbr\u003e\r\n fancy, new methods, not supported by older versions of Python 3.x\r\n\r\n  - Installing the package\u003cbr\u003e\r\n\r\nFor Microsoft Windows\r\n~~~powershell\r\npip install polynomial-regression-model\r\n~~~\r\nFor Linux\r\n~~~bash\r\npip3 install polynomial-regression-model\r\n~~~\r\n  - Importing the package\u003cbr\u003e\r\n\r\nFirstly, it's necessary to import the method regress from the package polinomial_regression.main. It will analyse the parameter(s) and return the right object with all the methods it provides:\r\n ~~~ python\r\n from polinomial_regression.main import regress\r\n ~~~\r\n\r\n Then, there are two ways of using this model: One which provides both the axis values, x and y, and the math is done, and the other which provides only the y axis, would be more fitting to a use case of overtime monitoring of a single metric, select the best option to use below:\r\n\r\n\u003cstrong\u003e - Just as a quick note: the more data points provided, the more accurate the chosen regression model and it's equation are\u003c/strong\u003e\r\n\r\n First the one that relates two different metrics, it is necessary to pass two same sized lists of numbers\r\n ~~~ python\r\n regression = regress([2, 4, 6, 8, 10], [1, 2, 3, 4, 5])\r\n # for it not to be reversed, the parameter\r\n # order should be y, x\r\n ~~~\r\n\r\n And also the one that monitors the overtime behaviour of a single metric, it is necessary to pass a number list\r\n ~~~ python\r\n regression = regress([1, 2, 3, 4, 5, 2, 4, 6, 8, 10])\r\n ~~~\r\n\r\n\r\n After we already got our object instance, all there is left to do is enjoy the beauty of math\r\n## Methods\r\n - get_degree\r\n~~~python\r\nregression.get_degree()\r\n# returns the polynomial degree(index) of the best fitting function\r\n# E.g. 4 in the case of the equation being a 4th degree polynomial\r\n~~~\r\n - get_ordinal\r\n~~~python\r\nregression.get_ordinal()\r\n# returns the polynomial degree ordinal suffix (for mere better display)\r\n# E.g. th in the case of the equation being a 4\"th\" degree polynomial\r\n~~~\r\n - get_full_degree\r\n~~~python\r\nregression.get_full_degree()\r\n# returns the polynomial degree(index) of the best fitting function\r\n# with its ordinal suffix\r\n# E.g. 4th in the case of the equation being a \"4th\" degree polynomial\r\n~~~\r\n - get_coefficients\r\n~~~python\r\nregression.get_coefficients()\r\n# returns a list of all the coefficients of the polynomial equation\r\n# E.g. [2, 3, 4, 5, 6] in case of the equation being\r\n# y = 2x^4 + 3x³ + 4x² + 5x + 6\r\n~~~\r\n - get_r2\r\n~~~python\r\nregression.get_r2()\r\n# returns the coefficient of determination(R²) to find\r\n# the accuracy of the best fitting regression just calculated\r\n# E.g. 0.9 in the case of the equation being highly accurate]\r\n# in relation to the test data\r\n# I.e. although the perfect index would be 1, in real life data\r\n# that is highly unlikely to happen\r\n~~~\r\n - get_prediction\r\n~~~python\r\nregression.get_prediction(x: float)\r\n# returns the prediction of the y value correspondent to\r\n# the x value informed according to the regression calculated\r\n# E.g. 794 in the case of the equation being y = 2x^4 + 3x³ + 4x² + 5x + 6\r\n# (like the example above)\r\n~~~\r\n - equation_string\r\n~~~python\r\nregression.equation_string()\r\n# returns the polynomial equation calculated as a string\r\n# to be better displayed if necessary\r\n# E.g. y = 2x^4 + 3x³ + 4x² + 5x + 6 in the case of the example above\r\n~~~\r\n - visualization\r\n~~~python\r\nregression.visualization()\r\n# returns the a graphic plot of both a scatter plot of the\r\n# real data and a line representing the regression calculated\r\n~~~\r\n - best_regression_model\r\n~~~python\r\nregression.best_regression_model()\r\n# returns the degree of the best fitting polynomial\r\n# if the best model is a polynomial or else the best fitting\r\n# mathematical model inside a string to be displayed\r\n~~~\r\n - coefficient_of_determination\r\n~~~python\r\nregression.coefficient_of_determination()\r\n# returns the coefficient of determination(R²) of the best\r\n# fitting polynomial inside a string to be displayed\r\n~~~\r\n - equation_text\r\n~~~python\r\nregression.equation_text()\r\n# returns the best fitting polynomial inside a string\r\n# to be displayed\r\n~~~\r\n - full_text_analysis\r\n~~~python\r\nregression.full_text_analysis()\r\n# returns the combination of the previous analysis, building\r\n# the full analysis as a text\r\n~~~~~~\r\n - full_analysis\r\n~~~python\r\nregression.full_analysis()\r\n# returns the full text analysis after plotting the\r\n# visualization plots\r\n~~~\r\n - print_full_analysis\r\n~~~python\r\nregression.print_full_analysis()\r\n# prints the full text analysis and plots the\r\n# visualization charts\r\n~~~\r\n### Correlation\r\n- correlation\r\n~~~ python\r\n regression.correlation()\r\n # returns the correlation between the datasets\r\n~~~\r\n- correlation_way\r\n~~~ python\r\n regression.correlation_way()\r\n # returns the way the two datasets are correlated\r\n # to each other\r\n~~~\r\n- correlation_intensity\r\n~~~ python\r\n regression.correlation_intensity()\r\n # returns the intensity by which the two datasets\r\n # are correlated to each other\r\n~~~\r\n- correlation_interpretation\r\n~~~ python\r\n regression.correlation_interpretation()\r\n # returns the interpretation of the correlation index\r\n # between the datasets\r\n~~~\r\n\r\n## Results\r\nThis package will return the best fitting model, trying its best to prevent overfitting, though it's good to clear out the possible outcomes:\r\n\r\n- Polynomials:\r\nThe package was created to, at first, only analyse polynomial regression, and it still does, now from possible indexes 1 to 30, which may not seem much but a 30 degree polynomial, unless really needed, may establish chaos, since it can kinda curve around to get all data points, but predictions may be as unreliable as it gets, despite the high r² score\r\n\r\n- Exponentials:\r\nAlthough polynomials are quite versatile and can describe a lot of patterns, others, more specific, such as exponentials, can sometimes, due to luck, be perfectly described by some polynomial, but still, to get the most out of it, the specificity is needed\r\n\r\n- Logarithms:\r\nJust like exponentials, it can sometimes be described by some crazy polynomials, though it loses accuracy quickly\r\n\r\n- Sinusoidal:\r\nUnlike the previously mentioned, a senoide is not so easy to represent, consistently, by polynomials, it always fits perfect to the data that you test the model with but then predictions go 100% wrong, then this specificity is more than necessary\r\n\r\n- Logistic:\r\nSimilarly to the previous, a logistic curve is not so easily represented by a polynomial and needs to have its own regression model in order to be better represented and be more reliable for predictions\r\n\r\n\r\n# Contributing\r\nWell, since this is a really simple package, contributing is always welcome, just as much as creating issues experienced with the package\r\n\r\nIn order to better organize this contributions, it would be ideal that all PRs follow the template:\r\n\r\n## PR Template\r\n WHAT: \u003cbr\u003e\r\n A brief description of the improvements\r\n\r\n WHY: \u003cbr\u003e\r\nA explanation on why those changes were needed, necessary, or at least, why is was on the best interest of the package users\r\n\r\nCHANGES: \u003cbr\u003e\r\nList of changes made, can be the name of the commits made, or a simple changes list\r\n\r\n## Commits\r\nIdeally the commits should make use of the convention of [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) \u003cbr\u003e\r\nSomething i recommend is the usage of either the [Commitizen](https://github.com/commitizen/cz-cli) terminal extension or the [Commit Message Editor](https://marketplace.visualstudio.com/items?itemName=adam-bender.commit-message-editor) VSCode Extension\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolas-virionis%2Fpolynomial-regression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikolas-virionis%2Fpolynomial-regression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolas-virionis%2Fpolynomial-regression/lists"}