Coder Social home page Coder Social logo

polynomial-regression's Introduction

Polynomial-Regression

This project implements the n degree Polynomial Regression in python. The class called 'Polynomial_Regression' receives 3 parameters x,y and polynomial function degree that will be generated to fit in the data. To show the code works, 2 datasets were obtained in chapter 20 of the book 'Numerical Methods for Engineers'.

In the first one, a 2-degree polynomial regression are used:

f = [7,9,15,25,40,75,100,150]
k = [0.29,0.37,0.48,0.65,0.8,0.97,0.99,1.07]

model = Polynomial_Regression(k,f,2)
model.building_the_linear_system()
model.generate_graph(title='Regressão quadratica nos dados',save_graph=True)

In the second, it was carried out 1, 2, 3 and 4-degree regression. We can note that a good fit was achieved using 3 degrees. However, the 4-degree polynomial regression creates a huge concavity between 4 and 5 dots by the absence of dots in that area and high degree.

y = [0,2.3,4.9,9.1,13.7,18.3,22.9,27.2]
x = [22.8,22.8,22.8,20.6,13.9,11.7,11.1,11.1]

polynomial-regression's People

Contributors

herberthipolito avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.