
上QQ阅读APP看书,第一时间看更新
Understanding the advertising data
This problem falls into the supervised learning type, in which we have explanatory features (input variables) and the response (output variable).
What are the features/input variables?
- TV: Advertising dollars spent on TV for a single product in a given market (in thousands of dollars)
- Radio: Advertising dollars spent on radio
- Newspaper: Advertising dollars spent on newspapers
What is the response/outcome/output variable?
- Sales: The sales of a single product in a given market (in thousands of widgets)
We can also use the DataFrame method shape to know the number of samples/observations in our data:
# print the shape of the DataFrame
advertising_data.shape
Output:
(200, 4)
So, there are 200 observations in the advertising data.