Posts

Showing posts from January, 2022

Non-linear Regression

Image
      Introduction If the data shows a curvy trend, then  linear regression  will not produce very accurate results when compared to a  non-linear regression  because, as the name implies,  linear regression  presumes that the  data  is  linear . Let’s learn about  non-linear regressions  and apply an example in  python . In this notebook, we fit a  non-linear model  to the  data points  corresponding to China’s GDP from 1960 to 2014. Importing required libraries # Basic Data Science libraries import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inlinesns.set() Though  Linear regression  is very good to solve many problems, it cannot be used for all datasets. First recall how  linear regression , could model a dataset. It models a  linear  relation between a  dependent  variable  y  and an  inde...

Non linear Regression : Code and Examples

Image
  Introduction     Non-Linear regression is a type of polynomial regression. It is a method  to model a non-linear relationship between the dependent and independent  variables. It is used in place when the data shows a curvy trend, and linear  regression would not produce very accurate results when compared to non- linear regression. This is because in linear regression it is pre-assumed that the data is linear. IMPORTING REQUIRED LIBRARIES # Basic Data Science libraries import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline sns.set()     Though  Linear regression  is very good to solve many problems, it cannot be used for all datasets. First recall how  linear regression , could model a dataset. It models a  linear  relation between a  dependent  variable  y  and an  independent  variable  x . It had a simple equation, of degree 1, for example...