# Linear Regression

## Rules of machine learning

Tonight Melina Katkic presented two ways to create linear regression, one made with pure code and one with the library scikit-learn. Linear regression is when you try to map your input to your output with a line. It could be salary vs. experience, house prices vs. apartment size or murders vs. chocolate sold. Some of them will fit well and this gives us the possibility to use the model to predict the value just based on our next input, others does not fit so well to a line and in those cases we might try a polynomial regression instead and some just do not make sense at all. And the last one is perhaps the most important to keep in mind. You might find some really nice regularity in your data, but are they causal or correlated. Does the data have any relation at all? In machine learning the data is often much more important than the model used and the base rule is to use the simplest model that solves the problem. Otherwise you will just spend too much resources, you do not want to use a flamethrower to light a candle.

## Linear regression

Now how do you fit some data to a line? A line in math is just this simple equation *y = m * x + b*. You can see the complete calculations with a clear explanation of the math at this link about Linear Regression. If you want to look at a code sample in scikit-learn you can look at this Linear Regression Sample.

If you want to take a look at the code Melina wrote you can get it at github: https://github.com/NordAxon/simple_regression

## Attend the events

We now have over 350 members at meetup but we still "only" see around 20 monkeys on every event. If you really want to know more about this topic then come to our events, because there is where you meet the most interesting people. Some work within the field, other are studying but the majority are enthusiasts who just want to know more and are eager to share ideas and talk about their projects. So, if you feel that you do not know anything about AI or computers, but would like to, then you are more than welcome to join. Our goal is to spread the knowledge about this fast growing field and bring people within this field together so we can all expand our knowledge.

* -
Linear Regression, scikit-learn, algebra*