Skip to content

Commit

Permalink
ds
Browse files Browse the repository at this point in the history
  • Loading branch information
luweizheng committed Feb 8, 2024
1 parent 71d9349 commit f3886fd
Show file tree
Hide file tree
Showing 13 changed files with 45,586 additions and 43,885 deletions.
2 changes: 2 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ subtrees:
- file: ch-data-science/index
entries:
- file: ch-data-science/data-science-lifecycle
- file: ch-data-science/machine-learning
- file: ch-data-science/python-ecosystem
- file: ch-dask/index
entries:
- file: ch-dask/dask-intro
Expand Down
87,759 changes: 43,875 additions & 43,884 deletions ch-data-science/data-science-lifecycle.ipynb

Large diffs are not rendered by default.

1,079 changes: 1,079 additions & 0 deletions ch-data-science/machine-learning.ipynb

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions ch-data-science/python-ecosystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(python-ecosystem)=
# Python 软件生态

Python 已经成为数据科学首选的编程语言。{numref}`python-ecosystem-img` 是一些主流的数据科学工具:

* NumPy 和 pandas 可以进行科学计算和数据处理。
* PyTorch 和 TensorFlow 可以实现神经网络训练和推理。
* scikit-learn 、XGBoost、LightGBM 等库可以实现常见机器学习算法。

```{figure} ../img/ch-data-science/python-ecosystem.svg
---
width: 800px
name: python-ecosystem-img
---
Python 数据科学软件生态
```

Dask、Ray、Xorbits 和 mpi4py 是对数据科学生态的拓展。本书假设读者对以上软件生态有一定了解,读者也可以阅读以下书籍深入理解这些软件工具:

* Wes McKinney(pandas 项目发起人)撰写的《利用 Python 进行数据分析》 {cite}`mckinney2022python` 是一本非常优秀的数据科学入门书籍,也是 pandas 框架的入门书籍。
* 周志华老师的《机器学习》 {cite}`zhou2016machine` 是机器学习理论的入门教科书,是了解绝大多数机器学习算法的必备书籍。
* 亚马逊科学家阿斯顿·张、李沐等人的《动手学深度学习》 {cite}`zhang2019dive` 从算法原理到编程实践,深入浅出地讲解了常见人工智能算法及其应用,是入门深度学习的最佳实战书籍。
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
external_toc_path = '_toc.yml'
html_baseurl = ''
html_favicon = ''
html_logo = 'logo.png'
html_logo = 'logo.svg'
html_sourcelink_suffix = ''
html_theme = 'sphinx_book_theme'
html_theme_options = {
Expand Down
157 changes: 157 additions & 0 deletions drawio/ch-data-science/back-propagation.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<mxfile host="Electron" modified="2024-02-08T03:12:41.488Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.1.18 Chrome/120.0.6099.199 Electron/28.1.2 Safari/537.36" etag="3fdCzDqwK1rEZ_nGzwUO" version="22.1.18" type="device">
<diagram id="E4XvmlmkzrnHq_XwyluQ" name="Page-1">
<mxGraphModel dx="1311" dy="848" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="1" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="AR4sCG_jHfe710a_NquC-9" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;strokeColor=none;" parent="1" vertex="1">
<mxGeometry x="200" y="56" width="900" height="600" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-1" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="240" y="200" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-2" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="240" y="340" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-3" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="240" y="480" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-4" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f46f44;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="480" y="145" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-5" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#F46F44;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="480" y="275" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-6" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#F46F44;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="480" y="405" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-7" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#F46F44;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="480" y="535" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-8" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#7FCBA4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="717" y="434" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-22" value="" style="endArrow=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" source="AR4sCG_jHfe710a_NquC-7" target="AR4sCG_jHfe710a_NquC-8" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="330" y="530" as="sourcePoint" />
<mxPoint x="720" y="420" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-23" value="" style="endArrow=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" source="AR4sCG_jHfe710a_NquC-6" target="AR4sCG_jHfe710a_NquC-8" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="570" y="585" as="sourcePoint" />
<mxPoint x="730" y="390" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-24" value="" style="endArrow=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" source="AR4sCG_jHfe710a_NquC-5" target="AR4sCG_jHfe710a_NquC-8" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="570" y="455" as="sourcePoint" />
<mxPoint x="730" y="390" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-25" value="" style="endArrow=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" source="AR4sCG_jHfe710a_NquC-4" target="gesuDwoeScGNuhRqJHfw-26" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="570" y="325" as="sourcePoint" />
<mxPoint x="730" y="390" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-26" value="&lt;span style=&quot;font-size: 16px&quot;&gt;输入层&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="252" y="90" width="60" height="40" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-27" value="&lt;font style=&quot;font-size: 16px&quot;&gt;第 `n-1` 层&lt;br&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="472.5" y="90" width="95" height="40" as="geometry" />
</mxCell>
<mxCell id="AR4sCG_jHfe710a_NquC-28" value="&lt;span style=&quot;font-size: 16px&quot;&gt;第 `n` 层&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="724.5" y="90" width="65" height="40" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-1" value="&lt;font face=&quot;Lucida Console&quot;&gt;$$&lt;br&gt;x_1&lt;br&gt;$$&lt;br&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;" parent="1" vertex="1">
<mxGeometry x="262" y="231" width="40" height="30" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-3" value="&lt;font face=&quot;Lucida Console&quot;&gt;$$&lt;br&gt;x_2&lt;br&gt;$$&lt;br&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;" parent="1" vertex="1">
<mxGeometry x="260" y="372" width="40" height="30" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-4" value="&lt;font face=&quot;Lucida Console&quot;&gt;$$&lt;br&gt;x_3&lt;br&gt;$$&lt;br&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;" parent="1" vertex="1">
<mxGeometry x="260" y="514" width="40" height="30" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-26" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#7FCBA4;strokeColor=#9673a6;" parent="1" vertex="1">
<mxGeometry x="717" y="236" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-27" value="" style="endArrow=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" target="AR4sCG_jHfe710a_NquC-8" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="560" y="185" as="sourcePoint" />
<mxPoint x="720" y="484" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-28" value="" style="endArrow=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" source="AR4sCG_jHfe710a_NquC-5" target="gesuDwoeScGNuhRqJHfw-26" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="571" y="201" as="sourcePoint" />
<mxPoint x="730" y="494" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-29" value="" style="endArrow=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" source="AR4sCG_jHfe710a_NquC-6" target="gesuDwoeScGNuhRqJHfw-26" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="570" y="325" as="sourcePoint" />
<mxPoint x="727" y="286" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-30" value="" style="endArrow=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=0;startArrow=classic;startFill=1;" parent="1" source="AR4sCG_jHfe710a_NquC-7" target="gesuDwoeScGNuhRqJHfw-26" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="570" y="455" as="sourcePoint" />
<mxPoint x="727" y="286" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-31" value="&lt;font style=&quot;font-size: 36px;&quot;&gt;...&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="370" y="329" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-36" value="&lt;span style=&quot;font-size: 16px;&quot;&gt;输出层&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="900" y="91" width="175" height="40" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-37" value="&lt;font face=&quot;Lucida Console&quot;&gt;$$&lt;br&gt;\hat{y}&lt;br&gt;$$&lt;br&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;" parent="1" vertex="1">
<mxGeometry x="1015" y="106" width="40" height="30" as="geometry" />
</mxCell>
<mxCell id="gesuDwoeScGNuhRqJHfw-38" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#bac8d3;strokeColor=#23445d;" parent="1" vertex="1">
<mxGeometry x="960" y="336" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="ZtJgcBNVWk9em0xLPz3v-2" value="&lt;font face=&quot;Lucida Console&quot;&gt;$$&lt;br&gt;\hat{y}&lt;br&gt;$$&lt;br&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;" parent="1" vertex="1">
<mxGeometry x="980" y="372" width="40" height="30" as="geometry" />
</mxCell>
<mxCell id="ZtJgcBNVWk9em0xLPz3v-3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="783" y="520" width="210" height="110" as="geometry" />
</mxCell>
<mxCell id="ZtJgcBNVWk9em0xLPz3v-4" value="&lt;font face=&quot;Lucida Console&quot;&gt;$$&lt;br&gt;L = (y - \hat{y})^2&lt;br&gt;$$&lt;br&gt;&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;" parent="1" vertex="1">
<mxGeometry x="930" y="299" width="160" height="30" as="geometry" />
</mxCell>
<mxCell id="ZtJgcBNVWk9em0xLPz3v-8" value="" style="shape=flexArrow;endArrow=classic;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="889.55" y="491" as="sourcePoint" />
<mxPoint x="889.55" y="441" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="4owZ6qvt6R5CPJsGBkxU-2" value="&lt;font style=&quot;font-size: 16px;&quot;&gt;$$&lt;br&gt;\boldsymbol{W^{[n]}} = \boldsymbol{W^{[n]}}-\alpha\frac{\partial L}{\partial \boldsymbol{W^{[n]}}}&lt;br&gt;$$&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="860" y="535" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="4owZ6qvt6R5CPJsGBkxU-6" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="gesuDwoeScGNuhRqJHfw-38" target="gesuDwoeScGNuhRqJHfw-26">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="900" y="350" as="sourcePoint" />
<mxPoint x="950" y="300" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="4owZ6qvt6R5CPJsGBkxU-7" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="gesuDwoeScGNuhRqJHfw-38" target="AR4sCG_jHfe710a_NquC-8">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="790" y="440" as="sourcePoint" />
<mxPoint x="840" y="390" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="4owZ6qvt6R5CPJsGBkxU-8" value="&lt;font style=&quot;font-size: 16px;&quot;&gt;$$&lt;br&gt;\boldsymbol{b^{[n]}} = \boldsymbol{b^{[n]}}-\alpha\frac{\partial L}{\partial \boldsymbol{b^{[n]}}}&lt;br&gt;$$&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="863" y="586" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="4owZ6qvt6R5CPJsGBkxU-10" value="" style="endArrow=none;html=1;rounded=0;strokeWidth=3;startArrow=classic;startFill=1;endFill=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="375" y="386.47" as="sourcePoint" />
<mxPoint x="425" y="386.47" as="targetPoint" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading

0 comments on commit f3886fd

Please sign in to comment.