master-thesis/EvolutionaryAlgorithm/EvolutionaryAlgorithm.ipynb
2019-11-08 10:47:58 +01:00

3104 lines
168 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Evolutionary Algorithm"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"the Evolutionary Algorithm that is supposed to create new recipes based on the Recipe Matrices that are created during the *Recipe Analysis* step.\n",
"\n",
"The Population of the Evolutional Algorithm consists of a set of recipe trees. Each Recipe Tree consists of several Nodes where each node is of one of the following Types:\n",
"\n",
"* **Ingredient Node:**\n",
" these are the leaf nodes. Containing an ingredient. The score is determined by the actions, that are applied if you follow up the path. At the Moment it measures how many duplicate actions are applied.\n",
"* **Action Node:**\n",
" An Action that is applied on it's child and this child's subtree. Score indicates the average likelihood that this action is applied on the ingredients inside the subtree\n",
"* **Mix Node:**\n",
" Mixing ingredients together. This is also the only Node that can have more than one child. The score is the average of all pairwise likelihoods that two ingredients are mixed togethter"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"sys.path.append(\"../\")\n",
"sys.path.append(\"../RecipeAnalysis/\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": " <script type=\"text/javascript\">\n window.PlotlyConfig = {MathJaxConfig: 'local'};\n if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n if (typeof require !== 'undefined') {\n require.undef(\"plotly\");\n requirejs.config({\n paths: {\n 'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n }\n });\n require(['plotly'], function(Plotly) {\n window._Plotly = Plotly;\n });\n }\n </script>\n "
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": " <script type=\"text/javascript\">\n window.PlotlyConfig = {MathJaxConfig: 'local'};\n if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n if (typeof require !== 'undefined') {\n require.undef(\"plotly\");\n requirejs.config({\n paths: {\n 'plotly': ['https://cdn.plot.ly/plotly-latest.min']\n }\n });\n require(['plotly'], function(Plotly) {\n window._Plotly = Plotly;\n });\n }\n </script>\n "
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import settings\n",
"\n",
"import pycrfsuite\n",
"\n",
"import json\n",
"\n",
"import db.db_settings as db_settings\n",
"from db.database_connection import DatabaseConnection\n",
"\n",
"from Tagging.conllu_generator import ConlluGenerator\n",
"from Tagging.crf_data_generator import *\n",
"\n",
"from RecipeAnalysis.Recipe import Ingredient\n",
"\n",
"import ea_tools\n",
"\n",
"from difflib import SequenceMatcher\n",
"\n",
"import numpy as np\n",
"\n",
"import plotly.graph_objs as go\n",
"from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot\n",
"from plotly.subplots import make_subplots\n",
"init_notebook_mode(connected=True)\n",
"\n",
"from graphviz import Digraph\n",
"\n",
"import itertools\n",
"\n",
"import random\n",
"\n",
"import plotly.io as pio\n",
"pio.renderers.default = \"jupyterlab\"\n",
"\n",
"from IPython.display import Markdown, HTML, display\n",
"\n",
"from copy import deepcopy"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def gaussian(x, mu, sig):\n",
" return 1./(np.sqrt(2.*np.pi)*sig)*np.exp(-np.power((x - mu)/sig, 2.)/2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## load adjacency matrices"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"import dill\n",
"m_act = dill.load(open(\"../RecipeAnalysis/m_act.dill\", \"rb\"))\n",
"m_mix = dill.load(open(\"../RecipeAnalysis/m_mix.dill\", \"rb\"))\n",
"m_base_act = dill.load(open(\"../RecipeAnalysis/m_base_act.dill\", \"rb\"))\n",
"m_base_mix = dill.load(open(\"../RecipeAnalysis/m_base_mix.dill\", \"rb\"))\n",
"\n",
"#m_act.apply_threshold(3)\n",
"#m_mix.apply_threshold(3)\n",
"#m_base_act.apply_threshold(5)\n",
"#m_base_mix.apply_threshold(5)\n",
"\n",
"\n",
"#c_act = m_act.get_csr()\n",
"#c_mix = m_mix.get_csr()\n",
"#c_base_act = m_base_act.get_csr()\n",
"#c_base_mix = m_base_mix.get_csr()\n",
"\n",
"c_act = m_act._csr\n",
"c_mix = m_mix._csr\n",
"c_base_act = m_base_act._csr\n",
"c_base_mix = m_base_mix._csr\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"actions = m_act.get_labels()[0]"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"base_ingredients = m_base_mix.get_labels()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"sym_label_buffer = {}\n",
"fw_label_buffer = {}\n",
"bw_label_buffer = {}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### helper functions for adjacency matrices"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"def get_sym_adjacent(key, m, c):\n",
" index = m._label_index[key]\n",
" i1 = c[index,:].nonzero()[1]\n",
" i2 = c[:,index].nonzero()[0]\n",
" \n",
" i = np.concatenate((i1,i2))\n",
" \n",
" if m in sym_label_buffer:\n",
" names = sym_label_buffer[m][i]\n",
" else:\n",
" names = np.array(m.get_labels())\n",
" sym_label_buffer[m] = names\n",
" names = names[i]\n",
" \n",
" counts = np.concatenate((c[index, i1].toarray().flatten(), c[i2, index].toarray().flatten()))\n",
" \n",
" s = np.argsort(-counts)\n",
" \n",
" return names[s], counts[s]"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"def get_forward_adjacent(key, m, c):\n",
" index = m._x_label_index[key]\n",
" i = c[index,:].nonzero()[1]\n",
" \n",
" if m in fw_label_buffer:\n",
" names = fw_label_buffer[m][i]\n",
" else:\n",
" names = np.array(m._y_labels)\n",
" fw_label_buffer[m] = names\n",
" names = names[i]\n",
" \n",
" \n",
" counts = c[index, i].toarray().flatten()\n",
" \n",
" s = np.argsort(-counts)\n",
" \n",
" return names[s], counts[s]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def get_backward_adjacent(key, m, c):\n",
" index = m._y_label_index[key]\n",
" i = c[:,index].nonzero()[0]\n",
" \n",
" if m in bw_label_buffer:\n",
" names = bw_label_buffer[m][i]\n",
" else:\n",
" names = np.array(m._x_labels)\n",
" bw_label_buffer[m] = names\n",
" names = names[i]\n",
" \n",
" \n",
" counts = c[i, index].toarray().flatten()\n",
" \n",
" s = np.argsort(-counts)\n",
" \n",
" return names[s], counts[s]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": "(array(['heat', 'simmer', 'cook', 'boil', 'bake', 'place', 'slice', 'cut',\n 'chop', 'cool', 'dice', 'refrigerate', 'pour', 'drain', 'brown',\n 'warm', 'blend', 'chill', 'spread', 'thicken', 'grill', 'saute',\n 'peel', 'fry', 'mash', 'whisk', 'break', 'freeze', 'melt'],\n dtype='<U11'),\n array([1673, 1323, 1265, 798, 722, 656, 511, 461, 396, 375, 366,\n 307, 298, 286, 232, 228, 227, 183, 172, 142, 124, 115,\n 113, 86, 82, 77, 59, 59, 56]))"
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"get_backward_adjacent(\"tomato\", m_base_act, c_base_act)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"v, w = get_forward_adjacent(\"cook\", m_act, c_act)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"ing = Ingredient(\"bacon\")\n",
"ing.apply_action(\"cook\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"ing = Ingredient(\"bacon\")\n",
"ing.apply_action(\"cook\")"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": "(array(['{\"base\": \"cheese\", \"actions\": []}',\n '{\"base\": \"sprinkle\", \"actions\": []}',\n '{\"base\": \"crisp\", \"actions\": [\"cook\"]}',\n '{\"base\": \"crumble\", \"actions\": []}',\n '{\"base\": \"salt\", \"actions\": []}',\n '{\"base\": \"sugar\", \"actions\": []}',\n '{\"base\": \"crisp\", \"actions\": [\"heat\"]}'], dtype='<U206'),\n array([31., 22., 14., 13., 12., 11., 11.]))"
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m_mix.get_adjacent(ing.to_json())"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"def sym_sum(key, m, c):\n",
" return np.sum(get_sym_adjacent(key,m,c)[1])\n",
"\n",
"def fw_sum(key, m, c):\n",
" return np.sum(get_forward_adjacent(key,m,c)[1])\n",
"\n",
"def bw_sum(key, m, c):\n",
" return np.sum(get_backward_adjacent(key,m,c)[1])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### different score functions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### normalizations"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"def fw_normalization_factor(key, m, c, quotient_func):\n",
" ia = m._x_label_index[key]\n",
" \n",
" occurances = c[ia,:].nonzero()[1]\n",
" \n",
" return 1. / quotient_func(c[ia,occurances].toarray())\n",
"\n",
"def bw_normalization_factor(key, m, c, quotient_func):\n",
" ib = m._y_label_index[key]\n",
" \n",
" occurances = c[:,ib].nonzero()[0]\n",
" \n",
" return 1. / quotient_func(c[occurances,ib].toarray())\n",
"\n",
"def sym_normalization_factor(key, m, c, quotient_func):\n",
" ii = m._label_index[key]\n",
" \n",
" fw_occurances = c[ii,:].nonzero()[1]\n",
" bw_occurances = c[:,ii].nonzero()[0]\n",
" \n",
" return 1. / quotient_func(np.concatenate(\n",
" [c[ii,fw_occurances].toarray().flatten(),\n",
" c[bw_occurances,ii].toarray().flatten()]\n",
" ))"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"def sym_p_a_given_b(key_a, key_b, m, c, quot_func = np.max):\n",
" ia = m._label_index[key_a]\n",
" ib = m._label_index[key_b]\n",
" \n",
" v = c[ia,ib] + c[ib,ia]\n",
" \n",
" return v * sym_normalization_factor(key_b, m, c, quot_func)\n",
"\n",
"def fw_p_a_given_b(key_a, key_b, m, c, quot_func = np.max):\n",
" ia = m._x_label_index[key_a]\n",
" ib = m._y_label_index[key_b]\n",
" \n",
" v = c[ia,ib]\n",
" \n",
" return v * bw_normalization_factor(key_b, m, c, quot_func)\n",
"\n",
"def bw_p_a_given_b(key_a, key_b, m, c, quot_func = np.max):\n",
" ia = m._y_label_index[key_a]\n",
" ib = m._x_label_index[key_b]\n",
" \n",
" v = c[ib,ia]\n",
" \n",
" return v * fw_normalization_factor(key_b, m, c, quot_func)\n"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"def sym_score(key_a, key_b, m, c):\n",
"\n",
" ia = m._label_index[key_a]\n",
" ib = m._label_index[key_b]\n",
" \n",
" v = c[ia,ib] + c[ib,ia]\n",
" \n",
" if v == 0:\n",
" return 0\n",
" \n",
" return max((v/sym_sum(key_a, m, c)), (v/sym_sum(key_b, m, c)))\n",
"\n",
"def asym_score(key_a, key_b, m, c):\n",
" ia = m._x_label_index[key_a]\n",
" ib = m._y_label_index[key_b]\n",
" \n",
" v = c[ia,ib]\n",
" \n",
" if v == 0:\n",
" return 0\n",
" \n",
" return max(v/fw_sum(key_a, m, c), v/bw_sum(key_b, m, c))"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"def p_ingredient_unprepared(base_ing):\n",
" ing = Ingredient(base_ing)\n",
" base_sum = sym_sum(base_ing, m_base_mix, c_base_mix)\n",
" specialized_sum = sym_sum(ing.to_json(), m_mix, c_mix)\n",
" return specialized_sum / base_sum"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"def p_heat(base_ing):\n",
" heat_actions = [\"heat\",\"cook\",\"simmer\",\"bake\"]\n",
" heat_sum = 0\n",
" m"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": "0.09869773817683344"
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"p_ingredient_unprepared(\"noodle\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Recipe Tree\n",
"### Tree Node Base Class"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"class RecipeTreeNode(object):\n",
" \n",
" id = 0\n",
" \n",
" def __init__(self, name, constant=False, single_child=False):\n",
" self._constant = constant\n",
" self._name = name\n",
" self._parent = None\n",
" \n",
" self._id = str(RecipeTreeNode.id)\n",
" RecipeTreeNode.id += 1\n",
" \n",
" self._single_child = single_child\n",
" \n",
" if self._single_child:\n",
" self._child = None\n",
" \n",
" def child():\n",
" return self._child\n",
" \n",
" def remove_child(c):\n",
" assert c == self._child\n",
" self._child._parent = None\n",
" self._child = None\n",
" \n",
" def childs():\n",
" c = self.child()\n",
" if c is None:\n",
" return set()\n",
" return set([c])\n",
" \n",
" def add_child(n):\n",
" self._child = n\n",
" n._parent = self\n",
" \n",
" self.child = child\n",
" self.childs = childs\n",
" self.add_child = add_child\n",
" self.remove_child = remove_child\n",
" else:\n",
" self._childs = set()\n",
" \n",
" def childs():\n",
" return self._childs\n",
" \n",
" def add_child(n):\n",
" self._childs.add(n)\n",
" n._parent = self\n",
" \n",
" def remove_child(c):\n",
" assert c in self._childs\n",
" c._parent = None\n",
" self._childs.remove(c)\n",
" \n",
" self.childs = childs\n",
" self.add_child = add_child\n",
" self.remove_child = remove_child\n",
" \n",
" def parent(self):\n",
" return self._parent\n",
" \n",
" def name(self):\n",
" return self._name\n",
" \n",
" def traverse(self):\n",
" l = []\n",
" \n",
" for c in self.childs():\n",
" l += c.traverse()\n",
" \n",
" return [self] + l\n",
" \n",
" def traverse_ingredients(self):\n",
" ingredient_set = []\n",
" for c in self.childs():\n",
" ingredient_set += c.traverse_ingredients()\n",
" \n",
" return ingredient_set\n",
" \n",
" def remove(self):\n",
" p = self.parent()\n",
" childs = self.childs().copy()\n",
" \n",
" assert p is None or not (len(childs) > 1 and p._single_child)\n",
" \n",
" for c in childs:\n",
" self.remove_child(c)\n",
" \n",
" if p is not None:\n",
" p.remove_child(self)\n",
" \n",
" if self._single_child and self._child is not None and p._name == self._child._name:\n",
" # two adjacent nodes with same name would remain after deletion.\n",
" # merge them! (by adding the child's childs to our parent instead of our childs)\n",
" childs = self._child.childs()\n",
" self._child.remove()\n",
" \n",
" \n",
" for c in childs:\n",
" p.add_child(c)\n",
" \n",
" def insert_before(self, n):\n",
" p = self._parent\n",
" if p is not None:\n",
" p.remove_child(self)\n",
" p.add_child(n)\n",
" n.add_child(self)\n",
" \n",
" def mutate(self):\n",
" n_node = self.n_node_mutate_options()\n",
" n_edge = self.n_edge_mutate_options()\n",
" \n",
" choice = random.choice(range(n_node + n_edge))\n",
" if choice < n_node:\n",
" self.mutate_node()\n",
" else:\n",
" self.mutate_edges()\n",
" \n",
" def mutate_edges(self):\n",
" ings = self.traverse_ingredients()\n",
" ing = random.choice(ings)\n",
" \n",
" a, w = get_backward_adjacent(ing._base_ingredient, m_base_act, c_base_act)\n",
" \n",
" action = random.choices(a, w)[0]\n",
" self.insert_before(ActionNode(action))\n",
" \n",
" def mutate_node(self):\n",
" raise NotImplementedError\n",
" \n",
" def n_node_mutate_options(self):\n",
" \n",
" return 0 if self._constant else 1\n",
" \n",
" def n_edge_mutate_options(self):\n",
" n = 1 if self._parent is not None else 0\n",
" return n\n",
" \n",
" def n_mutate_options(self):\n",
" return self.n_edge_mutate_options() + self.n_node_mutate_options()\n",
" \n",
" def dot_node(self, dot):\n",
" raise NotImplementedError()\n",
" \n",
" def dot(self, d=None):\n",
" if d is None:\n",
" d = Digraph()\n",
" self.dot_node(d)\n",
" \n",
" else:\n",
" self.dot_node(d)\n",
" if self._parent is not None:\n",
" d.edge(self._parent._id, self._id)\n",
" \n",
" \n",
" for c in self.childs():\n",
" c.dot(d)\n",
" \n",
" return d\n",
" \n",
" def serialize(self):\n",
" r = {}\n",
" r['type'] = str(self.__class__.__name__)\n",
" r['id'] = self._id\n",
" r['parent'] = self._parent._id if self._parent is not None else None\n",
" r['name'] = self._name\n",
" r['childs'] = [c._id for c in self.childs()]\n",
" r['constant'] = self._constant\n",
" r['single_child'] = self._single_child\n",
" \n",
" return r\n",
" \n",
" def node_score(self):\n",
" raise NotImplementedError()\n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Mix Node"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"class MixNode(RecipeTreeNode):\n",
" def __init__(self, constant=False):\n",
" super().__init__(\"mix\", constant, single_child=False)\n",
" \n",
" def dot_node(self, dot):\n",
" dot.node(self._id, label=f\"< <B>{self._name}</B><BR/>node score: {self.node_score():.4f}>\", shape=\"diamond\", style=\"filled\", color=\"#d5e8d4\")\n",
" \n",
" def split(self, set_above, set_below, node_between):\n",
" assert len(set_above.difference(self.childs())) == 0\n",
" assert len(set_below.difference(self.childs())) == 0\n",
" \n",
" n_above = MixNode()\n",
" n_below = MixNode()\n",
" \n",
" p = self.parent()\n",
" \n",
" for c in self.childs().copy():\n",
" self.remove_child(c)\n",
" self.remove()\n",
" \n",
" for c in set_below:\n",
" n_below.add_child(c)\n",
" \n",
" for c in set_above:\n",
" n_above.add_child(c)\n",
" \n",
" n_above.add_child(node_between)\n",
" node_between.add_child(n_below)\n",
" \n",
" if p is not None:\n",
" p.add_child(n_above)\n",
" \n",
" # test whether the mix nodes are useless\n",
" if len(n_above.childs()) == 1:\n",
" n_above.remove()\n",
" \n",
" if len(n_below.childs()) == 1:\n",
" n_below.remove()\n",
" \n",
" def n_node_mutate_options(self):\n",
" return 0 if self._constant or len(self.childs()) <= 2 else len(self.childs())\n",
" \n",
" def mutate_node(self):\n",
" \n",
" childs = self.childs()\n",
" \n",
" if len(childs) <= 2:\n",
" print(\"Warning: cannot modify mix node\")\n",
" return\n",
" \n",
" childs = random.sample(childs, len(childs))\n",
" \n",
" n = random.choice(range(1, len(childs)-1))\n",
" \n",
" between_node = ActionNode(random.choice(actions))\n",
" \n",
" self.split(set(childs[:n]), set(childs[n:]), between_node)\n",
" \n",
" \n",
" def node_score(self):\n",
" child_ingredients = [c.traverse_ingredients() for c in self.childs()]\n",
" \n",
" tmp_set = set()\n",
" cumulative_sets = []\n",
" \n",
" pairwise_tuples = []\n",
" \n",
" for c in child_ingredients:\n",
" if len(tmp_set) > 0:\n",
" cumulative_sets.append(tmp_set)\n",
" pairwise_tuples += [x for x in itertools.product(tmp_set, c)]\n",
" tmp_set = tmp_set.union(set(c))\n",
" \n",
" s_base = 0\n",
" s = 0\n",
" \n",
" for ing_a, ing_b in pairwise_tuples:\n",
" try:\n",
" #s_base += sym_score(ing_a._base_ingredient, ing_b._base_ingredient, m_base_mix, c_base_mix)\n",
" \n",
" #s += sym_score(ing_a.to_json(), ing_b.to_json(), m_mix, c_mix)\n",
" p1 = sym_p_a_given_b(ing_a.to_json(), ing_b.to_json(), m_mix, c_mix)\n",
" p2 = sym_p_a_given_b(ing_b.to_json(), ing_a.to_json(), m_mix, c_mix)\n",
" \n",
" s += 0.5 * p1 + 0.5 * p2\n",
" \n",
" except:\n",
" pass\n",
" \n",
" #s_base /= len(pairwise_tuples)\n",
" s /= len(pairwise_tuples)\n",
" \n",
" #return 0.5 * (s_base + s)\n",
" return s\n",
" \n",
" \n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ingredient Node Class"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"class IngredientNode(RecipeTreeNode):\n",
" def __init__(self, name, constant=False):\n",
" super().__init__(name, constant, single_child=True)\n",
" \n",
" def get_actions(self):\n",
" a_list = []\n",
" n = self.parent()\n",
" while n is not None:\n",
" if type(n) == ActionNode:\n",
" a_list.append(n.name())\n",
" n = n.parent()\n",
" return a_list\n",
" \n",
" def mutate_node(self):\n",
" self._name = random.choice(base_ingredients)\n",
" #TODO: change w.r.t. mixing probabilities \n",
" \n",
" def traverse_ingredients(self):\n",
" return [Ingredient(self._name)]\n",
" \n",
" def node_score(self):\n",
" actions = self.get_actions()\n",
" \n",
" if len(actions) == 0:\n",
" if p_ingredient_unprepared(self._name) < 0.2:\n",
" return 0\n",
" return 1\n",
" \n",
" seen_actions = set()\n",
" n_duplicates = 0\n",
" for act in actions:\n",
" if act in seen_actions:\n",
" n_duplicates += 1\n",
" else:\n",
" seen_actions.add(act)\n",
" \n",
" duplicate_actions_score = len(seen_actions) / len(actions)\n",
" \n",
" return duplicate_actions_score\n",
" \n",
" \n",
" def dot_node(self, dot):\n",
" dot.node(self._id, label=f\"< <B>{self._name}</B><BR/>node score:{self.node_score():.4f}>\", shape=\"box\", style=\"filled\", color=\"#ffe6cc\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Action Node Class"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"class ActionNode(RecipeTreeNode):\n",
" def __init__(self, name, constant=False):\n",
" super().__init__(name, constant, single_child=True)\n",
" \n",
" def n_node_mutate_options(self):\n",
" # beacause we can change or remove ourselve!\n",
" return 0 if self._constant else 2 \n",
" def mutate_node(self):\n",
" if random.choice(range(2)) == 0:\n",
" # change action\n",
" self._name = random.choice(actions)\n",
" else:\n",
" # delete\n",
" self.remove()\n",
" \n",
" def traverse_ingredients(self):\n",
" ingredient_set = super().traverse_ingredients()\n",
" for ing in ingredient_set:\n",
" ing.apply_action(self._name)\n",
" \n",
" return ingredient_set\n",
" \n",
" def node_score(self):\n",
" ings = self.child().traverse_ingredients()\n",
" \n",
" s = 0\n",
" \n",
" for ing in ings:\n",
" try:\n",
" #score = asym_score(self._name, ing.to_json(), m_act, c_act)\n",
" #base_score = asym_score(self._name, ing._base_ingredient, m_base_act, c_base_act)\n",
" \n",
" score = fw_p_a_given_b(self._name, ing._base_ingredient, m_base_act, c_base_act)\n",
" \n",
" s += score\n",
" except KeyError as e:\n",
" pass\n",
" \n",
" \n",
" return s / len(ings)\n",
" \n",
" def dot_node(self, dot):\n",
" dot.node(self._id, label=f\"< <B>{self._name}</B><BR/>node score: {self.node_score():.4f}>\", shape=\"ellipse\", style=\"filled\", color=\"#dae8fc\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Tree Class"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
"class Tree(object):\n",
" @staticmethod\n",
" def build_initial_tree(ingredients: list):\n",
" # get action sets for ingredients\n",
" possible_actions = {}\n",
" for ing in ingredients:\n",
" action_set, action_weights = m_base_act.get_backward_adjacent(ing)\n",
" possible_actions[ing] = set(action_set.tolist()[:5])\n",
" \n",
" # now find actions with the same subset\n",
" \n",
" ings_for_acts = {}\n",
" \n",
" for ing, acts in possible_actions.items():\n",
" for a in acts:\n",
" if a not in ings_for_acts:\n",
" ings_for_acts[a] = set()\n",
" \n",
" ings_for_acts[a].add(ing)\n",
" \n",
" # now looking for the largest subset and choose one of them randomly\n",
" \n",
" action_keys = np.array(list(ings_for_acts.keys()))\n",
" set_lengths = np.array([len(ings_for_acts[a]) for a in action_keys])\n",
" \n",
" # sort lengths\n",
" sorted_length_indices = np.argsort(-set_lengths)\n",
" \n",
" # now perform the following steps:\n",
" # * go through all unprocessed ingredients\n",
" # * for each ing: find largest action set that is suitable\n",
" # * perform this action on all it's ingredients.\n",
" # * continue until no ingredient is left\n",
" \n",
" unprocessed_ings = set(ingredients)\n",
" unprocessed_actions = set(ings_for_acts.keys())\n",
" highest_node_for_ingredient = {}\n",
" \n",
" \n",
" \n",
" # create ingredient nodes:\n",
" for ing in ingredients:\n",
" highest_node_for_ingredient[ing] = IngredientNode(ing, constant=True)\n",
" \n",
" while len(unprocessed_ings) > 0:\n",
" # select random ingredient:\n",
" ing = np.random.choice(list(unprocessed_ings))\n",
" \n",
" sorted_actions = action_keys[sorted_length_indices]\n",
" selected_action = None\n",
" \n",
" for action in sorted_actions:\n",
" if ing in ings_for_acts[action]:\n",
" selected_action = action\n",
" break\n",
" \n",
" # found best action. apply it to all matching ingredients\n",
" if selected_action is not None:\n",
" matching_ingredients = ings_for_acts[selected_action]\n",
" \n",
" \n",
" if len(matching_ingredients) == 1:\n",
" ing = list(matching_ingredients)[0]\n",
" ing_node = highest_node_for_ingredient[ing]\n",
" action_node = ActionNode(selected_action)\n",
" action_node.add_child(ing_node)\n",
" unprocessed_ings.remove(ing)\n",
" highest_node_for_ingredient[ing] = action_node\n",
" display(action_node.dot())\n",
" \n",
" else:\n",
" \n",
" nodes_to_mix = set()\n",
"\n",
" mix_node = MixNode()\n",
" action_node = ActionNode(selected_action)\n",
" action_node.add_child(mix_node)\n",
" \n",
" for ing in matching_ingredients:\n",
" nodes_to_mix.add(highest_node_for_ingredient[ing])\n",
"\n",
" # update reference to highest node in tree\n",
" highest_node_for_ingredient[ing] = action_node\n",
" \n",
" if ing in unprocessed_ings:\n",
" unprocessed_ings.remove(ing)\n",
"\n",
" for node in nodes_to_mix:\n",
" mix_node.add_child(node)\n",
" #display(action_node.dot())\n",
" \n",
" root_layer = set(highest_node_for_ingredient.values())\n",
"\n",
" root_layer_without_parents = []\n",
" for node in root_layer:\n",
" if node.parent() is None:\n",
" root_layer_without_parents.append(node)\n",
" \n",
" if len(root_layer_without_parents) == 1:\n",
" return root_layer_without_parents[0]\n",
" \n",
" root_node = MixNode()\n",
" for r in root_layer_without_parents:\n",
" root_node.add_child(r)\n",
" \n",
" return root_node\n",
" \n",
" \n",
" \n",
"\n",
" @staticmethod\n",
" def from_ingredients(ingredients: list):\n",
" root = MixNode()\n",
" \n",
" for ing in ingredients:\n",
" root.add_child(IngredientNode(ing, constant=True))\n",
" \n",
" return Tree(root)\n",
" \n",
" @staticmethod\n",
" def from_serialization(s):\n",
" def empty_node(raw_n):\n",
" if raw_n['type'] == \"MixNode\":\n",
" node = MixNode(raw_n['constant'])\n",
" elif raw_n['type'] == \"IngredientNode\":\n",
" node = IngredientNode(raw_n['name'], raw_n['constant'])\n",
" elif raw_n['type'] == \"ActionNode\":\n",
" node = ActionNode(raw_n['name'], raw_n['constant'])\n",
" else:\n",
" print(\"unknown node detected\")\n",
" return\n",
" \n",
" return node\n",
" \n",
" nodes = {}\n",
" for n in s:\n",
" nodes[n['id']] = empty_node(n)\n",
" \n",
" for n in s:\n",
" childs = n['childs']\n",
" id = n['id']\n",
" for c in childs:\n",
" nodes[id].add_child(nodes[c])\n",
" \n",
" return Tree(nodes[s[0]['id']])\n",
" \n",
" \n",
" def __init__(self, root):\n",
" # create a dummy entry node\n",
" self._root = RecipeTreeNode(\"root\", single_child=True)\n",
" self._root.add_child(root)\n",
" \n",
" def root(self):\n",
" return self._root.child()\n",
" \n",
" def mutate(self):\n",
" nodes = self.root().traverse()\n",
" weights = [n.n_mutate_options() for n in nodes]\n",
" \n",
" n = random.choices(nodes, weights)[0]\n",
" \n",
" n.mutate()\n",
" \n",
" def dot(self):\n",
" return self.root().dot()\n",
" \n",
" def serialize(self):\n",
" return [n.serialize() for n in self.root().traverse()]\n",
" \n",
" def structure_score(self):\n",
" n_duplicates = 0\n",
" \n",
" \n",
" def collect_scores(self):\n",
" self._mix_scores = []\n",
" self._act_scores = []\n",
" self._ing_scores = []\n",
" \n",
" nodes = self.root().traverse()\n",
" self._n_mix_nodes = 0\n",
" self._n_act_nodes = 0\n",
" self._n_ing_nodes = 0\n",
" \n",
" s = 0\n",
" for n in nodes:\n",
" if type(n) == MixNode:\n",
" self._mix_scores.append(n.node_score())\n",
" self._n_mix_nodes += 1\n",
" if type(n) == ActionNode:\n",
" self._act_scores.append(n.node_score())\n",
" self._n_act_nodes += 1\n",
" if type(n) == IngredientNode:\n",
" self._ing_scores.append(n.node_score())\n",
" self._n_ing_nodes += 1\n",
" \n",
" self._n_duplicates = 0\n",
" seen_actions = set()\n",
" \n",
" for n in nodes:\n",
" if type(n) == ActionNode:\n",
" if n.name() in seen_actions:\n",
" self._n_duplicates += 1\n",
" else:\n",
" seen_actions.add(n.name())\n",
" \n",
" self._mix_scores = np.array(self._mix_scores)\n",
" self._act_scores = np.array(self._act_scores)\n",
" self._ing_scores = np.array(self._ing_scores)\n",
" \n",
" \n",
" def mix_scores(self):\n",
" return self._mix_scores\n",
" \n",
" def action_scores(self):\n",
" return self._act_scores\n",
" \n",
" def ing_scores(self):\n",
" return self._ing_scores\n",
" \n",
" def bounds_mix_scores(self):\n",
" \n",
" nonzeros = self._mix_scores[self._mix_scores > 0]\n",
" if len(nonzeros) > 0:\n",
" mmax = np.max(nonzeros)\n",
" mmin = np.min(nonzeros)\n",
" return mmin, mmax\n",
" else:\n",
" return None, None\n",
" \n",
" def bounds_act_scores(self):\n",
" \n",
" if len(self._act_scores) == 0:\n",
" return None, None\n",
" nonzeros = self._act_scores[self._act_scores > 0]\n",
" if len(nonzeros) > 0:\n",
" mmax = np.max(nonzeros)\n",
" mmin = np.min(nonzeros)\n",
" return mmin, mmax\n",
" else:\n",
" return None, None\n",
" \n",
" def normalized_mix_scores(self, min, max):\n",
" if (max != min):\n",
" normalized = (self._mix_scores - min)/(max-min)\n",
" normalized[normalized <= 0] = 0\n",
" return normalized\n",
" else:\n",
" return None\n",
" \n",
" def normalized_act_scores(self, min, max):\n",
" if len(self._act_scores) == 0 or max == min:\n",
" return None\n",
" normalized = (self._act_scores - min)/(max-min)\n",
" normalized[normalized <= 0] = 0\n",
" return normalized\n",
" \n",
" def copy(self):\n",
" return Tree.from_serialization(self.serialize())\n"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"base_ings = [\"noodle\", \"bacon\", \"salt\", \"pepper\", \"tomato\", \"onion\"]\n",
"#test_ings = [Ingredient(i) for i in base_ings]\n",
"\n",
"#test_ings[0].__dir__()\n",
"\n",
"n = Tree.build_initial_tree(base_ings)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"794pt\" height=\"239pt\"\n viewBox=\"0.00 0.00 794.00 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 790,-234.9117 790,4 -4,4\"/>\n<!-- 7 -->\n<g id=\"node1\" class=\"node\">\n<title>7</title>\n<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"393\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n<text text-anchor=\"start\" x=\"378.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"382.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">heat</text>\n<text text-anchor=\"start\" x=\"341\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.7714</text>\n</g>\n<!-- 6 -->\n<g id=\"node2\" class=\"node\">\n<title>6</title>\n<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"393,-144 273,-108 393,-72 513,-108 393,-144\"/>\n<text text-anchor=\"start\" x=\"379.5\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"383.5\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n<text text-anchor=\"start\" x=\"341\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2565</text>\n</g>\n<!-- 7&#45;&gt;6 -->\n<g id=\"edge1\" class=\"edge\">\n<title>7&#45;&gt;6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M393,-179.8505C393,-171.9868 393,-163.0773 393,-154.2748\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"396.5001,-154.0596 393,-144.0596 389.5001,-154.0597 396.5001,-154.0596\"/>\n</g>\n<!-- 5 -->\n<g id=\"node3\" class=\"node\">\n<title>5</title>\n<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-36 0,-36 0,0 116,0 116,-36\"/>\n<text text-anchor=\"start\" x=\"39.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"43.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n<text text-anchor=\"start\" x=\"8\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n</g>\n<!-- 6&#45;&gt;5 -->\n<g id=\"edge2\" class=\"edge\">\n<title>6&#45;&gt;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M329.5952,-90.9659C271.3775,-75.3253 185.3636,-52.2171 125.7974,-36.2142\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"126.6701,-32.8246 116.1045,-33.6102 124.8539,-39.5849 126.6701,-32.8246\"/>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-36 134,-36 134,0 250,0 250,-36\"/>\n<text text-anchor=\"start\" x=\"169.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"173.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n<text text-anchor=\"start\" x=\"142\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n</g>\n<!-- 6&#45;&gt;3 -->\n<g id=\"edge3\" class=\"edge\">\n<title>6&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M344.8555,-86.4428C313.7007,-72.4929 273.233,-54.373 241.7628,-40.2818\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"242.8625,-36.9395 232.3053,-36.0472 240.0018,-43.3283 242.8625,-36.9395\"/>\n</g>\n<!-- 1 -->\n<g id=\"node5\" class=\"node\">\n<title>1</title>\n<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-36 268,-36 268,0 384,0 384,-36\"/>\n<text text-anchor=\"start\" x=\"306.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"310.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n<text text-anchor=\"start\" x=\"276\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n</g>\n<!-- 6&#45;&gt;1 -->\n<g id=\"edge4\" class=\"edge\">\n<title>6&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M371.0617,-78.5306C362.8707,-67.5278 353.6287,-55.1131 345.656,-44.4036\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"348.3576,-42.1713 339.5786,-36.2399 342.7426,-46.3513 348.3576,-42.1713\"/>\n</g>\n<!-- 4 -->\n<g id=\"node6\" class=\"node\">\n<title>4</title>\n<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-36 402,-36 402,0 518,0 518,-36\"/>\n<text text-anchor=\"start\" x=\"437\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"441\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n<text text-anchor=\"start\" x=\"410\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n</g>\n<!-- 6&#45;&gt;4 -->\n<g id=\"edge5\" class=\"edge\">\n<title>6&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M414.9383,-78.5306C423.1293,-67.5278 432.3713,-55.1131 440.344,-44.4036\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"443.2574,-46.3513 446.4214,-36.2399 437.6424,-42.1713 443.2574,-46.3513\"/>\n</g>\n<!-- 0 -->\n<g id=\"node7\" class=\"node\">\n<title>0</title>\n<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"652,-36 536,-36 536,0 652,0 652,-36\"/>\n<text text-anchor=\"start\" x=\"572.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"576.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n<text text-anchor=\"start\" x=\"544\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n</g>\n<!-- 6&#45;&gt;0 -->\n<g id=\"edge6\" class=\"edge\">\n<title>6&#45;&gt;0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M441.1445,-86.4428C472.2993,-72.4929 512.767,-54.373 544.2372,-40.2818\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"545.9982,-43.3283 553.6947,-36.0472 543.1375,-36.9395 545.9982,-43.3283\"/>\n</g>\n<!-- 2 -->\n<g id=\"node8\" class=\"node\">\n<title>2</title>\n<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"786,-36 670,-36 670,0 786,0 786,-36\"/>\n<text text-anchor=\"start\" x=\"715.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n<text text-anchor=\"start\" x=\"719.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n<text text-anchor=\"start\" x=\"678\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n</g>\n<!-- 6&#45;&gt;2 -->\n<g id=\"edge7\" class=\"edge\">\n<title>6&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M456.4048,-90.9659C514.6225,-75.3253 600.6364,-52.2171 660.2026,-36.2142\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"661.1461,-39.5849 669.8955,-33.6102 659.3299,-32.8246 661.1461,-39.5849\"/>\n</g>\n</g>\n</svg>\n",
"text/plain": "<graphviz.dot.Digraph at 0x7f5cbfe92510>"
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"n.dot()"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": "(array(['cook', 'bake', 'drain', 'heat', 'place', 'boil', 'cut', 'pour'],\n dtype='<U11'), array([315, 208, 156, 126, 115, 114, 76, 56]))"
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m_base_act.get_backward_adjacent(\"noodle\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Population"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"class Population(object):\n",
" def __init__(self, start_ingredients, n_population = 10):\n",
" self.population = [Tree.from_ingredients(start_ingredients) for i in range(n_population)]\n",
" self._n = n_population\n",
" self._mix_min = None\n",
" self._mix_max = None\n",
" self._act_min = None\n",
" self._act_max = None\n",
" self._mix_scores = None\n",
" self._act_scores = None\n",
" self._scores = None\n",
" \n",
" def mutate(self):\n",
" for tree in self.population.copy():\n",
" t_clone = tree.copy()\n",
" t_clone.mutate()\n",
" self.population.append(t_clone)\n",
" \n",
" def pairwise_competition(self):\n",
" new_population = []\n",
" indices = list(range(len(self.population)))\n",
" random.shuffle(indices)\n",
" \n",
" for i in range(len(self.population) // 2):\n",
" i_a = indices[2*i]\n",
" i_b = indices[2*i+1]\n",
" \n",
" if self._scores[i_a] > self._scores[i_b]:\n",
" new_population.append(self.population[i_a])\n",
" else:\n",
" new_population.append(self.population[i_b])\n",
" \n",
" self.population = new_population\n",
" \n",
" def hold_best(self, n=10):\n",
" sorted_indices = np.argsort(-self._scores)\n",
" \n",
" self.population = np.array(self.population)[sorted_indices[:n]].tolist()\n",
" \n",
" def analyse_scores(self):\n",
" for tree in self.population:\n",
" min, max = tree.bounds_mix_scores()\n",
" if min is not None and max is not None:\n",
" if self._mix_min is None or min < self._mix_min:\n",
" self._mix_min = min\n",
" if self._mix_max is None or max > self._mix_max:\n",
" self._mix_max = max\n",
" \n",
" min, max = tree.bounds_act_scores()\n",
" if min is not None and max is not None:\n",
" if self._act_min is None or min < self._act_min:\n",
" self._act_min = min\n",
" if self._act_max is None or max > self._act_max:\n",
" self._act_max = max\n",
" \n",
" def single_score(self, mix_scores, act_scores, ing_scores):\n",
" if mix_scores is None or act_scores is None or ing_scores is None:\n",
" return 0\n",
" score = (0.5 * np.average(mix_scores) + 0.5 * np.average(act_scores)) * np.average(ing_scores)\n",
" # judging also how many actions we have. So far use a gaussian with mean at number of ingredients\n",
" \n",
" score *= gaussian(len(act_scores), len(mix_scores), 1)\n",
" return score\n",
" \n",
" \n",
" \n",
" def collect_scores(self):\n",
" for tree in self.population:\n",
" tree.collect_scores()\n",
" \n",
" self.analyse_scores()\n",
" \n",
" if self._mix_min is not None and self._mix_max is not None:\n",
" self._mix_scores = [t.normalized_mix_scores(self._mix_min, self._mix_max) for t in self.population]\n",
" else:\n",
" # if no normalization can be done, all values are the same or 0.\n",
" # in this case just fill in zeros as score\n",
" self._mix_scores = [np.zeros(shape=t._mix_scores.shape) for t in self.population]\n",
" \n",
" if self._act_min is not None and self._act_max is not None:\n",
" self._act_scores = [t.normalized_act_scores(self._act_min, self._act_max) for t in self.population]\n",
" else:\n",
" self._act_scores = [np.zeros(shape=t._act_scores) for t in self.population]\n",
" \n",
" self._scores = []\n",
" for i in range(len(self._mix_scores)):\n",
" #print (self._mix_scores[i], self._act_scores[i])\n",
" if self._act_scores is None or self._mix_scores is None or self._act_scores[i] is None:\n",
" self._scores.append(0)\n",
" continue\n",
" \n",
" s = self.single_score(self._mix_scores[i], self._act_scores[i], self.population[i].ing_scores())\n",
" self._scores.append(s)\n",
" self._scores = np.array(self._scores)\n",
" \n",
" def run(self, n=50):\n",
" for i in range(n):\n",
" print(i)\n",
" self.mutate()\n",
" self.mutate()\n",
" self.collect_scores()\n",
" #self.pairwise_competition()\n",
" #self.collect_scores()\n",
" self.hold_best(self._n)\n",
" \n",
" \n",
" \n",
" def plot_population(self):\n",
" self.collect_scores()\n",
" #print(self._mix_scores)\n",
" #print(self._act_scores)\n",
" #print(self._scores)\n",
" for i, t in enumerate(self.population):\n",
" display(self._scores[i])\n",
" display(t.root().dot())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Run Evolutionary Algorithm"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
"p = Population([\"noodle\", \"bacon\", \"salt\", \"pepper\", \"tomato\", \"onion\"])"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"#p_ingredient_unprepared(list(p.population[0].root().childs())[0]._name) < 0.2"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n"
]
}
],
"source": [
"p.run(1)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.15600101279542286"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"239pt\"\n",
" viewBox=\"0.00 0.00 847.85 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 843.8528,-234.9117 843.8528,4 -4,4\"/>\n",
"<!-- 152 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>152</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"393,-230.9117 273,-194.9117 393,-158.9117 513,-194.9117 393,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"379.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"383.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2583</text>\n",
"</g>\n",
"<!-- 154 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>154</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"35\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"39\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;154 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>152&#45;&gt;154</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M326.098,-178.9266C271.5494,-165.4183 192.7289,-144.8146 125,-122.9117 121.0708,-121.641 117.0343,-120.272 112.9844,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.1489,-115.5509 103.5544,-115.4654 111.7833,-122.139 114.1489,-115.5509\"/>\n",
"</g>\n",
"<!-- 153 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>153</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"172.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"176.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;153 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>152&#45;&gt;153</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M346.8865,-172.5533C314.3958,-156.8001 271.0526,-135.7849 238.4805,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.6955,-116.6916 229.1704,-115.4781 236.6415,-122.9903 239.6955,-116.6916\"/>\n",
"</g>\n",
"<!-- 158 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>158</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"313.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"317.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;158 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>152&#45;&gt;158</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M372.3511,-164.8765C363.3539,-151.7895 352.899,-136.5822 344.1981,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"347.0436,-121.887 338.4942,-115.6294 341.2753,-125.8527 347.0436,-121.887\"/>\n",
"</g>\n",
"<!-- 157 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>157</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-115.4558 402,-115.4558 402,-79.4558 518,-79.4558 518,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"441.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"445.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;157 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>152&#45;&gt;157</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M413.6489,-164.8765C422.6461,-151.7895 433.101,-136.5822 441.8019,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"444.7247,-125.8527 447.5058,-115.6294 438.9564,-121.887 444.7247,-125.8527\"/>\n",
"</g>\n",
"<!-- 155 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>155</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"652,-115.4558 536,-115.4558 536,-79.4558 652,-79.4558 652,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"571.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"575.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"544\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;155 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>152&#45;&gt;155</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M439.1135,-172.5533C471.6042,-156.8001 514.9474,-135.7849 547.5195,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"549.3585,-122.9903 556.8296,-115.4781 546.3045,-116.6916 549.3585,-122.9903\"/>\n",
"</g>\n",
"<!-- 160 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>160</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"755\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"739\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"743\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"703\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;160 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>152&#45;&gt;160</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M456.6348,-177.8542C510.9421,-163.2878 591.1109,-141.763 661,-122.9117 667.8458,-121.0652 674.9713,-119.1405 682.1012,-117.2128\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"683.0612,-120.579 691.8005,-114.5893 681.2335,-113.8218 683.0612,-120.579\"/>\n",
"</g>\n",
"<!-- 156 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>156</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"813,-36 697,-36 697,0 813,0 813,-36\"/>\n",
"<text text-anchor=\"start\" x=\"733.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"737.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"705\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 160&#45;&gt;156 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>160&#45;&gt;156</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M755,-71.8782C755,-63.7122 755,-54.6289 755,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"758.5001,-46.2287 755,-36.2288 751.5001,-46.2288 758.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8baf0e10>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.15600101279542283"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"239pt\"\n",
" viewBox=\"0.00 0.00 847.85 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 843.8528,-234.9117 843.8528,4 -4,4\"/>\n",
"<!-- 263 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>263</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"393,-230.9117 273,-194.9117 393,-158.9117 513,-194.9117 393,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"379.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"383.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2583</text>\n",
"</g>\n",
"<!-- 265 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>265</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"38.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"42.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 263&#45;&gt;265 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>263&#45;&gt;265</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M326.098,-178.9266C271.5494,-165.4183 192.7289,-144.8146 125,-122.9117 121.0708,-121.641 117.0343,-120.272 112.9844,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.1489,-115.5509 103.5544,-115.4654 111.7833,-122.139 114.1489,-115.5509\"/>\n",
"</g>\n",
"<!-- 264 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>264</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"179.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"183.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 263&#45;&gt;264 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>263&#45;&gt;264</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M346.8865,-172.5533C314.3958,-156.8001 271.0526,-135.7849 238.4805,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.6955,-116.6916 229.1704,-115.4781 236.6415,-122.9903 239.6955,-116.6916\"/>\n",
"</g>\n",
"<!-- 269 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>269</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"307.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"311.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 263&#45;&gt;269 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>263&#45;&gt;269</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M372.3511,-164.8765C363.3539,-151.7895 352.899,-136.5822 344.1981,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"347.0436,-121.887 338.4942,-115.6294 341.2753,-125.8527 347.0436,-121.887\"/>\n",
"</g>\n",
"<!-- 267 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>267</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-115.4558 402,-115.4558 402,-79.4558 518,-79.4558 518,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"437\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"441\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 263&#45;&gt;267 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>263&#45;&gt;267</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M413.6489,-164.8765C422.6461,-151.7895 433.101,-136.5822 441.8019,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"444.7247,-125.8527 447.5058,-115.6294 438.9564,-121.887 444.7247,-125.8527\"/>\n",
"</g>\n",
"<!-- 268 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>268</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"652,-115.4558 536,-115.4558 536,-79.4558 652,-79.4558 652,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"571.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"575.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"544\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 263&#45;&gt;268 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>263&#45;&gt;268</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M439.1135,-172.5533C471.6042,-156.8001 514.9474,-135.7849 547.5195,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"549.3585,-122.9903 556.8296,-115.4781 546.3045,-116.6916 549.3585,-122.9903\"/>\n",
"</g>\n",
"<!-- 271 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>271</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"755\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"739\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"743\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"703\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 263&#45;&gt;271 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>263&#45;&gt;271</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M456.6348,-177.8542C510.9421,-163.2878 591.1109,-141.763 661,-122.9117 667.8458,-121.0652 674.9713,-119.1405 682.1012,-117.2128\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"683.0612,-120.579 691.8005,-114.5893 681.2335,-113.8218 683.0612,-120.579\"/>\n",
"</g>\n",
"<!-- 266 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>266</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"813,-36 697,-36 697,0 813,0 813,-36\"/>\n",
"<text text-anchor=\"start\" x=\"733.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"737.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"705\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 271&#45;&gt;266 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>271&#45;&gt;266</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M755,-71.8782C755,-63.7122 755,-54.6289 755,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"758.5001,-46.2287 755,-36.2288 751.5001,-46.2288 758.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.14231469422656626"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 847.85 325.82\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 321.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-321.8234 843.8528,-321.8234 843.8528,4 -4,4\"/>\n",
"<!-- 367 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>367</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"446.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"432.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"436.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cool</text>\n",
"<text text-anchor=\"start\" x=\"394.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2416</text>\n",
"</g>\n",
"<!-- 358 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>358</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"446.8528,-230.9117 326.8528,-194.9117 446.8528,-158.9117 566.8528,-194.9117 446.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"433.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"437.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"394.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2583</text>\n",
"</g>\n",
"<!-- 367&#45;&gt;358 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>367&#45;&gt;358</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M446.8528,-266.7622C446.8528,-258.8985 446.8528,-249.989 446.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"450.3529,-240.9713 446.8528,-230.9713 443.3529,-240.9714 450.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 364 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>364</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"68.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"72.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 358&#45;&gt;364 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>358&#45;&gt;364</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M383.218,-177.8542C328.9107,-163.2878 248.7419,-141.763 178.8528,-122.9117 172.007,-121.0652 164.8815,-119.1405 157.7516,-117.2128\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"158.6193,-113.8218 148.0523,-114.5893 156.7916,-120.579 158.6193,-113.8218\"/>\n",
"</g>\n",
"<!-- 363 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>363</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"303.8528,-115.4558 187.8528,-115.4558 187.8528,-79.4558 303.8528,-79.4558 303.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"223.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"227.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"195.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 358&#45;&gt;363 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>358&#45;&gt;363</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M400.7394,-172.5533C368.2486,-156.8001 324.9054,-135.7849 292.3333,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"293.5483,-116.6916 283.0232,-115.4781 290.4943,-122.9903 293.5483,-116.6916\"/>\n",
"</g>\n",
"<!-- 362 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>362</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"437.8528,-115.4558 321.8528,-115.4558 321.8528,-79.4558 437.8528,-79.4558 437.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"361.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"365.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"329.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 358&#45;&gt;362 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>358&#45;&gt;362</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M426.2039,-164.8765C417.2067,-151.7895 406.7518,-136.5822 398.0509,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"400.8964,-121.887 392.347,-115.6294 395.1281,-125.8527 400.8964,-121.887\"/>\n",
"</g>\n",
"<!-- 361 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>361</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"571.8528,-115.4558 455.8528,-115.4558 455.8528,-79.4558 571.8528,-79.4558 571.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"501.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"505.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"463.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 358&#45;&gt;361 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>358&#45;&gt;361</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M467.5017,-164.8765C476.4989,-151.7895 486.9538,-136.5822 495.6547,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"498.5775,-125.8527 501.3587,-115.6294 492.8092,-121.887 498.5775,-125.8527\"/>\n",
"</g>\n",
"<!-- 360 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>360</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"705.8528,-115.4558 589.8528,-115.4558 589.8528,-79.4558 705.8528,-79.4558 705.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"628.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"632.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"597.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 358&#45;&gt;360 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>358&#45;&gt;360</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M492.9663,-172.5533C525.457,-156.8001 568.8002,-135.7849 601.3723,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"603.2113,-122.9903 610.6824,-115.4781 600.1573,-116.6916 603.2113,-122.9903\"/>\n",
"</g>\n",
"<!-- 359 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>359</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"839.8528,-115.4558 723.8528,-115.4558 723.8528,-79.4558 839.8528,-79.4558 839.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"758.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"762.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"731.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 358&#45;&gt;359 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>358&#45;&gt;359</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M513.7548,-178.9266C568.3034,-165.4183 647.1239,-144.8146 714.8528,-122.9117 718.782,-121.641 722.8185,-120.272 726.8684,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"728.0695,-122.139 736.2984,-115.4654 725.7039,-115.5509 728.0695,-122.139\"/>\n",
"</g>\n",
"<!-- 365 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>365</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"142.8528,-36 26.8528,-36 26.8528,0 142.8528,0 142.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"63.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"67.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 364&#45;&gt;365 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>364&#45;&gt;365</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M84.8528,-71.8782C84.8528,-63.7122 84.8528,-54.6289 84.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"88.3529,-46.2287 84.8528,-36.2288 81.3529,-46.2288 88.3529,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.13079458634574578"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 847.85 325.82\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 321.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-321.8234 843.8528,-321.8234 843.8528,4 -4,4\"/>\n",
"<!-- 291 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>291</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"446.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"430.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"434.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"394.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.8520</text>\n",
"</g>\n",
"<!-- 282 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>282</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"446.8528,-230.9117 326.8528,-194.9117 446.8528,-158.9117 566.8528,-194.9117 446.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"433.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"437.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"394.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2421</text>\n",
"</g>\n",
"<!-- 291&#45;&gt;282 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>291&#45;&gt;282</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M446.8528,-266.7622C446.8528,-258.8985 446.8528,-249.989 446.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"450.3529,-240.9713 446.8528,-230.9713 443.3529,-240.9714 450.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 283 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>283</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"73.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"77.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cut</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2756</text>\n",
"</g>\n",
"<!-- 282&#45;&gt;283 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>282&#45;&gt;283</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M383.218,-177.8542C328.9107,-163.2878 248.7419,-141.763 178.8528,-122.9117 172.007,-121.0652 164.8815,-119.1405 157.7516,-117.2128\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"158.6193,-113.8218 148.0523,-114.5893 156.7916,-120.579 158.6193,-113.8218\"/>\n",
"</g>\n",
"<!-- 289 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>289</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"303.8528,-115.4558 187.8528,-115.4558 187.8528,-79.4558 303.8528,-79.4558 303.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"233.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"237.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"195.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 282&#45;&gt;289 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>282&#45;&gt;289</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M400.7394,-172.5533C368.2486,-156.8001 324.9054,-135.7849 292.3333,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"293.5483,-116.6916 283.0232,-115.4781 290.4943,-122.9903 293.5483,-116.6916\"/>\n",
"</g>\n",
"<!-- 288 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>288</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"437.8528,-115.4558 321.8528,-115.4558 321.8528,-79.4558 437.8528,-79.4558 437.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"357.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"361.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"329.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 282&#45;&gt;288 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>282&#45;&gt;288</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M426.2039,-164.8765C417.2067,-151.7895 406.7518,-136.5822 398.0509,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"400.8964,-121.887 392.347,-115.6294 395.1281,-125.8527 400.8964,-121.887\"/>\n",
"</g>\n",
"<!-- 287 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>287</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"571.8528,-115.4558 455.8528,-115.4558 455.8528,-79.4558 571.8528,-79.4558 571.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"492.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"496.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"463.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 282&#45;&gt;287 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>282&#45;&gt;287</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M467.5017,-164.8765C476.4989,-151.7895 486.9538,-136.5822 495.6547,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"498.5775,-125.8527 501.3587,-115.6294 492.8092,-121.887 498.5775,-125.8527\"/>\n",
"</g>\n",
"<!-- 286 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>286</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"705.8528,-115.4558 589.8528,-115.4558 589.8528,-79.4558 705.8528,-79.4558 705.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"629.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"633.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"597.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 282&#45;&gt;286 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>282&#45;&gt;286</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M492.9663,-172.5533C525.457,-156.8001 568.8002,-135.7849 601.3723,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"603.2113,-122.9903 610.6824,-115.4781 600.1573,-116.6916 603.2113,-122.9903\"/>\n",
"</g>\n",
"<!-- 285 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>285</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"839.8528,-115.4558 723.8528,-115.4558 723.8528,-79.4558 839.8528,-79.4558 839.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"762.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"766.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"731.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 282&#45;&gt;285 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>282&#45;&gt;285</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M513.7548,-178.9266C568.3034,-165.4183 647.1239,-144.8146 714.8528,-122.9117 718.782,-121.641 722.8185,-120.272 726.8684,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"728.0695,-122.139 736.2984,-115.4654 725.7039,-115.5509 728.0695,-122.139\"/>\n",
"</g>\n",
"<!-- 284 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>284</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"142.8528,-36 26.8528,-36 26.8528,0 142.8528,0 142.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"61.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"65.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 283&#45;&gt;284 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>283&#45;&gt;284</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M84.8528,-71.8782C84.8528,-63.7122 84.8528,-54.6289 84.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"88.3529,-46.2287 84.8528,-36.2288 81.3529,-46.2288 88.3529,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.11722113709725497"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"239pt\"\n",
" viewBox=\"0.00 0.00 848.00 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 844,-234.9117 844,4 -4,4\"/>\n",
"<!-- 125 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>125</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"406,-230.9117 286,-194.9117 406,-158.9117 526,-194.9117 406,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"392.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"396.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"354\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2402</text>\n",
"</g>\n",
"<!-- 130 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>130</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"38.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"42.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 125&#45;&gt;130 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>125&#45;&gt;130</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M336.9658,-179.5076C279.7061,-166.1868 196.4099,-145.5473 125,-122.9117 121.0634,-121.6639 117.0215,-120.3118 112.9677,-118.9034\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.126,-115.6006 103.5313,-115.5376 111.7743,-122.1938 114.126,-115.6006\"/>\n",
"</g>\n",
"<!-- 129 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>129</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"179.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"183.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 125&#45;&gt;129 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>125&#45;&gt;129</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M358.2406,-173.162C323.2989,-157.2495 276.0497,-135.7322 240.8545,-119.7042\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"242.2766,-116.5061 231.7253,-115.5468 239.3755,-122.8766 242.2766,-116.5061\"/>\n",
"</g>\n",
"<!-- 127 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>127</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"303\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"307\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 125&#45;&gt;127 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>125&#45;&gt;127</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M382.214,-165.9356C371.1528,-152.4609 358.1004,-136.5605 347.3584,-123.4746\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"350.0572,-121.246 341.007,-115.7374 344.6467,-125.6875 350.0572,-121.246\"/>\n",
"</g>\n",
"<!-- 133 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>133</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"487\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"471\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"475\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"435\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6603</text>\n",
"</g>\n",
"<!-- 125&#45;&gt;133 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>125&#45;&gt;133</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M430.0834,-165.9356C439.4801,-154.6298 450.2961,-141.6164 459.9589,-129.9906\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"462.7324,-132.1293 466.4326,-122.2016 457.349,-127.655 462.7324,-132.1293\"/>\n",
"</g>\n",
"<!-- 126 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>126</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"706,-115.4558 590,-115.4558 590,-79.4558 706,-79.4558 706,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"629.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"633.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"598\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 125&#45;&gt;126 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>125&#45;&gt;126</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M457.322,-174.2438C497.3973,-158.1051 552.9415,-135.7368 593.7467,-119.3042\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"595.2922,-122.455 603.2608,-115.4728 592.6773,-115.9618 595.2922,-122.455\"/>\n",
"</g>\n",
"<!-- 128 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>128</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"840,-115.4558 724,-115.4558 724,-79.4558 840,-79.4558 840,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"759.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"763.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"732\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 125&#45;&gt;128 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>125&#45;&gt;128</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M479.154,-180.7553C542.2319,-167.8645 635.4423,-147.1743 715,-122.9117 719.0169,-121.6866 723.1392,-120.3422 727.2693,-118.9311\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"728.6084,-122.1701 736.8742,-115.5423 726.2794,-115.5689 728.6084,-122.1701\"/>\n",
"</g>\n",
"<!-- 131 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>131</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"545,-36 429,-36 429,0 545,0 545,-36\"/>\n",
"<text text-anchor=\"start\" x=\"465.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"469.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"437\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 133&#45;&gt;131 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>133&#45;&gt;131</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M487,-71.8782C487,-63.7122 487,-54.6289 487,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"490.5001,-46.2287 487,-36.2288 483.5001,-46.2288 490.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.11055457053445297"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"636pt\" height=\"347pt\"\n",
" viewBox=\"0.00 0.00 635.85 346.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 342.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-342.9117 631.8528,-342.9117 631.8528,4 -4,4\"/>\n",
"<!-- 356 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>356</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"354.8528,-338.9117 234.8528,-302.9117 354.8528,-266.9117 474.8528,-302.9117 354.8528,-338.9117\"/>\n",
"<text text-anchor=\"start\" x=\"341.3528\" y=\"-306.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"345.3528\" y=\"-306.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"302.8528\" y=\"-292.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.0000</text>\n",
"</g>\n",
"<!-- 350 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>350</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"59.8528\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"63.8528\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">simmer</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.4219</text>\n",
"</g>\n",
"<!-- 356&#45;&gt;350 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>356&#45;&gt;350</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M300.2143,-283.19C256.4812,-267.4047 195.0579,-245.2341 148.9945,-228.6076\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"150.0044,-225.2512 139.4101,-225.1482 147.6278,-231.8354 150.0044,-225.2512\"/>\n",
"</g>\n",
"<!-- 355 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>355</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"274.8528\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"257.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"261.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">place</text>\n",
"<text text-anchor=\"start\" x=\"222.8528\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3497</text>\n",
"</g>\n",
"<!-- 356&#45;&gt;355 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>356&#45;&gt;355</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M331.0668,-273.9356C321.786,-262.6298 311.1035,-249.6164 301.5601,-237.9906\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"304.2164,-235.7103 295.1663,-230.2016 298.8059,-240.1517 304.2164,-235.7103\"/>\n",
"</g>\n",
"<!-- 353 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>353</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"493.8528,-223.4558 377.8528,-223.4558 377.8528,-187.4558 493.8528,-187.4558 493.8528,-223.4558\"/>\n",
"<text text-anchor=\"start\" x=\"414.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"418.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"385.8528\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 356&#45;&gt;353 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>356&#45;&gt;353</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M378.9362,-273.9356C390.1356,-260.4609 403.3511,-244.5605 414.2274,-231.4746\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"416.9579,-233.6651 420.6582,-223.7374 411.5746,-229.1907 416.9579,-233.6651\"/>\n",
"</g>\n",
"<!-- 348 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>348</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"627.8528,-223.4558 511.8528,-223.4558 511.8528,-187.4558 627.8528,-187.4558 627.8528,-223.4558\"/>\n",
"<text text-anchor=\"start\" x=\"550.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"554.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"519.8528\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 356&#45;&gt;348 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>356&#45;&gt;348</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M402.8354,-281.162C437.9404,-265.2495 485.4103,-243.7322 520.77,-227.7042\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"522.2789,-230.8632 529.9419,-223.5468 519.3889,-224.4876 522.2789,-230.8632\"/>\n",
"</g>\n",
"<!-- 351 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>351</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"138.8528,-126 22.8528,-126 22.8528,-90 138.8528,-90 138.8528,-126\"/>\n",
"<text text-anchor=\"start\" x=\"58.3528\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"62.3528\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"30.8528\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 350&#45;&gt;351 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>350&#45;&gt;351</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M83.8019,-179.8505C83.2539,-166.5006 82.5823,-150.1364 82.0184,-136.3988\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"85.501,-135.9005 81.5938,-126.0525 78.5069,-136.1876 85.501,-135.9005\"/>\n",
"</g>\n",
"<!-- 357 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>357</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"276.8528,-144 156.8528,-108 276.8528,-72 396.8528,-108 276.8528,-144\"/>\n",
"<text text-anchor=\"start\" x=\"263.3528\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"267.3528\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"224.8528\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.4135</text>\n",
"</g>\n",
"<!-- 355&#45;&gt;357 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>355&#45;&gt;357</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M275.3783,-179.8505C275.5397,-171.9868 275.7225,-163.0773 275.9032,-154.2748\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"279.4068,-154.1294 276.1128,-144.0596 272.4083,-153.9857 279.4068,-154.1294\"/>\n",
"</g>\n",
"<!-- 352 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>352</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"200.8528,-36 84.8528,-36 84.8528,0 200.8528,0 200.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"130.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"134.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"92.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 357&#45;&gt;352 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>357&#45;&gt;352</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M239.5263,-82.93C220.3199,-70.0301 197.0366,-54.3921 178.1328,-41.6955\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"180.0388,-38.7595 169.7859,-36.0894 176.1358,-44.5705 180.0388,-38.7595\"/>\n",
"</g>\n",
"<!-- 347 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>347</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"334.8528,-36 218.8528,-36 218.8528,0 334.8528,0 334.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"253.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"257.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"226.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 357&#45;&gt;347 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>357&#45;&gt;347</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M276.8528,-71.9121C276.8528,-63.3433 276.8528,-54.3253 276.8528,-46.1692\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"280.3529,-46.0539 276.8528,-36.0539 273.3529,-46.0539 280.3529,-46.0539\"/>\n",
"</g>\n",
"<!-- 349 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>349</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"468.8528,-36 352.8528,-36 352.8528,0 468.8528,0 468.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"392.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"396.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"360.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 357&#45;&gt;349 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>357&#45;&gt;349</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M314.1793,-82.93C333.3857,-70.0301 356.6691,-54.3921 375.5728,-41.6955\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"377.5698,-44.5705 383.9197,-36.0894 373.6669,-38.7595 377.5698,-44.5705\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.10984776980514128"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 848.00 325.82\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 321.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-321.8234 844,-321.8234 844,4 -4,4\"/>\n",
"<!-- 333 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>333</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"393\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"373.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"377.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">warm</text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.1375</text>\n",
"</g>\n",
"<!-- 324 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>324</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"393,-230.9117 273,-194.9117 393,-158.9117 513,-194.9117 393,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"379.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"383.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2402</text>\n",
"</g>\n",
"<!-- 333&#45;&gt;324 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>333&#45;&gt;324</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M393,-266.7622C393,-258.8985 393,-249.989 393,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"396.5001,-240.9713 393,-230.9713 389.5001,-240.9714 396.5001,-240.9713\"/>\n",
"</g>\n",
"<!-- 326 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>326</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"45.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"49.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 324&#45;&gt;326 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>324&#45;&gt;326</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M326.098,-178.9266C271.5494,-165.4183 192.7289,-144.8146 125,-122.9117 121.0708,-121.641 117.0343,-120.272 112.9844,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.1489,-115.5509 103.5544,-115.4654 111.7833,-122.139 114.1489,-115.5509\"/>\n",
"</g>\n",
"<!-- 325 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>325</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"172.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"176.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 324&#45;&gt;325 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>324&#45;&gt;325</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M346.8865,-172.5533C314.3958,-156.8001 271.0526,-135.7849 238.4805,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.6955,-116.6916 229.1704,-115.4781 236.6415,-122.9903 239.6955,-116.6916\"/>\n",
"</g>\n",
"<!-- 331 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>331</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"303.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"307.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 324&#45;&gt;331 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>324&#45;&gt;331</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M372.3511,-164.8765C363.3539,-151.7895 352.899,-136.5822 344.1981,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"347.0436,-121.887 338.4942,-115.6294 341.2753,-125.8527 347.0436,-121.887\"/>\n",
"</g>\n",
"<!-- 330 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>330</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-115.4558 402,-115.4558 402,-79.4558 518,-79.4558 518,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"441.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"445.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 324&#45;&gt;330 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>324&#45;&gt;330</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M413.6489,-164.8765C422.6461,-151.7895 433.101,-136.5822 441.8019,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"444.7247,-125.8527 447.5058,-115.6294 438.9564,-121.887 444.7247,-125.8527\"/>\n",
"</g>\n",
"<!-- 328 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>328</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"621\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"605\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"609\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"569\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6603</text>\n",
"</g>\n",
"<!-- 324&#45;&gt;328 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>324&#45;&gt;328</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M442.7538,-173.645C478.1458,-158.5171 525.8041,-138.1462 562.9362,-122.2745\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"564.3163,-125.491 572.1358,-118.3422 561.565,-119.0544 564.3163,-125.491\"/>\n",
"</g>\n",
"<!-- 327 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>327</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"840,-115.4558 724,-115.4558 724,-79.4558 840,-79.4558 840,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"759\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"763\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"732\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 324&#45;&gt;327 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>324&#45;&gt;327</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M467.9584,-181.309C533.7228,-168.6284 631.6036,-147.938 715,-122.9117 719.0894,-121.6845 723.2862,-120.329 727.4882,-118.9015\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"728.9817,-122.0865 737.2541,-115.467 726.6593,-115.483 728.9817,-122.0865\"/>\n",
"</g>\n",
"<!-- 329 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>329</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"679,-36 563,-36 563,0 679,0 679,-36\"/>\n",
"<text text-anchor=\"start\" x=\"599.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"603.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"571\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 328&#45;&gt;329 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>328&#45;&gt;329</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M621,-71.8782C621,-63.7122 621,-54.6289 621,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"624.5001,-46.2287 621,-36.2288 617.5001,-46.2288 624.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.07842295704725359"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"239pt\"\n",
" viewBox=\"0.00 0.00 847.85 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 843.8528,-234.9117 843.8528,4 -4,4\"/>\n",
"<!-- 89 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>89</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"446.8528,-230.9117 326.8528,-194.9117 446.8528,-158.9117 566.8528,-194.9117 446.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"433.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"437.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"394.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2421</text>\n",
"</g>\n",
"<!-- 97 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>97</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"73.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"77.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cut</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2756</text>\n",
"</g>\n",
"<!-- 89&#45;&gt;97 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>89&#45;&gt;97</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M383.218,-177.8542C328.9107,-163.2878 248.7419,-141.763 178.8528,-122.9117 172.007,-121.0652 164.8815,-119.1405 157.7516,-117.2128\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"158.6193,-113.8218 148.0523,-114.5893 156.7916,-120.579 158.6193,-113.8218\"/>\n",
"</g>\n",
"<!-- 94 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>94</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"303.8528,-115.4558 187.8528,-115.4558 187.8528,-79.4558 303.8528,-79.4558 303.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"226.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"230.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"195.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 89&#45;&gt;94 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>89&#45;&gt;94</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M400.7394,-172.5533C368.2486,-156.8001 324.9054,-135.7849 292.3333,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"293.5483,-116.6916 283.0232,-115.4781 290.4943,-122.9903 293.5483,-116.6916\"/>\n",
"</g>\n",
"<!-- 95 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>95</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"437.8528,-115.4558 321.8528,-115.4558 321.8528,-79.4558 437.8528,-79.4558 437.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"361.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"365.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"329.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 89&#45;&gt;95 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>89&#45;&gt;95</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M426.2039,-164.8765C417.2067,-151.7895 406.7518,-136.5822 398.0509,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"400.8964,-121.887 392.347,-115.6294 395.1281,-125.8527 400.8964,-121.887\"/>\n",
"</g>\n",
"<!-- 93 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>93</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"571.8528,-115.4558 455.8528,-115.4558 455.8528,-79.4558 571.8528,-79.4558 571.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"492.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"496.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"463.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 89&#45;&gt;93 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>89&#45;&gt;93</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M467.5017,-164.8765C476.4989,-151.7895 486.9538,-136.5822 495.6547,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"498.5775,-125.8527 501.3587,-115.6294 492.8092,-121.887 498.5775,-125.8527\"/>\n",
"</g>\n",
"<!-- 92 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>92</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"705.8528,-115.4558 589.8528,-115.4558 589.8528,-79.4558 705.8528,-79.4558 705.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"625.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"629.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"597.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 89&#45;&gt;92 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>89&#45;&gt;92</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M492.9663,-172.5533C525.457,-156.8001 568.8002,-135.7849 601.3723,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"603.2113,-122.9903 610.6824,-115.4781 600.1573,-116.6916 603.2113,-122.9903\"/>\n",
"</g>\n",
"<!-- 91 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>91</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"839.8528,-115.4558 723.8528,-115.4558 723.8528,-79.4558 839.8528,-79.4558 839.8528,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"769.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"773.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"731.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 89&#45;&gt;91 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>89&#45;&gt;91</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M513.7548,-178.9266C568.3034,-165.4183 647.1239,-144.8146 714.8528,-122.9117 718.782,-121.641 722.8185,-120.272 726.8684,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"728.0695,-122.139 736.2984,-115.4654 725.7039,-115.5509 728.0695,-122.139\"/>\n",
"</g>\n",
"<!-- 90 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>90</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"142.8528,-36 26.8528,-36 26.8528,0 142.8528,0 142.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"61.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"65.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 97&#45;&gt;90 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>97&#45;&gt;90</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M84.8528,-71.8782C84.8528,-63.7122 84.8528,-54.6289 84.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"88.3529,-46.2287 84.8528,-36.2288 81.3529,-46.2288 88.3529,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.07810123770938873"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"239pt\"\n",
" viewBox=\"0.00 0.00 848.00 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 844,-234.9117 844,4 -4,4\"/>\n",
"<!-- 212 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>212</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"393,-230.9117 273,-194.9117 393,-158.9117 513,-194.9117 393,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"379.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"383.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2520</text>\n",
"</g>\n",
"<!-- 216 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>216</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"45.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"49.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 212&#45;&gt;216 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>212&#45;&gt;216</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M326.098,-178.9266C271.5494,-165.4183 192.7289,-144.8146 125,-122.9117 121.0708,-121.641 117.0343,-120.272 112.9844,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.1489,-115.5509 103.5544,-115.4654 111.7833,-122.139 114.1489,-115.5509\"/>\n",
"</g>\n",
"<!-- 218 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>218</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"173.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"177.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 212&#45;&gt;218 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>212&#45;&gt;218</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M346.8865,-172.5533C314.3958,-156.8001 271.0526,-135.7849 238.4805,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.6955,-116.6916 229.1704,-115.4781 236.6415,-122.9903 239.6955,-116.6916\"/>\n",
"</g>\n",
"<!-- 214 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>214</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"303.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"307.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 212&#45;&gt;214 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>212&#45;&gt;214</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M372.3511,-164.8765C363.3539,-151.7895 352.899,-136.5822 344.1981,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"347.0436,-121.887 338.4942,-115.6294 341.2753,-125.8527 347.0436,-121.887\"/>\n",
"</g>\n",
"<!-- 213 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>213</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-115.4558 402,-115.4558 402,-79.4558 518,-79.4558 518,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"437\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"441\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 212&#45;&gt;213 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>212&#45;&gt;213</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M413.6489,-164.8765C422.6461,-151.7895 433.101,-136.5822 441.8019,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"444.7247,-125.8527 447.5058,-115.6294 438.9564,-121.887 444.7247,-125.8527\"/>\n",
"</g>\n",
"<!-- 220 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>220</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"621\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"606.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"610.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">slice</text>\n",
"<text text-anchor=\"start\" x=\"569\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2504</text>\n",
"</g>\n",
"<!-- 212&#45;&gt;220 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>212&#45;&gt;220</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M442.7538,-173.645C478.1458,-158.5171 525.8041,-138.1462 562.9362,-122.2745\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"564.3163,-125.491 572.1358,-118.3422 561.565,-119.0544 564.3163,-125.491\"/>\n",
"</g>\n",
"<!-- 217 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>217</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"840,-115.4558 724,-115.4558 724,-79.4558 840,-79.4558 840,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"760.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"764.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"732\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 212&#45;&gt;217 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>212&#45;&gt;217</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M467.9584,-181.309C533.7228,-168.6284 631.6036,-147.938 715,-122.9117 719.0894,-121.6845 723.2862,-120.329 727.4882,-118.9015\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"728.9817,-122.0865 737.2541,-115.467 726.6593,-115.483 728.9817,-122.0865\"/>\n",
"</g>\n",
"<!-- 215 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>215</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"679,-36 563,-36 563,0 679,0 679,-36\"/>\n",
"<text text-anchor=\"start\" x=\"601.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"605.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"571\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 220&#45;&gt;215 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>220&#45;&gt;215</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M621,-71.8782C621,-63.7122 621,-54.6289 621,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"624.5001,-46.2287 621,-36.2288 617.5001,-46.2288 624.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.06936547614329233"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"239pt\"\n",
" viewBox=\"0.00 0.00 848.00 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 844,-234.9117 844,4 -4,4\"/>\n",
"<!-- 98 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>98</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"393,-230.9117 273,-194.9117 393,-158.9117 513,-194.9117 393,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"379.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"383.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.1990</text>\n",
"</g>\n",
"<!-- 104 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>104</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"39.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"43.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 98&#45;&gt;104 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>98&#45;&gt;104</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M326.098,-178.9266C271.5494,-165.4183 192.7289,-144.8146 125,-122.9117 121.0708,-121.641 117.0343,-120.272 112.9844,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.1489,-115.5509 103.5544,-115.4654 111.7833,-122.139 114.1489,-115.5509\"/>\n",
"</g>\n",
"<!-- 103 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>103</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"170.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"174.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 98&#45;&gt;103 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>98&#45;&gt;103</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M346.8865,-172.5533C314.3958,-156.8001 271.0526,-135.7849 238.4805,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.6955,-116.6916 229.1704,-115.4781 236.6415,-122.9903 239.6955,-116.6916\"/>\n",
"</g>\n",
"<!-- 100 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>100</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"313.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"317.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 98&#45;&gt;100 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>98&#45;&gt;100</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M372.3511,-164.8765C363.3539,-151.7895 352.899,-136.5822 344.1981,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"347.0436,-121.887 338.4942,-115.6294 341.2753,-125.8527 347.0436,-121.887\"/>\n",
"</g>\n",
"<!-- 101 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>101</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-115.4558 402,-115.4558 402,-79.4558 518,-79.4558 518,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"437.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"441.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 98&#45;&gt;101 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>98&#45;&gt;101</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M413.6489,-164.8765C422.6461,-151.7895 433.101,-136.5822 441.8019,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"444.7247,-125.8527 447.5058,-115.6294 438.9564,-121.887 444.7247,-125.8527\"/>\n",
"</g>\n",
"<!-- 106 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>106</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"621\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"610\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"614\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">fry</text>\n",
"<text text-anchor=\"start\" x=\"569\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2833</text>\n",
"</g>\n",
"<!-- 98&#45;&gt;106 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>98&#45;&gt;106</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M442.7538,-173.645C478.1458,-158.5171 525.8041,-138.1462 562.9362,-122.2745\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"564.3163,-125.491 572.1358,-118.3422 561.565,-119.0544 564.3163,-125.491\"/>\n",
"</g>\n",
"<!-- 99 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>99</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"840,-115.4558 724,-115.4558 724,-79.4558 840,-79.4558 840,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"759\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"763\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"732\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 98&#45;&gt;99 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>98&#45;&gt;99</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M467.9584,-181.309C533.7228,-168.6284 631.6036,-147.938 715,-122.9117 719.0894,-121.6845 723.2862,-120.329 727.4882,-118.9015\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"728.9817,-122.0865 737.2541,-115.467 726.6593,-115.483 728.9817,-122.0865\"/>\n",
"</g>\n",
"<!-- 102 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>102</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"679,-36 563,-36 563,0 679,0 679,-36\"/>\n",
"<text text-anchor=\"start\" x=\"601.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"605.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"571\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 106&#45;&gt;102 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>106&#45;&gt;102</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M621,-71.8782C621,-63.7122 621,-54.6289 621,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"624.5001,-46.2287 621,-36.2288 617.5001,-46.2288 624.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8bb1a810>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"p.plot_population()"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
"<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n",
" -->\n",
"<!-- Title: %3 Pages: 1 -->\n",
"<svg width=\"848pt\" height=\"239pt\"\n",
" viewBox=\"0.00 0.00 847.85 238.91\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 234.9117)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-234.9117 843.8528,-234.9117 843.8528,4 -4,4\"/>\n",
"<!-- 152 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>152</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"393,-230.9117 273,-194.9117 393,-158.9117 513,-194.9117 393,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"379.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"383.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.2583</text>\n",
"</g>\n",
"<!-- 154 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>154</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-115.4558 0,-115.4558 0,-79.4558 116,-79.4558 116,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"35\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"39\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">tomato</text>\n",
"<text text-anchor=\"start\" x=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;154 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>152&#45;&gt;154</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M326.098,-178.9266C271.5494,-165.4183 192.7289,-144.8146 125,-122.9117 121.0708,-121.641 117.0343,-120.272 112.9844,-118.8514\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"114.1489,-115.5509 103.5544,-115.4654 111.7833,-122.139 114.1489,-115.5509\"/>\n",
"</g>\n",
"<!-- 153 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>153</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-115.4558 134,-115.4558 134,-79.4558 250,-79.4558 250,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"172.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"176.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bacon</text>\n",
"<text text-anchor=\"start\" x=\"142\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;153 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>152&#45;&gt;153</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M346.8865,-172.5533C314.3958,-156.8001 271.0526,-135.7849 238.4805,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.6955,-116.6916 229.1704,-115.4781 236.6415,-122.9903 239.6955,-116.6916\"/>\n",
"</g>\n",
"<!-- 158 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>158</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-115.4558 268,-115.4558 268,-79.4558 384,-79.4558 384,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"313.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"317.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">salt</text>\n",
"<text text-anchor=\"start\" x=\"276\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;158 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>152&#45;&gt;158</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M372.3511,-164.8765C363.3539,-151.7895 352.899,-136.5822 344.1981,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"347.0436,-121.887 338.4942,-115.6294 341.2753,-125.8527 347.0436,-121.887\"/>\n",
"</g>\n",
"<!-- 157 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>157</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518,-115.4558 402,-115.4558 402,-79.4558 518,-79.4558 518,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"441.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"445.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">onion</text>\n",
"<text text-anchor=\"start\" x=\"410\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;157 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>152&#45;&gt;157</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M413.6489,-164.8765C422.6461,-151.7895 433.101,-136.5822 441.8019,-123.9262\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"444.7247,-125.8527 447.5058,-115.6294 438.9564,-121.887 444.7247,-125.8527\"/>\n",
"</g>\n",
"<!-- 155 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>155</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"652,-115.4558 536,-115.4558 536,-79.4558 652,-79.4558 652,-115.4558\"/>\n",
"<text text-anchor=\"start\" x=\"571.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"575.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">pepper</text>\n",
"<text text-anchor=\"start\" x=\"544\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;155 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>152&#45;&gt;155</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M439.1135,-172.5533C471.6042,-156.8001 514.9474,-135.7849 547.5195,-119.9921\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"549.3585,-122.9903 556.8296,-115.4781 546.3045,-116.6916 549.3585,-122.9903\"/>\n",
"</g>\n",
"<!-- 160 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>160</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"755\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"739\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"743\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"703\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 152&#45;&gt;160 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>152&#45;&gt;160</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M456.6348,-177.8542C510.9421,-163.2878 591.1109,-141.763 661,-122.9117 667.8458,-121.0652 674.9713,-119.1405 682.1012,-117.2128\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"683.0612,-120.579 691.8005,-114.5893 681.2335,-113.8218 683.0612,-120.579\"/>\n",
"</g>\n",
"<!-- 156 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>156</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"813,-36 697,-36 697,0 813,0 813,-36\"/>\n",
"<text text-anchor=\"start\" x=\"733.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"737.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">noodle</text>\n",
"<text text-anchor=\"start\" x=\"705\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 160&#45;&gt;156 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>160&#45;&gt;156</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M755,-71.8782C755,-63.7122 755,-54.6289 755,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"758.5001,-46.2287 755,-36.2288 751.5001,-46.2288 758.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7f5b8aedded0>"
]
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"p.population[0].dot()"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
"an = list(p1.root().childs())[2]"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"source": [
"an.remove()"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'init.dot.pdf'"
]
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"p1.dot().render(filename=\"init.dot\")"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": "'init2.dot.pdf'"
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"n.dot().render(filename=\"init2.dot\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"file_extension": ".py",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"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.7.5rc1"
},
"mimetype": "text/x-python",
"name": "python",
"npconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": 3
},
"nbformat": 4,
"nbformat_minor": 4
}