- Deep Learning By Example
- Ahmed Menshawy
- 259字
- 2021-06-24 18:52:41
Data analysis and visualization
In order to understand the underlying form of the data, the relationship between the features and response, and more insights, we can use different types of visualization. To understand the relationship between the advertising data features and response, we are going to use a scatterplot.
In order to make different types of visualizations of your data, you can use Matplotlib (https://matplotlib.org/), which is a Python 2D library for making visualizations. To get Matplotlib, you can follow their installation instructions at: https://matplotlib.org/users/installing.html.
Let's import the visualization library Matplotlib:
import matplotlib.pyplot as plt
# The next line will allow us to make inline plots that could appear directly in the notebook
# without poping up in a different window
%matplotlib inline
Now, let's use a scatterplot to visualize the relationship between the advertising data features and response variable:
fig, axs = plt.subplots(1, 3, sharey=True)
# Adding the scatterplots to the grid
advertising_data.plot(kind='scatter', x='TV', y='sales', ax=axs[0], figsize=(16, 8))
advertising_data.plot(kind='scatter', x='radio', y='sales', ax=axs[1])
advertising_data.plot(kind='scatter', x='newspaper', y='sales', ax=axs[2])
Output:

Now, we need to see how the ads will help increase the sales. So, we need to ask ourselves a couple of questions about that. Worthwhile questions to ask will be something like the relationship between the ads and sales, which kind of ads contribute more to the sales, and the approximate effect of each type of ad on the sales. We will try to answer such questions using a simple linear model.
- LabVIEW虛擬儀器從入門到測控應用130例
- 大數據時代的數據挖掘
- 機器學習與大數據技術
- 自動生產線的拆裝與調試
- Photoshop CS3圖像處理融會貫通
- 網絡綜合布線設計與施工技術
- 網絡服務搭建、配置與管理大全(Linux版)
- 單片機技術項目化原理與實訓
- Red Hat Enterprise Linux 5.0服務器構建與故障排除
- 輸送技術、設備與工業應用
- SolarWinds Server & Application Monitor:Deployment and Administration
- Modern Big Data Processing with Hadoop
- VMware vSphere 6.5 Cookbook(Third Edition)
- 華人動畫師的法蘭西印象
- 數據庫技術:Access 2003·計算機網絡技術