[Hindi] Linear Regression Code In Python Sklearn! – Machine Learning Tutorials In Hindi
[ad_1]
This video is a part of my Machine Learning Using Python Playlist – https://www.youtube.com/playlist?list=PLu0W_9lII9ai6fAMHp-acBmJONT7Y4BSG
►Click here to subscribe – https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww
Best Hindi Videos For Learning Programming:
►Learn Python In One Video – https://www.youtube.com/watch?v=qHJjMvHLJdg
►Learn JavaScript in One Video – https://www.youtube.com/watch?v=onbBV0uFVpo
►Learn PHP In One Video – https://www.youtube.com/watch?v=xW7ro3lwaCI
►Machine Learning Using Python – https://www.youtube.com/playlist?list=PLu0W_9lII9ai6fAMHp-acBmJONT7Y4BSG
►Creating & Hosting A Website (Tech Blog) Using Python – https://www.youtube.com/playlist?list=PLu0W_9lII9agAiWp6Y41ueUKx1VcTRxmf
►Advanced Python Tutorials – https://www.youtube.com/playlist?list=PLu0W_9lII9aiJWQ7VhY712fuimEpQZYp4
►Object Oriented Programming In Python – https://www.youtube.com/playlist?list=PLu0W_9lII9ahfRrhFcoB-4lpp9YaBmdCP
►Python Data Science and Big Data Tutorials – https://www.youtube.com/playlist?list=PLu0W_9lII9agK8pojo23OHiNz3Jm6VQCH
Follow Me On Social Media
►Website (created using Flask) – https://www.codewithharry.com
►Facebook – https://www.facebook.com/CodeWithHarry
►Instagram – https://www.instagram.com/CodeWithHarry/
►Personal Facebook A/c – https://www.facebook.com/geekyharis
Twitter – https://twitter.com/Haris_Is_Here
Source
[ad_2]
#Code
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error
diabetes = datasets.load_diabetes()
diabetes_X = diabetes.data
diabetes_X_train = diabetes_X[:-30]
diabetes_X_test = diabetes_X[-30:]
diabetes_y_train = diabetes.target[:-30]
diabetes_y_test = diabetes.target[-30:]
model = linear_model.LinearRegression()
model.fit(diabetes_X_train, diabetes_y_train)
diabetes_y_predicted = model.predict(diabetes_X_test)
print("Mean squared error is: ", mean_squared_error(diabetes_y_test, diabetes_y_predicted))
print("Weights: ", model.coef_)
print("Intercept: ", model.intercept_)
# plt.scatter(diabetes_X_test, diabetes_y_test)
# plt.plot(diabetes_X_test, diabetes_y_predicted)
#
# plt.show()
# Mean squared error is: 3035.0601152912695
# Weights: [941.43097333]
# Intercept: 153.39713623331698
From 945 to 945k subscribers in 2 years ♥️
dataset kha sa lena ha link dede
excellent session
In one Sentence !! God is TEACHING US !!
ausome sir all clear
at 9:00 i think u messed up the slicing. diabetes_x_train[:-30] does not give last 30 elements. when i check shape it shows (412,1) elements. that means everything except last 30 elements and diabetes_x_train[-20:] means last 20 elements
ye bhi theek hai
Sir help me
Here an error occured while using matplotlib
So what to do now
aaj se roj dekhna hai isse
waada raha!!!!!
Great brother love from pakistan
You are a legend.
25:32
bhaiya ekdum santusht hain!!
thanku very much!!
Awesome, keep it up Harry…Geo
869 subs to 849 k subs ,
Great Journey
great video
Can I do this in Sublime ??
What are weights???
Thank you so much harry sir, you really teach very Nicely and love your videos and i have learned a lot
900 to 800k subscribers.
Extra talkative, it's sooo annoying literally
Mujhe ei error a raha hai.. iska solution kya hoga mujhe kahi or nehi mila
diabetes_x_train = diabetes_x[:,-30]
diabetes_x_test = diabetes_x[-30:]
diabetes_y_train = diabetes.target[:,30]
diabetes_y_test = diabetes.target[-30,:]
model = linear_model.LinearRegression()
model.fit(diabetes_x_train,diabetes_y_train)
diabetes_y_predict = model.predict(diabetes_x_test)
mean_squared_error(diabetes_y_test ,diabetes_y_predict)
============== ERROR==========================
IndexError Traceback (most recent call last)
<ipython-input-17-b0290405a178> in <module>
—-> 1 diabetes_x_train = diabetes_x[:,-30]
2 diabetes_x_test = diabetes_x[-30:]
3
4
5
IndexError: index -30 is out of bounds for axis 1 with size 1
ImportError: DLL load failed while importing ft2font: The specified module could not be found.
i am doing in vs code and its giving this error, how to fix it ?
diabetes_x = diabetes.data[:,np.newaxis,2]
In this line what is the meaning of np.newaxis?
I observed that there were only 965 subscribers when you were recording this video… and the number has crosses 7L in just 2 years… this shows your talent your hard work and and your determination towards your work. thanks a lot sir, for helping us grow… 🙂
Simply wowww… great explaination 👍👍 and thanks a lot for the code.
Ye scattering excel me bhi kar sakte h na carry bhai?
superb video sir,love youuuuuu sir
Hello bhai, thank you for sharing knowledge of python.
May I know what is a road map for data analysis.
Like first is EDA then after EDA what other analysis we can perform.
Thanks sir. You are really a great and intelligent person.
Sir ye error aa raha hai
ImportError: cannot import name '__check_build' from 'sklearn'
Please help
In am tired for saying go you… That is make adjustments video in jupyter notebook but you don't made what is problem… For beginner jupyter is very useful
Bilkul santusht hai guruji
ImportError: DLL load failed while importing ft2font: The specified module could not be found.
Mza aa gya bhai
great
really nice bro till now!!
Sir why you have not defined diabetes_y as you have defined diabetes_x =diabetes.data[:, np.newaxis, 2] ??
bhai yeh snowall k orginal mic kah s liya
Please make a course on Graphic Design
TypeError: fit() missing 1 required positional argument: 'y' this error is showing what i hould do
Sir mene bhut kuch sikha apse
Value error: x and y must be the same size, it is same size I copy your source code then also it's give me bug.
Using [:,-30] would pick first thirty elements when there are 60 elements in the whole array
I do not understand why we used[:-30] for first thirty elements instead I think we should use[:,30]