Linear Regression on Real Dataset
Learn to implement linear regression on a real data set with several features.
Linear regression with several unknowns
So far, we’ve worked with examples of linear regression consisting of only one unknown. However, systems from real-life situations are typically complex, with several unknowns. In this lesson, we’ll work with a more involved example of a
Context
The task at hand is to find a relationship that determines the amount of heating or cooling required by a building, given different features of the building like roof area, wall area, and glazing.
The data set consists of different features, namely X1 to X8, of different buildings, along with their heating and cooling loads, Y1 and Y2, respectively. Below is a representation of the first five data records and the header information.
Linear system modeling
For this specific lesson, we are interested in the target Y1 (heating load) in the data depending upon the feature attributes (X1, X2,…, X8). In particular, we want a prediction of the target given features. If we assume a linear relationship between the target and the features, we can model our data as a linear system.
Let represents a column vector of all ones and represents a column vector of the feature of all the records. The data matrix will then be ...