Multiple Linear Regression in Python - sklearn

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ค. 2022
  • If you are a complete beginner in machine learning, please watch the video on simple linear regression from this link before and learn the basic concepts first:
    • Simple Linear Regressi...
    Here is the dataset used in this video:
    Please feel free to check out my Data Science blog where you will find a lot of data visualization, exploratory data analysis, statistical analysis, machine learning, natural language processing, and computer vision tutorials and projects:
    regenerativetoday.com/
    Twitter page:
    / rashida048
    Facebook Page:
    regenerativetoday.com/
    #linearRegression #machinelearning #datascience #dataAnalytics #python #sklearn #jupyternotebook

ความคิดเห็น • 87

  • @imveryhungry112
    @imveryhungry112 ปีที่แล้ว +11

    im glad people like you exist. I am simply not smart enough to have figured this out on my own

  • @souravdey1227
    @souravdey1227 ปีที่แล้ว +9

    Very good tutorial. No nonsense and clean. Thanks

  • @anis.ldx1
    @anis.ldx1 3 หลายเดือนก่อน +1

    Absolutely brilliant! Your way of explaining is beyond exceptional. Thank you so much for this simplistic explanation!

  • @maheswaraardhani323
    @maheswaraardhani323 2 หลายเดือนก่อน

    from the bottom of my heart, i want to thank you for your detailed and easy to follow explanation. i dont know who you are or where you are but you have my utter respect. big thanks

  • @muhammadaalimisaal8453
    @muhammadaalimisaal8453 8 หลายเดือนก่อน

    I am kinda selfish type of person. Usually I donot like videos nor subscribe channels but how precise and to be the point your video was and I'm utterly impressed as this video was helpfull in clearning my concepts about MLR.
    Goodluck, Best wishes. You have won a subscriber

  • @subhabhadra619
    @subhabhadra619 11 หลายเดือนก่อน +1

    Fantastic video.simple to understand

  • @zishankhan2763
    @zishankhan2763 4 หลายเดือนก่อน +1

    Very clear instruction, thanks!

  • @Puputchi
    @Puputchi 4 หลายเดือนก่อน +1

    Thank you for the tutorial!

  • @albertjohnson8605
    @albertjohnson8605 10 หลายเดือนก่อน +1

    I don't know who you are, but THANK you from deep heart for making this content

  • @analyticalmindset
    @analyticalmindset ปีที่แล้ว +2

    I would've loved for you to squeak in a Residual analysis or whatever is done after you get your R2 values from your test and train group.

  • @robinncode
    @robinncode หลายเดือนก่อน

    Thanks for the amazing insights!

  • @programsolve3053
    @programsolve3053 29 วันที่ผ่านมา

    Very well explained 🎉🎉
    Thanks you so much 🎉🎉🎉

  • @freeprivatetutor
    @freeprivatetutor 7 หลายเดือนก่อน +1

    excellent. very helpful. subscribed!

  • @RaihanRisad
    @RaihanRisad 2 หลายเดือนก่อน +2

    where can i get the dataset that you used

  • @tianyouhu5973
    @tianyouhu5973 ปีที่แล้ว

    super helpful, appreciate it

  • @tejallengare3673
    @tejallengare3673 9 หลายเดือนก่อน

    This video is very helpful thank you so much

  • @KilalibaTugwell
    @KilalibaTugwell 11 หลายเดือนก่อน

    This video was super helpful

  • @nobio9591
    @nobio9591 ปีที่แล้ว

    Thanks Dear Rashida

  • @christophermiller4637
    @christophermiller4637 15 วันที่ผ่านมา

    Data isn't my background, but these videos help me understand how to structurally get there. Is there a way to export the predicted charges into a data population for further review. Also, is there a way to adjust the scatter plot dots by a filter on one of the independent variables (i.e. any record where age is 17, make the the plot red color). Thank you!

  • @cientifiko
    @cientifiko ปีที่แล้ว

    thanks... this is awesome

  • @elijahcota2408
    @elijahcota2408 3 หลายเดือนก่อน +1

    Thank you, god bless

  • @BayuWicaksana95
    @BayuWicaksana95 ปีที่แล้ว

    thank you for the tutorial

  • @mistymoose4424
    @mistymoose4424 ปีที่แล้ว +1

    omg thank you queen❤

  • @alirezarahbari3556
    @alirezarahbari3556 ปีที่แล้ว

    Helpful🔥

  • @nevermind9708
    @nevermind9708 5 หลายเดือนก่อน +3

    i think u can make a function to convert object name into numeric if the the data has many columns instead of writing 1 each 1 like this :
    for column in df.columns:
    if not pd.api.types.is_numeric_dtype(df[column]):
    df[column] = df[column].astype('category')
    df[column] = df[column].cat.codes
    df

    • @regenerativetoday4244
      @regenerativetoday4244  5 หลายเดือนก่อน

      Thank you so much for adding this here. I used this function in some other videos as well.

  • @Kennerdoll
    @Kennerdoll ปีที่แล้ว

    how do i go about passing new values from a user?

  • @alirezarahbari3556
    @alirezarahbari3556 ปีที่แล้ว

    Nice 👍

  • @svea3524
    @svea3524 10 หลายเดือนก่อน

    how do i plotthe fit line over the data?

  • @fatemehrakhshanifar6402
    @fatemehrakhshanifar6402 ปีที่แล้ว

    Hi, I could find the data but not the code, it's not on your github?

  • @Habbodonald
    @Habbodonald หลายเดือนก่อน

    Very good video. About the model, dont you need to check if R-square need an adjust to trust his income?

    • @regenerativetoday4244
      @regenerativetoday4244  หลายเดือนก่อน +1

      There are a few different ways to check the model prediction. R-squared error is one of them. It is common for machine learning models to use mean squared error or mean absolute error as well.

  • @ThobelaGoge
    @ThobelaGoge หลายเดือนก่อน

    How do we access the dataset used?

  • @wardaoktoh5060
    @wardaoktoh5060 5 หลายเดือนก่อน

    thank youuuuuuuuuuuuuuuuu miss

  • @richardreneBunalos
    @richardreneBunalos ปีที่แล้ว

    Can you show us how to do OneHotEncoding?

  • @jayasarojam8568
    @jayasarojam8568 4 หลายเดือนก่อน

    Great

  • @KilalibaTugwell
    @KilalibaTugwell 11 หลายเดือนก่อน

    If I developed a model with an r-squared of 0.2. What do I do to improve the performance of the model?

    • @regenerativetoday4244
      @regenerativetoday4244  11 หลายเดือนก่อน +1

      Try different hyperparameters to improve the model and also different models.

  • @subhasispaul7262
    @subhasispaul7262 3 หลายเดือนก่อน

    Can you share the following data please

  • @fariapromi4182
    @fariapromi4182 2 หลายเดือนก่อน

    Where is the dataset???

  • @chiragahlawat465
    @chiragahlawat465 2 วันที่ผ่านมา

    Thank you mam for such a wonderful learning!! I want to know further how can I improve my model accuracy with train score 0.75 and test score -1.12 ??

    • @regenerativetoday4244
      @regenerativetoday4244  2 วันที่ผ่านมา

      First is trying to tune hyperparameters, and also it is normal practice to try different models to find out which model works best for the dataset. Feel free to have a look at this video where you will find a technique for hyperparameter tuning: th-cam.com/video/km71sruT9jE/w-d-xo.html

  • @PersonalOne-wn2zd
    @PersonalOne-wn2zd 5 หลายเดือนก่อน +1

    I have a Different Insight from that i used the Wine data set for that

  • @Essentialenglishwords-ii7ek
    @Essentialenglishwords-ii7ek ปีที่แล้ว

    please may i ask you why you didn't put (axis = 1) when you drop a column

  • @mdrahatislamkhan9966
    @mdrahatislamkhan9966 2 หลายเดือนก่อน

    x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.2,random_state=0) it works fine but when i swapped the x_train and x_test it gives me error.
    x_test,x_train,y_train,y_test=train_test_split(x,y,test_size=0.2,random_state=0) why this code gives me error. can you please explain me?

    • @regenerativetoday4244
      @regenerativetoday4244  2 หลายเดือนก่อน

      It should give you error because x_test and y_train have different sizes

    • @mdrahatislamkhan9966
      @mdrahatislamkhan9966 2 หลายเดือนก่อน

      ​@@regenerativetoday4244i dont got your point. sized are same. I wanted to know if i write x_test,x_train .... it gives me error but it i write x_train,x_test.... then it works fine.

  • @jacintaqiu9919
    @jacintaqiu9919 2 หลายเดือนก่อน

    Why my coding shows "TypeError: float() argument must be a string or a real number, not 'Timestamp'"? which one could help me to solve this problem, plz!!

    • @regenerativetoday4244
      @regenerativetoday4244  2 หลายเดือนก่อน

      You need to check the data type of all the columns. If you see any variable is coming as timestamp, that needs to be excluded. Because this tutorial didn't account for datetime datatype. There are different ways of dealing with timestamps. You will find one way of using the timestamp data in this type of models in this tutorial: th-cam.com/video/Kt9_AI12qtM/w-d-xo.html

    • @jacintaqiu9919
      @jacintaqiu9919 2 หลายเดือนก่อน

      Thank you sooooo much!!!! really helpful:)@@regenerativetoday4244

  • @raymondkang1329
    @raymondkang1329 ปีที่แล้ว +5

    Erm, I think the method you convert the data "region" is inappropriate. U cant convert the "region" as category since it become ordinal data. I think we should convert each of the region into dummy variables then we can see the coefficient of each region.

    • @SS-st5uv
      @SS-st5uv 2 หลายเดือนก่อน

      Exactly

  • @shanenicholson94
    @shanenicholson94 ปีที่แล้ว +2

    Fantastic video. Very simple and to the point. How can I add the regression line to the chart?

    • @svea3524
      @svea3524 10 หลายเดือนก่อน

      do you have the answer?

    • @shanenicholson94
      @shanenicholson94 10 หลายเดือนก่อน

      @@svea3524 let me find it later for you. I got it eventually

    • @sedativelimit
      @sedativelimit 7 หลายเดือนก่อน

      use plt.plot to draw regression line i.e in the format
      plt.plot(X_train, reg.predict(np.column_stack((X_train))), color='blue', label='Regression Line')

  • @user-xp2qv2jk7b
    @user-xp2qv2jk7b หลายเดือนก่อน

    Please can you send me any link for case study using python polynomial regression (or multi polynomial) with data ?
    I want to practice.

    • @regenerativetoday4244
      @regenerativetoday4244  หลายเดือนก่อน

      Here it is: th-cam.com/video/nqNdBlA-j4w/w-d-xo.html

  • @maishakhatun5635
    @maishakhatun5635 5 หลายเดือนก่อน

    What if a dataset has columns with numerical values but with symbols, how to do the cleaning?

    • @maishakhatun5635
      @maishakhatun5635 5 หลายเดือนก่อน

      I mean comma or currency symbol, thank you

    • @maishakhatun5635
      @maishakhatun5635 5 หลายเดือนก่อน

      have you got any videos that calculate the mean absolute error for evaluation?

  • @JyotirmoyeeRoy
    @JyotirmoyeeRoy หลายเดือนก่อน

    Its showing a error as "df isn't defined "

  • @manyasachdeva1511
    @manyasachdeva1511 8 หลายเดือนก่อน +1

    Can you please provide the link for the csv file? I'd like to practice the codes on my own as well

    • @regenerativetoday4244
      @regenerativetoday4244  8 หลายเดือนก่อน +1

      Here is the link to the dataset: github.com/rashida048/Machine-Learning-Tutorials-Scikit-Learn/blob/main/insurance.csv
      Thanks!

    • @manyasachdeva1511
      @manyasachdeva1511 8 หลายเดือนก่อน

      @@regenerativetoday4244 thank you so much :)

    • @manyasachdeva1511
      @manyasachdeva1511 8 หลายเดือนก่อน

      Your content is amazing

  • @santakmohanty612
    @santakmohanty612 6 หลายเดือนก่อน

    Could you also upload or provide a google drive link for the data set file. It would be really helpful.

    • @regenerativetoday4244
      @regenerativetoday4244  6 หลายเดือนก่อน +4

      Here is the link to the dataset: github.com/rashida048/Machine-Learning-Tutorials-Scikit-Learn/blob/main/insurance.csv. I am sorry, TH-cam changed their policy for links.

    • @santakmohanty612
      @santakmohanty612 6 หลายเดือนก่อน

      @@regenerativetoday4244 Thanks a lot !!

  • @abinanda5754
    @abinanda5754 ปีที่แล้ว

  • @abbddos
    @abbddos ปีที่แล้ว +3

    Good.. but normally we test a model with data that it hasn't seen before, and that's the test split.

  • @girlthatcooks4079
    @girlthatcooks4079 5 หลายเดือนก่อน +1

    On what are you typing your codes this is not vsc?Sorry i am a begginer

  • @user-qc4yk9ko9t
    @user-qc4yk9ko9t 9 หลายเดือนก่อน

    what to do when data have null values?

    • @regenerativetoday4244
      @regenerativetoday4244  9 หลายเดือนก่อน +1

      I just added a detailed video on how to deal with null values. Here is the link: th-cam.com/video/BnfLUJkrMjs/w-d-xo.html

  • @sairahulreddykondlapudi8855
    @sairahulreddykondlapudi8855 ปีที่แล้ว +1

    training and testing on the same dataset?

  • @Martin-xf8be
    @Martin-xf8be 8 หลายเดือนก่อน

    Why did you need to convert to category?

    • @regenerativetoday4244
      @regenerativetoday4244  8 หลายเดือนก่อน +2

      Because machine learning models cannot work with strings. It features and labels should be numeric

    • @Martin-xf8be
      @Martin-xf8be 8 หลายเดือนก่อน

      @@regenerativetoday4244
      Ahh, I see. Thanks for a great video!

  • @sheldonoumaotieno6846
    @sheldonoumaotieno6846 ปีที่แล้ว

    hey I think the formula and the logic is wrong, though implementation is right. Linear regression even though they may seem it is quite different from the just a simple linear equation. The input features what you define as X are in fact vectors. If you compile n with m training example you have a matrix rather than simple linear equation and it turns out to be a matrix multiplication.
    The addition is something called bias. The W is the weight. Anyway keep up!

    • @regenerativetoday4244
      @regenerativetoday4244  ปีที่แล้ว +1

      The bias term in machine leaning term can actually be compared with y_intercept in the linear formula and the weights as coefficients. in y = aX+c, a and X are variables that can be integers, vectors, arrays, or matrices. Same as c. The formula is the concept. I have a detailed tutorial with explanation that shows the linear regression implementation in python from scratch (no libraries), please check if you are interested: regenerativetoday.com/how-to-develop-a-linear-regression-algorithm-from-scratch-in-python/.

  • @63living.
    @63living. 3 หลายเดือนก่อน

    Can't download dataset

    • @regenerativetoday4244
      @regenerativetoday4244  3 หลายเดือนก่อน

      Here is the link: github.com/rashida048/Machine-Learning-Tutorials-Scikit-Learn/blob/main/insurance.csv

  • @richardquinn72
    @richardquinn72 ปีที่แล้ว

    Very clear instruction, thanks!