Python3 Machine Learning (Linear Regression)

Hello, Programmers !
Welcome to CCP
Lets get started !

So,
In today's fun project lets get our hands dirty in Machine Learning !
Hottest topic of today's world,

Now, What is machine learning ?

Machine learning is the process by which we feed our computers with data and statistics, it learns from them and then predicts future outcomes,

And, Linear Regression is a method to discover the relationship b/w the data points to draw a line through them and we use this relationship,

Interesting huh ?

A line of linear regression looks like this:



Now, lets talk about some applications of it:

1. Big steps towards artificial intelligence, in a previous fun project we made a jarvis-like speaking program (you can catch it here), you can make it even more smarter without adding terrific amount of if statements by machine learning,

2. Widely used in weather forecasting (they feed their computers with weather conditions and predict the weather)

3. Speech recognition systems, like we used google's in the tutorial above, at its core, it was data science or Machine learning

Prerequisites:
1. You should be familiar with numpy library of python

Before going to the code, you should install scikit-learn using PIP like this:


In my case, These are already installed, but you have to wait till the sklearn and other dependencies are installed,
Now,
Lets stick to the code !


Now, we received 90.846 as our answer but the actual value was 86,

This, some sort of inaccuracy is due to unavailability of more data, From machine point of view, to produce more data and learn in order to give accurate results, This data is not sufficient, it needs much more data to understand the relation and produce results,

Else, All the information is provided in the code,

Note: Do read the comments in the code to understand it more better, as i have provided line-by-line explanations in it,

So,
This was all about the Linear Regression,
Have fun learning Machine learning :)

(Wow, It sounds good, I think i should keep it as the heading of this tutorial........Naaa, This title is good enough !)

Comments

  1. Waiting to see more on machine learning,
    Please make a tutorial on Deep learning also

    ReplyDelete
    Replies
    1. As you wish !
      We will be adding more tutorials on machine learning then !

      Delete

Post a Comment