机器学习实战

This commit is contained in:
yinkanglong_lab
2021-03-21 19:22:58 +08:00
parent 94b219c445
commit 20a6a22f08
56 changed files with 2153 additions and 368 deletions

View File

@@ -12,61 +12,49 @@ sidebar: auto
您还可以在我们的[用户指南](https://matplotlib.org/contents.html)中找到[外部资源](/resources/index.html)
和[常见问题解答](/faq/index.html)。
## 序言
## 序言introductory
这些教程涵盖了使用 Matplotlib 创建可视化的基础知识,以及有效使用软件包的一些最佳实践。
<div class="gallery-examples-list">
<ul>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_usage_thumb.png" />
</div>
<div class="text">
<a href="introductory/usage.html#sphx-glr-tutorials-introductory-usage-py">Usage Guide</a>
</div>
</li>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_pyplot_thumb.png" />
</div>
<div class="text">
<a href="introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py">Pyplot tutorial</a>
</div>
</li>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_sample_plots_thumb.png" />
</div>
<div class="text">
<a href="introductory/sample_plots.html#sphx-glr-tutorials-introductory-sample-plots-py">Sample plots in Matplotlib</a>
</div>
</li>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_images_thumb.png" />
</div>
<div class="text">
<a href="introductory/images.html#sphx-glr-tutorials-introductory-images-py">Image tutorial</a>
<a href="introductory/images.html#sphx-glr-tutorials-introductory-images-py">p tutorial</a>
</div>
</li>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_lifecycle_thumb.png" />
</div>
<div class="text">
<a href="introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py">The Lifecycle of a Plot</a>
</div>
</li>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_customizing_thumb.png" />
</div>
<div class="text">
<a href="introductory/customizing.html#sphx-glr-tutorials-introductory-customizing-py">Customizing Matplotlib with style sheets and rcParams</a>
</div>
@@ -74,16 +62,14 @@ sidebar: auto
</ul>
</div>
## 中级
## 中级intermediate
这些教程涵盖了Matplotlib中一些更复杂的类和函数。它们对于特定的自定义和复杂的可视化很有用。
<div class="gallery-examples-list">
<ul>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_artists_thumb.png" />
</div>
<div class="text">
<a href="intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py">Artist tutorial</a>
</div>
@@ -91,7 +77,7 @@ sidebar: auto
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_legend_guide_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_legend_guide_thumb.png" />
</div>
<div class="text">
<a href="intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py">Legend guide</a>
@@ -100,7 +86,7 @@ sidebar: auto
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_color_cycle_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_color_cycle_thumb.png" />
</div>
<div class="text">
<a href="intermediate/color_cycle.html#sphx-glr-tutorials-intermediate-color-cycle-py">Styling with cycler</a>
@@ -109,7 +95,7 @@ sidebar: auto
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_gridspec_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_gridspec_thumb.png" />
</div>
<div class="text">
<a href="intermediate/gridspec.html#sphx-glr-tutorials-intermediate-gridspec-py">Customizing Figure Layouts Using GridSpec and Other Functions</a>
@@ -118,7 +104,7 @@ sidebar: auto
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_constrainedlayout_guide_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_constrainedlayout_guide_thumb.png" />
</div>
<div class="text">
<a href="intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py">Constrained Layout Guide</a>
@@ -127,7 +113,7 @@ sidebar: auto
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_tight_layout_guide_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_tight_layout_guide_thumb.png" />
</div>
<div class="text">
<a href="intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py">Tight Layout guide</a>
@@ -135,9 +121,7 @@ sidebar: auto
</li>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_imshow_extent_thumb.png" />
</div>
<div class="text">
<a href="intermediate/imshow_extent.html#sphx-glr-tutorials-intermediate-imshow-extent-py">origin and extent in imshow</a>
</div>
@@ -145,7 +129,7 @@ sidebar: auto
</ul>
</div>
## 高级
## 高级advaced
这些教程涵盖了经验丰富的Matplotlib用户和开发人员的高级主题。
@@ -153,7 +137,7 @@ sidebar: auto
<ul>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_path_tutorial_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_path_tutorial_thumb.png" />
</div>
<div class="text">
<a href="advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py">Path Tutorial</a>
@@ -162,7 +146,7 @@ sidebar: auto
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_patheffects_guide_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_patheffects_guide_thumb.png" />
</div>
<div class="text">
<a href="advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py">Path effects guide</a>
@@ -171,7 +155,7 @@ sidebar: auto
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_transforms_tutorial_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_transforms_tutorial_thumb.png" />
</div>
<div class="text">
<a href="advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py">Transformations Tutorial</a>
@@ -180,7 +164,7 @@ sidebar: auto
</ul>
</div>
## 颜色
## 颜色colors
Matplotlib支持使用多种颜色和颜色图可视化信息。 这些教程涵盖了这些颜色图的外观,如何创建自己的颜色图以及如何针对用例自定义颜色图的基础知识。
@@ -190,7 +174,7 @@ Matplotlib支持使用多种颜色和颜色图可视化信息。 这些教程涵
<ul>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_colors_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_colors_thumb.png" />
</div>
<div class="text">
<a href="colors/colors.html#sphx-glr-tutorials-colors-colors-py">Specifying Colors</a>
@@ -199,7 +183,7 @@ Matplotlib支持使用多种颜色和颜色图可视化信息。 这些教程涵
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_colorbar_only_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_colorbar_only_thumb.png" />
</div>
<div class="text">
<a href="colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py">Customized Colorbars Tutorial</a>
@@ -208,7 +192,7 @@ Matplotlib支持使用多种颜色和颜色图可视化信息。 这些教程涵
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_colormap-manipulation_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_colormap-manipulation_thumb.png" />
</div>
<div class="text">
<a href="colors/colormap-manipulation.html#sphx-glr-tutorials-colors-colormap-manipulation-py">Creating Colormaps in Matplotlib</a>
@@ -217,7 +201,7 @@ Matplotlib支持使用多种颜色和颜色图可视化信息。 这些教程涵
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_colormapnorms_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_colormapnorms_thumb.png" />
</div>
<div class="text">
<a href="colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py">Colormap Normalization</a>
@@ -226,7 +210,7 @@ Matplotlib支持使用多种颜色和颜色图可视化信息。 这些教程涵
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_colormaps_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_colormaps_thumb.png" />
</div>
<div class="text">
<a href="colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py">Choosing Colormaps in Matplotlib</a>
@@ -235,7 +219,7 @@ Matplotlib支持使用多种颜色和颜色图可视化信息。 这些教程涵
</ul>
</div>
## 文本
## 文本text
matplotlib具有广泛的文本支持,包括对数学表达式的支持,对栅格和矢量输出的truetype支持,
任意旋转的换行符分隔文本以及unicode支持。
@@ -245,7 +229,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<ul>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_text_intro_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_text_intro_thumb.png" />
</div>
<div class="text">
<a href="text/text_intro.html#sphx-glr-tutorials-text-text-intro-py">Text in Matplotlib Plots</a>
@@ -254,7 +238,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_text_props_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_text_props_thumb.png" />
</div>
<div class="text">
<a href="text/text_props.html#sphx-glr-tutorials-text-text-props-py">Text properties and layout</a>
@@ -263,7 +247,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_annotations_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_annotations_thumb.png" />
</div>
<div class="text">
<a href="text/annotations.html#sphx-glr-tutorials-text-annotations-py">Annotations</a>
@@ -272,7 +256,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_mathtext_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_mathtext_thumb.png" />
</div>
<div class="text">
<a href="text/mathtext.html#sphx-glr-tutorials-text-mathtext-py">Writing mathematical expressions</a>
@@ -281,7 +265,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_pgf_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_pgf_thumb.png" />
</div>
<div class="text">
<a href="text/pgf.html#sphx-glr-tutorials-text-pgf-py">Typesetting With XeLaTeX/LuaLaTeX</a>
@@ -290,7 +274,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_usetex_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_usetex_thumb.png" />
</div>
<div class="text">
<a href="text/usetex.html#sphx-glr-tutorials-text-usetex-py">Text rendering With LaTeX</a>
@@ -299,7 +283,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
</ul>
</div>
## 小工具
## 小工具tookit
这些教程涵盖了旨在扩展 Matplotlib 功能以实现特定目标的工具包。
@@ -307,7 +291,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<ul>
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_axes_grid_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_axes_grid_thumb.png" />
</div>
<div class="text">
<a href="toolkits/axes_grid.html#sphx-glr-tutorials-toolkits-axes-grid-py">Overview of axes_grid1 toolkit</a>
@@ -316,7 +300,7 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_axisartist_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_axisartist_thumb.png" />
</div>
<div class="text">
<a href="toolkits/axisartist.html#sphx-glr-tutorials-toolkits-axisartist-py">Overview of axisartist toolkit</a>
@@ -325,11 +309,13 @@ matplotlib具有广泛的文本支持,包括对数学表达式的支持,对
<li>
<div class="poster">
<img src="https://matplotlib.org/_images/sphx_glr_mplot3d_thumb.png" />
<p src="https://matplotlib.org/_images/sphx_glr_mplot3d_thumb.png" />
</div>
<div class="text">
<a href="toolkits/mplot3d.html#sphx-glr-tutorials-toolkits-mplot3d-py">The mplot3d Toolkit</a>
</div>
</li>
</ul>
</div>
</div>
## 实例 example gallery

View File

@@ -0,0 +1,328 @@
# sklearn 概述
### 参考文献
* [快速入门教程](https://blog.csdn.net/yuanshuaipeng/article/details/80399863)
* [python-sklearn使用教程](https://www.jianshu.com/p/6ada34655862)
### 机器学习的一般流程
1. 获取数据
1. 处理数据
1. 训练模型
1. 评估模型
1. 使用模型
本文我们将依据传统机器学习的流程,看看在每一步流程中都有哪些常用的函数以及它们的用法是怎么样的。希望你看完这篇文章可以最为快速的开始你的学习任务。
## 1 获取数据
## 1.1 导入sklearn数据集
* sklearn中包含了大量的优质的数据集,在你学习机器学习的过程中,你可以通过使用这些数据集实现出不同的模型,从而提高你的动手实践能力,同时这个过程也可以加深你对理论知识的理解和把握。(这一步我也亟需加强,一起加油!^-^)
* 首先呢,要想使用sklearn中的数据集,必须导入datasets模块:
```
from sklearn import datasets
```
* 然后加载并使用数据集
```
iris = datasets.load_iris() # 导入数据集
X = iris.data # 获得其特征向量
y = iris.target # 获得样本label
```
* 下面是toy Dataset
![](image/2021-03-21-17-09-31.png)
* 下面是realword Dataset
![](image/2021-03-21-17-10-27.png)
## 1.2 创建数据集
你除了可以使用sklearn自带的数据集,还可以自己去创建训练样本,具体用法参见《Dataset loading utilities》,这里我们简单介绍一些,sklearn中的samples generator包含的大量创建样本数据的方法
![](image/2021-03-21-17-19-54.png)
```
from sklearn.datasets.samples_generator import make_classification
X, y = make_classification(n_samples=6, n_features=5, n_informative=2,
n_redundant=2, n_classes=2, n_clusters_per_class=2, scale=1.0,
random_state=20)
# n_samples:指定样本数
# n_features:指定特征数
# n_classes:指定几分类
# random_state:随机种子,使得随机状可重
>>> for x_,y_ in zip(X,y):
print(y_,end=': ')
print(x_)
0: [-0.6600737 -0.0558978 0.82286793 1.1003977 -0.93493796]
1: [ 0.4113583 0.06249216 -0.90760075 -1.41296696 2.059838 ]
1: [ 1.52452016 -0.01867812 0.20900899 1.34422289 -1.61299022]
0: [-1.25725859 0.02347952 -0.28764782 -1.32091378 -0.88549315]
0: [-3.28323172 0.03899168 -0.43251277 -2.86249859 -1.10457948]
1: [ 1.68841011 0.06754955 -1.02805579 -0.83132182 0.93286635]
```
## 2 处理数据
* 数据预处理阶段是机器学习中不可缺少的一环,它会使得数据更加有效的被模型或者评估器识别。下面我们来看一下sklearn中有哪些平时我们常用的函数:
```
from sklearn import preprocessing
```
## 2.1 数据归一化
* 为了使得训练数据的标准化规则与测试数据的标准化规则同步,preprocessing中提供了很多Scaler:
```
data = [[0, 0], [0, 0], [1, 1], [1, 1]]
# 1. 基于mean和std的标准化
scaler = preprocessing.StandardScaler().fit(train_data)
scaler.transform(train_data)
scaler.transform(test_data)
# 2. 将每个特征值归一化到一个固定范围
scaler = preprocessing.MinMaxScaler(feature_range=(0, 1)).fit(train_data)
scaler.transform(train_data)
scaler.transform(test_data)
#feature_range: 定义归一化范围,注用()括起来
```
## 2.2 正则化(normalize)
* 当你想要计算两个样本的相似度时必不可少的一个操作,就是正则化。其思想是:首先求出样本的p-范数,然后该样本的所有元素都要除以该范数,这样最终使得每个样本的范数都为1。
```
>>> X = [[ 1., -1., 2.],
... [ 2., 0., 0.],
... [ 0., 1., -1.]]
>>> X_normalized = preprocessing.normalize(X, norm='l2')
>>> X_normalized
array([[ 0.40..., -0.40..., 0.81...],
[ 1. ..., 0. ..., 0. ...],
[ 0. ..., 0.70..., -0.70...]])
```
## 2.3 one-hot编码
* one-hot编码是一种对离散特征值的编码方式,在LR模型中常用到,用于给线性模型增加非线性能力。
```
data = [[0, 0, 3], [1, 1, 0], [0, 2, 1], [1, 0, 2]]
encoder = preprocessing.OneHotEncoder().fit(data)
enc.transform(data).toarray()
```
## 3 数据集拆分
* 在得到训练数据集时,通常我们经常会把训练数据集进一步拆分成训练集和验证集,这样有助于我们模型参数的选取。
```py
# 作用:将数据集划分为 训练集和测试集
# 格式:train_test_split(*arrays, **options)
from sklearn.mode_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
"""
参数
---
arrays:样本数组,包含特征向量和标签
test_size:
  float-获得多大比重的测试样本 (默认:0.25)
  int - 获得多少个测试样本
train_size: 同test_size
random_state:
  int - 随机种子(种子固定,实验可复现)
  
shuffle - 是否在分割之前对数据进行洗牌(默认True)
返回
---
分割后的列表,长度=2*len(arrays),
  (train-test split)
"""
```
## 4 定义模型
* 在这一步我们首先要分析自己数据的类型,搞清出你要用什么模型来做,然后我们就可以在sklearn中定义模型了。sklearn为所有模型提供了非常相似的接口,这样使得我们可以更加快速的熟悉所有模型的用法。在这之前我们先来看看模型的常用属性和功能:
```py
# 拟合模型
model.fit(X_train, y_train)
# 模型预测
model.predict(X_test)
# 获得这个模型的参数
model.get_params()
# 为模型进行打分
model.score(data_X, data_y) # 线性回归:R square; 分类问题: acc
```
![](image/2021-03-21-17-36-27.png)
## 4.1 线性回归
```py
from sklearn.linear_model import LinearRegression
# 定义线性回归模型
model = LinearRegression(fit_intercept=True, normalize=False,
copy_X=True, n_jobs=1)
"""
参数
fit_intercept:是否计算截距。False-模型没有截距
normalize: 当fit_intercept设置为False时,该参数将被忽略。 如果为真,则回归前的回归系数X将通过减去平均值并除以l2-范数而归一化。
n_jobs:指定线程数
"""
```
## 4.2 逻辑回归LR
```py
from sklearn.linear_model import LogisticRegression
# 定义逻辑回归模型
model = LogisticRegression(penalty=’l2’, dual=False, tol=0.0001, C=1.0,
fit_intercept=True, intercept_scaling=1, class_weight=None,
random_state=None, solver=’liblinear’, max_iter=100, multi_class=’ovr’,
verbose=0, warm_start=False, n_jobs=1)
"""参数
---
penalty:使用指定正则化项(默认:l2)
dual: n_samples > n_features取False(默认)
C:正则化强度的反,值越小正则化强度越大
n_jobs: 指定线程数
random_state:随机数生成器
fit_intercept: 是否需要常量
"""
```
## 4.3 朴素贝叶斯算法NB
```py
from sklearn import naive_bayes
model = naive_bayes.GaussianNB() # 高斯贝叶斯
model = naive_bayes.MultinomialNB(alpha=1.0, fit_prior=True, class_prior=None)
model = naive_bayes.BernoulliNB(alpha=1.0, binarize=0.0, fit_prior=True, class_prior=None)
"""
文本分类问题常用MultinomialNB
参数
---
alpha:平滑参数
fit_prior:是否要学习类的先验概率;false-使用统一的先验概率
class_prior: 是否指定类的先验概率;若指定则不能根据参数调整
binarize: 二值化的阈值,若为None,则假设输入由二进制向量组成
```
## 4.4 决策树DT
```py
from sklearn import tree
model = tree.DecisionTreeClassifier(criterion=’gini’, max_depth=None,
min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0,
max_features=None, random_state=None, max_leaf_nodes=None,
min_impurity_decrease=0.0, min_impurity_split=None,
class_weight=None, presort=False)
"""参数
---
criterion :特征选择准则gini/entropy
max_depth:树的最大深度,None-尽量下分
min_samples_split:分裂内部节点,所需要的最小样本树
min_samples_leaf:叶子节点所需要的最小样本数
max_features: 寻找最优分割点时的最大特征数
max_leaf_nodes:优先增长到最大叶子节点数
min_impurity_decrease:如果这种分离导致杂质的减少大于或等于这个值,则节点将被拆分。
"""
```
## 4.5 支持向量机SVM
```py
from sklearn.svm import SVC
model = SVC(C=1.0, kernel=’rbf’, gamma=’auto’)
"""参数
---
C:误差项的惩罚参数C
gamma: 核相关系数。浮点数,If gamma is ‘auto’ then 1/n_features will be used instead.
"""
```
## 4.6 k近邻算法KNN
```py
from sklearn import neighbors
#定义kNN分类模型
model = neighbors.KNeighborsClassifier(n_neighbors=5, n_jobs=1) # 分类
model = neighbors.KNeighborsRegressor(n_neighbors=5, n_jobs=1) # 回归
"""参数
---
n_neighbors: 使用邻居的数目
n_jobs:并行任务数
"""
```
## 4.7 多层感知机(神经网络)
```py
from sklearn.neural_network import MLPClassifier
# 定义多层感知机分类算法
model = MLPClassifier(activation='relu', solver='adam', alpha=0.0001)
"""参数
---
hidden_layer_sizes: 元祖
activation:激活函数
solver :优化算法{‘lbfgs’, ‘sgd’, ‘adam’}
alpha:L2惩罚(正则化项)参数。
"""
```
## 5 模型评估与选择篇
## 5.1 交叉验证
```
from sklearn.model_selection import cross_val_score
cross_val_score(model, X, y=None, scoring=None, cv=None, n_jobs=1)
"""参数
---
model:拟合数据的模型
cv : k-fold
scoring: 打分参数-‘accuracy’、‘f1’、‘precision’、‘recall’ 、‘roc_auc’、'neg_log_loss'等等
"""
```
## 5.2 检验曲线
* 使用检验曲线,我们可以更加方便的改变模型参数,获取模型表现。
```
from sklearn.model_selection import validation_curve
train_score, test_score = validation_curve(model, X, y, param_name, param_range, cv=None, scoring=None, n_jobs=1)
"""参数
---
model:用于fit和predict的对象
X, y: 训练集的特征和标签
param_name:将被改变的参数的名字
param_range: 参数的改变范围
cv:k-fold
返回值
---
train_score: 训练集得分(array)
test_score: 验证集得分(array)
"""
```
## 6保存模型
* 最后,我们可以将我们训练好的model保存到本地,或者放到线上供用户使用,那么如何保存训练好的model呢?主要有下面两种方式:
## 6.1 保存为pickle文件
```
import pickle
# 保存模型
with open('model.pickle', 'wb') as f:
pickle.dump(model, f)
# 读取模型
with open('model.pickle', 'rb') as f:
model = pickle.load(f)
model.predict(X_test)
```
## 6.2 sklearn自带方法joblib
```
from sklearn.externals import joblib
# 保存模型
joblib.dump(model, 'model.pickle')
#载入模型
model = joblib.load('model.pickle')
```

View File

@@ -40,6 +40,7 @@
> 本书使用scikit-learn 0.15,NumPy 1.9和pandas 0.13,兼容Python2.7和Python3.4。还会用到其他的Python库,建议参考对应的官方安装指令。
![](image/2021-03-21-14-29-34.png)
# 1.1 从外部源获取样本数据

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@@ -1,73 +0,0 @@
* [安装 scikit-learn](docs/master/62.md)
* 用户指南
* [1. 监督学习](docs/master/1.md)
* [1.1. 广义线性模型](docs/master/2.md)
* [1.2. 线性和二次判别分析](docs/master/3.md)
* [1.3. 内核岭回归](docs/master/4.md)
* [1.4. 支持向量机](docs/master/5.md)
* [1.5. 随机梯度下降](docs/master/6.md)
* [1.6. 最近邻](docs/master/7.md)
* [1.7. 高斯过程](docs/master/8.md)
* [1.8. 交叉分解](docs/master/9.md)
* [1.9. 朴素贝叶斯](docs/master/10.md)
* [1.10. 决策树](docs/master/11.md)
* [1.11. 集成方法](docs/master/12.md)
* [1.12. 多类和多标签算法](docs/master/13.md)
* [1.13. 特征选择](docs/master/14.md)
* [1.14. 半监督学习](docs/master/15.md)
* [1.15. 等式回归](docs/master/16.md)
* [1.16. 概率校准](docs/master/17.md)
* [1.17. 神经网络模型(有监督)](docs/master/18.md)
* [2. 无监督学习](docs/master/19.md)
* [2.1. 高斯混合模型](docs/master/20.md)
* [2.2. 流形学习](docs/master/21.md)
* [2.3. 聚类](docs/master/22.md)
* [2.4. 双聚类](docs/master/23.md)
* [2.5. 分解成分中的信号(矩阵分解问题)](docs/master/24.md)
* [2.6. 协方差估计](docs/master/25.md)
* [2.7. 新奇和异常值检测](docs/master/26.md)
* [2.8. 密度估计](docs/master/27.md)
* [2.9. 神经网络模型(无监督)](docs/master/28.md)
* [3. 模型选择和评估](docs/master/29.md)
* [3.1. 交叉验证:评估估算器的表现](docs/master/30.md)
* [3.2. 调整估计器的超参数](docs/master/31.md)
* [3.3. 模型评估: 量化预测的质量](docs/master/32.md)
* [3.4. 模型持久化](docs/master/33.md)
* [3.5. 验证曲线: 绘制分数以评估模型](docs/master/34.md)
* [4. 检验](docs/master/35.md)
* [4.1. 部分依赖图](docs/master/36.md)
* [5. 数据集转换](docs/master/37.md)
* [5.1. Pipeline(管道)和 FeatureUnion(特征联合): 合并的评估器](docs/master/38.md)
* [5.2. 特征提取](docs/master/39.md)
* [5.3 预处理数据](docs/master/40.md)
* [5.4 缺失值插补](docs/master/41.md)
* [5.5. 无监督降维](docs/master/42.md)
* [5.6. 随机投影](docs/master/43.md)
* [5.7. 内核近似](docs/master/44.md)
* [5.8. 成对的矩阵, 类别和核函数](docs/master/45.md)
* [5.9. 预测目标 (`y`) 的转换](docs/master/46.md)
* [6. 数据集加载工具](docs/master/47.md)
* [6.1. 通用数据集 API](docs/master/47.md)
* [6.2. 玩具数据集](docs/master/47.md)
* [6.3 真实世界中的数据集](docs/master/47.md)
* [6.4. 样本生成器](docs/master/47.md)
* [6.5. 加载其他数据集](docs/master/47.md)
* [7. 使用scikit-learn计算](docs/master/48.md)
* [7.1. 大规模计算的策略: 更大量的数据](docs/master/48.md)
* [7.2. 计算性能](docs/master/48.md)
* [7.3. 并行性、资源管理和配置](docs/master/48.md)
* [教程](docs/master/50.md)
* [使用 scikit-learn 介绍机器学习](docs/master/51.md)
* [关于科学数据处理的统计学习教程](docs/master/52.md)
* [机器学习: scikit-learn 中的设置以及预估对象](docs/master/53.md)
* [监督学习:从高维观察预测输出变量](docs/master/54.md)
* [模型选择:选择估计量及其参数](docs/master/55.md)
* [无监督学习: 寻求数据表示](docs/master/56.md)
* [把它们放在一起](docs/master/57.md)
* [寻求帮助](docs/master/58.md)
* [处理文本数据](docs/master/59.md)
* [选择正确的评估器(estimator.md)](docs/master/60.md)
* [外部资源,视频和谈话](docs/master/61.md)
* [API 参考](https://scikit-learn.org/stable/modules/classes.html)
* [常见问题](docs/master/63.md)
* [时光轴](docs/master/64.md)

View File

@@ -6,6 +6,8 @@
> 1. 机器学习算法实践。
> 2. 联邦学习文章复现。
> 3. 恶意软件数据处理。
> * 静态数据处理
> * 动态数据处理
### 机器学习算法实践(四周)
> 尝试各种机器学习算法,主要使用主流的算法框架。寻找网络教程,完成这一块,还有很多书。机器学习算法,应该由浅入深。不能像之前那样想先学会所有的原理,自己手动实现这些原理,然后使用别人的框架实现这些过程,在别人的基础上进行改进。当前应该吧顺序颠倒过来。从使用开始,逐渐理解底层的东西,然后做出适当的修改。
@@ -14,23 +16,34 @@
> 3. ->理解机器学习算法的原理
> 4. ->改进算法符合自己的预期目标。
- sklearn与机器学习算法
- [ ] AIlearning算法原理(书)
- [ ] sklearn算法实现(书)中文文档+example实践
- [ ] tensorflow
- [ ] pysft
- [ ] fate
- 机器学习分类
- [x] 机器学习实战算法原理+ numpy实现
- sklearn
- [ ] 学习基础用法
- [ ] 分类算法实现
- tensorflow
- [ ] 学习TensorFlow2.0基础
- [ ] TensorFlow恶意软件机器学习分类
- [ ] TensorFlow恶意软件神经网络分类
- [ ] TensorFlow联邦学习实现
- pysft
- fate
### 联邦学习文章复现(四周)
> 阅读当前最新的联邦学习文章。使用别人的代码复现联邦学习的过程。复习和复现
- [ ] DeepAMD
- [ ] CIC
### 恶意软件数据处理(四周)
> 针对恶意软件使用机器学习算法。尝试单机或者使用联邦学习解决恶意软件中的问题。
- [ ] 恶意软件数据的处理
- [ ] 恶意软件与机器学习算法的结合
- 恶意软件数据的处理
- [ ] 静态数据处理
- [ ] 动态数据处理
### 任务安排

View File

@@ -10,9 +10,9 @@
> 学习深度学习框架pytorch和TensorFlow。
1. 每天sklearn一个机器学习小算法
- [x] k-近邻算法(学习原理、sklearn实践
- [ ] 、malware)
- [ ] 、tensorflow malware)
- [x] 决策树(学习原理、sklearn实践
- [ ] 、malware)
- [ ] 、tensorflow malware)
- [x] 复习吴恩达机器学习笔记
- [x] 复习吴恩达深度学习笔记
- [x] 复习Python-numpy-scipy那一套

View File

@@ -1,12 +1,12 @@
1. 每天sklearn一个机器学习小算法
- [ ] 朴素贝叶斯(学习原理、sklearn实践
- [ ] 、malware)
- [ ] 逻辑回归(学习原理、sklearn实践
- [ ] 、malware)
- [x] 朴素贝叶斯(学习原理、sklearn实践
- [ ] 、tensorflow malware)
- [x] 逻辑回归(学习原理、sklearn实践
- [ ] 、tensorflow malware)
2. 每天一个联邦学习框架
- [ ] tensorflow federated
- [ ] tensorflow
3. 每天一篇联邦学习的文章。
- [ ] CIC动态数据处理和静态数据处理方式
- [ ] 联邦半监督学习
4. 每天数据集处理一小步。
- [ ] 实现静态数据处理脚本

View File

@@ -0,0 +1,11 @@
1. 每天sklearn一个机器学习小算法
- [x] 支持向量机(学习原理、sklearn实践
- [ ] 、tensorflow malware)
- [x] 集成方法(学习原理、sklearn实践
- [ ] 、tensorflow malware)
2. 每天一个联邦学习框架
- [ ] tensorflow federated
3. 每天一篇联邦学习的文章。
- [ ] CIC动态数据处理和静态数据处理方式
4. 每天数据集处理一小步。
- [ ] 实现动态数据处理

View File

@@ -51,7 +51,7 @@ $$z=w^T*x +b$$
要找到某函数的最大值,最好的方法是沿着该函数的梯度方向探寻。如果梯度记为 ▽ ,则函数 f(x, y) 的梯度由下式表示:
$$
d f(x,y) = \left\{ \frac{\partial f(x,y)}{\partial x} ,\\ \frac{\partial f(x,y)}{\partial y} \right\}
\nabla f(x,y) = \left\{ \frac{\partial f(x,y)}{\partial x} ,\\ \frac{\partial f(x,y)}{\partial y} \right\}
$$
@@ -86,7 +86,7 @@ $$
* **局部最优现象 (Local Optima)**
![梯度下降图_4](http://data.apachecn.org/img/AiLearning/ml/5.Logistic/LR_20.png)
![](image/2021-03-21-11-20-21.png)
* 上图表示参数 θ 与误差函数 J(θ) 的关系图 (这里的误差函数是损失函数,所以我们要最小化损失函数),红色的部分是表示 J(θ) 有着比较高的取值,我们需要的是,能够让 J(θ) 的值尽量的低。也就是深蓝色的部分。θ0,θ1 表示 θ 向量的两个维度(此处的θ0,θ1是x0和x1的系数,也对应的是上文w0和w1)。
@@ -355,7 +355,7 @@ def stocGradAscent0(dataMatrix, classLabels):
判断优化算法优劣的可靠方法是看它是否收敛,也就是说参数是否达到了稳定值,是否还会不断地变化?下图展示了随机梯度上升算法在 200 次迭代过程中回归系数的变化情况。其中的系数2,也就是 X2 只经过了 50 次迭代就达到了稳定值,但系数 1 和 0 则需要更多次的迭代。如下图所示:
![回归系数与迭代次数的关系图](http://data.apachecn.org/img/AiLearning/ml/5.Logistic/LR_12.png)
![](image/2021-03-21-11-33-50.png)
针对这个问题,我们改进了之前的随机梯度上升算法,如下:

View File

@@ -1,85 +1,70 @@
# SVM
> 声明
```
阅读本文前,需要您懂一些高等数学、概率论、线性代数的相关知识,以便更好理解。
```
> 网上资料参考链接
> * [参考文献1](https://www.zhihu.com/question/21094489)
> * [参考文献2](http://docs.opencv.org/2.4/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.html)
> * [参考文献3](https://zhuanlan.zhihu.com/p/26891427?utm_medium=social&utm_source=qq)
> * [参考文献4](https://zhuanlan.zhihu.com/p/21308801?utm_medium=social&utm_source=qq)
> * [参考文献5](http://blog.csdn.net/v_july_v/article/details/7624837)
```
下面这些关于 SVM 的理解,是根据知乎和其他博客或者网站中查询到的资料加以整理,
并结合 ApacheCN 这段时间的撸代码和相关研究得到,有理解有误的地方还望大家指出,谢谢。
再次感谢网上的大佬们的无私贡献。
ApacheCN: http://www.apachecn.org/
ApacheCN MachineLearning github: https://github.com/apachecn/AiLearning
网上资料参考链接:https://www.zhihu.com/question/21094489
http://docs.opencv.org/2.4/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.html
https://zhuanlan.zhihu.com/p/26891427?utm_medium=social&utm_source=qq
https://zhuanlan.zhihu.com/p/21308801?utm_medium=social&utm_source=qq
http://blog.csdn.net/v_july_v/article/details/7624837
```
## Overview
## 1 支持向量机 概述
### What's the SVM?
^_^ 首先,支持向量机不是一种机器,而是一种机器学习算法。
1、SVM - Support Vector Machine ,俗称支持向量机,是一种 supervised learning (监督学习)算法,属于 classification (分类)的范畴。
2、在数据挖掘的应用中,与 unsupervised learning (无监督学习)的 Clustering(聚类)相对应和区别。
3、广泛应用于 Machine Learning (机器学习),Computer Vision (计算机视觉,装逼一点说,就是 cv)和 Data Mining (数据挖掘)当中。
1. 首先,支持向量机不是一种机器,而是一种机器学习算法。
2. SVM - Support Vector Machine ,俗称支持向量机,是一种 supervised learning (监督学习)算法,属于 classification (分类)的范畴。
3. 在数据挖掘的应用中,与 unsupervised learning (无监督学习)的 Clustering(聚类)相对应和区别。
4. 广泛应用于 Machine Learning (机器学习),Computer Vision (计算机视觉,装逼一点说,就是 cv)和 Data Mining (数据挖掘)当中。
### “ Machine (机)” 是什么?
Classification Machine,是分类器,这个没什么好说的。也可以理解为算法,机器学习领域里面常常用 “机” 也就是 machine 这个字表示算法。
* Classification Machine,是分类器,这个没什么好说的。也可以理解为算法,机器学习领域里面常常用 “机” 也就是 machine 这个字表示算法。
### “支持向量” 又是什么?
<b>通俗理解</b>:
support vector (支持向量)的意思就是 <b>数据集中的某些点</b>,位置比较特殊。比如 x+y-2=0 这条直线,直线上面区域 x+y-2>0 的全是 A 类,下面的 x+y-2<0 的全是 B 类,我们找这条直线的时候,一般就看聚集在一起的两类数据,他们各自的 <b>最边缘</b> 位置的点,也就是最靠近划分直线的那几个点,而其他点对这条直线的最终位置的确定起不了作用,所以我姑且叫这些点叫 “支持点”(意思就是有用的点),但是在数学上,没这种说法,数学里的点,又可以叫向量,比如 二维点 (x,y) 就是二维向量,三维度的就是三维向量 (x,y,z)。所以 “<b>支持点</b>” 改叫 “<b>支持向量</b>” ,听起来比较专业,而且又装逼,何乐而不为呢?是吧...
* **通俗理解**
* support vector (支持向量)的意思就是 <b>数据集中的某些点</b>,位置比较特殊。比如 x+y-2=0 这条直线,直线上面区域 x+y-2>0 的全是 A 类,下面的 x+y-2<0 的全是 B 类,我们找这条直线的时候,一般就看聚集在一起的两类数据,他们各自的 <b>最边缘</b> 位置的点,也就是最靠近划分直线的那几个点,而其他点对这条直线的最终位置的确定起不了作用,所以我姑且叫这些点叫 “支持点”(意思就是有用的点)
* 但是在数学上,没这种说法,数学里的点,又可以叫向量,比如 二维点 (x,y) 就是二维向量,三维度的就是三维向量 (x,y,z)。所以 “<b>支持点</b>” 改叫 “<b>支持向量</b>” ,听起来比较专业,而且又装逼,何乐而不为呢?是吧...
<b>不通俗的理解</b>:
在 maximum margin (最大间隔)上的这些点就叫 “支持向量”,我想补充的是为啥这些点就叫 “支持向量” ,因为最后的 classification machine (分类器)的表达式里只含有这些 “支持向量” 的信息,而与其他数据点无关:
* **不通俗的理解**
* 在 maximum margin (最大间隔)上的这些点就叫 “支持向量”,我想补充的是为啥这些点就叫 “支持向量” ,因为最后的 classification machine (分类器)的表达式里只含有这些 “支持向量” 的信息,而与其他数据点无关。在这个表达式中,只有支持向量的系数$\alpha$不等于 0 。
:
![支持向量机公式](http://data.apachecn.org/img/AiLearning/ml/6.SVM/supportVector公式.jpg "supportVector公式")
$$
w · \varphi(x) = \sum_i \alpha_i y_ik(x_i,x)
$$
在这个表达式中,只有支持向量的系数 ![alphai](http://data.apachecn.org/img/AiLearning/ml/6.SVM/alpha.png "alphai") 不等于 0 。
*
* 如果还是不怎么理解,不要紧,看下图。“支持向量” 就是图中用紫色框框圈出来的点...
如果还是不怎么理解,不要紧,看下图:
![supportVector](http://data.apachecn.org/img/AiLearning/ml/6.SVM/supportVector.png "supportVector")
“支持向量” 就是图中用紫色框框圈出来的点...
![](image/2021-03-21-14-17-48.png)
## Concept (相关概念)
我们先看一张图
## 2 Concept概念
![supportVectorMachine](http://data.apachecn.org/img/AiLearning/ml/6.SVM/svm_2.png "supportVectorMachine")
![](image/2021-03-21-14-17-38.png)
`linearly separable (线性可分)`: 如上图中的两组数据,它们之间已经分的足够开了,因此很容易就可以在图中画出一条直线将两组数据点分开。在这种情况下,这组数据就被称为<b>线性可分数据</b>。
* `linearly separable (线性可分)`: 如上图中的两组数据,它们之间已经分的足够开了,因此很容易就可以在图中画出一条直线将两组数据点分开。在这种情况下,这组数据就被称为<b>线性可分数据</b>。
`separating hyperplane(分隔超平面)`: 上述将数据集分隔开来的直线称为<b>分隔超平面</b>。
* `separating hyperplane(分隔超平面)`: 上述将数据集分隔开来的直线称为<b>分隔超平面</b>。
`hyperplane(超平面)`: 在上面给出的例子中,由于数据点都在二维平面上,所以此时分隔超平面就只是一条直线。但是,如果所给的数据集是三维的,那么此时用来分隔数据的就是一个平面。显而易见,更高纬度的情况可以依此类推。如果数据是 1024 维的,那么就需要一个 1023 维的某某对象(不是你们的男(女)票)来对数据进行分隔。这个 1023 维的某某对象到底应该叫什么呢? N-1 维呢?该对象被称为<b>超平面</b>,也就是分类的决策边界。分布在超平面一侧的所有数据都属于某个类别,而分布在另一侧的所有数据则属于另一个类别。
* `hyperplane(超平面)`: 在上面给出的例子中,由于数据点都在二维平面上,所以此时分隔超平面就只是一条直线。但是,如果所给的数据集是三维的,那么此时用来分隔数据的就是一个平面。显而易见,更高纬度的情况可以依此类推。如果数据是 1024 维的,那么就需要一个 1023 维的某某对象(不是你们的男(女)票)来对数据进行分隔。这个 1023 维的某某对象到底应该叫什么呢? N-1 维呢?该对象被称为<b>超平面</b>,也就是分类的决策边界。分布在超平面一侧的所有数据都属于某个类别,而分布在另一侧的所有数据则属于另一个类别。
`margin(间隔)`: 我们希望能通过上述的方式来构建分类器,即如果数据点离决策边界越远,那么其最后的预测结果也就越可信。既然这样,我们希望找到离分隔超平面最近的点,确保它们离分隔面的距离尽可能远。这里所说的点到分隔面的距离就是 <b>间隔</b>。我们希望间隔尽可能地大,这是因为如果我们犯错或者在有限数据上训练分类器的话,我们希望分类器尽可能健壮。
* `margin(间隔)`: 我们希望能通过上述的方式来构建分类器,即如果数据点离决策边界越远,那么其最后的预测结果也就越可信。既然这样,我们希望找到离分隔超平面最近的点,确保它们离分隔面的距离尽可能远。这里所说的点到分隔面的距离就是 <b>间隔</b>。我们希望间隔尽可能地大,这是因为如果我们犯错或者在有限数据上训练分类器的话,我们希望分类器尽可能健壮。
`支持向量(support vector)` : 就是上面所说的离分隔超平面最近的那些点。
* `支持向量(support vector)` : 就是上面所说的离分隔超平面最近的那些点。
`分类器` : 分类器就是给定一个样本的数据,判定这个样本属于哪个类别的算法。例如在股票涨跌预测中,我们认为前一天的交易量和收盘价对于第二天的涨跌是有影响的,那么分类器就是通过样本的交易量和收盘价预测第二天的涨跌情况的算法。
* `分类器` : 分类器就是给定一个样本的数据,判定这个样本属于哪个类别的算法。例如在股票涨跌预测中,我们认为前一天的交易量和收盘价对于第二天的涨跌是有影响的,那么分类器就是通过样本的交易量和收盘价预测第二天的涨跌情况的算法。
`特征` : 在分类问题中,输入到分类器中的数据叫做特征。以上面的股票涨跌预测问题为例,特征就是前一天的交易量和收盘价。
* `特征` : 在分类问题中,输入到分类器中的数据叫做特征。以上面的股票涨跌预测问题为例,特征就是前一天的交易量和收盘价。
`线性分类器` : 线性分类器是分类器中的一种,就是判定分类结果的根据是通过特征的线性组合得到的,不能通过特征的非线性运算结果作为判定根据。还以上面的股票涨跌预测问题为例,判断的依据只能是前一天的交易量和收盘价的线性组合,不能将交易量和收盘价进行开方,平方等运算。
* `线性分类器` : 线性分类器是分类器中的一种,就是判定分类结果的根据是通过特征的线性组合得到的,不能通过特征的非线性运算结果作为判定根据。还以上面的股票涨跌预测问题为例,判断的依据只能是前一天的交易量和收盘价的线性组合,不能将交易量和收盘价进行开方,平方等运算。
## How does it work? (SVM 原理)
## 3 SVM 原理
### 1、引用知乎上 [@简之](https://www.zhihu.com/people/wangjianzhi/answers) 大佬的回答:
### 1 引用知乎上 [@简之](https://www.zhihu.com/people/wangjianzhi/answers) 大佬的回答:
首先我们讲个故事:
@@ -247,21 +232,20 @@ Support Vector Machine, 一个普通的 SVM 就是一条直线罢了,用来完
还记得我们怎么预测一个新的水果是苹果还是香蕉吗?我们代入到分界的直线里,然后通过符号来判断。
刚刚w已经被表达出来了也就是说这个直线现在变成了: ![k_12](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_12.png "k_12")
看似仿佛用到了所有的训练水果,但是其中 ![k_13](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_13.png "k_13") 的水果都没有起到作用,剩下的就是小部分靠边边的 Support vectors 呀。
刚刚w已经被表达出来了也就是说这个直线现在变成了:
$y(x_0)=\sum_{n=1}^Na_ny_nx_n^Tx_0+b$
看似仿佛用到了所有的训练水果,但是其中$a_n=0$的水果都没有起到作用,剩下的就是小部分靠边边的 Support vectors 呀。
<b>III. dual representation</b>
![k_14](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_14.png "k_14")
![](image/2021-03-21-14-31-01.png)
<b>如果香蕉和苹果不能用直线分割呢?</b>
![k_3](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_3.jpg "k_3")
![](image/2021-03-21-14-30-51.png)
Kernel trick.
其实用直线分割的时候我们已经使用了 kernel ,那就是线性 kernel , ![k_15](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_15.png "k_15")
其实用直线分割的时候我们已经使用了 kernel ,那就是线性 kernel , !![](image/2021-03-21-14-30-43.png)
如果要替换 kernel 那么把目标函数里面的内积全部替换成新的 kernel function 就好了,就是这么简单。
@@ -269,13 +253,13 @@ Kernel trick.
<b>如果香蕉和苹果有交集呢?</b>
![k_4](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_4.jpg "k_4")
![](image/2021-03-21-14-30-34.png)
![k_16](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_16.png "k_16")
![](image/2021-03-21-14-30-26.png)
<b>如果还有梨呢?</b>
![k_5](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_5.jpg "k_5")
![](image/2021-03-21-14-30-17.png)
可以每个类别做一次 SVM: 是苹果还是不是苹果?是香蕉还是不是香蕉?是梨子还是不是梨子?从中选出可能性最大的。这是 one-versus-the-rest approach。
@@ -289,7 +273,7 @@ Kernel trick.
<p>最后送一张图我好爱哈哈哈 (Credit: Burr Settles)</p>
![k_6](http://data.apachecn.org/img/AiLearning/ml/6.SVM/k_6.png "k_6")
![](image/2021-03-21-14-29-53.png)
<p>[1] Bishop C M. Pattern recognition[J]. Machine Learning, 2006, 128.</p>
<p>[2] Friedman J, Hastie T, Tibshirani R. The elements of statistical learning[M]. Springer, Berlin: Springer series in statistics, 2001.</p>
@@ -311,7 +295,7 @@ Kernel trick.
SVM 的基本原理基本上已经说的差不多了,下面咱们就来看看 SVM 在实际应用该如何使用了。幸运的是,在 python 下面,sklearn 提供了一个非常好用的机器学习算法,我们调用相关的包就好啦。
![sklearn_map](http://data.apachecn.org/img/AiLearning/ml/6.SVM/ml_map.png "sklearn")
![](image/2021-03-21-14-29-14.png)
## 小结

View File

@@ -24,7 +24,6 @@
1. 寻找最大分类间距
2. 转而通过拉格朗日函数求优化的问题
* 数据可以通过画一条直线就可以将它们完全分开,这组数据叫`线性可分(linearly separable)`数据,而这条分隔直线称为`分隔超平面(separating hyperplane)`。
* 如果数据集上升到1024维呢?那么需要1023维来分隔数据集,也就说需要N-1维的对象来分隔,这个对象叫做`超平面(hyperlane)`,也就是分类的决策边界。
@@ -38,70 +37,72 @@
$$y(x)=w^Tx+b$$
* 分类的结果 (sign表示>0为1,<0为-1,=0为0) :
$$f(x)=sign(w^Tx+b)$$
* 点到超平面的`几何间距`(||w||表示w矩阵的二范数=> $\sqrt{w^T*w}$, 点到超平面的距离也是类似的):
* 点到超平面的`几何间距`(||w||表示w矩阵的二范数$\sqrt{w^T*w}$, 点到超平面的距离也是类似的):
$$d(x)=(w^Tx+b)/||w||$$
![点到直线的几何距离](http://data.apachecn.org/img/AiLearning/ml/6.SVM/SVM_4_point2line-distance.jpg)
* 点到直线的距离公式
$$
d=\left|\frac{Ax_0+By_0+C}{\sqrt{A^2+B^2}}\right|
$$
> 拉格朗日乘子法
* 类别标签用-1、1,是为了后期方便 $label*(w^Tx+b)$ 的标识和距离计算;如果 $label*(w^Tx+b)>0$ 表示预测正确,否则预测错误。
* 现在目标很明确,就是要找到`w`和`b`,因此我们必须要找到最小间隔的数据点,也就是前面所说的`支持向量`。
* 也就说,让最小的距离取最大.(最小的距离: 就是最小间隔的数据点;最大: 就是最大间距,为了找出最优超平面--最终就是支持向量)
* 目标函数:
* $$arg: max_{w, b} \left( min[label*(w^Tx+b)]*\frac{1}{||w||} \right) $$
1. 如果 $label*(w^Tx+b)>0$ 表示预测正确,也称`函数间隔`,$||w||$ 可以理解为归一化,也称`几何间隔`。
2. 令 $label*(w^Tx+b)>=1$, 因为0~1之间,得到的点是存在误判的可能性,所以要保障 $min[label*(w^Tx+b)]=1$,才能更好降低噪音数据影响。
3. 所以本质上是求 $arg: max_{w, b}\frac{1}{||w||}$;也就说,我们约束(前提)条件是: $label*(w^Tx+b)=1$
* 现在目标很明确,就是要找到`w`和`b`,因此我们必须要找到最小间隔的数据点,也就是前面所说的`支持向量`。也就说,让最小的距离取最大.(最小的距离: 就是最小间隔的数据点;最大: 就是最大间距,为了找出最优超平面--最终就是支持向量)
* 目标函数:
$$arg: max_{w, b} \left( min[label*(w^Tx+b)]*\frac{1}{||w||} \right) $$
*
1. 如果 $label*(w^Tx+b)>0$ 表示预测正确,也称`函数间隔`,$||w||$ 可以理解为归一化,也称`几何间隔`。
2. 令 $label*(w^Tx+b)>=1$, 因为0~1之间,得到的点是存在误判的可能性,所以要保障 $min[label*(w^Tx+b)]=1$,才能更好降低噪音数据影响。
3. 所以本质上是求 $arg: max_{w, b}\frac{1}{||w||}$;也就说,我们约束(前提)条件是: $label*(w^Tx+b)=1$
* 新的目标函数求解:
* $arg: max_{w, b} \frac{1}{||w||}$
* => 就是求: $arg: min_{w, b} ||w||$ (求矩阵会比较麻烦,如果x只是 $\frac{1}{2}*x^2$ 的偏导数,那么。。同样是求最小值)
* => 就是求: $arg: min_{w, b} (\frac{1}{2}*||w||^2)$ (二次函数求导,求极值,平方也方便计算)
* 本质上就是求线性不等式的二次优化问题(求分隔超平面,等价于求解相应的凸二次规划问题)
* 通过拉格朗日乘子法,求二次优化问题
* 假设需要求极值的目标函数 (objective function) 为 f(x,y),限制条件为 φ(x,y)=M # M=1
* 设g(x,y)=M-φ(x,y) # 临时φ(x,y)表示下文中
* 通过拉格朗日乘子法,求二次优化问题。假设需要求极值的目标函数 (objective function) 为 f(x,y),限制条件为 φ(x,y)=M # M=1。设g(x,y)=M-φ(x,y) # 临时φ(x,y)表示下文中
$$label*(w^Tx+b)$$
* 定义一个新函数: F(x,y,λ)=f(x,y)+λg(x,y)
* a为λ(a>=0),代表要引入的拉格朗日乘子(Lagrange multiplier)
* 那么:
* 定义一个新函数: F(x,y,λ)=f(x,y)+λg(x,y)a为λ(a>=0),代表要引入的拉格朗日乘子(Lagrange multiplier)那么:
$$L(w,b,\alpha)=\frac{1}{2} * ||w||^2 + \sum_{i=1}^{n} \alpha_i * [1 - label * (w^Tx+b)]$$
* 因为:
* 因为:
$$label*(w^Tx+b)>=1, \alpha>=0$$
* 所以
* 所以
$$\alpha*[1-label*(w^Tx+b)]<=0$$
$$\sum_{i=1}^{n} \alpha_i * [1-label*(w^Tx+b)]<=0$$
* 当
* 当
$$label*(w^Tx+b)>1$$
* 则
* 则
$$\alpha=0$$
* 表示该点为<font color=red>非支持向量</font>相当于求解:
* 表示该点为<font color=red>非支持向量</font>相当于求解:
$$max_{\alpha} L(w,b,\alpha) = \frac{1}{2} *||w||^2$$
* 如果求:
* 如果求:
$$min_{w, b} \frac{1}{2} *||w||^2$$
* 也就是要求:
* 也就是要求:
$$min_{w, b} \left( max_{\alpha} L(w,b,\alpha)\right)$$
* 现在转化到对偶问题的求解
$$min_{w, b} \left(max_{\alpha} L(w,b,\alpha) \right)>= max_{\alpha} \left(min_{w, b}\ L(w,b,\alpha) \right)$$
* 现在分2步
* 先求: $$min_{w, b} L(w,b,\alpha)=\frac{1}{2} * ||w||^2 + \sum_{i=1}^{n} \alpha_i * [1 - label * (w^Tx+b)]$$
* 就是求`L(w,b,a)`关于[w, b]的偏导数, 得到`w和b的值`,并化简为: `L和a的方程`。
* 参考: 如果公式推导还是不懂,也可以参考《统计学习方法》李航-P103<学习的对偶算法>
![计算拉格朗日函数的对偶函数](http://data.apachecn.org/img/AiLearning/ml/6.SVM/SVM_5_Lagrangemultiplier.png)
* 终于得到课本上的公式: $$max_{\alpha} \left( \sum_{i=1}^{m} \alpha_i - \frac{1}{2} \sum_{i, j=1}^{m} label_i \ast label_j \ast \alpha_i \ast \alpha_j \ast <x_i, x_j> \right) $$
* 约束条件: $$a>=0$$ 并且 $$\sum_{i=1}^{m} a_i \ast label_i=0$$
* 现在分2步先求:
$$min_{w, b} L(w,b,\alpha)=\frac{1}{2} * ||w||^2 + \sum_{i=1}^{n} \alpha_i * [1 - label * (w^Tx+b)]$$
* 就是求`L(w,b,a)`关于[w, b]的偏导数, 得到`w和b的值`,并化简为: `L和a的方程`。参考: 如果公式推导还是不懂,也可以参考《统计学习方法》李航-P103<学习的对偶算法>
![](image/2021-03-21-14-44-53.png)
* 终于得到课本上的公式:
$$max_{\alpha} \left( \sum_{i=1}^{m} \alpha_i - \frac{1}{2} \sum_{i, j=1}^{m} label_i \ast label_j \ast \alpha_i \ast \alpha_j \ast <x_i, x_j> \right) $$
* 约束条件:
$$a>=0$$
$$\sum_{i=1}^{m} a_i \ast label_i=0$$
> 松弛变量(slack variable)
参考地址: http://blog.csdn.net/wusecaiyun/article/details/49659183
![松弛变量公式](http://data.apachecn.org/img/AiLearning/ml/6.SVM/SVM_松弛变量.jpg)
![](image/2021-03-21-14-45-43.png)
* 我们知道几乎所有的数据都不那么干净, 通过引入松弛变量来 `允许数据点可以处于分隔面错误的一侧`。
* 约束条件: $$C>=a>=0$$ 并且 $$\sum_{i=1}^{m} a_i \ast label_i=0$$

View File

@@ -1,16 +1,22 @@
# 第7章 集成方法 ensemble method
> 参考文献
> * https://zhuanlan.zhihu.com/p/62993244
## 1 集成方法: ensemble method(元算法: meta algorithm) 概述
## 1 集成方法ensemble method/元算法: meta algorithm 概述
* 概念: 是对其他算法进行组合的一种形式。
* 通俗来说: 当做重要决定时,大家可能都会考虑吸取多个专家而不只是一个人的意见。
机器学习处理问题时又何尝不是如此? 这就是集成方法背后的思想。
* 概念:
* 是对其他算法进行组合的一种形式。通俗来说: 当做重要决定时,大家可能都会考虑吸取多个专家而不只是一个人的意见.机器学习处理问题时又何尝不是如此? 这就是集成方法背后的思想。
* 集成方法:
1. **投票选举bagging=自举汇聚法 bootstrap aggregating**: 是基于数据随机重抽样分类器构造的方法
2. **再学习(boosting)**: 是基于所有分类器的加权求和的方法
1. **投票选举bagging=自举汇聚法 bootstrap aggregating**: 是基于数据随机重抽样分类器构造的方法。将某个学习算法分别作用于多个数据集就得到了S个分类器。当对新数据进行分类时,可以应用这S个分类器进行分类,选择分类器投票结果中最多的类别作为最后的分类结果。随机森林是比较常见的bagging方法。
2. **再学习(boosting)**: 是基于所有分类器的加权求和的方法。boosting通过集中关注被已有分类器错分的那些数据来获得新的分类器。由于boosting分类的结果是基于所有分类器的加权求和结果的,因此boosting与bagging不太一样。bagging中分类器的权重是相等的,而boosting中的分类器权重并不相等,每个权重代表的是其对应分类器在上一轮迭代中的成功度。
![](image/2021-03-21-15-55-09.png)
* 方法说明
* 装袋法baggin的核心思想是构建多个相互独立的评估器,然后对其预测进行平均或多数表决原则来决定集成评估器的结果。装袋法的代表模型就是随机森林。
* 提升法中boosting基评估器是相关的,是按顺序一一构建的。其核心思想是结合弱评估器的力量一次次对难以评估的样本进行预测,从而构成一个强评估器。提升法的代表模型有Adaboost和梯度提升树。
## 2 集成方法 场景
@@ -36,12 +42,9 @@
### 随机森林 原理
那随机森林具体如何构建呢?<br/>
有两个方面: <br/>
1. 数据的随机性化<br/>
2. 待选特征的随机化<br/>
使得随机森林中的决策树都能够彼此不同,提升系统的多样性,从而提升分类性能。
* 随机森林的特征,使得随机森林中的决策树都能够彼此不同,提升系统的多样性,从而提升分类性能。:
1. 数据的随机性化
2. 待选特征的随机化
> 数据的随机化: 使得随机森林中的决策树更普遍化一点,适合更多的场景。
@@ -316,7 +319,7 @@ def evaluate_algorithm(dataset, algorithm, n_folds, *args):
> AdaBoost 工作原理
![AdaBoost 工作原理](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/adaboost_illustration.png "AdaBoost 工作原理")
![](image/2021-03-21-16-07-27.png)
> AdaBoost 开发流程
@@ -513,7 +516,7 @@ print m, errArr[predicting10 != mat(labelArrTest).T].sum(), errArr[predicting10
[完整代码地址](https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/7.AdaBoost/adaboost.py): <https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/7.AdaBoost/adaboost.py>
#### 要点补充
## 7 要点补充
> 非均衡现象:
@@ -528,54 +531,45 @@ print m, errArr[predicting10 != mat(labelArrTest).T].sum(), errArr[predicting10
再结合书中的方法,可以归为八大类:
##### 1.能否收集到更多的数据?
### 1.能否收集到更多的数据?
这个措施往往被人们所忽略,被认为很蠢。但是更大的数据集更能体现样本的分布,多样性。
* 这个措施往往被人们所忽略,被认为很蠢。但是更大的数据集更能体现样本的分布,多样性。
##### 2.尝试使用其他的评价指标
### 2.尝试使用其他的评价指标
Accuracy 或者error rate 不能用于非均衡的数据集。这会误导人。这时候可以尝试其他的评价指标。
* Accuracy 或者error rate 不能用于非均衡的数据集。这会误导人。这时候可以尝试其他的评价指标。
Confusion Matrix 混淆矩阵: 使用一个表格对分类器所预测的类别与其真实的类别的样本统计,分别为: TP、FN、FP与TN。
* Confusion Matrix 混淆矩阵: 使用一个表格对分类器所预测的类别与其真实的类别的样本统计,分别为: TP、FN、FP与TN。
Precision: 精确度
* Precision: 精确度
Recall: 召回率
* Recall: 召回率
F1 Score (or F-Score): 精确度和召回率的加权平均
* F1 Score (or F-Score): 精确度和召回率的加权平均
或者使用
Kappa (Cohen's kappa)
ROC Curves
> ROC 评估方法
* ROC 曲线: 最佳的分类器应该尽可能地处于左上角
![ROC曲线](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/ROC曲线.png)
* 对不同的 ROC 曲线进行比较的一个指标是曲线下的面积(Area Unser the Curve, AUC).
* Kappa (Cohen's kappa)
* ROC Curves
* ROC 曲线: 最佳的分类器应该尽可能地处于左上角
![](image/2021-03-21-16-17-56.png)
* 对不同的 ROC 曲线进行比较的一个指标是曲线下的面积(Area Unser the Curve, AUC).
* AUC 给出的是分类器的平均性能值,当然它并不能完全代替对整条曲线的观察。
* 一个完美分类器的 AUC 为1,而随机猜测的 AUC 则为0.5。
* 一个完美分类器的 AUC 为1,而随机猜测的 AUC 则为0.5。
##### 3.尝试对样本重抽样
### 3.尝试对样本重抽样
欠抽样(undersampling)或者过抽样(oversampling)
- 欠抽样: 意味着删除样例
- 过抽样: 意味着复制样例(重复使用)
- 欠抽样: 意味着删除样例
- 过抽样: 意味着复制样例(重复使用)
结合上述两种方法进行抽样:
对大类进行欠抽样
* 对大类进行欠抽样
* 对小类进行过抽样
* 同时对大类进行欠抽样对小类进行过抽样
对小类进行过抽样
或者结合上述两种方法进行抽样
一些经验法则:
* 考虑样本(超过1万、十万甚至更多)进行欠采样,即删除部分样本;
@@ -588,72 +582,56 @@ ROC Curves
* 考虑同时使用过采样与欠采样
       
##### 4.尝试产生人工生成的样本
### 4.尝试产生人工生成的样本
一种简单的方法就是随机抽样小类样本的属性(特征)来组成新的样本即属性值随机采样。你可以根据经验进行抽样,可以使用其他方式比如朴素贝叶斯方法假设各属性之间互相独立进行采样,这样便可得到更多的数据,但是无法保证属性之间的非线性关系。
* 一种简单的方法就是随机抽样小类样本的属性(特征)来组成新的样本即属性值随机采样。你可以根据经验进行抽样,可以使用其他方式比如朴素贝叶斯方法假设各属性之间互相独立进行采样,这样便可得到更多的数据,但是无法保证属性之间的非线性关系。
* 当然也有系统性的算法。最常用的SMOTE(Synthetic Minority Over-Sampling Technique)。 顾名思义,这是一种over sampling(过抽样)的方式。它是产生人为的样本而不是制造样本副本。这个算法是选取2个或者2个以上相似的样本(根据距离度量 distance measure),然后每次选择其中一个样本,并随机选择一定数量的邻居样本对选择的那个样本的一个属性增加噪声(每次只处理一个属性)。这样就构造了更多的新生数据。具体可以参见[原始论文](http://www.jair.org/papers/paper953.html)。
* python实现可以查阅[UnbalancedDataset](https://github.com/scikit-learn-contrib/imbalanced-learn)
### 5.尝试不同的算法
* 强烈建议不要在每个问题上使用你最喜欢的算法。虽然这个算法带来较好的效果,但是它也会蒙蔽你观察数据内蕴含的其他的信息。至少你得在同一个问题上试试各种算法。具体可以参阅[Why you should be Spot-Checking Algorithms on your Machine Learning Problems](https://machinelearningmastery.com/why-you-should-be-spot-checking-algorithms-on-your-machine-learning-problems/)
当然也有系统性的算法。最常用的SMOTE(Synthetic Minority Over-Sampling Technique)。 顾名思义,这是一种over sampling(过抽样)的方式。它是产生人为的样本而不是制造样本副本。这个算法是选取2个或者2个以上相似的样本(根据距离度量 distance measure),然后每次选择其中一个样本,并随机选择一定数量的邻居样本对选择的那个样本的一个属性增加噪声(每次只处理一个属性)。这样就构造了更多的新生数据。具体可以参见[原始论文](http://www.jair.org/papers/paper953.html)。
python实现可以查阅[UnbalancedDataset](https://github.com/scikit-learn-contrib/imbalanced-learn)
* 比如说,决策树经常在非均衡数据集上表现良好。创建分类树时候使用基于类变量的划分规则强制使类别表达出来。如果有疑惑,可以尝试一些流行的决策树,比如, C4.5, C5.0, CART 和 Random Forrest。
##### 5.尝试不同的算法
### 6.尝试使用惩罚的模型
强烈建议不要在每个问题上使用你最喜欢的算法。虽然这个算法带来较好的效果,但是它也会蒙蔽你观察数据内蕴含的其他的信息。至少你得在同一个问题上试试各种算法。具体可以参阅[Why you should be Spot-Checking Algorithms on your Machine Learning Problems](https://machinelearningmastery.com/why-you-should-be-spot-checking-algorithms-on-your-machine-learning-problems/)
比如说,决策树经常在非均衡数据集上表现良好。创建分类树时候使用基于类变量的划分规则强制使类别表达出来。如果有疑惑,可以尝试一些流行的决策树,比如, C4.5, C5.0, CART 和 Random Forrest。
* 你可以使用同种算法但是以不同的角度对待这个问题。
##### 6.尝试使用惩罚的模型
* 惩罚的模型就是对于不同的分类错误给予不同的代价(惩罚)。比如对于错分的小类给予更高的代价。这种方式会使模型偏差,更加关注小类。
你可以使用同种算法但是以不同的角度对待这个问题。
惩罚的模型就是对于不同的分类错误给予不同的代价(惩罚)。比如对于错分的小类给予更高的代价。这种方式会使模型偏差,更加关注小类。
通常来说这种代价/惩罚或者比重在学习中算法是特定的。比如使用代价函数来实现:
* 通常来说这种代价/惩罚或者比重在学习中算法是特定的。比如使用代价函数来实现:
> 代价函数
* 基于代价函数的分类器决策控制: `TP*(-5)+FN*1+FP*50+TN*0`
![](image/2021-03-21-16-21-33.png)
![代价函数](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/代价函数.png)
* 这种方式叫做 cost sensitive learning,Weka 中相应的框架可以实现叫[CostSensitiveClassifier](http://weka.sourceforge.net/doc.dev/weka/classifiers/meta/CostSensitiveClassifier.html)
这种方式叫做 cost sensitive learning,Weka 中相应的框架可以实现叫[CostSensitiveClassifier](http://weka.sourceforge.net/doc.dev/weka/classifiers/meta/CostSensitiveClassifier.html)
* 如果当你只能使用特定算法而且无法重抽样,或者模型效果不行,这时候使用惩罚(penalization)是可行的方法。这提供另外一种方式来“平衡”类别。但是设定惩罚函数/代价函数是比较复杂的。最好还是尝试不同的代价函数组合来得到最优效果。
如果当你只能使用特定算法而且无法重抽样,或者模型效果不行,这时候使用惩罚(penalization)是可行的方法。这提供另外一种方式来“平衡”类别。但是设定惩罚函数/代价函数是比较复杂的。最好还是尝试不同的代价函数组合来得到最优效果。
### 7.尝试使用不同的角度
##### 7.尝试使用不同的角度
* 其实有很多研究关于非均衡数据。他们有自己的算法,度量,术语。
其实有很多研究关于非均衡数据。他们有自己的算法,度量,术语。
* 从它们的角度看看你的问题,思考你的问题,说不定会有新的想法。
从它们的角度看看你的问题,思考你的问题,说不定会有新的想法。
* 两个领域您可以考虑: anomaly detection(异常值检测) 和 change detection(变化趋势检测)。
两个领域您可以考虑: anomaly detection(异常值检测) 和 change detection(变化趋势检测)。
* Anomaly dectection 就是检测稀有事件。 比如通过机器震动来识别机器谷中或者根据一系列系统的调用来检测恶意操作。与常规操作相比,这些事件是罕见的。
Anomaly dectection 就是检测稀有事件。 比如通过机器震动来识别机器谷中或者根据一系列系统的调用来检测恶意操作。与常规操作相比,这些事件是罕见的。
* 把小类想成异常类这种转变可能会帮助你想到新办法来分类数据样本。
把小类想成异常类这种转变可能会帮助你想到新办法来分类数据样本。
* change detection 变化趋势检测类似于异常值检测。但是他不是寻找异常值而是寻找变化或区别。比如通过使用模式或者银行交易记录来观察用户行为转变。
change detection 变化趋势检测类似于异常值检测。但是他不是寻找异常值而是寻找变化或区别。比如通过使用模式或者银行交易记录来观察用户行为转变。
这些两种转变可能会给你新的方式去思考你的问题和新的技术去尝试。
* 这些两种转变可能会给你新的方式去思考你的问题和新的技术去尝试。
   
##### 8.尝试去创新
### 8.尝试去创新
仔细思考你的问题然后想想看如何将这问题细分为几个更切实际的小问题。
* 仔细思考你的问题然后想想看如何将这问题细分为几个更切实际的小问题。比如:
* 将你的大类分解成多个较小的类;
* 使用One Class分类器(看待成异常点检测);
* 对数据集进行抽样成多个数据集,使用集成方式,训练多个分类器,然后联合这些分类器进行分类;
比如:
将你的大类分解成多个较小的类;
使用One Class分类器(看待成异常点检测);
对数据集进行抽样成多个数据集,使用集成方式,训练多个分类器,然后联合这些分类器进行分类;
这只是一个例子。更多的可以参阅[In classification, how do you handle an unbalanced training set?](http://www.quora.com/In-classification-how-do-you-handle-an-unbalanced-training-set) 和[Classification when 80% of my training set is of one class](https://www.reddit.com/r/MachineLearning/comments/12evgi/classification_when_80_of_my_training_set_is_of/)
* * *
* **作者: [片刻](https://github.com/jiangzhonglian)**
* [GitHub地址](https://github.com/apachecn/AiLearning): <https://github.com/apachecn/AiLearning>
* **版权声明: 欢迎转载学习 => 请标注信息来源于 [ApacheCN](http://www.apachecn.org/)**
* 这只是一个例子。更多的可以参阅[In classification, how do you handle an unbalanced training set?](http://www.quora.com/In-classification-how-do-you-handle-an-unbalanced-training-set) 和[Classification when 80% of my training set is of one class](https://www.reddit.com/r/MachineLearning/comments/12evgi/classification_when_80_of_my_training_set_is_of/)

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

View File

@@ -23,7 +23,7 @@ def load_data_set():
"""
data_arr = []
label_arr = []
f = open('data/5.Logistic/TestSet.txt', 'r')
f = open('./testSet.txt', 'r')
for line in f.readlines():
line_arr = line.strip().split()
# 为了方便计算,我们将 X0 的值设为 1.0 ,也就是在每一行的开头添加一个 1.0 作为 X0

View File

@@ -181,51 +181,51 @@ plt.show()
'''
# Logistic Regression 3-class Classifier 逻辑回归 3-类 分类器
def test_regression_classifier_iris():
print(__doc__)
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model, datasets
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model, datasets
# 引入一些数据来玩
iris = datasets.load_iris()
# 我们只采用样本数据的前两个feature
X = iris.data[:, :2]
Y = iris.target
# 引入一些数据来玩
iris = datasets.load_iris()
# 我们只采用样本数据的前两个feature
X = iris.data[:, :2]
Y = iris.target
h = .02 # 网格中的步长
h = .02 # 网格中的步长
logreg = linear_model.LogisticRegression(C=1e5)
logreg = linear_model.LogisticRegression(C=1e5)
# 我们创建了一个 Neighbours Classifier 的实例,并拟合数据。
logreg.fit(X, Y)
# 我们创建了一个 Neighbours Classifier 的实例,并拟合数据。
logreg.fit(X, Y)
# 绘制决策边界。为此我们将为网格 [x_min, x_max]x[y_min, y_max] 中的每个点分配一个颜色。
x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5
xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
Z = logreg.predict(np.c_[xx.ravel(), yy.ravel()])
# 绘制决策边界。为此我们将为网格 [x_min, x_max]x[y_min, y_max] 中的每个点分配一个颜色。
x_min, x_max = X[:, 0].min() - .5, X[:, 0].max() + .5
y_min, y_max = X[:, 1].min() - .5, X[:, 1].max() + .5
xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))
Z = logreg.predict(np.c_[xx.ravel(), yy.ravel()])
# 将结果放入彩色图中
Z = Z.reshape(xx.shape)
plt.figure(1, figsize=(4, 3))
plt.pcolormesh(xx, yy, Z, cmap=plt.cm.Paired)
# 将结果放入彩色图中
Z = Z.reshape(xx.shape)
plt.figure(1, figsize=(4, 3))
plt.pcolormesh(xx, yy, Z, cmap=plt.cm.Paired)
# 将训练点也同样放入彩色图中
plt.scatter(X[:, 0], X[:, 1], c=Y, edgecolors='k', cmap=plt.cm.Paired)
plt.xlabel('Sepal length')
plt.ylabel('Sepal width')
# 将训练点也同样放入彩色图中
plt.scatter(X[:, 0], X[:, 1], c=Y, edgecolors='k', cmap=plt.cm.Paired)
plt.xlabel('Sepal length')
plt.ylabel('Sepal width')
plt.xlim(xx.min(), xx.max())
plt.ylim(yy.min(), yy.max())
plt.xticks(())
plt.yticks(())
plt.xlim(xx.min(), xx.max())
plt.ylim(yy.min(), yy.max())
plt.xticks(())
plt.yticks(())
plt.show()
plt.show()
# Logistic function 逻辑回归函数
# 这个类似于咱们之前讲解 logistic 回归的 Sigmoid 函数,模拟的阶跃函数
# Logistic function 逻辑回归函数
# 这个类似于咱们之前讲解 logistic 回归的 Sigmoid 函数,模拟的阶跃函数
'''
print(__doc__)

View File

@@ -0,0 +1,100 @@
-0.017612 14.053064 0
-1.395634 4.662541 1
-0.752157 6.538620 0
-1.322371 7.152853 0
0.423363 11.054677 0
0.406704 7.067335 1
0.667394 12.741452 0
-2.460150 6.866805 1
0.569411 9.548755 0
-0.026632 10.427743 0
0.850433 6.920334 1
1.347183 13.175500 0
1.176813 3.167020 1
-1.781871 9.097953 0
-0.566606 5.749003 1
0.931635 1.589505 1
-0.024205 6.151823 1
-0.036453 2.690988 1
-0.196949 0.444165 1
1.014459 5.754399 1
1.985298 3.230619 1
-1.693453 -0.557540 1
-0.576525 11.778922 0
-0.346811 -1.678730 1
-2.124484 2.672471 1
1.217916 9.597015 0
-0.733928 9.098687 0
-3.642001 -1.618087 1
0.315985 3.523953 1
1.416614 9.619232 0
-0.386323 3.989286 1
0.556921 8.294984 1
1.224863 11.587360 0
-1.347803 -2.406051 1
1.196604 4.951851 1
0.275221 9.543647 0
0.470575 9.332488 0
-1.889567 9.542662 0
-1.527893 12.150579 0
-1.185247 11.309318 0
-0.445678 3.297303 1
1.042222 6.105155 1
-0.618787 10.320986 0
1.152083 0.548467 1
0.828534 2.676045 1
-1.237728 10.549033 0
-0.683565 -2.166125 1
0.229456 5.921938 1
-0.959885 11.555336 0
0.492911 10.993324 0
0.184992 8.721488 0
-0.355715 10.325976 0
-0.397822 8.058397 0
0.824839 13.730343 0
1.507278 5.027866 1
0.099671 6.835839 1
-0.344008 10.717485 0
1.785928 7.718645 1
-0.918801 11.560217 0
-0.364009 4.747300 1
-0.841722 4.119083 1
0.490426 1.960539 1
-0.007194 9.075792 0
0.356107 12.447863 0
0.342578 12.281162 0
-0.810823 -1.466018 1
2.530777 6.476801 1
1.296683 11.607559 0
0.475487 12.040035 0
-0.783277 11.009725 0
0.074798 11.023650 0
-1.337472 0.468339 1
-0.102781 13.763651 0
-0.147324 2.874846 1
0.518389 9.887035 0
1.015399 7.571882 0
-1.658086 -0.027255 1
1.319944 2.171228 1
2.056216 5.019981 1
-0.851633 4.375691 1
-1.510047 6.061992 0
-1.076637 -3.181888 1
1.821096 10.283990 0
3.010150 8.401766 1
-1.099458 1.688274 1
-0.834872 -1.733869 1
-0.846637 3.849075 1
1.400102 12.628781 0
1.752842 5.468166 1
0.078557 0.059736 1
0.089392 -0.715300 1
1.825662 12.693808 0
0.197445 9.744638 0
0.126117 0.922311 1
-0.679797 1.220530 1
0.677983 2.556666 1
0.761349 10.693862 0
-2.168791 0.143632 1
1.388610 9.341997 0
0.317029 14.739025 0

View File

@@ -41,7 +41,7 @@ def loadDataSet(fileName):
return dataMat, labelMat
X, Y = loadDataSet('data/6.SVM/testSet.txt')
X, Y = loadDataSet('testSet.txt')
X = np.mat(X)
print("X=", X)

View File

@@ -0,0 +1,100 @@
3.542485 1.977398 -1
3.018896 2.556416 -1
7.551510 -1.580030 1
2.114999 -0.004466 -1
8.127113 1.274372 1
7.108772 -0.986906 1
8.610639 2.046708 1
2.326297 0.265213 -1
3.634009 1.730537 -1
0.341367 -0.894998 -1
3.125951 0.293251 -1
2.123252 -0.783563 -1
0.887835 -2.797792 -1
7.139979 -2.329896 1
1.696414 -1.212496 -1
8.117032 0.623493 1
8.497162 -0.266649 1
4.658191 3.507396 -1
8.197181 1.545132 1
1.208047 0.213100 -1
1.928486 -0.321870 -1
2.175808 -0.014527 -1
7.886608 0.461755 1
3.223038 -0.552392 -1
3.628502 2.190585 -1
7.407860 -0.121961 1
7.286357 0.251077 1
2.301095 -0.533988 -1
-0.232542 -0.547690 -1
3.457096 -0.082216 -1
3.023938 -0.057392 -1
8.015003 0.885325 1
8.991748 0.923154 1
7.916831 -1.781735 1
7.616862 -0.217958 1
2.450939 0.744967 -1
7.270337 -2.507834 1
1.749721 -0.961902 -1
1.803111 -0.176349 -1
8.804461 3.044301 1
1.231257 -0.568573 -1
2.074915 1.410550 -1
-0.743036 -1.736103 -1
3.536555 3.964960 -1
8.410143 0.025606 1
7.382988 -0.478764 1
6.960661 -0.245353 1
8.234460 0.701868 1
8.168618 -0.903835 1
1.534187 -0.622492 -1
9.229518 2.066088 1
7.886242 0.191813 1
2.893743 -1.643468 -1
1.870457 -1.040420 -1
5.286862 -2.358286 1
6.080573 0.418886 1
2.544314 1.714165 -1
6.016004 -3.753712 1
0.926310 -0.564359 -1
0.870296 -0.109952 -1
2.369345 1.375695 -1
1.363782 -0.254082 -1
7.279460 -0.189572 1
1.896005 0.515080 -1
8.102154 -0.603875 1
2.529893 0.662657 -1
1.963874 -0.365233 -1
8.132048 0.785914 1
8.245938 0.372366 1
6.543888 0.433164 1
-0.236713 -5.766721 -1
8.112593 0.295839 1
9.803425 1.495167 1
1.497407 -0.552916 -1
1.336267 -1.632889 -1
9.205805 -0.586480 1
1.966279 -1.840439 -1
8.398012 1.584918 1
7.239953 -1.764292 1
7.556201 0.241185 1
9.015509 0.345019 1
8.266085 -0.230977 1
8.545620 2.788799 1
9.295969 1.346332 1
2.404234 0.570278 -1
2.037772 0.021919 -1
1.727631 -0.453143 -1
1.979395 -0.050773 -1
8.092288 -1.372433 1
1.667645 0.239204 -1
9.854303 1.365116 1
7.921057 -1.327587 1
8.500757 1.492372 1
1.339746 -0.291183 -1
3.107511 0.758367 -1
2.609525 0.902979 -1
3.263585 1.367898 -1
2.912122 -0.202359 -1
1.731786 0.589096 -1
2.387003 1.573131 -1

View File

@@ -0,0 +1,662 @@
# 第7章 集成方法 ensemble method
> 参考文献
> * https://zhuanlan.zhihu.com/p/62993244
## 1 集成方法ensemble method/元算法: meta algorithm 概述
* 概念:
* 是对其他算法进行组合的一种形式。通俗来说: 当做重要决定时,大家可能都会考虑吸取多个专家而不只是一个人的意见.机器学习处理问题时又何尝不是如此? 这就是集成方法背后的思想。
* 集成方法:
1. **投票选举bagging=自举汇聚法 bootstrap aggregating**: 是基于数据随机重抽样分类器构造的方法。将某个学习算法分别作用于多个数据集就得到了S个分类器。当对新数据进行分类时,可以应用这S个分类器进行分类,选择分类器投票结果中最多的类别作为最后的分类结果。随机森林是比较常见的bagging方法。
2. **再学习(boosting)**: 是基于所有分类器的加权求和的方法。boosting通过集中关注被已有分类器错分的那些数据来获得新的分类器。由于boosting分类的结果是基于所有分类器的加权求和结果的,因此boosting与bagging不太一样。bagging中分类器的权重是相等的,而boosting中的分类器权重并不相等,每个权重代表的是其对应分类器在上一轮迭代中的成功度。
![](image/2021-03-21-15-55-09.png)
* 方法说明
* 装袋法baggin的核心思想是构建多个相互独立的评估器,然后对其预测进行平均或多数表决原则来决定集成评估器的结果。装袋法的代表模型就是随机森林。
* 提升法中boosting基评估器是相关的,是按顺序一一构建的。其核心思想是结合弱评估器的力量一次次对难以评估的样本进行预测,从而构成一个强评估器。提升法的代表模型有Adaboost和梯度提升树。
## 2 集成方法 场景
* 目前 **bagging 方法最流行的版本是: 随机森林(random forest)**<br/>
选男友: 美女选择择偶对象的时候,会问几个闺蜜的建议,最后选择一个综合得分最高的一个作为男朋友
* 目前 **boosting 方法最流行的版本是: AdaBoost**<br/>
追女友: 3个帅哥追同一个美女,第1个帅哥失败->(传授经验: 姓名、家庭情况) 第2个帅哥失败->(传授经验: 兴趣爱好、性格特点) 第3个帅哥成功
> bagging 和 boosting 区别是什么?
1. bagging 是一种与 boosting 很类似的技术, 所使用的多个分类器的类型(数据量和特征量)都是一致的。
2. bagging 是由不同的分类器(1.数据随机化 2.特征随机化)经过训练,综合得出的出现最多分类结果;boosting 是通过调整已有分类器错分的那些数据来获得新的分类器,得出目前最优的结果。
3. bagging 中的分类器权重是相等的;而 boosting 中的分类器加权求和,所以权重并不相等,每个权重代表的是其对应分类器在上一轮迭代中的成功度。
## 3 随机森林
### 随机森林 概述
* 随机森林指的是利用多棵树对样本进行训练并预测的一种分类器。
* 决策树相当于一个大师,通过自己在数据集中学到的知识用于新数据的分类。但是俗话说得好,一个诸葛亮,玩不过三个臭皮匠。随机森林就是希望构建多个臭皮匠,希望最终的分类效果能够超过单个大师的一种算法。
### 随机森林 原理
* 随机森林的特征,使得随机森林中的决策树都能够彼此不同,提升系统的多样性,从而提升分类性能。:
1. 数据的随机性化
2. 待选特征的随机化
> 数据的随机化: 使得随机森林中的决策树更普遍化一点,适合更多的场景。
(有放回的准确率在: 70% 以上, 无放回的准确率在: 60% 以上)
1. 采取有放回的抽样方式 构造子数据集,保证不同子集之间的数量级一样(不同子集/同一子集 之间的元素可以重复)
2. 利用子数据集来构建子决策树,将这个数据放到每个子决策树中,每个子决策树输出一个结果。
3. 然后统计子决策树的投票结果,得到最终的分类 就是 随机森林的输出结果。
4. 如下图,假设随机森林中有3棵子决策树,2棵子树的分类结果是A类,1棵子树的分类结果是B类,那么随机森林的分类结果就是A类。
![数据重抽样](http://data.apachecn.org/img/AiLearning/ml/7.RandomForest/数据重抽样.jpg)
> 待选特征的随机化
1. 子树从所有的待选特征中随机选取一定的特征。
2. 在选取的特征中选取最优的特征。
下图中,蓝色的方块代表所有可以被选择的特征,也就是目前的待选特征;黄色的方块是分裂特征。<br/>
左边是一棵决策树的特征选取过程,通过在待选特征中选取最优的分裂特征(别忘了前文提到的ID3算法,C4.5算法,CART算法等等),完成分裂。<br/>
右边是一个随机森林中的子树的特征选取过程。<br/>
![特征重抽样](http://data.apachecn.org/img/AiLearning/ml/7.RandomForest/特征重抽样.jpg)
> 随机森林 开发流程
```
收集数据: 任何方法
准备数据: 转换样本集
分析数据: 任何方法
训练算法: 通过数据随机化和特征随机化,进行多实例的分类评估
测试算法: 计算错误率
使用算法: 输入样本数据,然后运行 随机森林 算法判断输入数据分类属于哪个分类,最后对计算出的分类执行后续处理
```
> 随机森林 算法特点
```
优点: 几乎不需要输入准备、可实现隐式特征选择、训练速度非常快、其他模型很难超越、很难建立一个糟糕的随机森林模型、大量优秀、免费以及开源的实现。
缺点: 劣势在于模型大小、是个很难去解释的黑盒子。
适用数据范围: 数值型和标称型
```
## 4 项目案例: 声纳信号分类
### 项目概述
这是 Gorman 和 Sejnowski 在研究使用神经网络的声纳信号分类中使用的数据集。任务是训练一个模型来区分声纳信号。
### 开发流程
```
收集数据: 提供的文本文件
准备数据: 转换样本集
分析数据: 手工检查数据
训练算法: 在数据上,利用 random_forest() 函数进行优化评估,返回模型的综合分类结果
测试算法: 在采用自定义 n_folds 份随机重抽样 进行测试评估,得出综合的预测评分
使用算法: 若你感兴趣可以构建完整的应用程序,从案例进行封装,也可以参考我们的代码
```
> 收集数据: 提供的文本文件
样本数据: sonar-all-data.txt
```
0.02,0.0371,0.0428,0.0207,0.0954,0.0986,0.1539,0.1601,0.3109,0.2111,0.1609,0.1582,0.2238,0.0645,0.066,0.2273,0.31,0.2999,0.5078,0.4797,0.5783,0.5071,0.4328,0.555,0.6711,0.6415,0.7104,0.808,0.6791,0.3857,0.1307,0.2604,0.5121,0.7547,0.8537,0.8507,0.6692,0.6097,0.4943,0.2744,0.051,0.2834,0.2825,0.4256,0.2641,0.1386,0.1051,0.1343,0.0383,0.0324,0.0232,0.0027,0.0065,0.0159,0.0072,0.0167,0.018,0.0084,0.009,0.0032,R
0.0453,0.0523,0.0843,0.0689,0.1183,0.2583,0.2156,0.3481,0.3337,0.2872,0.4918,0.6552,0.6919,0.7797,0.7464,0.9444,1,0.8874,0.8024,0.7818,0.5212,0.4052,0.3957,0.3914,0.325,0.32,0.3271,0.2767,0.4423,0.2028,0.3788,0.2947,0.1984,0.2341,0.1306,0.4182,0.3835,0.1057,0.184,0.197,0.1674,0.0583,0.1401,0.1628,0.0621,0.0203,0.053,0.0742,0.0409,0.0061,0.0125,0.0084,0.0089,0.0048,0.0094,0.0191,0.014,0.0049,0.0052,0.0044,R
0.0262,0.0582,0.1099,0.1083,0.0974,0.228,0.2431,0.3771,0.5598,0.6194,0.6333,0.706,0.5544,0.532,0.6479,0.6931,0.6759,0.7551,0.8929,0.8619,0.7974,0.6737,0.4293,0.3648,0.5331,0.2413,0.507,0.8533,0.6036,0.8514,0.8512,0.5045,0.1862,0.2709,0.4232,0.3043,0.6116,0.6756,0.5375,0.4719,0.4647,0.2587,0.2129,0.2222,0.2111,0.0176,0.1348,0.0744,0.013,0.0106,0.0033,0.0232,0.0166,0.0095,0.018,0.0244,0.0316,0.0164,0.0095,0.0078,R
```
> 准备数据: 转换样本集
```python
# 导入csv文件
def loadDataSet(filename):
dataset = []
with open(filename, 'r') as fr:
for line in fr.readlines():
if not line:
continue
lineArr = []
for featrue in line.split(','):
# strip()返回移除字符串头尾指定的字符生成的新字符串
str_f = featrue.strip()
if str_f.isdigit(): # 判断是否是数字
# 将数据集的第column列转换成float形式
lineArr.append(float(str_f))
else:
# 添加分类标签
lineArr.append(str_f)
dataset.append(lineArr)
return dataset
```
> 分析数据: 手工检查数据
> 训练算法: 在数据上,利用 random_forest() 函数进行优化评估,返回模型的综合分类结果
* 样本数据随机无放回抽样-用于交叉验证
```python
def cross_validation_split(dataset, n_folds):
"""cross_validation_split(将数据集进行抽重抽样 n_folds 份,数据可以重复抽取)
Args:
dataset 原始数据集
n_folds 数据集dataset分成n_flods份
Returns:
dataset_split list集合,存放的是: 将数据集进行抽重抽样 n_folds 份,数据可以重复抽取
"""
dataset_split = list()
dataset_copy = list(dataset) # 复制一份 dataset,防止 dataset 的内容改变
fold_size = len(dataset) / n_folds
for i in range(n_folds):
fold = list() # 每次循环 fold 清零,防止重复导入 dataset_split
while len(fold) < fold_size: # 这里不能用 if,if 只是在第一次判断时起作用,while 执行循环,直到条件不成立
           # 有放回的随机采样,有一些样本被重复采样,从而在训练集中多次出现,有的则从未在训练集中出现,此为自助采样法。从而保证每棵决策树训练集的差异性            
index = randrange(len(dataset_copy))
# 将对应索引 index 的内容从 dataset_copy 中导出,并将该内容从 dataset_copy 中删除。
# pop() 函数用于移除列表中的一个元素(默认最后一个元素),并且返回该元素的值。
fold.append(dataset_copy.pop(index)) # 无放回的方式
# fold.append(dataset_copy[index]) # 有放回的方式
dataset_split.append(fold)
# 由dataset分割出的n_folds个数据构成的列表,为了用于交叉验证
return dataset_split
```
* 训练数据集随机化
```python
# Create a random subsample from the dataset with replacement
def subsample(dataset, ratio): # 创建数据集的随机子样本
"""random_forest(评估算法性能,返回模型得分)
Args:
dataset 训练数据集
ratio 训练数据集的样本比例
Returns:
sample 随机抽样的训练样本
"""
sample = list()
# 训练样本的按比例抽样。
# round() 方法返回浮点数x的四舍五入值。
n_sample = round(len(dataset) * ratio)
while len(sample) < n_sample:
       # 有放回的随机采样,有一些样本被重复采样,从而在训练集中多次出现,有的则从未在训练集中出现,此为自助采样法。从而保证每棵决策树训练集的差异性
index = randrange(len(dataset))
sample.append(dataset[index])
return sample
```
* 特征随机化
```python
# 找出分割数据集的最优特征,得到最优的特征 index,特征值 row[index],以及分割完的数据 groups(left, right)
def get_split(dataset, n_features):
class_values = list(set(row[-1] for row in dataset)) # class_values =[0, 1]
b_index, b_value, b_score, b_groups = 999, 999, 999, None
features = list()
while len(features) < n_features:
       index = randrange(len(dataset[0])-1) # 往 features 添加 n_features 个特征( n_feature 等于特征数的个数),特征索引从 dataset 中随机取
if index not in features:
features.append(index)
for index in features: # 在 n_features 个特征中选出最优的特征索引,并没有遍历所有特征,从而保证了每课决策树的差异性
for row in dataset:
groups = test_split(index, row[index], dataset) # groups=(left, right), row[index] 遍历每一行 index 索引下的特征值作为分类值 value, 找出最优的分类特征和特征值
gini = gini_index(groups, class_values)
# 左右两边的数量越一样,说明数据区分度不高,gini系数越大
if gini < b_score:
b_index, b_value, b_score, b_groups = index, row[index], gini, groups # 最后得到最优的分类特征 b_index,分类特征值 b_value,分类结果 b_groups。b_value 为分错的代价成本
# print b_score
return {'index': b_index, 'value': b_value, 'groups': b_groups}
```
* 随机森林
```python
# Random Forest Algorithm
def random_forest(train, test, max_depth, min_size, sample_size, n_trees, n_features):
"""random_forest(评估算法性能,返回模型得分)
Args:
train 训练数据集
test 测试数据集
max_depth 决策树深度不能太深,不然容易导致过拟合
min_size 叶子节点的大小
sample_size 训练数据集的样本比例
n_trees 决策树的个数
n_features 选取的特征的个数
Returns:
predictions 每一行的预测结果,bagging 预测最后的分类结果
"""
trees = list()
# n_trees 表示决策树的数量
for i in range(n_trees):
# 随机抽样的训练样本, 随机采样保证了每棵决策树训练集的差异性
sample = subsample(train, sample_size)
# 创建一个决策树
tree = build_tree(sample, max_depth, min_size, n_features)
trees.append(tree)
# 每一行的预测结果,bagging 预测最后的分类结果
predictions = [bagging_predict(trees, row) for row in test]
return predictions
```
> 测试算法: 在采用自定义 n_folds 份随机重抽样 进行测试评估,得出综合的预测评分。
* 计算随机森林的预测结果的正确率
```python
# 评估算法性能,返回模型得分
def evaluate_algorithm(dataset, algorithm, n_folds, *args):
"""evaluate_algorithm(评估算法性能,返回模型得分)
Args:
dataset 原始数据集
algorithm 使用的算法
n_folds 数据的份数
*args 其他的参数
Returns:
scores 模型得分
"""
# 将数据集进行随机抽样,分成 n_folds 份,数据无重复的抽取
folds = cross_validation_split(dataset, n_folds)
scores = list()
# 每次循环从 folds 从取出一个 fold 作为测试集,其余作为训练集,遍历整个 folds ,实现交叉验证
for fold in folds:
train_set = list(folds)
train_set.remove(fold)
# 将多个 fold 列表组合成一个 train_set 列表, 类似 union all
"""
In [20]: l1=[[1, 2, 'a'], [11, 22, 'b']]
In [21]: l2=[[3, 4, 'c'], [33, 44, 'd']]
In [22]: l=[]
In [23]: l.append(l1)
In [24]: l.append(l2)
In [25]: l
Out[25]: [[[1, 2, 'a'], [11, 22, 'b']], [[3, 4, 'c'], [33, 44, 'd']]]
In [26]: sum(l, [])
Out[26]: [[1, 2, 'a'], [11, 22, 'b'], [3, 4, 'c'], [33, 44, 'd']]
"""
train_set = sum(train_set, [])
test_set = list()
# fold 表示从原始数据集 dataset 提取出来的测试集
for row in fold:
row_copy = list(row)
row_copy[-1] = None
test_set.append(row_copy)
predicted = algorithm(train_set, test_set, *args)
actual = [row[-1] for row in fold]
# 计算随机森林的预测结果的正确率
accuracy = accuracy_metric(actual, predicted)
scores.append(accuracy)
return scores
```
> 使用算法: 若你感兴趣可以构建完整的应用程序,从案例进行封装,也可以参考我们的代码
[完整代码地址](https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/7.RandomForest/randomForest.py): <https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/7.RandomForest/randomForest.py>
## 5 AdaBoost
### AdaBoost (adaptive boosting: 自适应 boosting) 概述
`能否使用弱分类器和多个实例来构建一个强分类器? 这是一个非常有趣的理论问题。`
### AdaBoost 原理
> AdaBoost 工作原理
![](image/2021-03-21-16-07-27.png)
> AdaBoost 开发流程
```
收集数据: 可以使用任意方法
准备数据: 依赖于所使用的弱分类器类型,本章使用的是单层决策树,这种分类器可以处理任何数据类型。
当然也可以使用任意分类器作为弱分类器,第2章到第6章中的任一分类器都可以充当弱分类器。
作为弱分类器,简单分类器的效果更好。
分析数据: 可以使用任意方法。
训练算法: AdaBoost 的大部分时间都用在训练上,分类器将多次在同一数据集上训练弱分类器。
测试算法: 计算分类的错误率。
使用算法: 通SVM一样,AdaBoost 预测两个类别中的一个。如果想把它应用到多个类别的场景,那么就要像多类 SVM 中的做法一样对 AdaBoost 进行修改。
```
> AdaBoost 算法特点
```
* 优点: 泛化(由具体的、个别的扩大为一般的)错误率低,易编码,可以应用在大部分分类器上,无参数调节。
* 缺点: 对离群点敏感。
* 适用数据类型: 数值型和标称型数据。
```
## 6 项目案例: 马疝病的预测
> 项目流程图
![AdaBoost代码流程图](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/adaboost_code-flow-chart.jpg "AdaBoost代码流程图")
基于单层决策树构建弱分类器
* 单层决策树(decision stump, 也称决策树桩)是一种简单的决策树。
### 项目概述
预测患有疝气病的马的存活问题,这里的数据包括368个样本和28个特征,疝气病是描述马胃肠痛的术语,然而,这种病并不一定源自马的胃肠问题,其他问题也可能引发疝气病,该数据集中包含了医院检测马疝气病的一些指标,有的指标比较主观,有的指标难以测量,例如马的疼痛级别。另外,除了部分指标主观和难以测量之外,该数据还存在一个问题,数据集中有30%的值是缺失的。
### 开发流程
```
收集数据: 提供的文本文件
准备数据: 确保类别标签是+1和-1,而非1和0
分析数据: 统计分析
训练算法: 在数据上,利用 adaBoostTrainDS() 函数训练出一系列的分类器
测试算法: 我们拥有两个数据集。在不采用随机抽样的方法下,我们就会对 AdaBoost 和 Logistic 回归的结果进行完全对等的比较
使用算法: 观察该例子上的错误率。不过,也可以构建一个 Web 网站,让驯马师输入马的症状然后预测马是否会死去
```
> 收集数据: 提供的文本文件
训练数据: horseColicTraining.txt<br/>
测试数据: horseColicTest.txt
```
2.000000 1.000000 38.500000 66.000000 28.000000 3.000000 3.000000 0.000000 2.000000 5.000000 4.000000 4.000000 0.000000 0.000000 0.000000 3.000000 5.000000 45.000000 8.400000 0.000000 0.000000 -1.000000
1.000000 1.000000 39.200000 88.000000 20.000000 0.000000 0.000000 4.000000 1.000000 3.000000 4.000000 2.000000 0.000000 0.000000 0.000000 4.000000 2.000000 50.000000 85.000000 2.000000 2.000000 -1.000000
2.000000 1.000000 38.300000 40.000000 24.000000 1.000000 1.000000 3.000000 1.000000 3.000000 3.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 33.000000 6.700000 0.000000 0.000000 1.000000
```
> 准备数据: 确保类别标签是+1和-1,而非1和0
```python
def loadDataSet(fileName):
# 获取 feature 的数量, 便于获取
numFeat = len(open(fileName).readline().split('\t'))
dataArr = []
labelArr = []
fr = open(fileName)
for line in fr.readlines():
lineArr = []
curLine = line.strip().split('\t')
for i in range(numFeat-1):
lineArr.append(float(curLine[i]))
dataArr.append(lineArr)
labelArr.append(float(curLine[-1]))
return dataArr, labelArr
```
> 分析数据: 统计分析
过拟合(overfitting, 也称为过学习)
* 发现测试错误率在达到一个最小值之后有开始上升,这种现象称为过拟合。
![过拟合](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/过拟合.png)
* 通俗来说: 就是把一些噪音数据也拟合进去的,如下图。
![过拟合](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/过拟合图解.png)
> 训练算法: 在数据上,利用 adaBoostTrainDS() 函数训练出一系列的分类器
```python
def adaBoostTrainDS(dataArr, labelArr, numIt=40):
"""adaBoostTrainDS(adaBoost训练过程放大)
Args:
dataArr 特征标签集合
labelArr 分类标签集合
numIt 实例数
Returns:
weakClassArr 弱分类器的集合
aggClassEst 预测的分类结果值
"""
weakClassArr = []
m = shape(dataArr)[0]
# 初始化 D,设置每个样本的权重值,平均分为m份
D = mat(ones((m, 1))/m)
aggClassEst = mat(zeros((m, 1)))
for i in range(numIt):
# 得到决策树的模型
bestStump, error, classEst = buildStump(dataArr, labelArr, D)
# alpha目的主要是计算每一个分类器实例的权重(组合就是分类结果)
# 计算每个分类器的alpha权重值
alpha = float(0.5*log((1.0-error)/max(error, 1e-16)))
bestStump['alpha'] = alpha
# store Stump Params in Array
weakClassArr.append(bestStump)
print "alpha=%s, classEst=%s, bestStump=%s, error=%s " % (alpha, classEst.T, bestStump, error)
# 分类正确: 乘积为1,不会影响结果,-1主要是下面求e的-alpha次方
# 分类错误: 乘积为 -1,结果会受影响,所以也乘以 -1
expon = multiply(-1*alpha*mat(labelArr).T, classEst)
print '(-1取反)预测值expon=', expon.T
# 计算e的expon次方,然后计算得到一个综合的概率的值
       # 结果发现: 判断错误的样本,D中相对应的样本权重值会变大。
D = multiply(D, exp(expon))
D = D/D.sum()
# 预测的分类结果值,在上一轮结果的基础上,进行加和操作
print '当前的分类结果: ', alpha*classEst.T
aggClassEst += alpha*classEst
print "叠加后的分类结果aggClassEst: ", aggClassEst.T
# sign 判断正为1, 0为0, 负为-1,通过最终加和的权重值,判断符号。
# 结果为: 错误的样本标签集合,因为是 !=,那么结果就是0 正, 1 负
aggErrors = multiply(sign(aggClassEst) != mat(labelArr).T, ones((m, 1)))
errorRate = aggErrors.sum()/m
# print "total error=%s " % (errorRate)
if errorRate == 0.0:
break
return weakClassArr, aggClassEst
```
```
发现:
alpha (模型权重)目的主要是计算每一个分类器实例的权重(加和就是分类结果)
分类的权重值: 最大的值= alpha 的加和,最小值=-最大值
D (样本权重)的目的是为了计算错误概率: weightedError = D.T*errArr,求最佳分类器
样本的权重值: 如果一个值误判的几率越小,那么 D 的样本权重越小
```
![AdaBoost算法权重计算公式](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/adaboost_alpha.png "AdaBoost算法权重计算公式")
> 测试算法: 我们拥有两个数据集。在不采用随机抽样的方法下,我们就会对 AdaBoost 和 Logistic 回归的结果进行完全对等的比较。
```python
def adaClassify(datToClass, classifierArr):
"""adaClassify(ada分类测试)
Args:
datToClass 多个待分类的样例
classifierArr 弱分类器的集合
Returns:
sign(aggClassEst) 分类结果
"""
# do stuff similar to last aggClassEst in adaBoostTrainDS
dataMat = mat(datToClass)
m = shape(dataMat)[0]
aggClassEst = mat(zeros((m, 1)))
# 循环 多个分类器
for i in range(len(classifierArr)):
# 前提: 我们已经知道了最佳的分类器的实例
# 通过分类器来核算每一次的分类结果,然后通过alpha*每一次的结果 得到最后的权重加和的值。
classEst = stumpClassify(dataMat, classifierArr[i]['dim'], classifierArr[i]['thresh'], classifierArr[i]['ineq'])
aggClassEst += classifierArr[i]['alpha']*classEst
return sign(aggClassEst)
```
> 使用算法: 观察该例子上的错误率。不过,也可以构建一个 Web 网站,让驯马师输入马的症状然后预测马是否会死去。
```python
# 马疝病数据集
# 训练集合
dataArr, labelArr = loadDataSet("data/7.AdaBoost/horseColicTraining2.txt")
weakClassArr, aggClassEst = adaBoostTrainDS(dataArr, labelArr, 40)
print weakClassArr, '\n-----\n', aggClassEst.T
# 计算ROC下面的AUC的面积大小
plotROC(aggClassEst.T, labelArr)
# 测试集合
dataArrTest, labelArrTest = loadDataSet("data/7.AdaBoost/horseColicTest2.txt")
m = shape(dataArrTest)[0]
predicting10 = adaClassify(dataArrTest, weakClassArr)
errArr = mat(ones((m, 1)))
# 测试: 计算总样本数,错误样本数,错误率
print m, errArr[predicting10 != mat(labelArrTest).T].sum(), errArr[predicting10 != mat(labelArrTest).T].sum()/m
```
[完整代码地址](https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/7.AdaBoost/adaboost.py): <https://github.com/apachecn/AiLearning/blob/master/src/py2.x/ml/7.AdaBoost/adaboost.py>
#### 要点补充
> 非均衡现象:
`在分类器训练时,正例数目和反例数目不相等(相差很大)。或者发生在正负例分类错误的成本不同的时候。`
* 判断马是否能继续生存(不可误杀)
* 过滤垃圾邮件(不可漏判)
* 不能放过传染病的人
* 不能随便认为别人犯罪
我们有多种方法来处理这个问题: 具体可参考[此链接](https://machinelearningmastery.com/tactics-to-combat-imbalanced-classes-in-your-machine-learning-dataset/)
再结合书中的方法,可以归为八大类:
##### 1.能否收集到更多的数据?
这个措施往往被人们所忽略,被认为很蠢。但是更大的数据集更能体现样本的分布,多样性。
##### 2.尝试使用其他的评价指标
Accuracy 或者error rate 不能用于非均衡的数据集。这会误导人。这时候可以尝试其他的评价指标。
Confusion Matrix 混淆矩阵: 使用一个表格对分类器所预测的类别与其真实的类别的样本统计,分别为: TP、FN、FP与TN。
Precision: 精确度
Recall: 召回率
F1 Score (or F-Score): 精确度和召回率的加权平均
或者使用
Kappa (Cohen's kappa)
ROC Curves
> ROC 评估方法
* ROC 曲线: 最佳的分类器应该尽可能地处于左上角
![ROC曲线](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/ROC曲线.png)
* 对不同的 ROC 曲线进行比较的一个指标是曲线下的面积(Area Unser the Curve, AUC).
* AUC 给出的是分类器的平均性能值,当然它并不能完全代替对整条曲线的观察。
* 一个完美分类器的 AUC 为1,而随机猜测的 AUC 则为0.5。
##### 3.尝试对样本重抽样
欠抽样(undersampling)或者过抽样(oversampling)
- 欠抽样: 意味着删除样例
- 过抽样: 意味着复制样例(重复使用)
对大类进行欠抽样
对小类进行过抽样
或者结合上述两种方法进行抽样
一些经验法则:
* 考虑样本(超过1万、十万甚至更多)进行欠采样,即删除部分样本;
* 考虑样本(不足1为甚至更少)进行过采样,即添加部分样本的副本;
* 考虑尝试随机采样与非随机采样两种采样方法;
* 考虑对各类别尝试不同的采样比例,不一定是1:1
* 考虑同时使用过采样与欠采样
       
##### 4.尝试产生人工生成的样本
一种简单的方法就是随机抽样小类样本的属性(特征)来组成新的样本即属性值随机采样。你可以根据经验进行抽样,可以使用其他方式比如朴素贝叶斯方法假设各属性之间互相独立进行采样,这样便可得到更多的数据,但是无法保证属性之间的非线性关系。
当然也有系统性的算法。最常用的SMOTE(Synthetic Minority Over-Sampling Technique)。 顾名思义,这是一种over sampling(过抽样)的方式。它是产生人为的样本而不是制造样本副本。这个算法是选取2个或者2个以上相似的样本(根据距离度量 distance measure),然后每次选择其中一个样本,并随机选择一定数量的邻居样本对选择的那个样本的一个属性增加噪声(每次只处理一个属性)。这样就构造了更多的新生数据。具体可以参见[原始论文](http://www.jair.org/papers/paper953.html)。
python实现可以查阅[UnbalancedDataset](https://github.com/scikit-learn-contrib/imbalanced-learn)
##### 5.尝试不同的算法
强烈建议不要在每个问题上使用你最喜欢的算法。虽然这个算法带来较好的效果,但是它也会蒙蔽你观察数据内蕴含的其他的信息。至少你得在同一个问题上试试各种算法。具体可以参阅[Why you should be Spot-Checking Algorithms on your Machine Learning Problems](https://machinelearningmastery.com/why-you-should-be-spot-checking-algorithms-on-your-machine-learning-problems/)
比如说,决策树经常在非均衡数据集上表现良好。创建分类树时候使用基于类变量的划分规则强制使类别表达出来。如果有疑惑,可以尝试一些流行的决策树,比如, C4.5, C5.0, CART 和 Random Forrest。
##### 6.尝试使用惩罚的模型
你可以使用同种算法但是以不同的角度对待这个问题。
惩罚的模型就是对于不同的分类错误给予不同的代价(惩罚)。比如对于错分的小类给予更高的代价。这种方式会使模型偏差,更加关注小类。
通常来说这种代价/惩罚或者比重在学习中算法是特定的。比如使用代价函数来实现:
> 代价函数
* 基于代价函数的分类器决策控制: `TP*(-5)+FN*1+FP*50+TN*0`
![代价函数](http://data.apachecn.org/img/AiLearning/ml/7.AdaBoost/代价函数.png)
这种方式叫做 cost sensitive learning,Weka 中相应的框架可以实现叫[CostSensitiveClassifier](http://weka.sourceforge.net/doc.dev/weka/classifiers/meta/CostSensitiveClassifier.html)
如果当你只能使用特定算法而且无法重抽样,或者模型效果不行,这时候使用惩罚(penalization)是可行的方法。这提供另外一种方式来“平衡”类别。但是设定惩罚函数/代价函数是比较复杂的。最好还是尝试不同的代价函数组合来得到最优效果。
##### 7.尝试使用不同的角度
其实有很多研究关于非均衡数据。他们有自己的算法,度量,术语。
从它们的角度看看你的问题,思考你的问题,说不定会有新的想法。
两个领域您可以考虑: anomaly detection(异常值检测) 和 change detection(变化趋势检测)。
Anomaly dectection 就是检测稀有事件。 比如通过机器震动来识别机器谷中或者根据一系列系统的调用来检测恶意操作。与常规操作相比,这些事件是罕见的。
把小类想成异常类这种转变可能会帮助你想到新办法来分类数据样本。
change detection 变化趋势检测类似于异常值检测。但是他不是寻找异常值而是寻找变化或区别。比如通过使用模式或者银行交易记录来观察用户行为转变。
这些两种转变可能会给你新的方式去思考你的问题和新的技术去尝试。
   
##### 8.尝试去创新
仔细思考你的问题然后想想看如何将这问题细分为几个更切实际的小问题。
比如:
将你的大类分解成多个较小的类;
使用One Class分类器(看待成异常点检测);
对数据集进行抽样成多个数据集,使用集成方式,训练多个分类器,然后联合这些分类器进行分类;
这只是一个例子。更多的可以参阅[In classification, how do you handle an unbalanced training set?](http://www.quora.com/In-classification-how-do-you-handle-an-unbalanced-training-set) 和[Classification when 80% of my training set is of one class](https://www.reddit.com/r/MachineLearning/comments/12evgi/classification_when_80_of_my_training_set_is_of/)
* * *
* **作者: [片刻](https://github.com/jiangzhonglian)**
* [GitHub地址](https://github.com/apachecn/AiLearning): <https://github.com/apachecn/AiLearning>
* **版权声明: 欢迎转载学习 => 请标注信息来源于 [ApacheCN](http://www.apachecn.org/)**

View File

@@ -253,12 +253,12 @@ def test():
# print(result)
# classifier_array, agg_class_est = ada_boost_train_ds(data_mat, class_labels, 9)
# print(classifier_array, agg_class_est)
data_mat, class_labels = load_data_set('data/7.AdaBoost/horseColicTraining2.txt')
data_mat, class_labels = load_data_set('horseColicTraining2.txt')
print(data_mat.shape, len(class_labels))
weak_class_arr, agg_class_est = ada_boost_train_ds(data_mat, class_labels, 40)
print(weak_class_arr, '\n-----\n', agg_class_est.T)
plot_roc(agg_class_est, class_labels)
data_arr_test, label_arr_test = load_data_set("data/7.AdaBoost/horseColicTest2.txt")
data_arr_test, label_arr_test = load_data_set("horseColicTest2.txt")
m = np.shape(data_arr_test)[0]
predicting10 = ada_classify(data_arr_test, weak_class_arr)
err_arr = np.mat(np.ones((m, 1)))

View File

@@ -0,0 +1,67 @@
2.000000 1.000000 38.500000 54.000000 20.000000 0.000000 1.000000 2.000000 2.000000 3.000000 4.000000 1.000000 2.000000 2.000000 5.900000 0.000000 2.000000 42.000000 6.300000 0.000000 0.000000 1.000000
2.000000 1.000000 37.600000 48.000000 36.000000 0.000000 0.000000 1.000000 1.000000 0.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 44.000000 6.300000 1.000000 5.000000 1.000000
1.000000 1.000000 37.700000 44.000000 28.000000 0.000000 4.000000 3.000000 2.000000 5.000000 4.000000 4.000000 1.000000 1.000000 0.000000 3.000000 5.000000 45.000000 70.000000 3.000000 2.000000 1.000000
1.000000 1.000000 37.000000 56.000000 24.000000 3.000000 1.000000 4.000000 2.000000 4.000000 4.000000 3.000000 1.000000 1.000000 0.000000 0.000000 0.000000 35.000000 61.000000 3.000000 2.000000 -1.000000
2.000000 1.000000 38.000000 42.000000 12.000000 3.000000 0.000000 3.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 2.000000 37.000000 5.800000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 60.000000 40.000000 3.000000 0.000000 1.000000 1.000000 0.000000 4.000000 0.000000 3.000000 2.000000 0.000000 0.000000 5.000000 42.000000 72.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.400000 80.000000 60.000000 3.000000 2.000000 2.000000 1.000000 3.000000 2.000000 1.000000 2.000000 2.000000 0.000000 1.000000 1.000000 54.000000 6.900000 0.000000 0.000000 1.000000
2.000000 1.000000 37.800000 48.000000 12.000000 2.000000 1.000000 2.000000 1.000000 3.000000 0.000000 1.000000 2.000000 0.000000 0.000000 2.000000 0.000000 48.000000 7.300000 1.000000 0.000000 1.000000
2.000000 1.000000 37.900000 45.000000 36.000000 3.000000 3.000000 3.000000 2.000000 2.000000 3.000000 1.000000 2.000000 1.000000 0.000000 3.000000 0.000000 33.000000 5.700000 3.000000 0.000000 1.000000
2.000000 1.000000 39.000000 84.000000 12.000000 3.000000 1.000000 5.000000 1.000000 2.000000 4.000000 2.000000 1.000000 2.000000 7.000000 0.000000 4.000000 62.000000 5.900000 2.000000 2.200000 -1.000000
2.000000 1.000000 38.200000 60.000000 24.000000 3.000000 1.000000 3.000000 2.000000 3.000000 3.000000 2.000000 3.000000 3.000000 0.000000 4.000000 4.000000 53.000000 7.500000 2.000000 1.400000 1.000000
1.000000 1.000000 0.000000 140.000000 0.000000 0.000000 0.000000 4.000000 2.000000 5.000000 4.000000 4.000000 1.000000 1.000000 0.000000 0.000000 5.000000 30.000000 69.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.900000 120.000000 60.000000 3.000000 3.000000 3.000000 1.000000 5.000000 4.000000 4.000000 2.000000 2.000000 7.500000 4.000000 5.000000 52.000000 6.600000 3.000000 1.800000 -1.000000
2.000000 1.000000 38.000000 72.000000 36.000000 1.000000 1.000000 3.000000 1.000000 3.000000 0.000000 2.000000 2.000000 1.000000 0.000000 3.000000 5.000000 38.000000 6.800000 2.000000 2.000000 1.000000
2.000000 9.000000 38.000000 92.000000 28.000000 1.000000 1.000000 2.000000 1.000000 1.000000 3.000000 2.000000 3.000000 0.000000 7.200000 0.000000 0.000000 37.000000 6.100000 1.000000 1.100000 1.000000
1.000000 1.000000 38.300000 66.000000 30.000000 2.000000 3.000000 1.000000 1.000000 2.000000 4.000000 3.000000 3.000000 2.000000 8.500000 4.000000 5.000000 37.000000 6.000000 0.000000 0.000000 1.000000
2.000000 1.000000 37.500000 48.000000 24.000000 3.000000 1.000000 1.000000 1.000000 2.000000 1.000000 0.000000 1.000000 1.000000 0.000000 3.000000 2.000000 43.000000 6.000000 1.000000 2.800000 1.000000
1.000000 1.000000 37.500000 88.000000 20.000000 2.000000 3.000000 3.000000 1.000000 4.000000 3.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 35.000000 6.400000 1.000000 0.000000 -1.000000
2.000000 9.000000 0.000000 150.000000 60.000000 4.000000 4.000000 4.000000 2.000000 5.000000 4.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 39.700000 100.000000 30.000000 0.000000 0.000000 6.000000 2.000000 4.000000 4.000000 3.000000 1.000000 0.000000 0.000000 4.000000 5.000000 65.000000 75.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.300000 80.000000 0.000000 3.000000 3.000000 4.000000 2.000000 5.000000 4.000000 3.000000 2.000000 1.000000 0.000000 4.000000 4.000000 45.000000 7.500000 2.000000 4.600000 1.000000
2.000000 1.000000 37.500000 40.000000 32.000000 3.000000 1.000000 3.000000 1.000000 3.000000 2.000000 3.000000 2.000000 1.000000 0.000000 0.000000 5.000000 32.000000 6.400000 1.000000 1.100000 1.000000
1.000000 1.000000 38.400000 84.000000 30.000000 3.000000 1.000000 5.000000 2.000000 4.000000 3.000000 3.000000 2.000000 3.000000 6.500000 4.000000 4.000000 47.000000 7.500000 3.000000 0.000000 -1.000000
1.000000 1.000000 38.100000 84.000000 44.000000 4.000000 0.000000 4.000000 2.000000 5.000000 3.000000 1.000000 1.000000 3.000000 5.000000 0.000000 4.000000 60.000000 6.800000 0.000000 5.700000 -1.000000
2.000000 1.000000 38.700000 52.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 0.000000 0.000000 0.000000 1.000000 3.000000 4.000000 74.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.100000 44.000000 40.000000 2.000000 1.000000 3.000000 1.000000 3.000000 3.000000 1.000000 0.000000 0.000000 0.000000 1.000000 3.000000 35.000000 6.800000 0.000000 0.000000 1.000000
2.000000 1.000000 38.400000 52.000000 20.000000 2.000000 1.000000 3.000000 1.000000 1.000000 3.000000 2.000000 2.000000 1.000000 0.000000 3.000000 5.000000 41.000000 63.000000 1.000000 1.000000 1.000000
1.000000 1.000000 38.200000 60.000000 0.000000 1.000000 0.000000 3.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 0.000000 4.000000 4.000000 43.000000 6.200000 2.000000 3.900000 1.000000
2.000000 1.000000 37.700000 40.000000 18.000000 1.000000 1.000000 1.000000 0.000000 3.000000 2.000000 1.000000 1.000000 1.000000 0.000000 3.000000 3.000000 36.000000 3.500000 0.000000 0.000000 1.000000
1.000000 1.000000 39.100000 60.000000 10.000000 0.000000 1.000000 1.000000 0.000000 2.000000 3.000000 0.000000 0.000000 0.000000 0.000000 4.000000 4.000000 0.000000 0.000000 0.000000 0.000000 1.000000
2.000000 1.000000 37.800000 48.000000 16.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 1.000000 2.000000 1.000000 0.000000 4.000000 3.000000 43.000000 7.500000 0.000000 0.000000 1.000000
1.000000 1.000000 39.000000 120.000000 0.000000 4.000000 3.000000 5.000000 2.000000 2.000000 4.000000 3.000000 2.000000 3.000000 8.000000 0.000000 0.000000 65.000000 8.200000 3.000000 4.600000 1.000000
1.000000 1.000000 38.200000 76.000000 0.000000 2.000000 3.000000 2.000000 1.000000 5.000000 3.000000 3.000000 1.000000 2.000000 6.000000 1.000000 5.000000 35.000000 6.500000 2.000000 0.900000 1.000000
2.000000 1.000000 38.300000 88.000000 0.000000 0.000000 0.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.000000 80.000000 30.000000 3.000000 3.000000 3.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 6.000000 0.000000 0.000000 48.000000 8.300000 0.000000 4.300000 1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 3.000000 1.000000 1.000000 1.000000 2.000000 3.000000 3.000000 1.000000 3.000000 6.000000 4.000000 4.000000 0.000000 0.000000 2.000000 0.000000 -1.000000
1.000000 1.000000 37.600000 40.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 2.000000 2.100000 1.000000
2.000000 1.000000 37.500000 44.000000 0.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 45.000000 5.800000 2.000000 1.400000 1.000000
2.000000 1.000000 38.200000 42.000000 16.000000 1.000000 1.000000 3.000000 1.000000 1.000000 3.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 35.000000 60.000000 1.000000 1.000000 1.000000
2.000000 1.000000 38.000000 56.000000 44.000000 3.000000 3.000000 3.000000 0.000000 0.000000 1.000000 1.000000 2.000000 1.000000 0.000000 4.000000 0.000000 47.000000 70.000000 2.000000 1.000000 1.000000
2.000000 1.000000 38.300000 45.000000 20.000000 3.000000 3.000000 2.000000 2.000000 2.000000 4.000000 1.000000 2.000000 0.000000 0.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 48.000000 96.000000 1.000000 1.000000 3.000000 1.000000 0.000000 4.000000 1.000000 2.000000 1.000000 0.000000 1.000000 4.000000 42.000000 8.000000 1.000000 0.000000 1.000000
1.000000 1.000000 37.700000 55.000000 28.000000 2.000000 1.000000 2.000000 1.000000 2.000000 3.000000 3.000000 0.000000 3.000000 5.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 1.000000
2.000000 1.000000 36.000000 100.000000 20.000000 4.000000 3.000000 6.000000 2.000000 2.000000 4.000000 3.000000 1.000000 1.000000 0.000000 4.000000 5.000000 74.000000 5.700000 2.000000 2.500000 -1.000000
1.000000 1.000000 37.100000 60.000000 20.000000 2.000000 0.000000 4.000000 1.000000 3.000000 0.000000 3.000000 0.000000 2.000000 5.000000 3.000000 4.000000 64.000000 8.500000 2.000000 0.000000 1.000000
2.000000 1.000000 37.100000 114.000000 40.000000 3.000000 0.000000 3.000000 2.000000 2.000000 2.000000 1.000000 0.000000 0.000000 0.000000 0.000000 3.000000 32.000000 0.000000 3.000000 6.500000 1.000000
1.000000 1.000000 38.100000 72.000000 30.000000 3.000000 3.000000 3.000000 1.000000 4.000000 4.000000 3.000000 2.000000 1.000000 0.000000 3.000000 5.000000 37.000000 56.000000 3.000000 1.000000 1.000000
1.000000 1.000000 37.000000 44.000000 12.000000 3.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 4.000000 2.000000 40.000000 6.700000 3.000000 8.000000 1.000000
1.000000 1.000000 38.600000 48.000000 20.000000 3.000000 1.000000 1.000000 1.000000 4.000000 3.000000 1.000000 0.000000 0.000000 0.000000 3.000000 0.000000 37.000000 75.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 82.000000 72.000000 3.000000 1.000000 4.000000 1.000000 2.000000 3.000000 3.000000 0.000000 3.000000 0.000000 4.000000 4.000000 53.000000 65.000000 3.000000 2.000000 -1.000000
1.000000 9.000000 38.200000 78.000000 60.000000 4.000000 4.000000 6.000000 0.000000 3.000000 3.000000 3.000000 0.000000 0.000000 0.000000 1.000000 0.000000 59.000000 5.800000 3.000000 3.100000 -1.000000
2.000000 1.000000 37.800000 60.000000 16.000000 1.000000 1.000000 3.000000 1.000000 2.000000 3.000000 2.000000 1.000000 2.000000 0.000000 3.000000 0.000000 41.000000 73.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.700000 34.000000 30.000000 2.000000 0.000000 3.000000 1.000000 2.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 33.000000 69.000000 0.000000 2.000000 -1.000000
1.000000 1.000000 0.000000 36.000000 12.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 0.000000 1.000000 5.000000 44.000000 0.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.300000 44.000000 60.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 6.400000 36.000000 0.000000 0.000000 1.000000
2.000000 1.000000 37.400000 54.000000 18.000000 3.000000 0.000000 1.000000 1.000000 3.000000 4.000000 3.000000 2.000000 2.000000 0.000000 4.000000 5.000000 30.000000 7.100000 2.000000 0.000000 1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 4.000000 3.000000 0.000000 2.000000 2.000000 4.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 54.000000 76.000000 3.000000 2.000000 1.000000
1.000000 1.000000 36.600000 48.000000 16.000000 3.000000 1.000000 3.000000 1.000000 4.000000 1.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 27.000000 56.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.500000 90.000000 0.000000 1.000000 1.000000 3.000000 1.000000 3.000000 3.000000 3.000000 2.000000 3.000000 2.000000 4.000000 5.000000 47.000000 79.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 75.000000 12.000000 1.000000 1.000000 4.000000 1.000000 5.000000 3.000000 3.000000 0.000000 3.000000 5.800000 0.000000 0.000000 58.000000 8.500000 1.000000 0.000000 1.000000
2.000000 1.000000 38.200000 42.000000 0.000000 3.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 2.000000 1.000000 0.000000 3.000000 2.000000 35.000000 5.900000 2.000000 0.000000 1.000000
1.000000 9.000000 38.200000 78.000000 60.000000 4.000000 4.000000 6.000000 0.000000 3.000000 3.000000 3.000000 0.000000 0.000000 0.000000 1.000000 0.000000 59.000000 5.800000 3.000000 3.100000 -1.000000
2.000000 1.000000 38.600000 60.000000 30.000000 1.000000 1.000000 3.000000 1.000000 4.000000 2.000000 2.000000 1.000000 1.000000 0.000000 0.000000 0.000000 40.000000 6.000000 1.000000 0.000000 1.000000
2.000000 1.000000 37.800000 42.000000 40.000000 1.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 0.000000 0.000000 0.000000 3.000000 3.000000 36.000000 6.200000 0.000000 0.000000 1.000000
1.000000 1.000000 38.000000 60.000000 12.000000 1.000000 1.000000 2.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 4.000000 44.000000 65.000000 3.000000 2.000000 -1.000000
2.000000 1.000000 38.000000 42.000000 12.000000 3.000000 0.000000 3.000000 1.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 37.000000 5.800000 0.000000 0.000000 1.000000
2.000000 1.000000 37.600000 88.000000 36.000000 3.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 1.000000 3.000000 1.500000 0.000000 0.000000 44.000000 6.000000 0.000000 0.000000 -1.000000

View File

@@ -0,0 +1,299 @@
2.000000 1.000000 38.500000 66.000000 28.000000 3.000000 3.000000 0.000000 2.000000 5.000000 4.000000 4.000000 0.000000 0.000000 0.000000 3.000000 5.000000 45.000000 8.400000 0.000000 0.000000 -1.000000
1.000000 1.000000 39.200000 88.000000 20.000000 0.000000 0.000000 4.000000 1.000000 3.000000 4.000000 2.000000 0.000000 0.000000 0.000000 4.000000 2.000000 50.000000 85.000000 2.000000 2.000000 -1.000000
2.000000 1.000000 38.300000 40.000000 24.000000 1.000000 1.000000 3.000000 1.000000 3.000000 3.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 33.000000 6.700000 0.000000 0.000000 1.000000
1.000000 9.000000 39.100000 164.000000 84.000000 4.000000 1.000000 6.000000 2.000000 2.000000 4.000000 4.000000 1.000000 2.000000 5.000000 3.000000 0.000000 48.000000 7.200000 3.000000 5.300000 -1.000000
2.000000 1.000000 37.300000 104.000000 35.000000 0.000000 0.000000 6.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 74.000000 7.400000 0.000000 0.000000 -1.000000
2.000000 1.000000 0.000000 0.000000 0.000000 2.000000 1.000000 3.000000 1.000000 2.000000 3.000000 2.000000 2.000000 1.000000 0.000000 3.000000 3.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 37.900000 48.000000 16.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 3.000000 1.000000 1.000000 0.000000 3.000000 5.000000 37.000000 7.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 60.000000 0.000000 3.000000 0.000000 0.000000 1.000000 0.000000 4.000000 2.000000 2.000000 1.000000 0.000000 3.000000 4.000000 44.000000 8.300000 0.000000 0.000000 -1.000000
2.000000 1.000000 0.000000 80.000000 36.000000 3.000000 4.000000 3.000000 1.000000 4.000000 4.000000 4.000000 2.000000 1.000000 0.000000 3.000000 5.000000 38.000000 6.200000 0.000000 0.000000 -1.000000
2.000000 9.000000 38.300000 90.000000 0.000000 1.000000 0.000000 1.000000 1.000000 5.000000 3.000000 1.000000 2.000000 1.000000 0.000000 3.000000 0.000000 40.000000 6.200000 1.000000 2.200000 1.000000
1.000000 1.000000 38.100000 66.000000 12.000000 3.000000 3.000000 5.000000 1.000000 3.000000 3.000000 1.000000 2.000000 1.000000 3.000000 2.000000 5.000000 44.000000 6.000000 2.000000 3.600000 1.000000
2.000000 1.000000 39.100000 72.000000 52.000000 2.000000 0.000000 2.000000 1.000000 2.000000 1.000000 2.000000 1.000000 1.000000 0.000000 4.000000 4.000000 50.000000 7.800000 0.000000 0.000000 1.000000
1.000000 1.000000 37.200000 42.000000 12.000000 2.000000 1.000000 1.000000 1.000000 3.000000 3.000000 3.000000 3.000000 1.000000 0.000000 4.000000 5.000000 0.000000 7.000000 0.000000 0.000000 1.000000
2.000000 9.000000 38.000000 92.000000 28.000000 1.000000 1.000000 2.000000 1.000000 1.000000 3.000000 2.000000 3.000000 0.000000 7.200000 1.000000 1.000000 37.000000 6.100000 1.000000 0.000000 -1.000000
1.000000 1.000000 38.200000 76.000000 28.000000 3.000000 1.000000 1.000000 1.000000 3.000000 4.000000 1.000000 2.000000 2.000000 0.000000 4.000000 4.000000 46.000000 81.000000 1.000000 2.000000 1.000000
1.000000 1.000000 37.600000 96.000000 48.000000 3.000000 1.000000 4.000000 1.000000 5.000000 3.000000 3.000000 2.000000 3.000000 4.500000 4.000000 0.000000 45.000000 6.800000 0.000000 0.000000 -1.000000
1.000000 9.000000 0.000000 128.000000 36.000000 3.000000 3.000000 4.000000 2.000000 4.000000 4.000000 3.000000 3.000000 0.000000 0.000000 4.000000 5.000000 53.000000 7.800000 3.000000 4.700000 -1.000000
2.000000 1.000000 37.500000 48.000000 24.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 37.600000 64.000000 21.000000 1.000000 1.000000 2.000000 1.000000 2.000000 3.000000 1.000000 1.000000 1.000000 0.000000 2.000000 5.000000 40.000000 7.000000 1.000000 0.000000 1.000000
2.000000 1.000000 39.400000 110.000000 35.000000 4.000000 3.000000 6.000000 0.000000 0.000000 3.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 55.000000 8.700000 0.000000 0.000000 1.000000
1.000000 1.000000 39.900000 72.000000 60.000000 1.000000 1.000000 5.000000 2.000000 5.000000 4.000000 4.000000 3.000000 1.000000 0.000000 4.000000 4.000000 46.000000 6.100000 2.000000 0.000000 1.000000
2.000000 1.000000 38.400000 48.000000 16.000000 1.000000 0.000000 1.000000 1.000000 1.000000 3.000000 1.000000 2.000000 3.000000 5.500000 4.000000 3.000000 49.000000 6.800000 0.000000 0.000000 1.000000
1.000000 1.000000 38.600000 42.000000 34.000000 2.000000 1.000000 4.000000 0.000000 2.000000 3.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 48.000000 7.200000 0.000000 0.000000 1.000000
1.000000 9.000000 38.300000 130.000000 60.000000 0.000000 3.000000 0.000000 1.000000 2.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 50.000000 70.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.100000 60.000000 12.000000 3.000000 3.000000 3.000000 1.000000 0.000000 4.000000 3.000000 3.000000 2.000000 2.000000 0.000000 0.000000 51.000000 65.000000 0.000000 0.000000 1.000000
2.000000 1.000000 37.800000 60.000000 42.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.300000 72.000000 30.000000 4.000000 3.000000 3.000000 2.000000 3.000000 3.000000 3.000000 2.000000 1.000000 0.000000 3.000000 5.000000 43.000000 7.000000 2.000000 3.900000 1.000000
1.000000 1.000000 37.800000 48.000000 12.000000 3.000000 1.000000 1.000000 1.000000 0.000000 3.000000 2.000000 1.000000 1.000000 0.000000 1.000000 3.000000 37.000000 5.500000 2.000000 1.300000 1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.700000 48.000000 0.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 45.000000 76.000000 0.000000 0.000000 1.000000
2.000000 1.000000 37.700000 96.000000 30.000000 3.000000 3.000000 4.000000 2.000000 5.000000 4.000000 4.000000 3.000000 2.000000 4.000000 4.000000 5.000000 66.000000 7.500000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.200000 108.000000 12.000000 3.000000 3.000000 4.000000 2.000000 2.000000 4.000000 2.000000 0.000000 3.000000 6.000000 3.000000 3.000000 52.000000 8.200000 3.000000 7.400000 -1.000000
1.000000 1.000000 37.200000 60.000000 0.000000 2.000000 1.000000 1.000000 1.000000 3.000000 3.000000 3.000000 2.000000 1.000000 0.000000 4.000000 5.000000 43.000000 6.600000 0.000000 0.000000 1.000000
1.000000 1.000000 38.200000 64.000000 28.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 0.000000 0.000000 0.000000 0.000000 4.000000 4.000000 49.000000 8.600000 2.000000 6.600000 1.000000
1.000000 1.000000 0.000000 100.000000 30.000000 3.000000 3.000000 4.000000 2.000000 5.000000 4.000000 4.000000 3.000000 3.000000 0.000000 4.000000 4.000000 52.000000 6.600000 0.000000 0.000000 1.000000
2.000000 1.000000 0.000000 104.000000 24.000000 4.000000 3.000000 3.000000 2.000000 4.000000 4.000000 3.000000 0.000000 3.000000 0.000000 0.000000 2.000000 73.000000 8.400000 0.000000 0.000000 -1.000000
2.000000 1.000000 38.300000 112.000000 16.000000 0.000000 3.000000 5.000000 2.000000 0.000000 0.000000 1.000000 1.000000 2.000000 0.000000 0.000000 5.000000 51.000000 6.000000 2.000000 1.000000 -1.000000
1.000000 1.000000 37.800000 72.000000 0.000000 0.000000 3.000000 0.000000 1.000000 5.000000 3.000000 1.000000 0.000000 1.000000 0.000000 1.000000 1.000000 56.000000 80.000000 1.000000 2.000000 1.000000
2.000000 1.000000 38.600000 52.000000 0.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 1.000000 1.000000 0.000000 1.000000 3.000000 32.000000 6.600000 1.000000 5.000000 1.000000
1.000000 9.000000 39.200000 146.000000 96.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 88.000000 0.000000 3.000000 3.000000 6.000000 2.000000 5.000000 3.000000 3.000000 1.000000 3.000000 0.000000 4.000000 5.000000 63.000000 6.500000 3.000000 0.000000 -1.000000
2.000000 9.000000 39.000000 150.000000 72.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 47.000000 8.500000 0.000000 0.100000 1.000000
2.000000 1.000000 38.000000 60.000000 12.000000 3.000000 1.000000 3.000000 1.000000 3.000000 3.000000 1.000000 1.000000 1.000000 0.000000 2.000000 2.000000 47.000000 7.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 120.000000 0.000000 3.000000 4.000000 4.000000 1.000000 4.000000 4.000000 4.000000 1.000000 1.000000 0.000000 0.000000 5.000000 52.000000 67.000000 2.000000 2.000000 -1.000000
1.000000 1.000000 35.400000 140.000000 24.000000 3.000000 3.000000 4.000000 2.000000 4.000000 4.000000 0.000000 2.000000 1.000000 0.000000 0.000000 5.000000 57.000000 69.000000 3.000000 2.000000 -1.000000
2.000000 1.000000 0.000000 120.000000 0.000000 4.000000 3.000000 4.000000 2.000000 5.000000 4.000000 4.000000 1.000000 1.000000 0.000000 4.000000 5.000000 60.000000 6.500000 3.000000 0.000000 -1.000000
1.000000 1.000000 37.900000 60.000000 15.000000 3.000000 0.000000 4.000000 2.000000 5.000000 4.000000 4.000000 2.000000 2.000000 0.000000 4.000000 5.000000 65.000000 7.500000 0.000000 0.000000 1.000000
2.000000 1.000000 37.500000 48.000000 16.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 37.000000 6.500000 0.000000 0.000000 1.000000
1.000000 1.000000 38.900000 80.000000 44.000000 3.000000 3.000000 3.000000 2.000000 2.000000 3.000000 3.000000 2.000000 2.000000 7.000000 3.000000 1.000000 54.000000 6.500000 3.000000 0.000000 -1.000000
2.000000 1.000000 37.200000 84.000000 48.000000 3.000000 3.000000 5.000000 2.000000 4.000000 1.000000 2.000000 1.000000 2.000000 0.000000 2.000000 1.000000 73.000000 5.500000 2.000000 4.100000 -1.000000
2.000000 1.000000 38.600000 46.000000 0.000000 1.000000 1.000000 2.000000 1.000000 1.000000 3.000000 2.000000 1.000000 1.000000 0.000000 0.000000 2.000000 49.000000 9.100000 1.000000 1.600000 1.000000
1.000000 1.000000 37.400000 84.000000 36.000000 1.000000 0.000000 3.000000 2.000000 3.000000 3.000000 2.000000 0.000000 0.000000 0.000000 4.000000 5.000000 0.000000 0.000000 3.000000 0.000000 -1.000000
2.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 3.000000 1.000000 1.000000 3.000000 1.000000 0.000000 0.000000 0.000000 2.000000 2.000000 43.000000 7.700000 0.000000 0.000000 1.000000
2.000000 1.000000 38.600000 40.000000 20.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 41.000000 6.400000 0.000000 0.000000 1.000000
2.000000 1.000000 40.300000 114.000000 36.000000 3.000000 3.000000 1.000000 2.000000 2.000000 3.000000 3.000000 2.000000 1.000000 7.000000 1.000000 5.000000 57.000000 8.100000 3.000000 4.500000 -1.000000
1.000000 9.000000 38.600000 160.000000 20.000000 3.000000 0.000000 5.000000 1.000000 3.000000 3.000000 4.000000 3.000000 0.000000 0.000000 4.000000 0.000000 38.000000 0.000000 2.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 24.000000 6.700000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 64.000000 36.000000 2.000000 0.000000 2.000000 1.000000 5.000000 3.000000 3.000000 2.000000 2.000000 0.000000 0.000000 0.000000 42.000000 7.700000 0.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 0.000000 20.000000 4.000000 3.000000 3.000000 0.000000 5.000000 4.000000 3.000000 2.000000 0.000000 0.000000 4.000000 4.000000 53.000000 5.900000 3.000000 0.000000 -1.000000
2.000000 1.000000 0.000000 96.000000 0.000000 3.000000 3.000000 3.000000 2.000000 5.000000 4.000000 4.000000 1.000000 2.000000 0.000000 4.000000 5.000000 60.000000 0.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.800000 48.000000 32.000000 1.000000 1.000000 3.000000 1.000000 2.000000 1.000000 0.000000 1.000000 1.000000 0.000000 4.000000 5.000000 37.000000 6.700000 0.000000 0.000000 1.000000
2.000000 1.000000 38.500000 60.000000 0.000000 2.000000 2.000000 1.000000 1.000000 1.000000 2.000000 2.000000 2.000000 1.000000 0.000000 1.000000 1.000000 44.000000 7.700000 0.000000 0.000000 1.000000
1.000000 1.000000 37.800000 88.000000 22.000000 2.000000 1.000000 2.000000 1.000000 3.000000 0.000000 0.000000 2.000000 0.000000 0.000000 4.000000 0.000000 64.000000 8.000000 1.000000 6.000000 -1.000000
2.000000 1.000000 38.200000 130.000000 16.000000 4.000000 3.000000 4.000000 2.000000 2.000000 4.000000 4.000000 1.000000 1.000000 0.000000 0.000000 0.000000 65.000000 82.000000 2.000000 2.000000 -1.000000
1.000000 1.000000 39.000000 64.000000 36.000000 3.000000 1.000000 4.000000 2.000000 3.000000 3.000000 2.000000 1.000000 2.000000 7.000000 4.000000 5.000000 44.000000 7.500000 3.000000 5.000000 1.000000
1.000000 1.000000 0.000000 60.000000 36.000000 3.000000 1.000000 3.000000 1.000000 3.000000 3.000000 2.000000 1.000000 1.000000 0.000000 3.000000 4.000000 26.000000 72.000000 2.000000 1.000000 1.000000
2.000000 1.000000 37.900000 72.000000 0.000000 1.000000 1.000000 5.000000 2.000000 3.000000 3.000000 1.000000 1.000000 3.000000 2.000000 3.000000 4.000000 58.000000 74.000000 1.000000 2.000000 1.000000
2.000000 1.000000 38.400000 54.000000 24.000000 1.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 2.000000 1.000000 0.000000 3.000000 2.000000 49.000000 7.200000 1.000000 0.000000 1.000000
2.000000 1.000000 0.000000 52.000000 16.000000 1.000000 0.000000 3.000000 1.000000 0.000000 0.000000 0.000000 2.000000 3.000000 5.500000 0.000000 0.000000 55.000000 7.200000 0.000000 0.000000 1.000000
2.000000 1.000000 38.000000 48.000000 12.000000 1.000000 1.000000 1.000000 1.000000 1.000000 3.000000 0.000000 1.000000 1.000000 0.000000 3.000000 2.000000 42.000000 6.300000 2.000000 4.100000 1.000000
2.000000 1.000000 37.000000 60.000000 20.000000 3.000000 0.000000 0.000000 1.000000 3.000000 0.000000 3.000000 2.000000 2.000000 4.500000 4.000000 4.000000 43.000000 7.600000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.800000 48.000000 28.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 2.000000 0.000000 0.000000 1.000000 1.000000 46.000000 5.900000 2.000000 7.000000 1.000000
1.000000 1.000000 37.700000 56.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.100000 52.000000 24.000000 1.000000 1.000000 5.000000 1.000000 4.000000 3.000000 1.000000 2.000000 3.000000 7.000000 1.000000 0.000000 54.000000 7.500000 2.000000 2.600000 -1.000000
1.000000 9.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 37.000000 4.900000 0.000000 0.000000 -1.000000
1.000000 9.000000 39.700000 100.000000 0.000000 3.000000 3.000000 5.000000 2.000000 2.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 48.000000 57.000000 2.000000 2.000000 -1.000000
1.000000 1.000000 37.600000 38.000000 20.000000 3.000000 3.000000 1.000000 1.000000 3.000000 3.000000 2.000000 0.000000 0.000000 0.000000 3.000000 0.000000 37.000000 68.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.700000 52.000000 20.000000 2.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 1.000000 33.000000 77.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 3.000000 3.000000 3.000000 3.000000 5.000000 3.000000 3.000000 3.000000 2.000000 0.000000 4.000000 5.000000 46.000000 5.900000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.500000 96.000000 18.000000 1.000000 3.000000 6.000000 2.000000 3.000000 4.000000 2.000000 2.000000 3.000000 5.000000 0.000000 4.000000 69.000000 8.900000 3.000000 0.000000 1.000000
1.000000 1.000000 36.400000 98.000000 35.000000 3.000000 3.000000 4.000000 1.000000 4.000000 3.000000 2.000000 0.000000 0.000000 0.000000 4.000000 4.000000 47.000000 6.400000 3.000000 3.600000 -1.000000
1.000000 1.000000 37.300000 40.000000 0.000000 0.000000 3.000000 1.000000 1.000000 2.000000 3.000000 2.000000 3.000000 1.000000 0.000000 3.000000 5.000000 36.000000 0.000000 3.000000 2.000000 1.000000
1.000000 9.000000 38.100000 100.000000 80.000000 3.000000 1.000000 2.000000 1.000000 3.000000 4.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 36.000000 5.700000 0.000000 0.000000 1.000000
1.000000 1.000000 38.000000 0.000000 24.000000 3.000000 3.000000 6.000000 2.000000 5.000000 0.000000 4.000000 1.000000 1.000000 0.000000 0.000000 0.000000 68.000000 7.800000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.800000 60.000000 80.000000 1.000000 3.000000 2.000000 2.000000 2.000000 3.000000 3.000000 0.000000 2.000000 5.500000 4.000000 0.000000 40.000000 4.500000 2.000000 0.000000 1.000000
2.000000 1.000000 38.000000 54.000000 30.000000 2.000000 3.000000 3.000000 3.000000 3.000000 1.000000 2.000000 2.000000 2.000000 0.000000 0.000000 4.000000 45.000000 6.200000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 88.000000 40.000000 3.000000 3.000000 4.000000 2.000000 5.000000 4.000000 3.000000 3.000000 0.000000 0.000000 4.000000 5.000000 50.000000 7.700000 3.000000 1.400000 -1.000000
2.000000 1.000000 0.000000 40.000000 16.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 50.000000 7.000000 2.000000 3.900000 -1.000000
2.000000 1.000000 39.000000 64.000000 40.000000 1.000000 1.000000 5.000000 1.000000 3.000000 3.000000 2.000000 2.000000 1.000000 0.000000 3.000000 3.000000 42.000000 7.500000 2.000000 2.300000 1.000000
2.000000 1.000000 38.300000 42.000000 10.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 38.000000 61.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.000000 52.000000 16.000000 0.000000 0.000000 0.000000 0.000000 2.000000 0.000000 0.000000 0.000000 3.000000 1.000000 1.000000 1.000000 53.000000 86.000000 0.000000 0.000000 1.000000
2.000000 1.000000 40.300000 114.000000 36.000000 3.000000 3.000000 1.000000 2.000000 2.000000 3.000000 3.000000 2.000000 1.000000 7.000000 1.000000 5.000000 57.000000 8.100000 3.000000 4.500000 -1.000000
2.000000 1.000000 38.800000 50.000000 20.000000 3.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 0.000000 3.000000 1.000000 42.000000 6.200000 0.000000 0.000000 1.000000
2.000000 1.000000 0.000000 0.000000 0.000000 3.000000 3.000000 1.000000 1.000000 5.000000 3.000000 3.000000 1.000000 1.000000 0.000000 4.000000 5.000000 38.000000 6.500000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.500000 48.000000 30.000000 4.000000 1.000000 3.000000 1.000000 0.000000 2.000000 1.000000 1.000000 1.000000 0.000000 1.000000 1.000000 48.000000 8.600000 0.000000 0.000000 1.000000
1.000000 1.000000 37.300000 48.000000 20.000000 0.000000 1.000000 2.000000 1.000000 3.000000 3.000000 3.000000 2.000000 1.000000 0.000000 3.000000 5.000000 41.000000 69.000000 0.000000 0.000000 1.000000
2.000000 1.000000 0.000000 84.000000 36.000000 0.000000 0.000000 3.000000 1.000000 0.000000 3.000000 1.000000 2.000000 1.000000 0.000000 3.000000 2.000000 44.000000 8.500000 0.000000 0.000000 1.000000
1.000000 1.000000 38.100000 88.000000 32.000000 3.000000 3.000000 4.000000 1.000000 2.000000 3.000000 3.000000 0.000000 3.000000 1.000000 4.000000 5.000000 55.000000 60.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.700000 44.000000 40.000000 2.000000 1.000000 3.000000 1.000000 1.000000 3.000000 2.000000 1.000000 1.000000 0.000000 1.000000 5.000000 41.000000 60.000000 0.000000 0.000000 1.000000
2.000000 1.000000 39.600000 108.000000 51.000000 3.000000 3.000000 6.000000 2.000000 2.000000 4.000000 3.000000 1.000000 2.000000 0.000000 3.000000 5.000000 59.000000 8.000000 2.000000 2.600000 1.000000
1.000000 1.000000 38.200000 40.000000 16.000000 3.000000 3.000000 1.000000 1.000000 1.000000 3.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 34.000000 66.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 60.000000 20.000000 4.000000 3.000000 4.000000 2.000000 5.000000 4.000000 0.000000 0.000000 1.000000 0.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 38.300000 40.000000 16.000000 3.000000 0.000000 1.000000 1.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 37.000000 57.000000 0.000000 0.000000 1.000000
1.000000 9.000000 38.000000 140.000000 68.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 0.000000 0.000000 0.000000 2.000000 1.000000 39.000000 5.300000 0.000000 0.000000 1.000000
1.000000 1.000000 37.800000 52.000000 24.000000 1.000000 3.000000 3.000000 1.000000 4.000000 4.000000 1.000000 2.000000 3.000000 5.700000 2.000000 5.000000 48.000000 6.600000 1.000000 3.700000 -1.000000
1.000000 1.000000 0.000000 70.000000 36.000000 1.000000 0.000000 3.000000 2.000000 2.000000 3.000000 2.000000 2.000000 0.000000 0.000000 4.000000 5.000000 36.000000 7.300000 0.000000 0.000000 1.000000
1.000000 1.000000 38.300000 52.000000 96.000000 0.000000 3.000000 3.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 1.000000 0.000000 43.000000 6.100000 0.000000 0.000000 1.000000
2.000000 1.000000 37.300000 50.000000 32.000000 1.000000 1.000000 3.000000 1.000000 1.000000 3.000000 2.000000 0.000000 0.000000 0.000000 1.000000 0.000000 44.000000 7.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.700000 60.000000 32.000000 4.000000 3.000000 2.000000 2.000000 4.000000 4.000000 4.000000 0.000000 0.000000 0.000000 4.000000 5.000000 53.000000 64.000000 3.000000 2.000000 -1.000000
1.000000 9.000000 38.400000 84.000000 40.000000 3.000000 3.000000 2.000000 1.000000 3.000000 3.000000 3.000000 1.000000 1.000000 0.000000 0.000000 0.000000 36.000000 6.600000 2.000000 2.800000 -1.000000
1.000000 1.000000 0.000000 70.000000 16.000000 3.000000 4.000000 5.000000 2.000000 2.000000 3.000000 2.000000 2.000000 1.000000 0.000000 4.000000 5.000000 60.000000 7.500000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.300000 40.000000 16.000000 3.000000 0.000000 0.000000 1.000000 1.000000 3.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 38.000000 58.000000 1.000000 2.000000 1.000000
1.000000 1.000000 0.000000 40.000000 0.000000 2.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 1.000000 1.000000 0.000000 0.000000 5.000000 39.000000 56.000000 0.000000 0.000000 1.000000
1.000000 1.000000 36.800000 60.000000 28.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 10.000000 -1.000000
1.000000 1.000000 38.400000 44.000000 24.000000 3.000000 0.000000 4.000000 0.000000 5.000000 4.000000 3.000000 2.000000 1.000000 0.000000 4.000000 5.000000 50.000000 77.000000 0.000000 0.000000 1.000000
2.000000 1.000000 0.000000 0.000000 40.000000 3.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 45.000000 70.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.000000 44.000000 12.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 3.000000 2.000000 1.000000 0.000000 4.000000 5.000000 42.000000 65.000000 0.000000 0.000000 1.000000
2.000000 1.000000 39.500000 0.000000 0.000000 3.000000 3.000000 4.000000 2.000000 3.000000 4.000000 3.000000 0.000000 3.000000 5.500000 4.000000 5.000000 0.000000 6.700000 1.000000 0.000000 -1.000000
1.000000 1.000000 36.500000 78.000000 30.000000 1.000000 0.000000 1.000000 1.000000 5.000000 3.000000 1.000000 0.000000 1.000000 0.000000 0.000000 0.000000 34.000000 75.000000 2.000000 1.000000 1.000000
2.000000 1.000000 38.100000 56.000000 20.000000 2.000000 1.000000 2.000000 1.000000 1.000000 3.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 46.000000 70.000000 0.000000 0.000000 1.000000
1.000000 1.000000 39.400000 54.000000 66.000000 1.000000 1.000000 2.000000 1.000000 2.000000 3.000000 2.000000 1.000000 1.000000 0.000000 3.000000 4.000000 39.000000 6.000000 2.000000 0.000000 1.000000
1.000000 1.000000 38.300000 80.000000 40.000000 0.000000 0.000000 6.000000 2.000000 4.000000 3.000000 1.000000 0.000000 2.000000 0.000000 1.000000 4.000000 67.000000 10.200000 2.000000 1.000000 -1.000000
2.000000 1.000000 38.700000 40.000000 28.000000 2.000000 1.000000 1.000000 1.000000 3.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 39.000000 62.000000 1.000000 1.000000 1.000000
1.000000 1.000000 38.200000 64.000000 24.000000 1.000000 1.000000 3.000000 1.000000 4.000000 4.000000 3.000000 2.000000 1.000000 0.000000 4.000000 4.000000 45.000000 7.500000 1.000000 2.000000 -1.000000
2.000000 1.000000 37.600000 48.000000 20.000000 3.000000 1.000000 4.000000 1.000000 1.000000 1.000000 3.000000 2.000000 1.000000 0.000000 1.000000 1.000000 37.000000 5.500000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.000000 42.000000 68.000000 4.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 2.000000 2.000000 0.000000 4.000000 4.000000 41.000000 7.600000 0.000000 0.000000 1.000000
1.000000 1.000000 38.700000 0.000000 0.000000 3.000000 1.000000 3.000000 1.000000 5.000000 4.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 33.000000 6.500000 2.000000 0.000000 1.000000
1.000000 1.000000 37.400000 50.000000 32.000000 3.000000 3.000000 0.000000 1.000000 4.000000 4.000000 1.000000 2.000000 1.000000 0.000000 1.000000 0.000000 45.000000 7.900000 2.000000 1.000000 1.000000
1.000000 1.000000 37.400000 84.000000 20.000000 0.000000 0.000000 3.000000 1.000000 2.000000 3.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 31.000000 61.000000 0.000000 1.000000 -1.000000
1.000000 1.000000 38.400000 49.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 1.000000 2.000000 1.000000 0.000000 0.000000 0.000000 44.000000 7.600000 0.000000 0.000000 1.000000
1.000000 1.000000 37.800000 30.000000 12.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.600000 88.000000 36.000000 3.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 1.000000 3.000000 1.500000 0.000000 0.000000 44.000000 6.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.900000 40.000000 24.000000 1.000000 1.000000 1.000000 1.000000 2.000000 3.000000 1.000000 0.000000 0.000000 0.000000 0.000000 3.000000 40.000000 5.700000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 100.000000 0.000000 3.000000 0.000000 4.000000 2.000000 5.000000 4.000000 0.000000 2.000000 0.000000 0.000000 2.000000 0.000000 59.000000 6.300000 0.000000 0.000000 -1.000000
1.000000 9.000000 38.100000 136.000000 48.000000 3.000000 3.000000 3.000000 1.000000 5.000000 1.000000 3.000000 2.000000 2.000000 4.400000 2.000000 0.000000 33.000000 4.900000 2.000000 2.900000 -1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 3.000000 3.000000 3.000000 2.000000 5.000000 3.000000 3.000000 3.000000 2.000000 0.000000 4.000000 5.000000 46.000000 5.900000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.000000 48.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 4.000000 2.000000 2.000000 0.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.000000 56.000000 0.000000 1.000000 2.000000 3.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 1.000000 42.000000 71.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.000000 60.000000 32.000000 1.000000 1.000000 0.000000 1.000000 3.000000 3.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 50.000000 7.000000 1.000000 1.000000 1.000000
1.000000 1.000000 38.100000 44.000000 9.000000 3.000000 1.000000 1.000000 1.000000 2.000000 2.000000 1.000000 1.000000 1.000000 0.000000 4.000000 5.000000 31.000000 7.300000 0.000000 0.000000 1.000000
2.000000 1.000000 36.000000 42.000000 30.000000 0.000000 0.000000 5.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 64.000000 6.800000 0.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 120.000000 0.000000 4.000000 3.000000 6.000000 2.000000 5.000000 4.000000 4.000000 0.000000 0.000000 0.000000 4.000000 5.000000 57.000000 4.500000 3.000000 3.900000 -1.000000
1.000000 1.000000 37.800000 48.000000 28.000000 1.000000 1.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 0.000000 0.000000 1.000000 1.000000 46.000000 5.900000 2.000000 7.000000 1.000000
1.000000 1.000000 37.100000 84.000000 40.000000 3.000000 3.000000 6.000000 1.000000 2.000000 4.000000 4.000000 3.000000 2.000000 2.000000 4.000000 5.000000 75.000000 81.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 0.000000 80.000000 32.000000 3.000000 3.000000 2.000000 1.000000 2.000000 3.000000 3.000000 2.000000 1.000000 0.000000 3.000000 0.000000 50.000000 80.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.200000 48.000000 0.000000 1.000000 3.000000 3.000000 1.000000 3.000000 4.000000 4.000000 1.000000 3.000000 2.000000 4.000000 5.000000 42.000000 71.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.000000 44.000000 12.000000 2.000000 1.000000 3.000000 1.000000 3.000000 4.000000 3.000000 1.000000 2.000000 6.500000 1.000000 4.000000 33.000000 6.500000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.300000 132.000000 0.000000 0.000000 3.000000 6.000000 2.000000 2.000000 4.000000 2.000000 2.000000 3.000000 6.200000 4.000000 4.000000 57.000000 8.000000 0.000000 5.200000 1.000000
2.000000 1.000000 38.700000 48.000000 24.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 1.000000 1.000000 0.000000 1.000000 0.000000 34.000000 63.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.900000 44.000000 14.000000 3.000000 1.000000 1.000000 1.000000 2.000000 3.000000 2.000000 0.000000 0.000000 0.000000 0.000000 2.000000 33.000000 64.000000 0.000000 0.000000 1.000000
1.000000 1.000000 39.300000 0.000000 0.000000 4.000000 3.000000 6.000000 2.000000 4.000000 4.000000 2.000000 1.000000 3.000000 4.000000 4.000000 4.000000 75.000000 0.000000 3.000000 4.300000 -1.000000
1.000000 1.000000 0.000000 100.000000 0.000000 3.000000 3.000000 4.000000 2.000000 0.000000 4.000000 4.000000 2.000000 1.000000 2.000000 0.000000 0.000000 68.000000 64.000000 3.000000 2.000000 1.000000
2.000000 1.000000 38.600000 48.000000 20.000000 3.000000 1.000000 1.000000 1.000000 1.000000 3.000000 2.000000 2.000000 1.000000 0.000000 3.000000 2.000000 50.000000 7.300000 1.000000 0.000000 1.000000
2.000000 1.000000 38.800000 48.000000 40.000000 1.000000 1.000000 3.000000 1.000000 3.000000 3.000000 4.000000 2.000000 0.000000 0.000000 0.000000 5.000000 41.000000 65.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.000000 48.000000 20.000000 3.000000 3.000000 4.000000 1.000000 1.000000 4.000000 2.000000 2.000000 0.000000 5.000000 0.000000 2.000000 49.000000 8.300000 1.000000 0.000000 1.000000
2.000000 1.000000 38.600000 52.000000 20.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 2.000000 1.000000 1.000000 0.000000 1.000000 3.000000 36.000000 6.600000 1.000000 5.000000 1.000000
1.000000 1.000000 37.800000 60.000000 24.000000 1.000000 0.000000 3.000000 2.000000 0.000000 4.000000 4.000000 2.000000 3.000000 2.000000 0.000000 5.000000 52.000000 75.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 38.000000 42.000000 40.000000 3.000000 1.000000 1.000000 1.000000 3.000000 3.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
2.000000 1.000000 0.000000 0.000000 12.000000 1.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 3.000000 1.000000 0.000000 1.000000 3.000000 44.000000 7.500000 2.000000 0.000000 1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 5.000000 35.000000 58.000000 2.000000 1.000000 1.000000
1.000000 1.000000 38.300000 42.000000 24.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 40.000000 8.500000 0.000000 0.000000 -1.000000
2.000000 1.000000 39.500000 60.000000 10.000000 3.000000 0.000000 0.000000 2.000000 3.000000 3.000000 2.000000 2.000000 1.000000 0.000000 3.000000 0.000000 38.000000 56.000000 1.000000 0.000000 1.000000
1.000000 1.000000 38.000000 66.000000 20.000000 1.000000 3.000000 3.000000 1.000000 5.000000 3.000000 1.000000 1.000000 1.000000 0.000000 3.000000 0.000000 46.000000 46.000000 3.000000 2.000000 -1.000000
1.000000 1.000000 38.700000 76.000000 0.000000 1.000000 1.000000 5.000000 2.000000 3.000000 3.000000 2.000000 2.000000 2.000000 0.000000 4.000000 4.000000 50.000000 8.000000 0.000000 0.000000 1.000000
1.000000 1.000000 39.400000 120.000000 48.000000 0.000000 0.000000 5.000000 1.000000 0.000000 3.000000 3.000000 1.000000 0.000000 0.000000 4.000000 0.000000 56.000000 64.000000 1.000000 2.000000 -1.000000
1.000000 1.000000 38.300000 40.000000 18.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 1.000000 0.000000 0.000000 0.000000 2.000000 1.000000 43.000000 5.900000 1.000000 0.000000 1.000000
2.000000 1.000000 0.000000 44.000000 24.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 1.000000 2.000000 1.000000 0.000000 0.000000 1.000000 0.000000 6.300000 0.000000 0.000000 1.000000
1.000000 1.000000 38.400000 104.000000 40.000000 1.000000 1.000000 3.000000 1.000000 2.000000 4.000000 2.000000 2.000000 3.000000 6.500000 0.000000 4.000000 55.000000 8.500000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 65.000000 24.000000 0.000000 0.000000 0.000000 2.000000 5.000000 0.000000 4.000000 3.000000 1.000000 0.000000 0.000000 5.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.500000 44.000000 20.000000 1.000000 1.000000 3.000000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 35.000000 7.200000 0.000000 0.000000 1.000000
2.000000 1.000000 39.000000 86.000000 16.000000 3.000000 3.000000 5.000000 0.000000 3.000000 3.000000 3.000000 0.000000 2.000000 0.000000 0.000000 0.000000 68.000000 5.800000 3.000000 6.000000 -1.000000
1.000000 1.000000 38.500000 129.000000 48.000000 3.000000 3.000000 3.000000 1.000000 2.000000 4.000000 3.000000 1.000000 3.000000 2.000000 0.000000 0.000000 57.000000 66.000000 3.000000 2.000000 1.000000
1.000000 1.000000 0.000000 104.000000 0.000000 3.000000 3.000000 5.000000 2.000000 2.000000 4.000000 3.000000 0.000000 3.000000 0.000000 4.000000 4.000000 69.000000 8.600000 2.000000 3.400000 -1.000000
2.000000 1.000000 0.000000 0.000000 0.000000 3.000000 4.000000 6.000000 0.000000 4.000000 0.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.200000 60.000000 30.000000 1.000000 1.000000 3.000000 1.000000 3.000000 3.000000 1.000000 2.000000 1.000000 0.000000 3.000000 2.000000 48.000000 66.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 68.000000 14.000000 0.000000 0.000000 4.000000 1.000000 4.000000 0.000000 0.000000 0.000000 1.000000 4.300000 0.000000 0.000000 0.000000 0.000000 2.000000 2.800000 -1.000000
1.000000 1.000000 0.000000 60.000000 30.000000 3.000000 3.000000 4.000000 2.000000 5.000000 4.000000 4.000000 1.000000 1.000000 0.000000 4.000000 0.000000 45.000000 70.000000 3.000000 2.000000 1.000000
2.000000 1.000000 38.500000 100.000000 0.000000 3.000000 3.000000 5.000000 2.000000 4.000000 3.000000 4.000000 2.000000 1.000000 0.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.400000 84.000000 30.000000 3.000000 1.000000 5.000000 2.000000 4.000000 3.000000 3.000000 2.000000 3.000000 6.500000 4.000000 4.000000 47.000000 7.500000 3.000000 0.000000 -1.000000
2.000000 1.000000 37.800000 48.000000 14.000000 0.000000 0.000000 1.000000 1.000000 3.000000 0.000000 2.000000 1.000000 3.000000 5.300000 1.000000 0.000000 35.000000 7.500000 0.000000 0.000000 1.000000
1.000000 1.000000 38.000000 0.000000 24.000000 3.000000 3.000000 6.000000 2.000000 5.000000 0.000000 4.000000 1.000000 1.000000 0.000000 0.000000 0.000000 68.000000 7.800000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.800000 56.000000 16.000000 1.000000 1.000000 2.000000 1.000000 2.000000 1.000000 1.000000 2.000000 1.000000 0.000000 1.000000 0.000000 44.000000 68.000000 1.000000 1.000000 1.000000
2.000000 1.000000 38.200000 68.000000 32.000000 2.000000 2.000000 2.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 0.000000 1.000000 1.000000 43.000000 65.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.500000 120.000000 60.000000 4.000000 3.000000 6.000000 2.000000 0.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 54.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 39.300000 64.000000 90.000000 2.000000 3.000000 1.000000 1.000000 0.000000 3.000000 1.000000 1.000000 2.000000 0.000000 0.000000 0.000000 39.000000 6.700000 0.000000 0.000000 1.000000
1.000000 1.000000 38.400000 80.000000 30.000000 4.000000 3.000000 1.000000 1.000000 3.000000 3.000000 3.000000 3.000000 3.000000 0.000000 4.000000 5.000000 32.000000 6.100000 3.000000 4.300000 1.000000
1.000000 1.000000 38.500000 60.000000 0.000000 1.000000 1.000000 0.000000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 33.000000 53.000000 1.000000 0.000000 1.000000
1.000000 1.000000 38.300000 60.000000 16.000000 3.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 2.000000 2.000000 3.000000 1.000000 4.000000 30.000000 6.000000 1.000000 3.000000 1.000000
1.000000 1.000000 37.100000 40.000000 8.000000 0.000000 1.000000 4.000000 1.000000 3.000000 3.000000 1.000000 1.000000 1.000000 0.000000 3.000000 3.000000 23.000000 6.700000 3.000000 0.000000 1.000000
2.000000 9.000000 0.000000 100.000000 44.000000 2.000000 1.000000 1.000000 1.000000 4.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 37.000000 4.700000 0.000000 0.000000 1.000000
1.000000 1.000000 38.200000 48.000000 18.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 3.000000 1.000000 2.000000 0.000000 4.000000 0.000000 48.000000 74.000000 1.000000 2.000000 1.000000
1.000000 1.000000 0.000000 60.000000 48.000000 3.000000 3.000000 4.000000 2.000000 4.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 58.000000 7.600000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.900000 88.000000 24.000000 1.000000 1.000000 2.000000 1.000000 2.000000 2.000000 1.000000 0.000000 0.000000 0.000000 4.000000 1.000000 37.000000 56.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.000000 44.000000 12.000000 3.000000 1.000000 1.000000 0.000000 0.000000 1.000000 2.000000 0.000000 0.000000 0.000000 1.000000 0.000000 42.000000 64.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.500000 60.000000 20.000000 1.000000 1.000000 5.000000 2.000000 2.000000 2.000000 1.000000 2.000000 1.000000 0.000000 2.000000 3.000000 63.000000 7.500000 2.000000 2.300000 -1.000000
2.000000 1.000000 38.500000 96.000000 36.000000 3.000000 3.000000 0.000000 2.000000 2.000000 4.000000 2.000000 1.000000 2.000000 0.000000 4.000000 5.000000 70.000000 8.500000 0.000000 0.000000 -1.000000
2.000000 1.000000 38.300000 60.000000 20.000000 1.000000 1.000000 1.000000 2.000000 1.000000 3.000000 1.000000 0.000000 0.000000 0.000000 3.000000 0.000000 34.000000 66.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.500000 60.000000 40.000000 3.000000 1.000000 2.000000 1.000000 2.000000 1.000000 2.000000 0.000000 0.000000 0.000000 3.000000 2.000000 49.000000 59.000000 0.000000 0.000000 1.000000
1.000000 1.000000 37.300000 48.000000 12.000000 1.000000 0.000000 3.000000 1.000000 3.000000 1.000000 3.000000 2.000000 1.000000 0.000000 3.000000 3.000000 40.000000 6.600000 2.000000 0.000000 1.000000
1.000000 1.000000 38.500000 86.000000 0.000000 1.000000 1.000000 3.000000 1.000000 4.000000 4.000000 3.000000 2.000000 1.000000 0.000000 3.000000 5.000000 45.000000 7.400000 1.000000 3.400000 -1.000000
1.000000 1.000000 37.500000 48.000000 40.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 5.000000 41.000000 55.000000 3.000000 2.000000 -1.000000
2.000000 1.000000 37.200000 36.000000 9.000000 1.000000 1.000000 1.000000 1.000000 2.000000 3.000000 1.000000 2.000000 1.000000 0.000000 4.000000 1.000000 35.000000 5.700000 0.000000 0.000000 1.000000
1.000000 1.000000 39.200000 0.000000 23.000000 3.000000 1.000000 3.000000 1.000000 4.000000 4.000000 2.000000 2.000000 0.000000 0.000000 0.000000 0.000000 36.000000 6.600000 1.000000 3.000000 1.000000
2.000000 1.000000 38.500000 100.000000 0.000000 3.000000 3.000000 5.000000 2.000000 4.000000 3.000000 4.000000 2.000000 1.000000 0.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.500000 96.000000 30.000000 2.000000 3.000000 4.000000 2.000000 4.000000 4.000000 3.000000 2.000000 1.000000 0.000000 3.000000 5.000000 50.000000 65.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 45.000000 8.700000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.800000 88.000000 80.000000 3.000000 3.000000 5.000000 2.000000 0.000000 3.000000 3.000000 2.000000 3.000000 0.000000 4.000000 5.000000 64.000000 89.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.500000 44.000000 10.000000 3.000000 1.000000 1.000000 1.000000 3.000000 1.000000 2.000000 2.000000 0.000000 0.000000 3.000000 3.000000 43.000000 51.000000 1.000000 1.000000 1.000000
1.000000 1.000000 37.900000 68.000000 20.000000 0.000000 1.000000 2.000000 1.000000 2.000000 4.000000 2.000000 0.000000 0.000000 0.000000 1.000000 5.000000 45.000000 4.000000 3.000000 2.800000 -1.000000
1.000000 1.000000 38.000000 86.000000 24.000000 4.000000 3.000000 4.000000 1.000000 2.000000 4.000000 4.000000 1.000000 1.000000 0.000000 4.000000 5.000000 45.000000 5.500000 1.000000 10.100000 -1.000000
1.000000 9.000000 38.900000 120.000000 30.000000 1.000000 3.000000 2.000000 2.000000 3.000000 3.000000 3.000000 3.000000 1.000000 3.000000 0.000000 0.000000 47.000000 6.300000 1.000000 0.000000 1.000000
1.000000 1.000000 37.600000 45.000000 12.000000 3.000000 1.000000 3.000000 1.000000 0.000000 2.000000 2.000000 2.000000 1.000000 0.000000 1.000000 4.000000 39.000000 7.000000 2.000000 1.500000 1.000000
2.000000 1.000000 38.600000 56.000000 32.000000 2.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 0.000000 0.000000 2.000000 0.000000 40.000000 7.000000 2.000000 2.100000 1.000000
1.000000 1.000000 37.800000 40.000000 12.000000 1.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 2.000000 1.000000 0.000000 1.000000 2.000000 38.000000 7.000000 0.000000 0.000000 1.000000
2.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.000000 76.000000 18.000000 0.000000 0.000000 0.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 71.000000 11.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.100000 40.000000 36.000000 1.000000 2.000000 2.000000 1.000000 2.000000 2.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 52.000000 28.000000 3.000000 3.000000 4.000000 1.000000 3.000000 4.000000 3.000000 2.000000 1.000000 0.000000 4.000000 4.000000 37.000000 8.100000 0.000000 0.000000 1.000000
1.000000 1.000000 39.200000 88.000000 58.000000 4.000000 4.000000 0.000000 2.000000 5.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.000000 2.000000 -1.000000
1.000000 1.000000 38.500000 92.000000 40.000000 4.000000 3.000000 0.000000 1.000000 2.000000 4.000000 3.000000 0.000000 0.000000 0.000000 4.000000 0.000000 46.000000 67.000000 2.000000 2.000000 1.000000
1.000000 1.000000 0.000000 112.000000 13.000000 4.000000 4.000000 4.000000 1.000000 2.000000 3.000000 1.000000 2.000000 1.000000 4.500000 4.000000 4.000000 60.000000 6.300000 3.000000 0.000000 1.000000
1.000000 1.000000 37.700000 66.000000 12.000000 1.000000 1.000000 3.000000 1.000000 3.000000 3.000000 2.000000 2.000000 0.000000 0.000000 4.000000 4.000000 31.500000 6.200000 2.000000 1.600000 1.000000
1.000000 1.000000 38.800000 50.000000 14.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 1.000000 1.000000 1.000000 0.000000 3.000000 5.000000 38.000000 58.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.400000 54.000000 24.000000 1.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 2.000000 1.000000 0.000000 3.000000 2.000000 49.000000 7.200000 1.000000 8.000000 1.000000
1.000000 1.000000 39.200000 120.000000 20.000000 4.000000 3.000000 5.000000 2.000000 2.000000 3.000000 3.000000 1.000000 3.000000 0.000000 0.000000 4.000000 60.000000 8.800000 3.000000 0.000000 -1.000000
1.000000 9.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 45.000000 6.500000 2.000000 0.000000 1.000000
1.000000 1.000000 37.300000 90.000000 40.000000 3.000000 0.000000 6.000000 2.000000 5.000000 4.000000 3.000000 2.000000 2.000000 0.000000 1.000000 5.000000 65.000000 50.000000 3.000000 2.000000 -1.000000
1.000000 9.000000 38.500000 120.000000 70.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 2.000000 0.000000 0.000000 1.000000 0.000000 35.000000 54.000000 1.000000 1.000000 1.000000
1.000000 1.000000 38.500000 104.000000 40.000000 3.000000 3.000000 0.000000 1.000000 4.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
2.000000 1.000000 39.500000 92.000000 28.000000 3.000000 3.000000 6.000000 1.000000 5.000000 4.000000 1.000000 0.000000 3.000000 0.000000 4.000000 0.000000 72.000000 6.400000 0.000000 3.600000 -1.000000
1.000000 1.000000 38.500000 30.000000 18.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 40.000000 7.700000 0.000000 0.000000 1.000000
1.000000 1.000000 38.300000 72.000000 30.000000 4.000000 3.000000 3.000000 2.000000 3.000000 3.000000 3.000000 2.000000 1.000000 0.000000 3.000000 5.000000 43.000000 7.000000 2.000000 3.900000 1.000000
2.000000 1.000000 37.500000 48.000000 30.000000 4.000000 1.000000 3.000000 1.000000 0.000000 2.000000 1.000000 1.000000 1.000000 0.000000 1.000000 1.000000 48.000000 8.600000 0.000000 0.000000 1.000000
1.000000 1.000000 38.100000 52.000000 24.000000 1.000000 1.000000 5.000000 1.000000 4.000000 3.000000 1.000000 2.000000 3.000000 7.000000 1.000000 0.000000 54.000000 7.500000 2.000000 2.600000 -1.000000
2.000000 1.000000 38.200000 42.000000 26.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 2.000000 0.000000 0.000000 0.000000 1.000000 0.000000 36.000000 6.900000 0.000000 0.000000 1.000000
2.000000 1.000000 37.900000 54.000000 42.000000 2.000000 1.000000 5.000000 1.000000 3.000000 1.000000 1.000000 0.000000 1.000000 0.000000 0.000000 2.000000 47.000000 54.000000 3.000000 1.000000 1.000000
2.000000 1.000000 36.100000 88.000000 0.000000 3.000000 3.000000 3.000000 1.000000 3.000000 3.000000 2.000000 2.000000 3.000000 0.000000 0.000000 4.000000 45.000000 7.000000 3.000000 4.800000 -1.000000
1.000000 1.000000 38.100000 70.000000 22.000000 0.000000 1.000000 0.000000 1.000000 5.000000 3.000000 0.000000 0.000000 0.000000 0.000000 0.000000 5.000000 36.000000 65.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.000000 90.000000 30.000000 4.000000 3.000000 4.000000 2.000000 5.000000 4.000000 4.000000 0.000000 0.000000 0.000000 4.000000 5.000000 55.000000 6.100000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.200000 52.000000 16.000000 1.000000 1.000000 2.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 43.000000 8.100000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 36.000000 32.000000 1.000000 1.000000 4.000000 1.000000 5.000000 3.000000 3.000000 2.000000 3.000000 4.000000 0.000000 4.000000 41.000000 5.900000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.400000 92.000000 20.000000 1.000000 0.000000 0.000000 2.000000 0.000000 3.000000 3.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 9.000000 38.200000 124.000000 88.000000 1.000000 3.000000 2.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 47.000000 8.000000 1.000000 0.000000 1.000000
2.000000 1.000000 0.000000 96.000000 0.000000 3.000000 3.000000 3.000000 2.000000 5.000000 4.000000 4.000000 0.000000 1.000000 0.000000 4.000000 5.000000 60.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.600000 68.000000 32.000000 3.000000 0.000000 3.000000 1.000000 4.000000 2.000000 4.000000 2.000000 2.000000 6.500000 1.000000 5.000000 47.000000 7.200000 1.000000 0.000000 1.000000
1.000000 1.000000 38.100000 88.000000 24.000000 3.000000 3.000000 4.000000 1.000000 5.000000 4.000000 3.000000 2.000000 1.000000 0.000000 3.000000 4.000000 41.000000 4.600000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.000000 108.000000 60.000000 2.000000 3.000000 4.000000 1.000000 4.000000 3.000000 3.000000 2.000000 0.000000 0.000000 3.000000 4.000000 0.000000 0.000000 3.000000 0.000000 1.000000
2.000000 1.000000 38.200000 48.000000 0.000000 2.000000 0.000000 1.000000 2.000000 3.000000 3.000000 1.000000 2.000000 1.000000 0.000000 0.000000 2.000000 34.000000 6.600000 0.000000 0.000000 1.000000
1.000000 1.000000 39.300000 100.000000 51.000000 4.000000 4.000000 6.000000 1.000000 2.000000 4.000000 1.000000 1.000000 3.000000 2.000000 0.000000 4.000000 66.000000 13.000000 3.000000 2.000000 -1.000000
2.000000 1.000000 36.600000 42.000000 18.000000 3.000000 3.000000 2.000000 1.000000 1.000000 4.000000 1.000000 1.000000 1.000000 0.000000 0.000000 5.000000 52.000000 7.100000 0.000000 0.000000 -1.000000
1.000000 9.000000 38.800000 124.000000 36.000000 3.000000 1.000000 2.000000 1.000000 2.000000 3.000000 4.000000 1.000000 1.000000 0.000000 4.000000 4.000000 50.000000 7.600000 3.000000 0.000000 -1.000000
2.000000 1.000000 0.000000 112.000000 24.000000 3.000000 3.000000 4.000000 2.000000 5.000000 4.000000 2.000000 0.000000 0.000000 0.000000 4.000000 0.000000 40.000000 5.300000 3.000000 2.600000 1.000000
1.000000 1.000000 0.000000 80.000000 0.000000 3.000000 3.000000 3.000000 1.000000 4.000000 4.000000 4.000000 0.000000 0.000000 0.000000 4.000000 5.000000 43.000000 70.000000 0.000000 0.000000 1.000000
1.000000 9.000000 38.800000 184.000000 84.000000 1.000000 0.000000 1.000000 1.000000 4.000000 1.000000 3.000000 0.000000 0.000000 0.000000 2.000000 0.000000 33.000000 3.300000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.500000 72.000000 0.000000 2.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 35.000000 65.000000 2.000000 2.000000 -1.000000
1.000000 1.000000 38.700000 96.000000 28.000000 3.000000 3.000000 4.000000 1.000000 0.000000 4.000000 0.000000 0.000000 3.000000 7.500000 0.000000 0.000000 64.000000 9.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.500000 52.000000 12.000000 1.000000 1.000000 1.000000 1.000000 2.000000 3.000000 2.000000 2.000000 1.000000 0.000000 3.000000 5.000000 36.000000 61.000000 1.000000 1.000000 1.000000
1.000000 1.000000 40.800000 72.000000 42.000000 3.000000 3.000000 1.000000 1.000000 2.000000 3.000000 1.000000 2.000000 1.000000 0.000000 0.000000 0.000000 54.000000 7.400000 3.000000 0.000000 -1.000000
2.000000 1.000000 38.000000 40.000000 25.000000 0.000000 1.000000 1.000000 1.000000 4.000000 3.000000 2.000000 1.000000 1.000000 0.000000 4.000000 0.000000 37.000000 69.000000 0.000000 0.000000 1.000000
2.000000 1.000000 38.400000 48.000000 16.000000 2.000000 1.000000 1.000000 1.000000 1.000000 0.000000 2.000000 2.000000 1.000000 0.000000 0.000000 2.000000 39.000000 6.500000 0.000000 0.000000 1.000000
2.000000 9.000000 38.600000 88.000000 28.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 35.000000 5.900000 0.000000 0.000000 1.000000
1.000000 1.000000 37.100000 75.000000 36.000000 0.000000 0.000000 3.000000 2.000000 4.000000 4.000000 2.000000 2.000000 3.000000 5.000000 4.000000 4.000000 48.000000 7.400000 3.000000 3.200000 -1.000000
1.000000 1.000000 38.300000 44.000000 21.000000 3.000000 1.000000 2.000000 1.000000 3.000000 3.000000 3.000000 2.000000 1.000000 0.000000 1.000000 5.000000 44.000000 6.500000 2.000000 4.400000 1.000000
2.000000 1.000000 0.000000 56.000000 68.000000 3.000000 1.000000 1.000000 1.000000 3.000000 3.000000 1.000000 2.000000 1.000000 0.000000 1.000000 0.000000 40.000000 6.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 38.600000 68.000000 20.000000 2.000000 1.000000 3.000000 1.000000 3.000000 3.000000 2.000000 1.000000 1.000000 0.000000 1.000000 5.000000 38.000000 6.500000 1.000000 0.000000 1.000000
2.000000 1.000000 38.300000 54.000000 18.000000 3.000000 1.000000 2.000000 1.000000 2.000000 3.000000 2.000000 0.000000 3.000000 5.400000 0.000000 4.000000 44.000000 7.200000 3.000000 0.000000 1.000000
1.000000 1.000000 38.200000 42.000000 20.000000 0.000000 0.000000 1.000000 1.000000 0.000000 3.000000 0.000000 0.000000 0.000000 0.000000 3.000000 0.000000 47.000000 60.000000 0.000000 0.000000 1.000000
1.000000 1.000000 39.300000 64.000000 90.000000 2.000000 3.000000 1.000000 1.000000 0.000000 3.000000 1.000000 1.000000 2.000000 6.500000 1.000000 5.000000 39.000000 6.700000 0.000000 0.000000 1.000000
1.000000 1.000000 37.500000 60.000000 50.000000 3.000000 3.000000 1.000000 1.000000 3.000000 3.000000 2.000000 2.000000 2.000000 3.500000 3.000000 4.000000 35.000000 6.500000 0.000000 0.000000 -1.000000
1.000000 1.000000 37.700000 80.000000 0.000000 3.000000 3.000000 6.000000 1.000000 5.000000 4.000000 1.000000 2.000000 3.000000 0.000000 3.000000 1.000000 50.000000 55.000000 3.000000 2.000000 1.000000
1.000000 1.000000 0.000000 100.000000 30.000000 3.000000 3.000000 4.000000 2.000000 5.000000 4.000000 4.000000 3.000000 3.000000 0.000000 4.000000 4.000000 52.000000 6.600000 0.000000 0.000000 1.000000
1.000000 1.000000 37.700000 120.000000 28.000000 3.000000 3.000000 3.000000 1.000000 5.000000 3.000000 3.000000 1.000000 1.000000 0.000000 0.000000 0.000000 65.000000 7.000000 3.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 76.000000 0.000000 0.000000 3.000000 0.000000 0.000000 0.000000 4.000000 4.000000 0.000000 0.000000 0.000000 0.000000 5.000000 0.000000 0.000000 0.000000 0.000000 -1.000000
1.000000 9.000000 38.800000 150.000000 50.000000 1.000000 3.000000 6.000000 2.000000 5.000000 3.000000 2.000000 1.000000 1.000000 0.000000 0.000000 0.000000 50.000000 6.200000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.000000 36.000000 16.000000 3.000000 1.000000 1.000000 1.000000 4.000000 2.000000 2.000000 3.000000 3.000000 2.000000 3.000000 0.000000 37.000000 75.000000 2.000000 1.000000 -1.000000
2.000000 1.000000 36.900000 50.000000 40.000000 2.000000 3.000000 3.000000 1.000000 1.000000 3.000000 2.000000 3.000000 1.000000 7.000000 0.000000 0.000000 37.500000 6.500000 0.000000 0.000000 1.000000
2.000000 1.000000 37.800000 40.000000 16.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 37.000000 6.800000 0.000000 0.000000 1.000000
2.000000 1.000000 38.200000 56.000000 40.000000 4.000000 3.000000 1.000000 1.000000 2.000000 4.000000 3.000000 2.000000 2.000000 7.500000 0.000000 0.000000 47.000000 7.200000 1.000000 2.500000 1.000000
1.000000 1.000000 38.600000 48.000000 12.000000 0.000000 0.000000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 36.000000 67.000000 0.000000 0.000000 1.000000
2.000000 1.000000 40.000000 78.000000 0.000000 3.000000 3.000000 5.000000 1.000000 2.000000 3.000000 1.000000 1.000000 1.000000 0.000000 4.000000 1.000000 66.000000 6.500000 0.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 70.000000 16.000000 3.000000 4.000000 5.000000 2.000000 2.000000 3.000000 2.000000 2.000000 1.000000 0.000000 4.000000 5.000000 60.000000 7.500000 0.000000 0.000000 -1.000000
1.000000 1.000000 38.200000 72.000000 18.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 35.000000 6.400000 0.000000 0.000000 1.000000
2.000000 1.000000 38.500000 54.000000 0.000000 1.000000 1.000000 1.000000 1.000000 3.000000 1.000000 1.000000 2.000000 1.000000 0.000000 1.000000 0.000000 40.000000 6.800000 2.000000 7.000000 1.000000
1.000000 1.000000 38.500000 66.000000 24.000000 1.000000 1.000000 1.000000 1.000000 3.000000 3.000000 1.000000 2.000000 1.000000 0.000000 4.000000 5.000000 40.000000 6.700000 1.000000 0.000000 1.000000
2.000000 1.000000 37.800000 82.000000 12.000000 3.000000 1.000000 1.000000 2.000000 4.000000 0.000000 3.000000 1.000000 3.000000 0.000000 0.000000 0.000000 50.000000 7.000000 0.000000 0.000000 -1.000000
2.000000 9.000000 39.500000 84.000000 30.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 28.000000 5.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.000000 50.000000 36.000000 0.000000 1.000000 1.000000 1.000000 3.000000 2.000000 2.000000 0.000000 0.000000 0.000000 3.000000 0.000000 39.000000 6.600000 1.000000 5.300000 1.000000
2.000000 1.000000 38.600000 45.000000 16.000000 2.000000 1.000000 2.000000 1.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 43.000000 58.000000 0.000000 0.000000 1.000000
1.000000 1.000000 38.900000 80.000000 44.000000 3.000000 3.000000 3.000000 1.000000 2.000000 3.000000 3.000000 2.000000 2.000000 7.000000 3.000000 1.000000 54.000000 6.500000 3.000000 0.000000 -1.000000
1.000000 1.000000 37.000000 66.000000 20.000000 1.000000 3.000000 2.000000 1.000000 4.000000 3.000000 3.000000 1.000000 0.000000 0.000000 1.000000 5.000000 35.000000 6.900000 2.000000 0.000000 -1.000000
1.000000 1.000000 0.000000 78.000000 24.000000 3.000000 3.000000 3.000000 1.000000 0.000000 3.000000 0.000000 2.000000 1.000000 0.000000 0.000000 4.000000 43.000000 62.000000 0.000000 2.000000 -1.000000
2.000000 1.000000 38.500000 40.000000 16.000000 1.000000 1.000000 1.000000 1.000000 2.000000 1.000000 1.000000 0.000000 0.000000 0.000000 3.000000 2.000000 37.000000 67.000000 0.000000 0.000000 1.000000
1.000000 1.000000 0.000000 120.000000 70.000000 4.000000 0.000000 4.000000 2.000000 2.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 5.000000 55.000000 65.000000 0.000000 0.000000 -1.000000
2.000000 1.000000 37.200000 72.000000 24.000000 3.000000 2.000000 4.000000 2.000000 4.000000 3.000000 3.000000 3.000000 1.000000 0.000000 4.000000 4.000000 44.000000 0.000000 3.000000 3.300000 -1.000000
1.000000 1.000000 37.500000 72.000000 30.000000 4.000000 3.000000 4.000000 1.000000 4.000000 4.000000 3.000000 2.000000 1.000000 0.000000 3.000000 5.000000 60.000000 6.800000 0.000000 0.000000 -1.000000
1.000000 1.000000 36.500000 100.000000 24.000000 3.000000 3.000000 3.000000 1.000000 3.000000 3.000000 3.000000 3.000000 1.000000 0.000000 4.000000 4.000000 50.000000 6.000000 3.000000 3.400000 1.000000
1.000000 1.000000 37.200000 40.000000 20.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4.000000 1.000000 36.000000 62.000000 1.000000 1.000000 -1.000000

View File

@@ -0,0 +1,47 @@
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_wine
from sklearn.model_selection import train_test_split,cross_val_score
from matplotlib import pyplot as plt
wine = load_wine()
wine.data
wine.target
Xtrain, Xtest, Ytrain, Ytest = train_test_split(wine.data,wine.target,test_size=0.3)
clf = DecisionTreeClassifier(random_state=0)
rfc = RandomForestClassifier(random_state=0)
clf = clf.fit(Xtrain,Ytrain)
rfc = rfc.fit(Xtrain,Ytrain)
score_c = clf.score(Xtest,Ytest)
score_r = rfc.score(Xtest,Ytest)
print("Single Tree:{}".format(score_c),"Random Forest:{}".format(score_r))
# rfc_l = []
# clf_l = []
# for i in range(10):
# rfc = RandomForestClassifier(n_estimators=25)
# rfc_s = cross_val_score(rfc,wine.data,wine.target,cv=10).mean()
# rfc_l.append(rfc_s)
# clf = DecisionTreeClassifier()
# clf_s = cross_val_score(clf,wine.data,wine.target,cv=10).mean()
# clf_l.append(clf_s)
# plt.plot(range(1,11),rfc_l,label = "Random Forest")
# plt.plot(range(1,11),clf_l,label = "Decision Tree")
# plt.legend()
# plt.show()
# superpa = []
# for i in range(200):
# rfc = RandomForestClassifier(n_estimators=i+1,n_jobs=-1)
# rfc_s = cross_val_score(rfc,wine.data,wine.target,cv=10).mean()
# superpa.append(rfc_s)
# print(max(superpa),superpa.index(max(superpa)))
# plt.figure(figsize=[20,5])
# plt.plot(range(1,201),superpa)
# plt.show()

View File

@@ -0,0 +1,74 @@
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.0-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python3",
"display_name": "Python 3.8.0 64-bit",
"metadata": {
"interpreter": {
"hash": "38740d3277777e2cd7c6c2cc9d8addf5118fdf3f82b1b39231fd12aeac8aee8b"
}
}
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"source": [
"## 命令模式\n",
"* 编辑模式\n",
" * Enter : 转入编辑模式\n",
" * Shift-Enter : 运行本单元,选中下个单元\n",
" * Ctrl-Enter : 运行本单元\n",
" * Alt-Enter : 运行本单元,在其下插入新单元\n",
" * Y : 单元转入代码状态\n",
" * M :单元转入markdown状态\n",
"* 选中\n",
" * Up : 选中上方单元\n",
" * K : 选中上方单元\n",
" * Down : 选中下方单元\n",
" * J : 选中下方单元\n",
" * Shift-K : 扩大选中上方单元\n",
" * Shift-J : 扩大选中下方单元\n",
"* 插入删除\n",
" * A : 在上方插入新单元\n",
" * B : 在下方插入新单元\n",
" * X : 剪切选中的单元\n",
" * C : 复制选中的单元\n",
" * Shift-V : 粘贴到上方单元\n",
" * V : 粘贴到下方单元"
],
"cell_type": "markdown",
"metadata": {}
},
{
"source": [
"## 编辑模式\n",
"* Esc : 进入命令模式\n",
"* Ctrl-M : 进入命令模式\n",
"* Shift-Enter : 运行本单元,选中下一单元\n",
"* Ctrl-Enter : 运行本单元\n",
"* Alt-Enter : 运行本单元,在下面插入一单元\n",
"* Tab : 代码补全或缩进\n",
"* Shift-Tab : 提示\n",
"* Ctrl-] : 缩进\n",
"* Ctrl-[ : 解除缩进"
],
"cell_type": "markdown",
"metadata": {}
}
]
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
# 说明
* 主要用来记录学习过程中的一些jupyter notebook。用于存档。
* 算是一种刷题笔记吧。