master-thesis/EvolutionaryAlgorithm/EvolutionaryAlgorithm.ipynb
2020-01-04 13:49:14 +01:00

3414 lines
161 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"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/jonas/.local/lib/python3.7/site-packages/ipykernel_launcher.py:39: TqdmExperimentalWarning:\n",
"\n",
"Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n",
"\n"
]
}
],
"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 ActionGroups as AG\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 tqdm.autonotebook import tqdm\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",
"\n",
"m_grouped_mix = dill.load(open(\"../RecipeAnalysis/m_grouped_mix_raw.dill\", \"rb\"))\n",
"m_grouped_act = dill.load(open(\"../RecipeAnalysis/m_grouped_act_raw.dill\", \"rb\"))\n",
"m_grouped_base_act = dill.load(open(\"../RecipeAnalysis/m_grouped_base_act_raw.dill\", \"rb\"))\n",
"\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",
"m_act.compile()\n",
"m_mix.compile()\n",
"m_base_act.compile()\n",
"m_base_mix.compile()\n",
"\n",
"m_grouped_mix.compile()\n",
"m_grouped_act.compile()\n",
"m_grouped_base_act.compile()\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"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {},
"outputs": [],
"source": [
"c_grouped_mix = m_grouped_mix._csr\n",
"c_grouped_act = m_grouped_act._csr\n",
"c_grouped_base_act = m_grouped_base_act._csr"
]
},
{
"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": [],
"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": "code",
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
"def to_grouped_ingredient(ing:Ingredient):\n",
" groups = set()\n",
" for act in ing._action_set:\n",
" groups.add(AG.groups[act])\n",
" grouped_ingredient = Ingredient(ing._base_ingredient)\n",
" for g in groups:\n",
" grouped_ingredient.apply_action(g)\n",
" return grouped_ingredient"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### different score functions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### normalizations"
]
},
{
"cell_type": "code",
"execution_count": 12,
"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": 13,
"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": 14,
"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": 15,
"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": "markdown",
"metadata": {},
"source": [
"**new probability for preprocess ingredients:**"
]
},
{
"cell_type": "code",
"execution_count": 71,
"metadata": {},
"outputs": [],
"source": [
"PREPARE_RATIO_THRESHOLD = 0.35\n",
"HEAT_RATIO_THRESHOLD = 0.65\n",
"\n",
"PREPARE_SCORE_EPS = 0.05\n",
"HEAT_SCORE_EPS = 0.05\n",
"\n",
"def prepare_ratio(ing:str):\n",
" keys, values = m_grouped_act.get_backward_adjacent(Ingredient(ing).to_json())\n",
" action_dict = dict(zip(keys,values))\n",
" return action_dict['prepare'] / action_dict['heat']\n",
"\n",
"def random_prepare(ing:str):\n",
" \"\"\"\n",
" returns randomly a boolean value if ing should be prepared, w.r.t. the prepare_ration function\n",
" \"\"\"\n",
" \n",
" return prepare_ratio(ing) > np.random.normal(PREPARE_RATIO_THRESHOLD,0.1)\n",
"\n",
"def heat_ratio(ingredient:str):\n",
" action_set, action_weights = m_grouped_base_act.get_backward_adjacent(ingredient)\n",
" d = dict(zip(action_set, action_weights))\n",
" ratio = 1 - d['prepare'] / d['heat']\n",
" \n",
" return ratio\n",
"\n",
"def random_heated(ingredient:str):\n",
" ratio = heat_ratio(ingredient)\n",
" \n",
" return ratio > np.random.normal(HEAT_RATIO_THRESHOLD,0.15)\n",
"\n",
"def prepare_score(ingredient:Ingredient):\n",
" ing_str = ingredient._base_ingredient\n",
" \n",
" g_ing = to_grouped_ingredient(ingredient)\n",
" \n",
" ratio = prepare_ratio(ing_str)\n",
" \n",
" if ratio > PREPARE_RATIO_THRESHOLD + PREPARE_SCORE_EPS:\n",
" if 'prepare' not in g_ing._action_set:\n",
" return 0\n",
" \n",
" if ratio < PREPARE_RATIO_THRESHOLD - PREPARE_SCORE_EPS:\n",
" if 'prepare' in g_ing._action_set:\n",
" return 0\n",
" \n",
" return 1\n",
"\n",
"def heat_score(ingredient:Ingredient):\n",
" ing_str = ingredient._base_ingredient\n",
" \n",
" g_ing = to_grouped_ingredient(ingredient)\n",
" \n",
" ratio = heat_ratio(ing_str)\n",
" \n",
" if ratio > HEAT_RATIO_THRESHOLD + HEAT_SCORE_EPS:\n",
" if 'heat' not in g_ing._action_set:\n",
" return 0\n",
" \n",
" if ratio < HEAT_RATIO_THRESHOLD - HEAT_SCORE_EPS:\n",
" if 'heat' in g_ing._action_set:\n",
" return 0\n",
" \n",
" return 1\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"def relative_action_rank(ingredient:str, action:str):\n",
" action_set, action_weights = m_base_act.get_backward_adjacent(ingredient)\n",
" if action not in action_set or len(action_set) <= 1:\n",
" return 0\n",
" return 1 - action_set.tolist().index(action) / (len(action_set) - 1)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"def filter_set_by_group(act_set, act_w, group):\n",
" new_act_set = []\n",
" new_act_w = []\n",
" for i in range(len(act_set)):\n",
" if act_set[i] in AG.inverse_groups[group]:\n",
" new_act_set.append(act_set[i])\n",
" new_act_w.append(act_w[i])\n",
" return np.array(new_act_set), np.array(new_act_w)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## better normalized scores:"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"def normalized_score(key, matrix):\n",
" sum_key = matrix.get_sum(key)\n",
" keys, values = matrix.get_adjacent(key)\n",
" normalized_values = np.array([(values[i] / matrix.get_sum(keys[i])) * (values[i] / sum_key) for i in range(len(keys))])\n",
" sort = np.argsort(-normalized_values)\n",
" return keys[sort], normalized_values[sort]\n",
"\n",
"def forward_normalized_score(key, matrix):\n",
" sum_key = matrix.get_fw_sum(key)\n",
" keys, values = matrix.get_forward_adjacent(key)\n",
" normalized_values = np.array([(values[i] / matrix.get_bw_sum(keys[i])) * (values[i] / sum_key) for i in range(len(keys))])\n",
" sort = np.argsort(-normalized_values)\n",
" return keys[sort], normalized_values[sort]\n",
"\n",
"def backward_normalized_score(key, matrix):\n",
" sum_key = matrix.get_bw_sum(key)\n",
" keys, values = matrix.get_backward_adjacent(key)\n",
" normalized_values = np.array([(values[i] / matrix.get_fw_sum(keys[i])) * (values[i] / sum_key) for i in range(len(keys))])\n",
" sort = np.argsort(-normalized_values)\n",
" return keys[sort], normalized_values[sort]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Helper class for instructions"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"class RecipeInstructionState(object):\n",
" def __init__(self):\n",
" self.current_step = 1\n",
" self.id_to_state = {}\n",
" self.instructions_by_step = {}\n",
" self.step_by_nodeid = {}\n",
" self.text_by_nodeid = {}\n",
" self.ingredients = set()\n",
" \n",
" def _add_instruction(self, node_id):\n",
" s = self.text_by_nodeid[node_id]\n",
" self.instructions_by_step[self.current_step] = s\n",
" self.step_by_nodeid[node_id] = self.current_step\n",
" self.current_step += 1\n",
" return self.current_step - 1\n",
" \n",
" def add_text(self, node_id, text, is_instruction=False, is_ingredient=False):\n",
" self.text_by_nodeid[node_id] = text\n",
" if is_instruction:\n",
" self._add_instruction(node_id)\n",
" if is_ingredient:\n",
" self.ingredients.add(text)\n",
" \n",
" def exists_any_instruction(self, node_ids:list):\n",
" \"\"\"check if any instruction exists for list of id's\n",
" \"\"\"\n",
" \n",
" for node_id in node_ids:\n",
" if node_id in self.step_by_nodeid:\n",
" return True\n",
" return False\n",
" \n",
" def to_markdown(self):\n",
" \n",
" md_text = \"**Ingredients**:\\n\"\n",
" \n",
" for ing in self.ingredients:\n",
" md_text += f\" * {ing}\\n\"\n",
" \n",
" md_text += \"\\n\\n**Instructions**:\\n\\n\"\n",
" md_text += \"| Step | Instruction |\\n\"\n",
" md_text += \"| ----:|:----------- |\\n\"\n",
" \n",
" for step in range(1, self.current_step):\n",
" md_text += f\"| {step} | {self.instructions_by_step[step]} |\\n\"\n",
" \n",
" return Markdown(md_text)\n",
" \n",
" \n",
" \n",
" \n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Recipe Tree\n",
"### Tree Node Base Class"
]
},
{
"cell_type": "code",
"execution_count": 21,
"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 root(self):\n",
" if self._parent is None:\n",
" return self\n",
" return self._parent.root()\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 simplify(self):\n",
" # simplify nodes (mainly used to delete doubled Mix Nodes)\n",
" for c in self.childs().copy():\n",
" c.simplify()\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",
" def to_instruction(self, state:RecipeInstructionState):\n",
" # create an instruction out of a recipe Tree\n",
" raise NotImplementedError()\n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Mix Node"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For the Node Score: just make a simple lookup whether this combination is seen or not. So the node Score is defined as:\n"
]
},
{
"cell_type": "code",
"execution_count": 53,
"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",
" \n",
" # old method:\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",
" #s += 0.5 * p1 + 0.5 * p2\n",
" \n",
" grouped_ing_a = to_grouped_ingredient(ing_a)\n",
" grouped_ing_b = to_grouped_ingredient(ing_b)\n",
" \n",
" ia = m_grouped_mix._label_index[grouped_ing_a.to_json()]\n",
" ib = m_grouped_mix._label_index[grouped_ing_b.to_json()]\n",
" \n",
" if c_grouped_mix[ia,ib] > 0 or c_grouped_mix[ib,ia] > 0:\n",
" s += 1\n",
" \n",
" \n",
" \n",
" except KeyError as e:\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",
" def simplify(self):\n",
" for c in self.childs().copy():\n",
" c.simplify()\n",
" \n",
" # if our parent is also a Mix Node, we can just delete ourselve\n",
" p = self.parent()\n",
" \n",
" if p is not None:\n",
" if type(p) == MixNode:\n",
" # just delete ourselve\n",
" self.remove()\n",
" \n",
" def to_instruction(self, state:RecipeInstructionState = None):\n",
" \"\"\"\n",
" returns a RecipeInstructionState\n",
" \"\"\"\n",
" \n",
" def english_enum(items, use_and=True):\n",
" if len(items) > 1 and use_and:\n",
" return \", \".join(items[:-1]) + \" and \" + items[-1]\n",
" return \", \".join(items)\n",
" \n",
" if state is None:\n",
" state = RecipeInstructionState()\n",
" \n",
" for c in self.childs():\n",
" c.to_instruction(state)\n",
" \n",
" \n",
" text = \"\"\n",
" \n",
" # children with instructions\n",
" instruction_childs = []\n",
" \n",
" # children without instructions\n",
" base_childs = []\n",
" \n",
" # childre without instructions that are ingredients\n",
" ingredient_childs = []\n",
" \n",
" for c in self.childs():\n",
" assert type(c) != MixNode\n",
" if type(c) == IngredientNode:\n",
" ingredient_childs.append(c)\n",
" elif c._id not in state.step_by_nodeid:\n",
" # action node with no step so far, so a base child\n",
" base_childs.append(c)\n",
" else:\n",
" instruction_childs.append(c)\n",
" \n",
" if len(base_childs) > 0:\n",
" use_and= len(ingredient_childs)==0 and len(instruction_childs)==0\n",
" text = english_enum([state.text_by_nodeid[c._id] for c in base_childs], use_and=use_and)\n",
" \n",
" \n",
" if len(ingredient_childs) > 0:\n",
" if len(base_childs) > 0:\n",
" text += \" and mix it with \" + english_enum([state.text_by_nodeid[c._id] for c in ingredient_childs])\n",
" \n",
" else:\n",
" text = \"Mix \" + english_enum([state.text_by_nodeid[c._id] for c in ingredient_childs])\n",
" \n",
" if len(instruction_childs) > 0:\n",
" if len(base_childs) == 0:\n",
" text = \"Mix together the results of \"\n",
" else:\n",
" text += \" and mix it together with the results of \"\n",
" \n",
" text += english_enum([f\"step {state.step_by_nodeid[c._id]}\" for c in instruction_childs])\n",
" \n",
" text += \".\"\n",
" \n",
" if type(self.parent()) == ActionNode:\n",
" state.add_text(self._id, text, is_instruction=False)\n",
" else:\n",
" state.add_text(self._id, text, is_instruction=True)\n",
" \n",
" \n",
" return state\n",
" \n",
" \n",
" \n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Ingredient Node Class"
]
},
{
"cell_type": "code",
"execution_count": 127,
"metadata": {},
"outputs": [],
"source": [
"n_wanted_actions = 2\n",
"gaussian_normalize_factor = 1 / gaussian(n_wanted_actions, n_wanted_actions, 1)\n",
"\n",
"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",
" pass\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 duplicate_actions_score(self, actions):\n",
" \n",
" if len(actions) == 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",
" def duplicate_groups_score(self, actions):\n",
" if len(actions) == 0:\n",
" return 1\n",
" groups = [AG.groups[a] for a in actions]\n",
" groups_set = set(groups)\n",
" \n",
" return len(groups_set) / len(groups)\n",
" \n",
" def node_score(self):\n",
" actions = self.get_actions()\n",
" \n",
" ing = Ingredient(self._name)\n",
" for a in actions:\n",
" ing.apply_action(a)\n",
" \n",
" heat = heat_score(ing)\n",
" prepare = prepare_score(ing)\n",
" \n",
" score = (heat + prepare + self.duplicate_groups_score(actions)) / 3\n",
" score *= self.duplicate_actions_score(actions)\n",
" \n",
" return score\n",
" \n",
" \"\"\"\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",
" \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\")\n",
" \n",
" def to_instruction(self, state:RecipeInstructionState = None):\n",
" state.add_text(self._id, self._name, is_instruction=False, is_ingredient=True)\n",
" return state"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Action Node Class"
]
},
{
"cell_type": "code",
"execution_count": 128,
"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",
" \n",
" i_act = m_act._x_label_index[self.name()]\n",
" i_ing = m_act._y_label_index[ing.to_json()]\n",
" \n",
" if c_act[i_act,i_ing] > 0:\n",
" s += 1\n",
" \n",
" except KeyError as e:\n",
" #print(f\"WARNING: no entry found for: {str(e)}\")\n",
" pass\n",
" \n",
" ''' # old method:\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",
" \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\")\n",
" \n",
" def to_instruction(self, state:RecipeInstructionState = None):\n",
" \n",
" if state is None:\n",
" state = RecipeInstructionState()\n",
" \n",
" for c in self.childs():\n",
" c.to_instruction(state)\n",
" \n",
" c = self._child\n",
" \n",
" if type(c) == MixNode:\n",
" text = state.text_by_nodeid[c._id] + f\" Then {self._name} it.\"\n",
" state.add_text(self._id, text, True)\n",
" elif type(c) == IngredientNode:\n",
" text = f\"{self._name} {state.text_by_nodeid[c._id]}\"\n",
" state.add_text(self._id, text, False)\n",
" \n",
" elif type(c) == ActionNode:\n",
" assert c._id in state.step_by_nodeid\n",
" text = f\"{self._name} the result of step {state.step_by_nodeid[c._id]}\"\n",
" state.add_text(self._id, text, True)\n",
" \n",
" return state\n",
" \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Tree Class"
]
},
{
"cell_type": "code",
"execution_count": 129,
"metadata": {},
"outputs": [],
"source": [
"class Tree(object):\n",
" @staticmethod\n",
" def build_initial_tree(ingredients: list, main_ingredients: list, max_n = 5, wheel_turns = 2):\n",
" \n",
" assert set(main_ingredients).issubset(set(ingredients))\n",
"\n",
" def does_action_match(ingredient:str, action:str, t = 0.6):\n",
" return relative_action_rank(ingredient, action) > t\n",
"\n",
"\n",
" # choose randomly an action for each ingredient by the \"wheel of fortune\" method\n",
" actions_for_ing = {}\n",
" for ing in ingredients:\n",
" actions_for_ing[ing] = set()\n",
" action_set, action_weights = m_base_act.get_backward_adjacent(ing)\n",
" if random_heated(ing):\n",
" #print(action_set)\n",
" action_set, action_weights = filter_set_by_group(action_set, action_weights, \"heat\")\n",
" #print(action_set)\n",
" for i in range(wheel_turns):\n",
" if ing in main_ingredients:\n",
" # if main ingredient: choose by action probability\n",
" w = np.array(list(action_weights), dtype=float)\n",
" w *= (1.0 / np.sum(w))\n",
" action = np.random.choice(list(action_set), size=1, replace=False, p=w)[0]\n",
" else:\n",
" # else: choose rank based\n",
" action = ea_tools.wheel_of_fortune_selection(action_set[:max_n], action_weights[:max_n])\n",
" actions_for_ing[ing].add(action)\n",
" #print(f\"action {action} for ing {ing}\")\n",
" #print(ing, action)\n",
"\n",
" # create ingredient nodes:\n",
" ingredient_nodes = {}\n",
"\n",
" # create ingredient nodes:\n",
" for ing in ingredients:\n",
" new_node = IngredientNode(ing, constant=True)\n",
"\n",
" # check if we should do a preparation step\n",
" if random_prepare(ing):\n",
" # choose a preparation cooking action\n",
" action_set, action_weights = m_act.get_backward_adjacent(Ingredient(ing).to_json())\n",
" action_set, action_weights = filter_set_by_group(action_set, action_weights, \"prepare\")\n",
" if len(action_set) > 0:\n",
" action = ea_tools.wheel_of_fortune_selection(action_set[:max_n], action_weights[:max_n])\n",
" act_node = ActionNode(action)\n",
" act_node.add_child(new_node)\n",
" new_node = act_node\n",
"\n",
"\n",
" ingredient_nodes[ing] = new_node\n",
"\n",
" # starting now with the actions found for the main ingredients and try to match all ingredients together\n",
" # with that:\n",
"\n",
" unprocessed_ings = set(filter(lambda x: len(actions_for_ing[x]) > 0, ingredients))\n",
" unprocessed_main_ings = set(filter(lambda x: len(actions_for_ing[x]) > 0, main_ingredients))\n",
"\n",
" while len(unprocessed_main_ings) > 0:\n",
" main_ing = unprocessed_main_ings.pop()\n",
"\n",
" # random action for that ing:\n",
" act = actions_for_ing[main_ing].pop()\n",
"\n",
" act_node = ActionNode(act)\n",
" mix_node = MixNode()\n",
" mix_node.add_child(ingredient_nodes[main_ing])\n",
" act_node.add_child(mix_node)\n",
" ingredient_nodes[main_ing] = act_node\n",
"\n",
" unprocessed_ings.remove(main_ing)\n",
"\n",
" for ing in unprocessed_ings.copy():\n",
" if does_action_match(ing, act):\n",
" mix_node.add_child(ingredient_nodes[ing])\n",
" ingredient_nodes[ing] = act_node\n",
" unprocessed_ings.remove(ing)\n",
" if ing in unprocessed_main_ings:\n",
" unprocessed_main_ings.remove(ing)\n",
"\n",
" if len(mix_node.childs()) == 1:\n",
" mix_node.remove()\n",
"\n",
" # now make the same with all remaining ingredients:\n",
" while len(unprocessed_ings) > 0:\n",
" current_ing = unprocessed_ings.pop() \n",
"\n",
" # random action for that ing:\n",
" act = actions_for_ing[current_ing].pop()\n",
"\n",
" act_node = ActionNode(act)\n",
" mix_node = MixNode()\n",
" mix_node.add_child(ingredient_nodes[current_ing])\n",
" act_node.add_child(mix_node)\n",
"\n",
" ingredient_nodes[current_ing] = act_node\n",
"\n",
"\n",
" for ing in unprocessed_ings.copy():\n",
" if does_action_match(ing, act):\n",
" mix_node.add_child(ingredient_nodes[ing])\n",
" ingredient_nodes[ing] = act_node\n",
" unprocessed_ings.remove(ing)\n",
"\n",
" if len(mix_node.childs()) == 1:\n",
" mix_node.remove()\n",
"\n",
"\n",
" root_layer = set([n.root() for n in ingredient_nodes.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",
" root_node = root_layer_without_parents[0]\n",
"\n",
" else:\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",
" @staticmethod\n",
" def find_ingredients(constant_ingredients, main_ingredients, min_additional:int, max_additional:int, top_ings:int=3):\n",
" '''\n",
" create an initial set of ingredients, based on given constant ingredients.\n",
" min_additional and max_additional gives the range of ingredients that are added to our set\n",
" '''\n",
" \n",
" seen_items = set(constant_ingredients)\n",
"\n",
" items = []\n",
" scores = []\n",
"\n",
" assert set(main_ingredients).issubset(set(constant_ingredients))\n",
"\n",
" # additional ingredients are choosen w.r.t all given ingredients\n",
" n_additional_ings = np.random.randint(min_additional, max_additional + 1)\n",
"\n",
" # extra ings are ingredients choosen specially for the main ingredient\n",
" n_extra_ings = int((len(main_ingredients) / len(constant_ingredients)) * n_additional_ings)\n",
"\n",
" if n_extra_ings > n_additional_ings:\n",
" n_extra_ings = n_additional_ings\n",
"\n",
"\n",
" # choose extra ingredients\n",
" extra_candidates = []\n",
" extra_weights = []\n",
"\n",
" for ing in main_ingredients:\n",
" candidates, weights = normalized_score(ing, m_base_mix)\n",
" extra_candidates.append(candidates[:10])\n",
" extra_weights.append(weights[:10])\n",
"\n",
" extra_ingredients = ea_tools.combined_wheel_of_fortune_selection(extra_candidates,\n",
" extra_weights,\n",
" n_extra_ings)\n",
"\n",
" for ing in constant_ingredients:\n",
" # find best matching ingredients\n",
" best_items = []\n",
" best_scores = []\n",
"\n",
" candidates, weights = m_base_mix.get_adjacent(ing)\n",
" i = 0\n",
" while i < len(candidates) and len(best_items) < top_ings:\n",
" if candidates[i] not in seen_items:\n",
" best_items.append(candidates[i])\n",
" best_scores.append(weights[i])\n",
" i += 1\n",
"\n",
" items.append(best_items)\n",
" scores.append(best_scores)\n",
"\n",
" #TODO: error handling if too few options are availabale!\n",
"\n",
" additional_ingredients = ea_tools.combined_wheel_of_fortune_selection(items,\n",
" scores,\n",
" n_additional_ings - n_extra_ings)\n",
" \n",
" return list(constant_ingredients) + list(additional_ingredients) + list(extra_ingredients)\n",
"\n",
" @staticmethod\n",
" def from_ingredients(ingredients: list, main_ingredients: list, additional_ings=0):\n",
" root = None\n",
" \n",
" constant_ingredients = ingredients\n",
" \n",
" if additional_ings > 0:\n",
" ingredients = Tree.find_ingredients(ingredients, main_ingredients, min_additional=0, max_additional=additional_ings)\n",
" \n",
" \n",
" root = Tree.build_initial_tree(ingredients, main_ingredients)\n",
" \n",
" # mark initial ingredient nodes as constant:\n",
" nodes = root.traverse()\n",
" for node in nodes:\n",
" if type(node) == IngredientNode:\n",
" if node.name() in constant_ingredients:\n",
" node._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",
" # check for simplification after modification\n",
" self.root().simplify()\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": "markdown",
"metadata": {},
"source": [
"## Population"
]
},
{
"cell_type": "code",
"execution_count": 130,
"metadata": {},
"outputs": [],
"source": [
"class Population(object):\n",
" def __init__(self, start_ingredients, main_ingredients, n_population = 10, max_additional_ings=0):\n",
" self.population = [Tree.from_ingredients(start_ingredients, main_ingredients, additional_ings=max_additional_ings) 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(ing_scores), 1)\n",
" return score\n",
" \n",
" \n",
" \n",
" def collect_scores(self):\n",
" for tree in tqdm(self.population, desc=\"evaluate population scores\", leave=False):\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 tqdm(range(n), desc=\"run evolutionary cycles\"):\n",
" self.mutate()\n",
" #self.mutate()\n",
" self.collect_scores()\n",
" \n",
" self.pairwise_competition()\n",
" #self.collect_scores()\n",
" #self.hold_best(self._n)\n",
" \n",
" \n",
" \n",
" def plot_population(self, collect_scores=True):\n",
" if (collect_scores):\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",
" if (collect_scores):\n",
" display(self._scores[i])\n",
" display(t.root().dot())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Run Evolutionary Algorithm"
]
},
{
"cell_type": "code",
"execution_count": 131,
"metadata": {},
"outputs": [],
"source": [
"p = Population([\"noodle\"],['noodle'], max_additional_ings=6)"
]
},
{
"cell_type": "code",
"execution_count": 132,
"metadata": {},
"outputs": [],
"source": [
"#p_ingredient_unprepared(list(p.population[0].root().childs())[0]._name) < 0.2"
]
},
{
"cell_type": "code",
"execution_count": 133,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "77d517dcc77745f5ab9bad76c5a154ea",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, description='run evolutionary cycles', max=5.0, style=ProgressStyle(de…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, description='evaluate population scores', max=20.0, style=ProgressStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/lib/python3/dist-packages/numpy/lib/function_base.py:392: RuntimeWarning:\n",
"\n",
"Mean of empty slice.\n",
"\n",
"/usr/lib/python3/dist-packages/numpy/core/_methods.py:85: RuntimeWarning:\n",
"\n",
"invalid value encountered in double_scalars\n",
"\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, description='evaluate population scores', max=20.0, style=ProgressStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, description='evaluate population scores', max=20.0, style=ProgressStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, description='evaluate population scores', max=20.0, style=ProgressStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, description='evaluate population scores', max=20.0, style=ProgressStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n"
]
}
],
"source": [
"p.run(5)"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'test.dot'"
]
},
"execution_count": 48,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d.save(\"test.dot\")"
]
},
{
"cell_type": "code",
"execution_count": 89,
"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=\"178pt\" height=\"218pt\"\n",
" viewBox=\"0.00 0.00 177.71 217.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 213.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-213.8234 173.7056,-213.8234 173.7056,4 -4,4\"/>\n",
"<!-- 4307 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>4307</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-184.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"68.8528\" y=\"-188.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"72.8528\" y=\"-188.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">chop</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-174.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.0000</text>\n",
"</g>\n",
"<!-- 4310 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>4310</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\">bake</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",
"<!-- 4307&#45;&gt;4310 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>4307&#45;&gt;4310</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M84.8528,-158.7612C84.8528,-150.7873 84.8528,-141.8428 84.8528,-133.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"88.3529,-133.1794 84.8528,-123.1795 81.3529,-133.1795 88.3529,-133.1794\"/>\n",
"</g>\n",
"<!-- 4308 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>4308</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:0.6667</text>\n",
"</g>\n",
"<!-- 4310&#45;&gt;4308 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>4310&#45;&gt;4308</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 0x7fe164969b10>"
]
},
"execution_count": 89,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = p.population[2].root().dot()\n",
"d"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"**Ingredients**:\n",
" * noodle\n",
" * cheese\n",
"\n",
"\n",
"**Instructions**:\n",
"\n",
"| Step | Instruction |\n",
"| ----:|:----------- |\n",
"| 1 | Mix noodle and cheese. Then cook it. |\n"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"execution_count": 66,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"p.population[1].root().to_instruction().to_markdown()"
]
},
{
"cell_type": "code",
"execution_count": 134,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(FloatProgress(value=0.0, description='evaluate population scores', max=10.0, style=ProgressStyl…"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.2792595962810029"
]
},
"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=\"500pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 499.71 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 495.7056,-321.8234 495.7056,4 -4,4\"/>\n",
"<!-- 6950 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>6950</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"245.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"229.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"233.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=\"193.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 6951 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>6951</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"245.8528,-230.9117 125.8528,-194.9117 245.8528,-158.9117 365.8528,-194.9117 245.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"232.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"236.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=\"193.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 6950&#45;&gt;6951 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>6950&#45;&gt;6951</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M245.8528,-266.7622C245.8528,-258.8985 245.8528,-249.989 245.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"249.3529,-240.9713 245.8528,-230.9713 242.3529,-240.9714 249.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 6954 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>6954</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\">bake</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",
"<!-- 6951&#45;&gt;6954 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>6951&#45;&gt;6954</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M206.0551,-170.8215C183.4309,-157.1267 154.986,-139.9086 131.3392,-125.5948\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"132.9007,-122.4487 122.5335,-120.2645 129.2758,-128.4371 132.9007,-122.4487\"/>\n",
"</g>\n",
"<!-- 6953 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>6953</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=\"199.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"203.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</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",
"<!-- 6951&#45;&gt;6953 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>6951&#45;&gt;6953</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M245.8528,-158.8996C245.8528,-147.9536 245.8528,-136.0871 245.8528,-125.7278\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"249.3529,-125.5795 245.8528,-115.5795 242.3529,-125.5795 249.3529,-125.5795\"/>\n",
"</g>\n",
"<!-- 6957 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>6957</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"406.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"390.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"394.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=\"354.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 6951&#45;&gt;6957 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>6951&#45;&gt;6957</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M285.6506,-170.8215C308.2748,-157.1267 336.7196,-139.9086 360.3664,-125.5948\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"362.4298,-128.4371 369.1722,-120.2645 358.8049,-122.4487 362.4298,-128.4371\"/>\n",
"</g>\n",
"<!-- 6955 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>6955</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"147.3528,-36 22.3528,-36 22.3528,0 147.3528,0 147.3528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"30.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"34.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 6954&#45;&gt;6955 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>6954&#45;&gt;6955</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",
"<!-- 6952 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>6952</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"464.8528,-36 348.8528,-36 348.8528,0 464.8528,0 464.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"385.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"389.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=\"356.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.4167</text>\n",
"</g>\n",
"<!-- 6957&#45;&gt;6952 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>6957&#45;&gt;6952</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M406.8528,-71.8782C406.8528,-63.7122 406.8528,-54.6289 406.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"410.3529,-46.2287 406.8528,-36.2288 403.3529,-46.2288 410.3529,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7fe15eea3250>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.06631790227561707"
]
},
"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=\"446pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 445.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 441.8528,-321.8234 441.8528,4 -4,4\"/>\n",
"<!-- 7194 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7194</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"245.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"234.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"238.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cut</text>\n",
"<text text-anchor=\"start\" x=\"193.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3333</text>\n",
"</g>\n",
"<!-- 7196 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7196</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"245.8528,-230.9117 125.8528,-194.9117 245.8528,-158.9117 365.8528,-194.9117 245.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"232.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"236.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=\"193.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7194&#45;&gt;7196 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7194&#45;&gt;7196</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M245.8528,-266.7622C245.8528,-258.8985 245.8528,-249.989 245.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"249.3529,-240.9713 245.8528,-230.9713 242.3529,-240.9714 249.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 7197 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7197</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\">bake</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",
"<!-- 7196&#45;&gt;7197 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7196&#45;&gt;7197</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M206.0551,-170.8215C183.4309,-157.1267 154.986,-139.9086 131.3392,-125.5948\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"132.9007,-122.4487 122.5335,-120.2645 129.2758,-128.4371 132.9007,-122.4487\"/>\n",
"</g>\n",
"<!-- 7200 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7200</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=\"224.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"228.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=\"195.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.3333</text>\n",
"</g>\n",
"<!-- 7196&#45;&gt;7200 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7196&#45;&gt;7200</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M245.8528,-158.8996C245.8528,-147.9536 245.8528,-136.0871 245.8528,-125.7278\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"249.3529,-125.5795 245.8528,-115.5795 242.3529,-125.5795 249.3529,-125.5795\"/>\n",
"</g>\n",
"<!-- 7199 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7199</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=\"333.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"337.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</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.3333</text>\n",
"</g>\n",
"<!-- 7196&#45;&gt;7199 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7196&#45;&gt;7199</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M281.0597,-169.3063C301.4147,-154.5025 326.8663,-135.992 346.838,-121.4669\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"349.0023,-124.2207 355.031,-115.5083 344.885,-118.5596 349.0023,-124.2207\"/>\n",
"</g>\n",
"<!-- 7198 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7198</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"147.3528,-36 22.3528,-36 22.3528,0 147.3528,0 147.3528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"30.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"34.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 7197&#45;&gt;7198 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7197&#45;&gt;7198</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 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.1411495893028336"
]
},
"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=\"554pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 553.71 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 549.7056,-321.8234 549.7056,4 -4,4\"/>\n",
"<!-- 7283 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7283</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"272.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"252.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"256.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">knead</text>\n",
"<text text-anchor=\"start\" x=\"220.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.0000</text>\n",
"</g>\n",
"<!-- 7284 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7284</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"272.8528,-230.9117 152.8528,-194.9117 272.8528,-158.9117 392.8528,-194.9117 272.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"259.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"263.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=\"220.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7283&#45;&gt;7284 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7283&#45;&gt;7284</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M272.8528,-266.7622C272.8528,-258.8985 272.8528,-249.989 272.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"276.3529,-240.9713 272.8528,-230.9713 269.3529,-240.9714 276.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 7285 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7285</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=\"70.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"74.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">heat</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",
"<!-- 7284&#45;&gt;7285 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7284&#45;&gt;7285</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M228.7752,-172.0626C201.1586,-157.7467 165.4433,-139.2325 136.5007,-124.2292\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"137.8495,-120.9861 127.3606,-119.4911 134.6279,-127.2007 137.8495,-120.9861\"/>\n",
"</g>\n",
"<!-- 7289 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7289</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"272.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"256.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"260.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"220.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7284&#45;&gt;7289 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7284&#45;&gt;7289</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M272.8528,-158.8996C272.8528,-150.5122 272.8528,-141.5843 272.8528,-133.2082\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"276.3529,-132.9756 272.8528,-122.9757 269.3529,-132.9757 276.3529,-132.9756\"/>\n",
"</g>\n",
"<!-- 7287 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>7287</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"460.8528\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"444.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"448.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=\"408.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7284&#45;&gt;7287 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>7284&#45;&gt;7287</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M316.9305,-172.0626C344.547,-157.7467 380.2623,-139.2325 409.2049,-124.2292\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"411.0778,-127.2007 418.345,-119.4911 407.8562,-120.9861 411.0778,-127.2007\"/>\n",
"</g>\n",
"<!-- 7286 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7286</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=\"38.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"42.8528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 7285&#45;&gt;7286 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7285&#45;&gt;7286</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",
"<!-- 7290 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7290</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"335.3528,-36 210.3528,-36 210.3528,0 335.3528,0 335.3528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"218.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"222.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"222.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 7289&#45;&gt;7290 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7289&#45;&gt;7290</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M272.8528,-71.8782C272.8528,-63.7122 272.8528,-54.6289 272.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"276.3529,-46.2287 272.8528,-36.2288 269.3529,-46.2288 276.3529,-46.2287\"/>\n",
"</g>\n",
"<!-- 7288 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>7288</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"518.8528,-36 402.8528,-36 402.8528,0 518.8528,0 518.8528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"439.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"443.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=\"410.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 7287&#45;&gt;7288 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>7287&#45;&gt;7288</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M460.8528,-71.8782C460.8528,-63.7122 460.8528,-54.6289 460.8528,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"464.3529,-46.2287 460.8528,-36.2288 457.3529,-46.2288 464.3529,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.1745372476756268"
]
},
"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=\"477pt\" height=\"434pt\"\n",
" viewBox=\"0.00 0.00 476.85 433.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 429.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-429.8234 472.8528,-429.8234 472.8528,4 -4,4\"/>\n",
"<!-- 7086 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7086</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"178.8528,-425.8234 58.8528,-389.8234 178.8528,-353.8234 298.8528,-389.8234 178.8528,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"165.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"169.3528\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"126.8528\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3333</text>\n",
"</g>\n",
"<!-- 7096 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7096</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"84.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"70.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"74.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">slice</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.0000</text>\n",
"</g>\n",
"<!-- 7086&#45;&gt;7096 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7086&#45;&gt;7096</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M151.9162,-361.8964C140.5946,-350.1586 127.3608,-336.4383 115.6545,-324.3016\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"118.0553,-321.7491 108.5939,-316.9814 113.017,-326.6088 118.0553,-321.7491\"/>\n",
"</g>\n",
"<!-- 7089 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7089</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"272.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"258.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"262.3528\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">heat</text>\n",
"<text text-anchor=\"start\" x=\"220.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3333</text>\n",
"</g>\n",
"<!-- 7086&#45;&gt;7089 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7086&#45;&gt;7089</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M205.7894,-361.8964C217.1111,-350.1586 230.3448,-336.4383 242.0511,-324.3016\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"244.6886,-326.6088 249.1118,-316.9814 239.6503,-321.7491 244.6886,-326.6088\"/>\n",
"</g>\n",
"<!-- 7087 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7087</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=\"70.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"74.3528\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">beat</text>\n",
"<text text-anchor=\"start\" x=\"32.8528\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7096&#45;&gt;7087 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7096&#45;&gt;7087</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M84.8528,-266.7612C84.8528,-258.7873 84.8528,-249.8428 84.8528,-241.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"88.3529,-241.1794 84.8528,-231.1795 81.3529,-241.1795 88.3529,-241.1794\"/>\n",
"</g>\n",
"<!-- 7088 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7088</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=\"39.3528\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"43.3528\" y=\"-111.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">ricotta cheese</text>\n",
"<text text-anchor=\"start\" x=\"30.8528\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.5000</text>\n",
"</g>\n",
"<!-- 7087&#45;&gt;7088 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7087&#45;&gt;7088</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",
"<!-- 7090 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7090</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: 1.0000</text>\n",
"</g>\n",
"<!-- 7089&#45;&gt;7090 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7089&#45;&gt;7090</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M273.4421,-266.7612C273.6256,-258.7873 273.8314,-249.8428 274.0279,-241.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"277.5298,-241.2574 274.2609,-231.1795 270.5316,-241.0963 277.5298,-241.2574\"/>\n",
"</g>\n",
"<!-- 7091 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>7091</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.6667</text>\n",
"</g>\n",
"<!-- 7090&#45;&gt;7091 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>7090&#45;&gt;7091</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",
"<!-- 7093 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>7093</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=\"118.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"122.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">sausage</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",
"<!-- 7091&#45;&gt;7093 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>7091&#45;&gt;7093</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",
"<!-- 7094 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>7094</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=\"255.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"259.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=\"226.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 7091&#45;&gt;7094 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>7091&#45;&gt;7094</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",
"<!-- 7092 -->\n",
"<g id=\"node10\" class=\"node\">\n",
"<title>7092</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=\"390.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"394.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cheese</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",
"<!-- 7091&#45;&gt;7092 -->\n",
"<g id=\"edge9\" class=\"edge\">\n",
"<title>7091&#45;&gt;7092</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 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.13123551100656317"
]
},
"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=\"473pt\" height=\"434pt\"\n",
" viewBox=\"0.00 0.00 472.85 433.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 429.8234)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-429.8234 468.8528,-429.8234 468.8528,4 -4,4\"/>\n",
"<!-- 7262 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7262</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"286,-425.8234 166,-389.8234 286,-353.8234 406,-389.8234 286,-425.8234\"/>\n",
"<text text-anchor=\"start\" x=\"272.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"276.5\" y=\"-393.6234\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mix</text>\n",
"<text text-anchor=\"start\" x=\"234\" y=\"-379.6234\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3333</text>\n",
"</g>\n",
"<!-- 7266 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7266</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"192\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"177.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"181.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">heat</text>\n",
"<text text-anchor=\"start\" x=\"140\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3333</text>\n",
"</g>\n",
"<!-- 7262&#45;&gt;7266 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7262&#45;&gt;7266</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M259.0634,-361.8964C247.7417,-350.1586 234.508,-336.4383 222.8017,-324.3016\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"225.2025,-321.7491 215.741,-316.9814 220.1642,-326.6088 225.2025,-321.7491\"/>\n",
"</g>\n",
"<!-- 7263 -->\n",
"<g id=\"node8\" class=\"node\">\n",
"<title>7263</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"380\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"365.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"369.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">slice</text>\n",
"<text text-anchor=\"start\" x=\"328\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7262&#45;&gt;7263 -->\n",
"<g id=\"edge7\" class=\"edge\">\n",
"<title>7262&#45;&gt;7263</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M312.9366,-361.8964C324.2583,-350.1586 337.492,-336.4383 349.1983,-324.3016\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"351.8358,-326.6088 356.259,-316.9814 346.7975,-321.7491 351.8358,-326.6088\"/>\n",
"</g>\n",
"<!-- 7267 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7267</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"192\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"174.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"178.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">place</text>\n",
"<text text-anchor=\"start\" x=\"140\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7266&#45;&gt;7267 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7266&#45;&gt;7267</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-266.7612C192,-258.7873 192,-249.8428 192,-241.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-241.1794 192,-231.1795 188.5001,-241.1795 195.5001,-241.1794\"/>\n",
"</g>\n",
"<!-- 7268 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7268</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"192,-144 72,-108 192,-72 312,-108 192,-144\"/>\n",
"<text text-anchor=\"start\" x=\"178.5\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"182.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=\"140\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7267&#45;&gt;7268 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7267&#45;&gt;7268</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-179.8505C192,-171.9868 192,-163.0773 192,-154.2748\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-154.0596 192,-144.0596 188.5001,-154.0597 195.5001,-154.0596\"/>\n",
"</g>\n",
"<!-- 7269 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7269</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-36 0,-36 0,0 116,0 116,-36\"/>\n",
"<text text-anchor=\"start\" x=\"33.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"37.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">sausage</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",
"<!-- 7268&#45;&gt;7269 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7268&#45;&gt;7269</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M154.6735,-82.93C135.4671,-70.0301 112.1837,-54.3921 93.28,-41.6955\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"95.1859,-38.7595 84.9331,-36.0894 91.283,-44.5705 95.1859,-38.7595\"/>\n",
"</g>\n",
"<!-- 7270 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7270</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"250,-36 134,-36 134,0 250,0 250,-36\"/>\n",
"<text text-anchor=\"start\" x=\"170.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"174.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=\"142\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 7268&#45;&gt;7270 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7268&#45;&gt;7270</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-71.9121C192,-63.3433 192,-54.3253 192,-46.1692\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-46.0539 192,-36.0539 188.5001,-46.0539 195.5001,-46.0539\"/>\n",
"</g>\n",
"<!-- 7271 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>7271</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"384,-36 268,-36 268,0 384,0 384,-36\"/>\n",
"<text text-anchor=\"start\" x=\"305.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"309.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cheese</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",
"<!-- 7268&#45;&gt;7271 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>7268&#45;&gt;7271</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M229.3265,-82.93C248.5329,-70.0301 271.8163,-54.3921 290.72,-41.6955\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"292.717,-44.5705 299.0669,-36.0894 288.8141,-38.7595 292.717,-44.5705\"/>\n",
"</g>\n",
"<!-- 7265 -->\n",
"<g id=\"node9\" class=\"node\">\n",
"<title>7265</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"438,-223.4558 322,-223.4558 322,-187.4558 438,-187.4558 438,-223.4558\"/>\n",
"<text text-anchor=\"start\" x=\"338.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"342.5\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">ricotta cheese</text>\n",
"<text text-anchor=\"start\" x=\"330\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 7263&#45;&gt;7265 -->\n",
"<g id=\"edge8\" class=\"edge\">\n",
"<title>7263&#45;&gt;7265</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M380,-266.7612C380,-256.3964 380,-244.3917 380,-233.7674\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"383.5001,-233.7151 380,-223.7151 376.5001,-233.7151 383.5001,-233.7151\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.1637783329847165"
]
},
"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=\"446pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 445.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 441.8528,-321.8234 441.8528,4 -4,4\"/>\n",
"<!-- 7216 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7216</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"192\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"176\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"180\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"140\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7217 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7217</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"192,-230.9117 72,-194.9117 192,-158.9117 312,-194.9117 192,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"178.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"182.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=\"140\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7216&#45;&gt;7217 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7216&#45;&gt;7217</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-266.7622C192,-258.8985 192,-249.989 192,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-240.9713 192,-230.9713 188.5001,-240.9714 195.5001,-240.9713\"/>\n",
"</g>\n",
"<!-- 7220 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7220</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=\"12\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"16\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</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",
"<!-- 7217&#45;&gt;7220 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7217&#45;&gt;7220</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M156.7931,-169.3063C136.4381,-154.5025 110.9865,-135.992 91.0148,-121.4669\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"92.9678,-118.5596 82.8218,-115.5083 88.8505,-124.2207 92.9678,-118.5596\"/>\n",
"</g>\n",
"<!-- 7222 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7222</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:1.0000</text>\n",
"</g>\n",
"<!-- 7217&#45;&gt;7222 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7217&#45;&gt;7222</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-158.8996C192,-147.9536 192,-136.0871 192,-125.7278\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-125.5795 192,-115.5795 188.5001,-125.5795 195.5001,-125.5795\"/>\n",
"</g>\n",
"<!-- 7218 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7218</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"353\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"337\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"301\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7217&#45;&gt;7218 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7217&#45;&gt;7218</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M231.7978,-170.8215C254.4219,-157.1267 282.8668,-139.9086 306.5136,-125.5948\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"308.577,-128.4371 315.3194,-120.2645 304.9521,-122.4487 308.577,-128.4371\"/>\n",
"</g>\n",
"<!-- 7219 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7219</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"415.5,-36 290.5,-36 290.5,0 415.5,0 415.5,-36\"/>\n",
"<text text-anchor=\"start\" x=\"298.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"302.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"303\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 7218&#45;&gt;7219 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7218&#45;&gt;7219</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M353,-71.8782C353,-63.7122 353,-54.6289 353,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"356.5001,-46.2287 353,-36.2288 349.5001,-46.2288 356.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.14652509681410644"
]
},
"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=\"446pt\" height=\"413pt\"\n",
" viewBox=\"0.00 0.00 445.85 412.74\" 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 408.7351)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-408.7351 441.8528,-408.7351 441.8528,4 -4,4\"/>\n",
"<!-- 7085 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7085</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"245.8528\" cy=\"-379.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"234.3528\" y=\"-383.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"238.3528\" y=\"-383.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cut</text>\n",
"<text text-anchor=\"start\" x=\"193.8528\" y=\"-369.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.0000</text>\n",
"</g>\n",
"<!-- 7078 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7078</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"245.8528\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"229.8528\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"233.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=\"193.8528\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7085&#45;&gt;7078 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7085&#45;&gt;7078</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M245.8528,-353.6729C245.8528,-345.699 245.8528,-336.7545 245.8528,-328.2147\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"249.3529,-328.0911 245.8528,-318.0911 242.3529,-328.0912 249.3529,-328.0911\"/>\n",
"</g>\n",
"<!-- 7079 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7079</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"245.8528,-230.9117 125.8528,-194.9117 245.8528,-158.9117 365.8528,-194.9117 245.8528,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"232.3528\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"236.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=\"193.8528\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7078&#45;&gt;7079 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7078&#45;&gt;7079</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M245.8528,-266.7622C245.8528,-258.8985 245.8528,-249.989 245.8528,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"249.3529,-240.9713 245.8528,-230.9713 242.3529,-240.9714 249.3529,-240.9713\"/>\n",
"</g>\n",
"<!-- 7082 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7082</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\">bake</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",
"<!-- 7079&#45;&gt;7082 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7079&#45;&gt;7082</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M206.0551,-170.8215C183.4309,-157.1267 154.986,-139.9086 131.3392,-125.5948\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"132.9007,-122.4487 122.5335,-120.2645 129.2758,-128.4371 132.9007,-122.4487\"/>\n",
"</g>\n",
"<!-- 7081 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7081</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=\"199.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"203.8528\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</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.6667</text>\n",
"</g>\n",
"<!-- 7079&#45;&gt;7081 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7079&#45;&gt;7081</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M245.8528,-158.8996C245.8528,-147.9536 245.8528,-136.0871 245.8528,-125.7278\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"249.3529,-125.5795 245.8528,-115.5795 242.3529,-125.5795 249.3529,-125.5795\"/>\n",
"</g>\n",
"<!-- 7080 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>7080</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=\"358.3528\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"362.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=\"329.8528\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.6667</text>\n",
"</g>\n",
"<!-- 7079&#45;&gt;7080 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>7079&#45;&gt;7080</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M281.0597,-169.3063C301.4147,-154.5025 326.8663,-135.992 346.838,-121.4669\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"349.0023,-124.2207 355.031,-115.5083 344.885,-118.5596 349.0023,-124.2207\"/>\n",
"</g>\n",
"<!-- 7083 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7083</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"147.3528,-36 22.3528,-36 22.3528,0 147.3528,0 147.3528,-36\"/>\n",
"<text text-anchor=\"start\" x=\"30.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"34.3528\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"34.8528\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.5556</text>\n",
"</g>\n",
"<!-- 7082&#45;&gt;7083 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7082&#45;&gt;7083</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 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.19357657961531471"
]
},
"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=\"402pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 402.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 398,-321.8234 398,4 -4,4\"/>\n",
"<!-- 7234 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7234</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"197\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"179.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"183.5\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">place</text>\n",
"<text text-anchor=\"start\" x=\"145\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3333</text>\n",
"</g>\n",
"<!-- 7235 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7235</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"197\" cy=\"-205.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"181\" y=\"-209.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"185\" y=\"-209.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"145\" y=\"-195.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7234&#45;&gt;7235 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7234&#45;&gt;7235</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M197,-266.7612C197,-258.7873 197,-249.8428 197,-241.303\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"200.5001,-241.1794 197,-231.1795 193.5001,-241.1795 200.5001,-241.1794\"/>\n",
"</g>\n",
"<!-- 7236 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7236</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"197,-144 77,-108 197,-72 317,-108 197,-144\"/>\n",
"<text text-anchor=\"start\" x=\"183.5\" y=\"-111.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"187.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=\"145\" y=\"-97.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7235&#45;&gt;7236 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7235&#45;&gt;7236</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M197,-179.8505C197,-171.9868 197,-163.0773 197,-154.2748\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"200.5001,-154.0596 197,-144.0596 193.5001,-154.0597 200.5001,-154.0596\"/>\n",
"</g>\n",
"<!-- 7237 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7237</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"116,-36 0,-36 0,0 116,0 116,-36\"/>\n",
"<text text-anchor=\"start\" x=\"36.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"40.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=\"8\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 7236&#45;&gt;7237 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7236&#45;&gt;7237</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M158.6497,-83.1689C138.6299,-70.2064 114.2623,-54.4289 94.5181,-41.6448\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"96.382,-38.682 86.0856,-36.1849 92.5774,-44.5579 96.382,-38.682\"/>\n",
"</g>\n",
"<!-- 7240 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7240</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"259.5,-36 134.5,-36 134.5,0 259.5,0 259.5,-36\"/>\n",
"<text text-anchor=\"start\" x=\"142.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"146.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"147\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 7236&#45;&gt;7240 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7236&#45;&gt;7240</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M197,-71.9121C197,-63.3433 197,-54.3253 197,-46.1692\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"200.5001,-46.0539 197,-36.0539 193.5001,-46.0539 200.5001,-46.0539\"/>\n",
"</g>\n",
"<!-- 7238 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7238</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"394,-36 278,-36 278,0 394,0 394,-36\"/>\n",
"<text text-anchor=\"start\" x=\"290\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"294\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</text>\n",
"<text text-anchor=\"start\" x=\"286\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 7236&#45;&gt;7238 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7236&#45;&gt;7238</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M235.3503,-83.1689C255.3701,-70.2064 279.7377,-54.4289 299.4819,-41.6448\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"301.4226,-44.5579 307.9144,-36.1849 297.618,-38.682 301.4226,-44.5579\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.1637783329847165"
]
},
"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=\"446pt\" height=\"326pt\"\n",
" viewBox=\"0.00 0.00 445.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 441.8528,-321.8234 441.8528,4 -4,4\"/>\n",
"<!-- 6904 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>6904</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"192\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"176\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"180\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"140\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 6905 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>6905</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"192,-230.9117 72,-194.9117 192,-158.9117 312,-194.9117 192,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"178.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"182.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=\"140\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 6904&#45;&gt;6905 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>6904&#45;&gt;6905</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-266.7622C192,-258.8985 192,-249.989 192,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-240.9713 192,-230.9713 188.5001,-240.9714 195.5001,-240.9713\"/>\n",
"</g>\n",
"<!-- 6907 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>6907</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=\"36.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"40.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=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 6905&#45;&gt;6907 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>6905&#45;&gt;6907</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M156.7931,-169.3063C136.4381,-154.5025 110.9865,-135.992 91.0148,-121.4669\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"92.9678,-118.5596 82.8218,-115.5083 88.8505,-124.2207 92.9678,-118.5596\"/>\n",
"</g>\n",
"<!-- 6908 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>6908</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=\"146\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"150\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</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",
"<!-- 6905&#45;&gt;6908 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>6905&#45;&gt;6908</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-158.8996C192,-147.9536 192,-136.0871 192,-125.7278\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-125.5795 192,-115.5795 188.5001,-125.5795 195.5001,-125.5795\"/>\n",
"</g>\n",
"<!-- 6910 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>6910</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"353\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"337\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"301\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 6905&#45;&gt;6910 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>6905&#45;&gt;6910</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M231.7978,-170.8215C254.4219,-157.1267 282.8668,-139.9086 306.5136,-125.5948\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"308.577,-128.4371 315.3194,-120.2645 304.9521,-122.4487 308.577,-128.4371\"/>\n",
"</g>\n",
"<!-- 6906 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>6906</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"415.5,-36 290.5,-36 290.5,0 415.5,0 415.5,-36\"/>\n",
"<text text-anchor=\"start\" x=\"298.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"302.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"303\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8333</text>\n",
"</g>\n",
"<!-- 6910&#45;&gt;6906 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>6910&#45;&gt;6906</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M353,-71.8782C353,-63.7122 353,-54.6289 353,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"356.5001,-46.2287 353,-36.2288 349.5001,-46.2288 356.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"0.23690276157171494"
]
},
"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=\"446pt\" height=\"413pt\"\n",
" viewBox=\"0.00 0.00 445.85 412.74\" 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 408.7351)\">\n",
"<title>%3</title>\n",
"<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-408.7351 441.8528,-408.7351 441.8528,4 -4,4\"/>\n",
"<!-- 7172 -->\n",
"<g id=\"node1\" class=\"node\">\n",
"<title>7172</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"192\" cy=\"-379.2792\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"174.5\" y=\"-383.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"178.5\" y=\"-383.0792\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">place</text>\n",
"<text text-anchor=\"start\" x=\"140\" y=\"-369.0792\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.3333</text>\n",
"</g>\n",
"<!-- 7165 -->\n",
"<g id=\"node2\" class=\"node\">\n",
"<title>7165</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"192\" cy=\"-292.3675\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"176\" y=\"-296.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"180\" y=\"-296.1675\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">cook</text>\n",
"<text text-anchor=\"start\" x=\"140\" y=\"-282.1675\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7172&#45;&gt;7165 -->\n",
"<g id=\"edge1\" class=\"edge\">\n",
"<title>7172&#45;&gt;7165</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-353.6729C192,-345.699 192,-336.7545 192,-328.2147\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-328.0911 192,-318.0911 188.5001,-328.0912 195.5001,-328.0911\"/>\n",
"</g>\n",
"<!-- 7166 -->\n",
"<g id=\"node3\" class=\"node\">\n",
"<title>7166</title>\n",
"<polygon fill=\"#d5e8d4\" stroke=\"#d5e8d4\" points=\"192,-230.9117 72,-194.9117 192,-158.9117 312,-194.9117 192,-230.9117\"/>\n",
"<text text-anchor=\"start\" x=\"178.5\" y=\"-198.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"182.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=\"140\" y=\"-184.7117\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 0.6667</text>\n",
"</g>\n",
"<!-- 7165&#45;&gt;7166 -->\n",
"<g id=\"edge2\" class=\"edge\">\n",
"<title>7165&#45;&gt;7166</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-266.7622C192,-258.8985 192,-249.989 192,-241.1865\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-240.9713 192,-230.9713 188.5001,-240.9714 195.5001,-240.9713\"/>\n",
"</g>\n",
"<!-- 7167 -->\n",
"<g id=\"node4\" class=\"node\">\n",
"<title>7167</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=\"36.5\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"40.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=\"8\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:1.0000</text>\n",
"</g>\n",
"<!-- 7166&#45;&gt;7167 -->\n",
"<g id=\"edge3\" class=\"edge\">\n",
"<title>7166&#45;&gt;7167</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M156.7931,-169.3063C136.4381,-154.5025 110.9865,-135.992 91.0148,-121.4669\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"92.9678,-118.5596 82.8218,-115.5083 88.8505,-124.2207 92.9678,-118.5596\"/>\n",
"</g>\n",
"<!-- 7168 -->\n",
"<g id=\"node5\" class=\"node\">\n",
"<title>7168</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=\"146\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"150\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">spaghetti sauce</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",
"<!-- 7166&#45;&gt;7168 -->\n",
"<g id=\"edge4\" class=\"edge\">\n",
"<title>7166&#45;&gt;7168</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M192,-158.8996C192,-147.9536 192,-136.0871 192,-125.7278\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.5001,-125.5795 192,-115.5795 188.5001,-125.5795 195.5001,-125.5795\"/>\n",
"</g>\n",
"<!-- 7169 -->\n",
"<g id=\"node6\" class=\"node\">\n",
"<title>7169</title>\n",
"<ellipse fill=\"#dae8fc\" stroke=\"#dae8fc\" cx=\"353\" cy=\"-97.4558\" rx=\"84.7059\" ry=\"25.4118\"/>\n",
"<text text-anchor=\"start\" x=\"337\" y=\"-101.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"341\" y=\"-101.2558\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">bake</text>\n",
"<text text-anchor=\"start\" x=\"301\" y=\"-87.2558\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score: 1.0000</text>\n",
"</g>\n",
"<!-- 7166&#45;&gt;7169 -->\n",
"<g id=\"edge5\" class=\"edge\">\n",
"<title>7166&#45;&gt;7169</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M231.7978,-170.8215C254.4219,-157.1267 282.8668,-139.9086 306.5136,-125.5948\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"308.577,-128.4371 315.3194,-120.2645 304.9521,-122.4487 308.577,-128.4371\"/>\n",
"</g>\n",
"<!-- 7170 -->\n",
"<g id=\"node7\" class=\"node\">\n",
"<title>7170</title>\n",
"<polygon fill=\"#ffe6cc\" stroke=\"#ffe6cc\" points=\"415.5,-36 290.5,-36 290.5,0 415.5,0 415.5,-36\"/>\n",
"<text text-anchor=\"start\" x=\"298.5\" y=\"-21.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\"> </text>\n",
"<text text-anchor=\"start\" x=\"302.5\" y=\"-21.8\" font-family=\"Times,serif\" font-weight=\"bold\" font-size=\"14.00\" fill=\"#000000\">mozzarella cheese</text>\n",
"<text text-anchor=\"start\" x=\"303\" y=\"-7.8\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">node score:0.8889</text>\n",
"</g>\n",
"<!-- 7169&#45;&gt;7170 -->\n",
"<g id=\"edge6\" class=\"edge\">\n",
"<title>7169&#45;&gt;7170</title>\n",
"<path fill=\"none\" stroke=\"#000000\" d=\"M353,-71.8782C353,-63.7122 353,-54.6289 353,-46.2824\"/>\n",
"<polygon fill=\"#000000\" stroke=\"#000000\" points=\"356.5001,-46.2287 353,-36.2288 349.5001,-46.2288 356.5001,-46.2287\"/>\n",
"</g>\n",
"</g>\n",
"</svg>\n"
],
"text/plain": [
"<graphviz.dot.Digraph at 0x7fe15ea94c90>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"p.plot_population(collect_scores=True)"
]
},
{
"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.5"
},
"mimetype": "text/x-python",
"name": "python",
"npconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": 3
},
"nbformat": 4,
"nbformat_minor": 4
}