Python for Machine Learning | Polynomial Linear Regression with Numpy - P8

preview_player
Показать описание
Polynomial Linear Regression with Numpy - P8

Topics to be covered - Polynomial Regression without sklearn

Code Starts Here
===============

import numpy as np

'''
Degree 1 - y = 0.3321x + 0.475

Degree 2 - y = -0.0179x2 + 0.4393x + 0.3857

Degree 3 - y = 0.0194x3 - 0.1929x2 + 0.8282x + 0.269

Degree 4 - y = -0.0087x4 + 0.124x3 - 0.5799x2 + 1.2688x + 0.2242

Degree 5 - y = 0.0129x5 - 0.2025x4 + 1.1358x3 - 2.7112x2 + 2.7536x + 0.1873

'''

print(coefint1)
print(coefint2)
print(coefint3)
print(coefint4)
print(coefint5)

for i in range(1,6):
print('Degree is ', i)

ypred = coefint2[0]*x*x + coefint2[1]*x + coefint2[2]

print('Predicted Values:', ypred)

print('Actual Values :', y)

ypred = coefint1[0]*x + coefint1[1]
print(ypred)

print(y)

yresidual = y - ypred

Sumofresidual = sum(pow(yresidual,2))
Rsquare = 1 - Sumofresidual/SumofTotal

print(Rsquare)

slope, intercept, r_value, p_value, str_err = linregress(x,y)
print(pow(r_value,2))

All Playlist of this youtube channel
====================================

1. Data Preprocessing in Machine Learning

2. Confusion Matrix in Machine Learning, ML, AI

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz

4. Cross Validation, Sampling, train test split in Machine Learning

5. Drop and Delete Operations in Python Pandas

6. Matrices and Vectors with python

7. Detect Outliers in Machine Learning

8. TimeSeries preprocessing in Machine Learning

9. Handling Missing Values in Machine Learning

10. Dummy Encoding Encoding in Machine Learning

11. Data Visualisation with Python, Seaborn, Matplotlib

12. Feature Scaling in Machine Learning

13. Python 3 basics for Beginner

14. Statistics with Python

15. Sklearn Scikit Learn Machine Learning

16. Python Pandas Dataframe Operations

17. Linear Regression, Supervised Machine Learning

18 Interiew Questions on Machine Learning and Data Science

19. Jupyter Notebook Operations
Рекомендации по теме
Комментарии
Автор

Amazing Explanation. Very helpful.
Have you taught ML using sklearn? I am looking for it.

injeel_ahmed