The first predictive model we build is usually not the best one. Building predictive models is an iterative process that involves much trial and error. In this video we'll discuss some ideas to improve linear regression model. Even though we do not discuss it here we point out that theta prepossession which we discussed in the previous model of this course can have profound effect of our model result. We mainly focus on two ways to improve model feed. The first one is interacting terms, and the second one is, data transformation. Model selection is another way to improve model feed which we discuss in a separate video. In the regression model, an interaction term is the multiplication of two terms Let's go back to our housing data example. In the model regression we performed earlier, we included two predictor variables, square foot and parking type. We can include a third term on the right-hand side, which is the product of square foot and parking type. This new term is an interaction term. The resulting regression is simply a micro regression with three predictor variables. Where the third particular variable is a product of the first two variables. It can be estimated using the same multiple regression method, for the dataset that we have, we obtain that b0 is about -19.29, b1 is 0.41, b2 is -125.14, and B3 is 0.02. Recall that including parking type, in the second to last term changes intercept when parking type to one. By including the interacting term when parking type to one, the slope of also changes. In this particular example, the coefficient for parking term is 0.02, therefore, when parking type equal one, the slope of square foot is increased by zero point zero two. When parking type includes zero the last two terms on the right hand side, vanish. Why would we interpret the result is that garage parking is worse about lacking one hundred, twenty five, thousand dollars. Holding everything else constant, however with the garage parking the value slightly. Next, we'll discuss data transformation. For simplicity of our discussion, we return to simple regression as the predictor variable. The figures here shows the scatter plot with different transformation, the top left figure is a scatter plot of the list price versus square foot when no transformation is performed. The top right one shows a scatter plot when a log transformation is applied to square foot. The bottom left figure shows a plot where a log transformation is applied to list price, where the bottom right feeder shows a cloud where log transformation is applied to both variables. Which one gave us better model feed? This table shows the result for the four scenarios we considered. For each of them we looked at r squared as a measure of good list of feed. The result shows that when the log transformation is applied to both variables r squared is the highest. When data transformation is not applied, r squared is 0.64. Therefore, for transforming variables we were able to considerably improve the model feed. The result we obtain is not surprising if we look at the scatter plots in more detail. Here is a scatter plot with and without data transformation. When that transformation is applied to both variables, the scatter plot shows a more apparent linear pattern. Without the transformation, most data points in the scatter plot are clustered in the lower left corner. Indeed, a visualization, such as the one shown here, are often used to determine appropriate data transformation.