SkLearn Linear Regression (Housing Prices Example)
[ad_1]
#LinearRegression #HousingPrices #ScikitLearn #DataScience #MachineLearning #DataAnalytics
We will be learning how we use sklearn library in python to apply machine learning algorithms in python.
scikit learn has Linear Regression in linear model class. Regression can be used for predicting any kind of data. In this tutorial we use regression for predicting housing prices in the boston dataset present in the sklearn datasets.
For all Ipython notebooks, used in this series : https://github.com/shreyans29/thesemicolon
Facebook : https://www.facebook.com/thesemicolon.code
Support us on Patreon : https://www.patreon.com/thesemicolon
Check out the machine learning, deep learning and developer products
Data Science book Recommendations :
US :
Python Reinforcement Learning : https://amzn.to/30MSlIU
Machine Learning : https://amzn.to/30OuRmw
Deep Learning Essentials : https://amzn.to/336opJ9
Deep Learning : https://amzn.to/2OoSY8J
Pattern Recognition : https://amzn.to/2MgUveD
India :
Pattern Recognition : https://amzn.to/2ViNWfJ
Deep Learning : https://amzn.to/2Vp3UVC
Reinforcement Learning : https://amzn.to/2LQz0SY
Python Deep Learning : https://amzn.to/2LQvXKj
Machine Learning : https://amzn.to/2Ml6NSX
Laptop Recommendations for Data Science :
US:
Asus : https://amzn.to/338roku
MSI : https://amzn.to/2OvdDIB
Lenovo : https://amzn.to/2OmpzMr
India:
Dell : https://amzn.to/2OnFeet
Asus : https://amzn.to/2LPQqyZ
Lenovo : https://amzn.to/2AS7XQx
Computer Science book Recommendations :
US:
Algorithms and Datastructures : https://amzn.to/3555P69
C programming : https://amzn.to/2nnuYrJ
Networking : https://amzn.to/2ItnOcN
Operating Systems : https://amzn.to/2LOjXsI
Database Systems : https://amzn.to/32ZqczM
India :
Computer Systems Architecture : https://amzn.to/336IxuM
Database Systems : https://amzn.to/2nntKN9
Operating Systems : https://amzn.to/2Vj1tUr
Networking : https://amzn.to/2IrnpHL
Algorithms and Datastructures : https://amzn.to/358jA3S
C programming : https://amzn.to/2oXKXNm
Book Recommendations for Developers :
US:
Design Patterns : https://amzn.to/2Mo0M8q
Refactoring : https://amzn.to/2AItLhJ
Enterprise Application Architecture : https://amzn.to/2VgoA21
Pragmatic Programmer : https://amzn.to/2IslX89
Clean Code : https://amzn.to/2ImBKVV
Clean Coder : https://amzn.to/33845Y0
Code Complete : https://amzn.to/2OnX696
Mythical Man month : https://amzn.to/2LTGOTX
India:
Design Patterns : https://amzn.to/2VhrPWH
Refactoring : https://amzn.to/2MmT8uG
Enterprise Application Architecture : https://amzn.to/31Q6J4t
Pragmatic Programmer : https://amzn.to/2p1fTwb
Clean Code : https://amzn.to/2LPmcvL
Code Complete : https://amzn.to/2LNUU9g
Mythical Man month : https://amzn.to/31QjFXL
Developer Laptop Recommendations :
US:
Microsoft Surface : https://amzn.to/2nknEgk
Lenovo Thinkpad : https://amzn.to/356RNRj
Macbook Pro : https://amzn.to/2oZDzRy
Dell XPS : https://amzn.to/338tkcK
India :
Lenovo Think Pad : https://amzn.to/30Ryet4
Microsoft Surface : https://amzn.to/2VjyD6w
Dell XPS : https://amzn.to/35d6nGU
Macbook Pro : https://amzn.to/33887PW
Source
[ad_2]
Finally a simple demo
Thank you from all beginners!
How to predict data if the data is in string format like "Brand of the care" on the basis of "Price and Hourse Power"?
This was very useful. Thank you
Hello i need help in python.
I have dataset in which 3 features and i want to predict the 3rd feature on base of first 2 features.
tnq
tnq
where's the sets?
How do you manipulate the parameters ???
2019+ Use…
sklearn.model_selection
not
sklearn.cross_validationSir, hoe can i get the dataset of india for house price prediction because i don't get it on kaggle or in any website..
Where are the p-values for the regression coefficients?
a=reg.predict(x_test)
error :ValueError: shapes (102,1) and (13,1) not aligned: 1 (dim 1) != 13 (dim 0)
Can anyone help me out ???
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sklearn
from sklearn.datasets import load_boston
boston = load_boston()
x = pd.DataFrame(boston.data,columns=boston.feature_names)
y = pd.DataFrame(boston.target)
from sklearn.model_selection import train_test_split
x_train,y_train,x_test,y_test = train_test_split(x,y,test_size=1/3,random_state=3)
from sklearn.linear_model import LinearRegression
reg = LinearRegression()
reg.fit(x_train,y_train)
i guess you should speak a bit more loud
If you have an error use 'from sklearn.model_selection import train_test_split'
To help, sklearn.cross_validation is depricated, now the uses is sklearn.model_selection
Straight to the point. Excellent!!!
9 minute video packed with great value. Bow!
short & sweet explaination
hey just came across this..quite basic informative, but a question that arent we suppose to compare " a vs y_train" instead of y_test?
hey
awesome videos
keep making the good stuff!!!
i tried the code and made a scatter plot
and the regression line was not accurate as you are saying the error is high !!
what do you mean by better model ? what other type of better models available in scikitlearn.
Is it required to normalize the data before training? This is one confusion I always have when building my models.
Please visualize the test set data.
Bro you have taught pandas, Numpy, and Matplotlib but did not teach Sckit-learn before this?
Why coefficient used here
sir can you help me there is no boston dataset in my anaconda I install all the libraries you wrote in the video
So the output of reg.predict(x_test) are the next values of price? and what does the left column in dataframe [y_test] mean?
simply surpb
Good tutorial… Simple and crisp. Great for a beginner like me .. Thanks 🙂
sir what is traning data and test data im beg im so confuse
Very useful pointers that make it easy to learn and remember. Thank you. Please start a new series doing the datasets from Kaggle and UCI for both Classification and Regression if possible. I'd be indebted to you in terms of gratitude.
it sounds pretty good 🙂
can we use other dataset instead of boston dataset if yes then how?please tell me
Hello,I have a similar task and I'm having trouble performing it, can you help me in detail