Intro to Data Science : Lesson 4
Intro to Data Science Online Course - Udacity
Data Visualization
- Information Visualization
- Clarity
- Precision
- Efficiency
- シャルル・ミナール
- ナポレオンのロシア進軍の図
- 軍の大きさ、撤退した人、温度
- Size/Location/Direction of Army, Temperature
- Components of effective visualization
- visual cues / visual encoding
- Position (plot, dots)
- 散布図 scattergraph , scatter plot
- Length (bar chart)
- Angle (Pie chart)
- 小さい差が分からない
- Direction
- Shape
- Area/Volume
- Color
- Hue (色相) , Saturation (彩度) -> volume
- Position (plot, dots)
- coordinate systems
- Scale / Data types
- Context
- Annotation
- visual cues / visual encoding
- Interviews of AT&T data scientists
- 正確さ Position -> Length -> Angle -> Direction -> Area -> Volume -> Saturation -> Hue
- Python Packages
- matplotlib
- ggplot (R ggplot2)
- gg = Grammer of Graphics
print ggplot(data, aes(xvar, yvar)) + geom_point(color = 'coral') + geom_line(color='coral') + \ ggtitle('title') + xlab('x-label') + ylab('y-label')
年次折れ線グラフ(ホームラン数)
data = read_csv(hr_year_csv) gg = ggplot(data, aes('yearID', 'HR')) + geom_point(color='red') + geom_line(color='red') return gg
geom = geometric 幾何学の
Data type
- Numeric
- Discrete / Continuous
- Categorical Data
- can take numerical values ordinal data (Stars)
- Time series
- Numeric
2つの群を折れ線で描画
aesの中でcolorをフィールドで指定する
data = pandas.read_csv('hr_by_team_year_sf_la.csv') gg = ggplot(data, aes('yearID', 'HR', color='teamID')) + geom_point() + geom_line() return gg
http://nbviewer.ipython.org/gist/modqhx/1a8eb7a149e84e1a218a
- Scatter plot 散布図
- 2チームの勝率
- line chart 折れ線グラフ
- Multivariate
- ホームラン数と勝率
- dotの大きさ、彩度
- ホームラン数と勝率
- advice
Pythonの問題は2問のみ
ちょうど1h