# Predict the Future with Regression Analysis

## Using Scikit-Learn and a little bit of Python Solve if you are a genius, or just know how to use scikit-learn

## Wish life was just as simple as a linear function

You may have noticed that we used LinerRegression here. What is linear? As you have seen in the formula used, Y depended on X1 and X2, but not on something like X1², X2², X1*X2 or even X power something greater than 2, or the square root of X or such. These kind of formulae, we call them non-linear ones.

## Ain’t there other models, other that LinearRegression?

Of course, Scikit-Learn provides more complex models. Back in the early 2000’s, SVM (Support Vector Machines) was the new cool, something like Deep Learning of today. SVM can deal with non-linear data too, by using some trick called kernels. In this code, we are going to use SVM with a Polynomial kernel (i.e. non-linear) to do our regression task. We are going to use the same data as above.

## How to tell the model we are using is a good fit or not?

Now back to your earlier question, “How to tell the model we are using is a good fit four our data or not?” Previously, we used all our data as training data. In practice, we normally split our data into two chunks. One chunk we use as our training data. I.e. we use it to train a model. The other chunk we call testing data. Once we have our model trained, we use it to predict the Y values of the testing data. Since we already know the true values of Y for the testing data anyway, we can then compare the true values to the predicted values, and decide whether our model is sound or not. 