决策树算法(二)
日萌社
人工智能AI:Keras PyTorch MXNet TensorFlow PaddlePaddle 深度学习实战(不定时更新)
4.5 决策树算法api
class sklearn.tree.DecisionTreeClassifier(criterion=’gini’, max_depth=None,random_state=None)
-
criterion
- 特征选择标准
- "gini"或者"entropy",前者代表基尼系数,后者代表信息增益。一默认"gini",即CART算法。
-
min_samples_split
- 内部节点再划分所需最小样本数
- 这个值限制了子树继续划分的条件,如果某节点的样本数少于min_samples_split,则不会继续再尝试选择最优特征来进行划分。 默认是2.如果样本量不大,不需要管这个值。如果样本量数量级非常大,则推荐增大这个值。我之前的一个项目例子,有大概10万样本,建立决策树时,我选择了min_samples_split=10。可以作为参考。
-
min_samples_leaf
- 叶子节点最少样本数
- 这个值限制了叶子节点最少的样本数,如果某叶子节点数目小于样本数,则会和兄弟节点一起被剪枝。 默认是1,可以输入最少的样本数的整数,或者最少样本数占样本总数的百分比。如果样本量不大,不需要管这个值。如果样本量数量级非常大,则推荐增大这个值。之前的10万样本项目使用min_samples_leaf的值为5,仅供参考。
-
max_depth
- 决策树最大深度
- 决策树的最大深度,默认可以不输入,如果不输入的话,决策树在建立子树的时候不会限制子树的深度。一般来说,数据少或者特征少的时候可以不管这个值。如果模型样本量多,特征也多的情况下,推荐限制这个最大深度,具体的取值取决于数据的分布。常用的可以取值10-100之间
- random_state
- 随机数种子
In [1]:
# 1.获取数据
# 2.数据基本处理
# 2.1 确定特征值,目标值
# 2.2 缺失值处理
# 2.3 数据集划分
# 3.特征工程(字典特征抽取)
# 4.机器学习(决策树)
# 5.模型评估
In [2]:
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction import DictVectorizer
from sklearn.tree import DecisionTreeClassifier, export_graphviz
In [3]:
# 1.获取数据
titan = pd.read_csv("http://biostat.mc.vanderbilt.edu/wiki/pub/Main/DataSets/titanic.txt")
In [4]:
titan
Out[4]:
row.names | pclass | survived | name | age | embarked | home.dest | room | ticket | boat | sex | |
---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 1st | 1 | Allen, Miss Elisabeth Walton | 29.0000 | Southampton | St Louis, MO | B-5 | 24160 L221 | 2 | female |
1 | 2 | 1st | 0 | Allison, Miss Helen Loraine | 2.0000 | Southampton | Montreal, PQ / Chesterville, ON | C26 | NaN | NaN | female |
2 | 3 | 1st | 0 | Allison, Mr Hudson Joshua Creighton | 30.0000 | Southampton | Montreal, PQ / Chesterville, ON | C26 | NaN | (135) | male |
3 | 4 | 1st | 0 | Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) | 25.0000 | Southampton | Montreal, PQ / Chesterville, ON | C26 | NaN | NaN | female |
4 | 5 | 1st | 1 | Allison, Master Hudson Trevor | 0.9167 | Southampton | Montreal, PQ / Chesterville, ON | C22 | NaN | 11 | male |
5 | 6 | 1st | 1 | Anderson, Mr Harry | 47.0000 | Southampton | New York, NY | E-12 | NaN | 3 | male |
6 | 7 | 1st | 1 | Andrews, Miss Kornelia Theodosia | 63.0000 | Southampton | Hudson, NY | D-7 | 13502 L77 | 10 | female |
7 | 8 | 1st | 0 | Andrews, Mr Thomas, jr | 39.0000 | Southampton | Belfast, NI | A-36 | NaN | NaN | male |
8 | 9 | 1st | 1 | Appleton, Mrs Edward Dale (Charlotte Lamson) | 58.0000 | Southampton | Bayside, Queens, NY | C-101 | NaN | 2 | female |
9 | 10 | 1st | 0 | Artagaveytia, Mr Ramon | 71.0000 | Cherbourg | Montevideo, Uruguay | NaN | NaN | (22) | male |
10 | 11 | 1st | 0 | Astor, Colonel John Jacob | 47.0000 | Cherbourg | New York, NY | NaN | 17754 L224 10s 6d | (124) | male |
11 | 12 | 1st | 1 | Astor, Mrs John Jacob (Madeleine Talmadge Force) | 19.0000 | Cherbourg | New York, NY | NaN | 17754 L224 10s 6d | 4 | female |
12 | 13 | 1st | 1 | Aubert, Mrs Leontine Pauline | NaN | Cherbourg | Paris, France | B-35 | 17477 L69 6s | 9 | female |
13 | 14 | 1st | 1 | Barkworth, Mr Algernon H. | NaN | Southampton | Hessle, Yorks | A-23 | NaN | B | male |
14 | 15 | 1st | 0 | Baumann, Mr John D. | NaN | Southampton | New York, NY | NaN | NaN | NaN | male |
15 | 16 | 1st | 1 | Baxter, Mrs James (Helene DeLaudeniere Chaput) | 50.0000 | Cherbourg | Montreal, PQ | B-58/60 | NaN | 6 | female |
16 | 17 | 1st | 0 | Baxter, Mr Quigg Edmond | 24.0000 | Cherbourg | Montreal, PQ | B-58/60 | NaN | NaN | male |
17 | 18 | 1st | 0 | Beattie, Mr Thomson | 36.0000 | Cherbourg | Winnipeg, MN | C-6 | NaN | NaN | male |
18 | 19 | 1st | 1 | Beckwith, Mr Richard Leonard | 37.0000 | Southampton | New York, NY | D-35 | NaN | 5 | male |
19 | 20 | 1st | 1 | Beckwith, Mrs Richard Leonard (Sallie Monypeny) | 47.0000 | Southampton | New York, NY | D-35 | NaN | 5 | female |
20 | 21 | 1st | 1 | Behr, Mr Karl Howell | 26.0000 | Cherbourg | New York, NY | C-148 | NaN | 5 | male |
21 | 22 | 1st | 0 | Birnbaum, Mr Jakob | 25.0000 | Cherbourg | San Francisco, CA | NaN | NaN | (148) | male |
22 | 23 | 1st | 1 | Bishop, Mr Dickinson H. | 25.0000 | Cherbourg | Dowagiac, MI | B-49 | NaN | 7 | male |
23 | 24 | 1st | 1 | Bishop, Mrs Dickinson H. (Helen Walton) | 19.0000 | Cherbourg | Dowagiac, MI | B-49 | NaN | 7 | female |
24 | 25 | 1st | 1 | Bjornstrm-Steffansson, Mr Mauritz Hakan | 28.0000 | Southampton | Stockholm, Sweden / Washington, DC | NaN | D | male | |
25 | 26 | 1st | 0 | Blackwell, Mr Stephen Weart | 45.0000 | Southampton | Trenton, NJ | NaN | NaN | (241) | male |
26 | 27 | 1st | 1 | Blank, Mr Henry | 39.0000 | Cherbourg | Glen Ridge, NJ | A-31 | NaN | 7 | male |
27 | 28 | 1st | 1 | Bonnell, Miss Caroline | 30.0000 | Southampton | Youngstown, OH | C-7 | NaN | 8 | female |
28 | 29 | 1st | 1 | Bonnell, Miss Elizabeth | 58.0000 | Southampton | Birkdale, England Cleveland, Ohio | C-103 | NaN | 8 | female |
29 | 30 | 1st | 0 | Borebank, Mr John James | NaN | Southampton | London / Winnipeg, MB | D-21/2 | NaN | NaN | male |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
1283 | 1284 | 3rd | 0 | Vestrom, Miss Hulda Amanda Adolfina | NaN | NaN | NaN | NaN | NaN | NaN | female |
1284 | 1285 | 3rd | 0 | Vonk, Mr Jenko | NaN | NaN | NaN | NaN | NaN | NaN | male |
1285 | 1286 | 3rd | 0 | Ware, Mr Frederick | NaN | NaN | NaN | NaN | NaN | NaN | male |
1286 | 1287 | 3rd | 0 | Warren, Mr Charles William | NaN | NaN | NaN | NaN | NaN | NaN | male |
1287 | 1288 | 3rd | 0 | Wazli, Mr Yousif | NaN | NaN | NaN | NaN | NaN | NaN | male |
1288 | 1289 | 3rd | 0 | Webber, Mr James | NaN | NaN | NaN | NaN | NaN | NaN | male |
1289 | 1290 | 3rd | 1 | Wennerstrom, Mr August Edvard | NaN | NaN | NaN | NaN | NaN | NaN | male |
1290 | 1291 | 3rd | 0 | Wenzel, Mr Linhart | NaN | NaN | NaN | NaN | NaN | NaN | male |
1291 | 1292 | 3rd | 0 | Widegren, Mr Charles Peter | NaN | NaN | NaN | NaN | NaN | NaN | male |
1292 | 1293 | 3rd | 0 | Wiklund, Mr Jacob Alfred | NaN | NaN | NaN | NaN | NaN | NaN | male |
1293 | 1294 | 3rd | 1 | Wilkes, Mrs Ellen | NaN | NaN | NaN | NaN | NaN | NaN | female |
1294 | 1295 | 3rd | 0 | Willer, Mr Aaron | NaN | NaN | NaN | NaN | NaN | NaN | male |
1295 | 1296 | 3rd | 0 | Willey, Mr Edward | NaN | NaN | NaN | NaN | NaN | NaN | male |
1296 | 1297 | 3rd | 0 | Williams, Mr Howard Hugh | NaN | NaN | NaN | NaN | NaN | NaN | male |
1297 | 1298 | 3rd | 0 | Williams, Mr Leslie | NaN | NaN | NaN | NaN | NaN | NaN | male |
1298 | 1299 | 3rd | 0 | Windelov, Mr Einar | NaN | NaN | NaN | NaN | NaN | NaN | male |
1299 | 1300 | 3rd | 0 | Wirz, Mr Albert | NaN | NaN | NaN | NaN | NaN | NaN | male |
1300 | 1301 | 3rd | 0 | Wiseman, Mr Phillippe | NaN | NaN | NaN | NaN | NaN | NaN | male |
1301 | 1302 | 3rd | 0 | Wittevrongel, Mr Camiel | NaN | NaN | NaN | NaN | NaN | NaN | male |
1302 | 1303 | 3rd | 1 | Yalsevac, Mr Ivan | NaN | NaN | NaN | NaN | NaN | NaN | male |
1303 | 1304 | 3rd | 0 | Yasbeck, Mr Antoni | NaN | NaN | NaN | NaN | NaN | NaN | male |
1304 | 1305 | 3rd | 1 | Yasbeck, Mrs Antoni | NaN | NaN | NaN | NaN | NaN | NaN | female |
1305 | 1306 | 3rd | 0 | Youssef, Mr Gerios | NaN | NaN | NaN | NaN | NaN | NaN | male |
1306 | 1307 | 3rd | 0 | Zabour, Miss Hileni | NaN | NaN | NaN | NaN | NaN | NaN | female |
1307 | 1308 | 3rd | 0 | Zabour, Miss Tamini | NaN | NaN | NaN | NaN | NaN | NaN | female |
1308 | 1309 | 3rd | 0 | Zakarian, Mr Artun | NaN | NaN | NaN | NaN | NaN | NaN | male |
1309 | 1310 | 3rd | 0 | Zakarian, Mr Maprieder | NaN | NaN | NaN | NaN | NaN | NaN | male |
1310 | 1311 | 3rd | 0 | Zenn, Mr Philip | NaN | NaN | NaN | NaN | NaN | NaN | male |
1311 | 1312 | 3rd | 0 | Zievens, Rene | NaN | NaN | NaN | NaN | NaN | NaN | female |
1312 | 1313 | 3rd | 0 | Zimmerman, Leo | NaN | NaN | NaN | NaN | NaN | NaN | male |
1313 rows × 11 columns
In [5]:
titan.describe()
Out[5]:
row.names | survived | age | |
---|---|---|---|
count | 1313.000000 | 1313.000000 | 633.000000 |
mean | 657.000000 | 0.341965 | 31.194181 |
std | 379.174762 | 0.474549 | 14.747525 |
min | 1.000000 | 0.000000 | 0.166700 |
25% | 329.000000 | 0.000000 | 21.000000 |
50% | 657.000000 | 0.000000 | 30.000000 |
75% | 985.000000 | 1.000000 | 41.000000 |
max | 1313.000000 | 1.000000 | 71.000000 |
In [6]:
# 2.数据基本处理
# 2.1 确定特征值,目标值
x = titan[["pclass", "age", "sex"]]
y = titan["survived"]
In [7]:
x.head()
Out[7]:
pclass | age | sex | |
---|---|---|---|
0 | 1st | 29.0000 | female |
1 | 1st | 2.0000 | female |
2 | 1st | 30.0000 | male |
3 | 1st | 25.0000 | female |
4 | 1st | 0.9167 | male |
In [8]:
y.head()
Out[8]:
0 1
1 0
2 0
3 0
4 1
Name: survived, dtype: int64
In [9]:
# 2.2 缺失值处理
x['age'].fillna(value=titan["age"].mean(), inplace=True)
In [10]:
x.head()
Out[10]:
pclass | age | sex | |
---|---|---|---|
0 | 1st | 29.0000 | female |
1 | 1st | 2.0000 | female |
2 | 1st | 30.0000 | male |
3 | 1st | 25.0000 | female |
4 | 1st | 0.9167 | male |
In [11]:
# 2.3 数据集划分
x_train, x_test, y_train, y_test = train_test_split(x, y, random_state=22, test_size=0.2)
In [12]:
# 3.特征工程(字典特征抽取)
In [13]:
x_train.head()
Out[13]:
pclass | age | sex | |
---|---|---|---|
649 | 3rd | 45.000000 | female |
1078 | 3rd | 31.194181 | male |
59 | 1st | 31.194181 | female |
201 | 1st | 18.000000 | male |
61 | 1st | 31.194181 | female |
In [14]:
x_train = x_train.to_dict(orient="records")
x_test = x_test.to_dict(orient="records")
In [15]:
x_train
Out[15]:
[{'pclass': '3rd', 'age': 45.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 18.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 6.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 27.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 21.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 4.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 13.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 30.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 30.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 50.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 22.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 49.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 62.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 32.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 64.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 55.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 24.0, 'sex': 'male'},
{'pclass': '1st', 'age': 6.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 10.0, 'sex': 'female'},
{'pclass': '1st', 'age': 53.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 36.0, 'sex': 'female'},
{'pclass': '1st', 'age': 19.0, 'sex': 'male'},
{'pclass': '1st', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 17.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 21.0, 'sex': 'female'},
{'pclass': '1st', 'age': 25.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 19.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '1st', 'age': 21.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 48.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 27.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 46.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 29.0, 'sex': 'female'},
{'pclass': '1st', 'age': 35.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 38.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 32.0, 'sex': 'male'},
{'pclass': '1st', 'age': 16.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 16.0, 'sex': 'male'},
{'pclass': '1st', 'age': 33.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 17.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 30.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 20.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 33.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 52.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 35.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 25.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 45.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 50.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 52.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 20.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 32.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 34.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 33.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 21.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 45.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 43.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 59.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 47.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 38.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 51.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 36.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 6.0, 'sex': 'female'},
{'pclass': '1st', 'age': 58.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 4.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 20.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 35.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 12.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 19.0, 'sex': 'male'},
{'pclass': '1st', 'age': 64.0, 'sex': 'male'},
{'pclass': '1st', 'age': 27.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 34.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 18.0, 'sex': 'male'},
{'pclass': '1st', 'age': 48.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 50.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 18.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 34.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 21.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 44.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 19.0, 'sex': 'male'},
{'pclass': '1st', 'age': 39.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 42.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 69.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 2.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 22.0, 'sex': 'male'},
{'pclass': '1st', 'age': 47.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 22.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 42.0, 'sex': 'male'},
{'pclass': '1st', 'age': 21.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 48.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 45.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 45.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 39.0, 'sex': 'male'},
{'pclass': '1st', 'age': 14.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 30.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 32.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 54.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 36.0, 'sex': 'female'},
{'pclass': '1st', 'age': 47.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 0.8333, 'sex': 'male'},
{'pclass': '1st', 'age': 53.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 24.0, 'sex': 'female'},
{'pclass': '1st', 'age': 37.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 25.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 40.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 23.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 22.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 29.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '1st', 'age': 55.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 26.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 49.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 24.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 22.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 54.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 38.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 42.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 52.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 19.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 8.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 57.0, 'sex': 'male'},
{'pclass': '1st', 'age': 22.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 16.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 45.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 28.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 19.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 24.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 38.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 36.0, 'sex': 'female'},
{'pclass': '1st', 'age': 55.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 25.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 32.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 9.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '1st', 'age': 29.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 40.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 39.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 25.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 49.0, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 17.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 24.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 40.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 6.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 17.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 34.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 41.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 61.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 17.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 3.0, 'sex': 'male'},
{'pclass': '1st', 'age': 24.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 30.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 41.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 42.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 48.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 50.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 16.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 40.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 23.0, 'sex': 'female'},
{'pclass': '1st', 'age': 34.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 39.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 34.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 22.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 9.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 22.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 30.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 25.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 24.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 26.0, 'sex': 'female'},
{'pclass': '1st', 'age': 57.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 39.0, 'sex': 'male'},
{'pclass': '1st', 'age': 35.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 41.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 67.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 11.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 22.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 20.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 50.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 33.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 36.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 48.0, 'sex': 'female'},
{'pclass': '1st', 'age': 59.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 25.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 17.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 45.0, 'sex': 'female'},
{'pclass': '1st', 'age': 49.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 33.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 46.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 52.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 36.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 19.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 43.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'male'},
{'pclass': '1st', 'age': 51.0, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 3.0, 'sex': 'male'},
{'pclass': '1st', 'age': 48.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 48.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 16.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 44.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 36.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 37.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 32.0, 'sex': 'male'},
{'pclass': '1st', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 22.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 40.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 24.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 65.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 37.0, 'sex': 'female'},
{'pclass': '1st', 'age': 52.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 23.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 0.8333, 'sex': 'male'},
{'pclass': '2nd', 'age': 35.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 27.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 27.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 41.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 18.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 33.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 56.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 40.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 9.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 28.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 25.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 48.0, 'sex': 'female'},
{'pclass': '1st', 'age': 36.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 35.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 1.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 2.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 32.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 25.0, 'sex': 'male'},
{'pclass': '1st', 'age': 29.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 21.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 27.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 38.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 0.9167, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 39.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 9.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 45.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 20.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 14.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 30.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 22.0, 'sex': 'male'},
{'pclass': '1st', 'age': 60.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 20.0, 'sex': 'male'},
{'pclass': '1st', 'age': 48.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 23.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 32.0, 'sex': 'male'},
{'pclass': '1st', 'age': 30.0, 'sex': 'male'},
{'pclass': '1st', 'age': 46.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 32.0, 'sex': 'male'},
{'pclass': '1st', 'age': 27.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 61.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 39.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 0.1667, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 15.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 24.0, 'sex': 'male'},
{'pclass': '1st', 'age': 17.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 42.0, 'sex': 'female'},
{'pclass': '1st', 'age': 20.0, 'sex': 'female'},
{'pclass': '1st', 'age': 62.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 49.0, 'sex': 'male'},
{'pclass': '1st', 'age': 23.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 33.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 19.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 45.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 70.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 37.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 54.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 51.0, 'sex': 'female'},
{'pclass': '1st', 'age': 21.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 64.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 29.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 33.0, 'sex': 'male'},
{'pclass': '1st', 'age': 50.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 19.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 59.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 49.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 38.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 48.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 54.0, 'sex': 'female'},
{'pclass': '1st', 'age': 19.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 3.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 18.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 22.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 34.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 28.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 15.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 40.0, 'sex': 'female'},
{'pclass': '1st', 'age': 46.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 8.0, 'sex': 'female'},
{'pclass': '1st', 'age': 63.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 43.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 16.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 38.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 1.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 35.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.0, 'sex': 'male'},
{'pclass': '1st', 'age': 42.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 38.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 17.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 40.0, 'sex': 'male'},
{'pclass': '1st', 'age': 4.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 29.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 22.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 57.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 40.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 47.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 37.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 42.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 21.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 5.0, 'sex': 'female'},
{'pclass': '1st', 'age': 21.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 40.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 9.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 41.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 36.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 28.0, 'sex': 'male'},
{'pclass': '1st', 'age': 39.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 35.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 24.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 45.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 24.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 50.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 56.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 32.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 19.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 45.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 22.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 50.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 30.0, 'sex': 'male'},
{'pclass': '1st', 'age': 24.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 40.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 21.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 52.0, 'sex': 'male'},
{'pclass': '1st', 'age': 45.0, 'sex': 'male'},
{'pclass': '1st', 'age': 11.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 26.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 40.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 49.0, 'sex': 'male'},
{'pclass': '1st', 'age': 18.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 9.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 25.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 35.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 32.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 21.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 32.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 45.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 26.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 21.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 25.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'male'},
{'pclass': '1st', 'age': 27.0, 'sex': 'male'},
{'pclass': '1st', 'age': 24.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 18.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 56.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 16.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 18.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 64.0, 'sex': 'male'},
{'pclass': '1st', 'age': 46.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 18.0, 'sex': 'male'},
{'pclass': '1st', 'age': 46.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 29.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 18.0, 'sex': 'female'},
{'pclass': '1st', 'age': 33.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 34.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 0.8333, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 58.0, 'sex': 'female'},
{'pclass': '1st', 'age': 60.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 23.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 44.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 71.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 13.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 58.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 4.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 16.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 33.0, 'sex': 'female'},
{'pclass': '1st', 'age': 33.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 48.0, 'sex': 'male'},
{'pclass': '1st', 'age': 28.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 55.0, 'sex': 'female'},
{'pclass': '1st', 'age': 54.0, 'sex': 'male'},
{'pclass': '1st', 'age': 71.0, 'sex': 'male'},
{'pclass': '1st', 'age': 47.0, 'sex': 'female'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 21.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 21.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 24.0, 'sex': 'male'},
{'pclass': '1st', 'age': 23.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 18.0, 'sex': 'female'},
{'pclass': '1st', 'age': 54.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 17.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 6.0, 'sex': 'male'},
{'pclass': '1st', 'age': 45.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 36.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 55.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 26.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '1st', 'age': 65.0, 'sex': 'male'},
{'pclass': '1st', 'age': 27.0, 'sex': 'male'},
{'pclass': '1st', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 22.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '2nd', 'age': 7.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 30.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 39.0, 'sex': 'female'},
{'pclass': '1st', 'age': 19.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 19.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 20.0, 'sex': 'male'},
{'pclass': '1st', 'age': 56.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 38.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'female'},
{'pclass': '2nd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 42.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 23.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 25.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '2nd', 'age': 16.0, 'sex': 'male'},
{'pclass': '2nd', 'age': 42.0, 'sex': 'male'},
{'pclass': '3rd', 'age': 2.0, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'female'},
{'pclass': '3rd', 'age': 31.19418104265403, 'sex': 'male'},
{'pclass': '1st', 'age': 36.0, 'sex': 'male'},
...]
In [16]:
transfer = DictVectorizer()
x_train = transfer.fit_transform(x_train)
x_test = transfer.fit_transform(x_test)
In [17]:x_test
Out[17]:
<263x6 sparse matrix of type '<class 'numpy.float64'>'
with 789 stored elements in Compressed Sparse Row format>
In [18]:
# 4.机器学习(决策树)
estimator = DecisionTreeClassifier(max_depth=15)
estimator.fit(x_train, y_train)
Out[18]:
DecisionTreeClassifier(class_weight=None, criterion='gini', max_depth=15,
max_features=None, max_leaf_nodes=None,
min_impurity_decrease=0.0, min_impurity_split=None,
min_samples_leaf=1, min_samples_split=2,
min_weight_fraction_leaf=0.0, presort=False, random_state=None,
splitter='best')
In [19]:
# 5.模型评估
y_pre = estimator.predict(x_test)
In [20]:y_pre
Out[20]:
array([0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1,
1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1])
In [21]:
ret = estimator.score(x_test, y_test)
print(ret)
0.779467680608365
In [22]:
export_graphviz(estimator, out_file="./data/tree.dot", feature_names=['age', 'pclass=1st', 'pclass=2nd', 'pclass=3rd', '女性', '男性'])
上一篇: 创建型-原型模式