Python ML #03: Rainfall Prediction Using Linear Regression Model

Поделиться
HTML-код
  • Опубликовано: 3 дек 2020
  • In this video, you'll learn how to use linear regression model with the help of machine learning in Python to predict the rainfall in Austin, Texas since 2013 for a time span of 5 years [ 2013 - 2017 ].
    Linear regression is a linear approach to modelling the relationship between a scalar response and one or more explanatory variables.
    Website : bekbrace.netlify.app
    Source code + CSV File: github.com/BekBrace/Machine.L...
    DEV profile : dev.to/bekbrace
    Github profile: github.com/BekBrace
    Follow me on Instagram / Twitter: Bek Brace

Комментарии • 40

  • @tuankuomo6560
    @tuankuomo6560 3 года назад +3

    Thank you, Very useful for me...

    • @BekBrace
      @BekBrace  3 года назад

      I’m glad, my friend 🙂

  • @user-tv2pk4zb9z
    @user-tv2pk4zb9z 6 месяцев назад

    Hello sir, I'm trying to put together a scatter plot for the precipitation trend and precipitation vs. selected attributes, but I'm receiving an error [TypeError: unhashable type: 'numpy.ndarray'].
    Could you please possibly assist me in figuring this out?

  • @kennethbermudez8074
    @kennethbermudez8074 3 года назад +4

    hello Bek Brace, can you explain more about the "input" please, what is it? why is it random? thanks!

    • @BekBrace
      @BekBrace  3 года назад +2

      Hi Kenneth.
      So, the inp variable is used in this case because we need a sample input just to test the model - nothing more, and these are random values for a 2-D vector for each column in the dataset, checkout the dataset and you will see what I mean -
      And ultimately, we will use the classifier ( variable clf to predict the rainfall based on our sample input :
      >>> print('The precipitation in inches for the input is:', clf.predict(inp))
      if you have more questions, just let me know - peace out

  • @NandoRooster
    @NandoRooster 3 года назад +2

    For your inp variable, shouldn't you have 16 inputs instead of 17? I am getting an error when predicting the precipitation

    • @BekBrace
      @BekBrace  3 года назад

      What the error report says ?

    • @NandoRooster
      @NandoRooster 3 года назад

      @@BekBrace When you imported the austin_clean.csv didn't you get an extra index column at the beginning ? That's why maybe you end up with 17 columns instead of 16

    • @NandoRooster
      @NandoRooster 3 года назад

      And this is the error I was getting: "ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 16 is different from 17)"

    • @BekBrace
      @BekBrace  3 года назад

      @@NandoRooster Thank you.
      This is odd, because i didn't use matmul method but the array method instead which should create an array object
      inp = np.array([[74], [60], [45], [67], [49], [43], [33], [45],
      [57], [29.68], [10], [7], [2], [0], [20], [4], [31]])
      They are 17 columns without the 0 index, in fact if you will take a look to the set you will find the numbers that i picked from 74 to 31 as a sample.

  • @ndsingh2368
    @ndsingh2368 3 года назад +2

    in the input data you have given 17 entries but only 16 are required as per the new final csv file. Why did you add an extra [0] in 14th place?

    • @BekBrace
      @BekBrace  3 года назад +1

      Unintentional, but If you will ignore the [0], you’ll get the same result

    • @ndsingh2368
      @ndsingh2368 3 года назад

      @@BekBrace but if we don't add that [0], an error occurs.

  • @kavanamgowda6707
    @kavanamgowda6707 2 года назад +1

    By any chance does your code predicts flood , if there is high rainfall??

    • @BekBrace
      @BekBrace  2 года назад

      No, but we can always train the model

  • @fosbergaddai4996
    @fosbergaddai4996 2 года назад +1

    Please what does it mean when tbs precipitation inches is 1.2

    • @BekBrace
      @BekBrace  2 года назад

      This means rainfall precipitation is 1.2 inches , precipitation is any product of the condensation of water vapor that falls under gravitational pull from cloud, in our case the rain 🌧️

  • @vaidehidesai1015
    @vaidehidesai1015 3 года назад +1

    Can I have a same dataset for Gujarat, India?

    • @BekBrace
      @BekBrace  3 года назад

      sure, check it out on Kaggle

  • @madhavshashi5041
    @madhavshashi5041 3 года назад +3

    Can you please explain this problem?
    Q). you’ve implemented a regularized linear regression to identify whether it will rain or not. What steps will you take if your model continues to show large errors?

    • @BekBrace
      @BekBrace  3 года назад +1

      what do you mean ? like what if the model is overfitting the training data ?

    • @madhavshashi5041
      @madhavshashi5041 3 года назад

      @@BekBrace ok, 1) what if the model is overfitting?
      2) What steps will you take if the above problem occurs due to underfitting?

  • @vishalkhatal6338
    @vishalkhatal6338 Год назад

    why there is 1200 day from which we have to select , instead there should be index of 365 day because here we are predicting data of next year on the basis of past data ?

  • @vaidehidesai1015
    @vaidehidesai1015 3 года назад +2

    From where did you find the dataset? Please mention link.

    • @BekBrace
      @BekBrace  3 года назад

      Hello ! Of course, it's from Kaggle website, I'm sure you can find what you're looking for in their repos.
      Link: www.kaggle.com/datasets?search=eeg

  • @Avinash-er8tu
    @Avinash-er8tu 3 года назад +2

    What to do if i want to use logistic regression

    • @BekBrace
      @BekBrace  3 года назад +1

      Hello Avinash!
      The answer for your question requires a whole separate video, but I have another machine learning tutorial on the channel using logistic regression [ heart disease prediction tutorial #5 ]- maybe you can check it and see how you can modify the rainfall prediction mode to accommodate Logistic Regression -

    • @Avinash-er8tu
      @Avinash-er8tu 3 года назад

      @@BekBrace oh thanks i just want to confirm one more thing i run this code like a month ago and downloaded libraries but when i tried to run it today it is showing pd is not defined so do i need to install libraries again.

    • @BekBrace
      @BekBrace  3 года назад +1

      Check out first if the libraries are already installed or not using :
      >>> pip freeze
      Then check out what’s missing ..
      Worst case scenario is you’re going to reinstall them all

    • @Avinash-er8tu
      @Avinash-er8tu 3 года назад

      @@BekBrace ohk thank you so much u been a great help

    • @BekBrace
      @BekBrace  3 года назад

      @@Avinash-er8tu welcome my friend

  • @Singh.7777
    @Singh.7777 3 года назад +1

    👍

  • @user-jg9un8dz9j
    @user-jg9un8dz9j 4 месяца назад

    I have one question in datasets.... Which is target value of the project .....which problem is solved by the project.... Explain it .....

    • @BekBrace
      @BekBrace  4 месяца назад +1

      You've got a long road to learn, son. And you have to say " PLEASE " if you ask someone for something.

    • @user-jg9un8dz9j
      @user-jg9un8dz9j 4 месяца назад

      @@BekBrace ok ... Please explain

  • @confidential303
    @confidential303 3 года назад +1

    Your Mouse cursor delay effect is very distracting.

    • @BekBrace
      @BekBrace  3 года назад

      Sorry to hear that

  • @niazizarif3810
    @niazizarif3810 2 года назад

    May god bless you the code is wrong

    • @BekBrace
      @BekBrace  2 года назад

      May God bless you're mistaken 😂