Files
2026-02-08 11:20:43 -10:00

6749 lines
404 KiB
Plaintext
Vendored

{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Predict wine quality"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use the latest versions of DataFrame and KotlinDL libraries from the [version repository](https://github.com/Kotlin/kotlin-jupyter-libraries).\n",
"\n",
"To run this notebook in Kotlin Notebook, please make sure \"Resolve multiplatform dependencies\" is turned OFF for this library"
]
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:10:46.465849Z",
"start_time": "2025-08-04T19:10:46.437989Z"
}
},
"cell_type": "code",
"source": "%useLatestDescriptors",
"outputs": [],
"execution_count": 1
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:10:54.630902Z",
"start_time": "2025-08-04T19:10:47.236780Z"
}
},
"cell_type": "code",
"source": "%use dataframe",
"outputs": [],
"execution_count": 3
},
{
"cell_type": "code",
"metadata": {
"pycharm": {
"is_executing": true
},
"ExecuteTime": {
"end_time": "2025-08-04T19:10:58.474041Z",
"start_time": "2025-08-04T19:10:54.658015Z"
}
},
"source": "%use kotlin-dl",
"outputs": [],
"execution_count": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Read the dataframe from CSV and print the first few lines of it"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:02.418907Z",
"start_time": "2025-08-04T19:10:58.768380Z"
}
},
"source": [
"val rawDf = DataFrame.readCsv(fileOrUrl = \"winequality-red.csv\", delimiter = ';')\n",
"rawDf.head()"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_1()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_1\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865856&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame: rowsCount = 5, columnsCount = 12&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;fixed acidity: Double&bsol;&quot;&gt;fixed acidity&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;11.2&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;volatile acidity: Double&bsol;&quot;&gt;volatile acidity&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.70&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.88&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.76&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.28&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.70&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;citric acid: Double&bsol;&quot;&gt;citric acid&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.04&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;residual sugar: Double&bsol;&quot;&gt;residual sugar&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.9&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;2.6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;2.3&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.9&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.9&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;chlorides: Double&bsol;&quot;&gt;chlorides&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.076&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.098&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.092&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.075&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.076&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;free sulfur dioxide: Double&bsol;&quot;&gt;free sulfur dioxide&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;11.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;25.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;15.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;17.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;11.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;total sulfur dioxide: Double&bsol;&quot;&gt;total sulfur dioxide&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;34.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;67.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;54.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;60.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;34.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;density: Double&bsol;&quot;&gt;density&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.9978&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.9968&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.9970&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.9980&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.9978&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;pH: Double&bsol;&quot;&gt;pH&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;3.51&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;3.20&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;3.26&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;3.16&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;3.51&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;sulphates: Double&bsol;&quot;&gt;sulphates&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.68&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.65&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.58&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;alcohol: Double&bsol;&quot;&gt;alcohol&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;quality: Int&bsol;&quot;&gt;quality&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"], id: 687865856, rootId: 687865856, totalRows: 5 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865856) });\n",
"\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_1() {\n",
" let elem = document.getElementById(\"iframe_out_1\");\n",
" resize_iframe_out_1(elem);\n",
" setInterval(resize_iframe_out_1, 5000, elem);\n",
" }\n",
" function resize_iframe_out_1(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script> <html theme='dark'>\n",
" <head>\n",
" <style type=\"text/css\">\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover > td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"/* formatting */\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
" </style>\n",
" </head>\n",
" <body>\n",
" <table class=\"dataframe\" id=\"static_df_687865857\"><thead><tr><th class=\"bottomBorder\" style=\"text-align:left\">fixed acidity</th><th class=\"bottomBorder\" style=\"text-align:left\">volatile acidity</th><th class=\"bottomBorder\" style=\"text-align:left\">citric acid</th><th class=\"bottomBorder\" style=\"text-align:left\">residual sugar</th><th class=\"bottomBorder\" style=\"text-align:left\">chlorides</th><th class=\"bottomBorder\" style=\"text-align:left\">free sulfur dioxide</th><th class=\"bottomBorder\" style=\"text-align:left\">total sulfur dioxide</th><th class=\"bottomBorder\" style=\"text-align:left\">density</th><th class=\"bottomBorder\" style=\"text-align:left\">pH</th><th class=\"bottomBorder\" style=\"text-align:left\">sulphates</th><th class=\"bottomBorder\" style=\"text-align:left\">alcohol</th><th class=\"bottomBorder\" style=\"text-align:left\">quality</th></tr></thead><tbody><tr><td style=\"vertical-align:top\">7.400000</td><td style=\"vertical-align:top\">0.700000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">1.900000</td><td style=\"vertical-align:top\">0.076000</td><td style=\"vertical-align:top\">11.000000</td><td style=\"vertical-align:top\">34.000000</td><td style=\"vertical-align:top\">0.997800</td><td style=\"vertical-align:top\">3.510000</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">9.400000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.800000</td><td style=\"vertical-align:top\">0.880000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">2.600000</td><td style=\"vertical-align:top\">0.098000</td><td style=\"vertical-align:top\">25.000000</td><td style=\"vertical-align:top\">67.000000</td><td style=\"vertical-align:top\">0.996800</td><td style=\"vertical-align:top\">3.200000</td><td style=\"vertical-align:top\">0.680000</td><td style=\"vertical-align:top\">9.800000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.800000</td><td style=\"vertical-align:top\">0.760000</td><td style=\"vertical-align:top\">0.040000</td><td style=\"vertical-align:top\">2.300000</td><td style=\"vertical-align:top\">0.092000</td><td style=\"vertical-align:top\">15.000000</td><td style=\"vertical-align:top\">54.000000</td><td style=\"vertical-align:top\">0.997000</td><td style=\"vertical-align:top\">3.260000</td><td style=\"vertical-align:top\">0.650000</td><td style=\"vertical-align:top\">9.800000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">11.200000</td><td style=\"vertical-align:top\">0.280000</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">1.900000</td><td style=\"vertical-align:top\">0.075000</td><td style=\"vertical-align:top\">17.000000</td><td style=\"vertical-align:top\">60.000000</td><td style=\"vertical-align:top\">0.998000</td><td style=\"vertical-align:top\">3.160000</td><td style=\"vertical-align:top\">0.580000</td><td style=\"vertical-align:top\">9.800000</td><td style=\"vertical-align:top\">6</td></tr><tr><td style=\"vertical-align:top\">7.400000</td><td style=\"vertical-align:top\">0.700000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">1.900000</td><td style=\"vertical-align:top\">0.076000</td><td style=\"vertical-align:top\">11.000000</td><td style=\"vertical-align:top\">34.000000</td><td style=\"vertical-align:top\">0.997800</td><td style=\"vertical-align:top\">3.510000</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">9.400000</td><td style=\"vertical-align:top\">5</td></tr></tbody></table>\n",
" </body>\n",
" <script>\n",
" document.getElementById(\"static_df_687865857\").style.display = \"none\";\n",
" </script>\n",
" </html>"
],
"application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"fixed acidity\",\"volatile acidity\",\"citric acid\",\"residual sugar\",\"chlorides\",\"free sulfur dioxide\",\"total sulfur dioxide\",\"density\",\"pH\",\"sulphates\",\"alcohol\",\"quality\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":5,\"ncol\":12},\"kotlin_dataframe\":[{\"fixed acidity\":7.4,\"volatile acidity\":0.7,\"citric acid\":0.0,\"residual sugar\":1.9,\"chlorides\":0.076,\"free sulfur dioxide\":11.0,\"total sulfur dioxide\":34.0,\"density\":0.9978,\"pH\":3.51,\"sulphates\":0.56,\"alcohol\":9.4,\"quality\":5},{\"fixed acidity\":7.8,\"volatile acidity\":0.88,\"citric acid\":0.0,\"residual sugar\":2.6,\"chlorides\":0.098,\"free sulfur dioxide\":25.0,\"total sulfur dioxide\":67.0,\"density\":0.9968,\"pH\":3.2,\"sulphates\":0.68,\"alcohol\":9.8,\"quality\":5},{\"fixed acidity\":7.8,\"volatile acidity\":0.76,\"citric acid\":0.04,\"residual sugar\":2.3,\"chlorides\":0.092,\"free sulfur dioxide\":15.0,\"total sulfur dioxide\":54.0,\"density\":0.997,\"pH\":3.26,\"sulphates\":0.65,\"alcohol\":9.8,\"quality\":5},{\"fixed acidity\":11.2,\"volatile acidity\":0.28,\"citric acid\":0.56,\"residual sugar\":1.9,\"chlorides\":0.075,\"free sulfur dioxide\":17.0,\"total sulfur dioxide\":60.0,\"density\":0.998,\"pH\":3.16,\"sulphates\":0.58,\"alcohol\":9.8,\"quality\":6},{\"fixed acidity\":7.4,\"volatile acidity\":0.7,\"citric acid\":0.0,\"residual sugar\":1.9,\"chlorides\":0.076,\"free sulfur dioxide\":11.0,\"total sulfur dioxide\":34.0,\"density\":0.9978,\"pH\":3.51,\"sulphates\":0.56,\"alcohol\":9.4,\"quality\":5}]}"
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 5
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"_Note:_ For formatting, the DataFrame needs to be rendered as HTML.\n",
"This means that when running in Kotlin Notebook, \"Render DataFrame tables natively\" needs to be turned off, or we need\n",
"to explicitly turn the dataframe into HTML."
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:03.284594Z",
"start_time": "2025-08-04T19:11:02.584533Z"
}
},
"source": [
"import org.jetbrains.kotlinx.dataframe.api.FormattingDsl.red\n",
"import org.jetbrains.kotlinx.dataframe.api.FormattingDsl.green\n",
"\n",
"rawDf.corr()\n",
" .format { colsOf<Double>() }.linearBg(from = -1 to red, to = +1 to green)\n",
" .toHtml()"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_2()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_2\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865858&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;table class=&quot;dataframe&quot; id=&quot;static_df_687865859&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;column&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;fixed acidity&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;volatile acidity&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;residual sugar&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;chlorides&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;density&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;pH&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;sulphates&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;alcohol&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;quality&lt;&sol;th&gt;&lt;&sol;tr&gt;&lt;&sol;thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;fixed acidity&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.256131&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.114777&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.093705&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.668047&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.682978&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.183006&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.061668&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.124052&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;volatile acidity&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.256131&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.001918&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.061298&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.022026&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.234937&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.260987&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.202288&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.390558&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;residual sugar&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.114777&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.001918&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.055610&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.355283&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.085652&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.005527&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.042075&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.013732&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;chlorides&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.093705&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.061298&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.055610&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.200632&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.265026&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.371260&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.221141&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.128907&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;density&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.668047&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.022026&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.355283&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.200632&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.341699&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.148506&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.496180&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.174919&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;pH&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.682978&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.234937&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.085652&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.265026&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.341699&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.196648&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.205633&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.057731&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;sulphates&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.183006&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.260987&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.005527&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.371260&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.148506&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.196648&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.093595&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.251397&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;alcohol&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.061668&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.202288&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.042075&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.221141&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.496180&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.205633&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.093595&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.476166&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;quality&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.124052&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.390558&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.013732&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.128907&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.174919&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;-0.057731&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.251397&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0.476166&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1.000000&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;&sol;tbody&gt;&lt;&sol;table&gt;\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame [9 x 10]&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;column: String&bsol;&quot;&gt;column&lt;&sol;span&gt;&quot;, children: [], rightAlign: false, values: [&quot;fixed acidity&quot;,&quot;volatile acidity&quot;,&quot;residual sugar&quot;,&quot;chlorides&quot;,&quot;density&quot;,&quot;pH&quot;,&quot;sulphates&quot;,&quot;alcohol&quot;,&quot;quality&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;fixed acidity: Double&bsol;&quot;&gt;fixed acidity&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#a05e00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.256131&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#708e00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.114777&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#738b00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.093705&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#2ad400&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.668047&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#d62800&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.682978&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#689600&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.183006&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#877700&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.061668&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#6f8f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.124052&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;volatile acidity: Double&bsol;&quot;&gt;volatile acidity&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#a05e00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.256131&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7f7f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.001918&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#778700&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.061298&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7c8200&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.022026&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#619d00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.234937&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#a05e00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.260987&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#996500&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.202288&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#b14d00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.390558&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;residual sugar: Double&bsol;&quot;&gt;residual sugar&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#708e00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.114777&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7f7f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.001918&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#788600&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.055610&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#52ac00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.355283&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#8a7400&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.085652&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7e8000&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.005527&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7a8400&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.042075&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7d8100&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.013732&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;chlorides: Double&bsol;&quot;&gt;chlorides&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#738b00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.093705&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#778700&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.061298&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#788600&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.055610&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#659900&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.200632&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#a15d00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.265026&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#50ae00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.371260&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#9b6300&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.221141&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#8f6f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.128907&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;density: Double&bsol;&quot;&gt;density&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#2ad400&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.668047&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7c8200&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.022026&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#52ac00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.355283&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#659900&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.200632&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#ab5300&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.341699&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#6c9200&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.148506&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#be4000&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.496180&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#956900&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.174919&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;pH: Double&bsol;&quot;&gt;pH&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#d62800&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.682978&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#619d00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.234937&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#8a7400&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.085652&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#a15d00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.265026&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#ab5300&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.341699&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#986600&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.196648&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#659900&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.205633&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#867800&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.057731&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;sulphates: Double&bsol;&quot;&gt;sulphates&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#689600&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.183006&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#a05e00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.260987&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7e8000&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.005527&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#50ae00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.371260&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#6c9200&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.148506&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#986600&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.196648&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#738b00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.093595&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#5f9f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.251397&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;alcohol: Double&bsol;&quot;&gt;alcohol&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#877700&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.061668&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#996500&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.202288&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7a8400&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.042075&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#9b6300&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.221141&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#be4000&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.496180&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#659900&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.205633&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#738b00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.093595&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#42bc00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.476166&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;quality: Double&bsol;&quot;&gt;quality&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#6f8f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.124052&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#b14d00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.390558&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#7d8100&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.013732&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#8f6f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.128907&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#956900&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.174919&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#867800&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;-0.057731&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#5f9f00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.251397&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#42bc00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.476166&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#00ff00&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"], id: 687865858, rootId: 687865858, totalRows: 9 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865858) });\n",
"\n",
"document.getElementById(&quot;static_df_687865859&quot;).style.display = &quot;none&quot;;\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_2() {\n",
" let elem = document.getElementById(\"iframe_out_2\");\n",
" resize_iframe_out_2(elem);\n",
" setInterval(resize_iframe_out_2, 5000, elem);\n",
" }\n",
" function resize_iframe_out_2(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Based on the correlation, we can remove some columns, they seem to be insignificant"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:05.527869Z",
"start_time": "2025-08-04T19:11:04.230783Z"
}
},
"source": [
"val df = rawDf.remove { `free sulfur dioxide` and `residual sugar` and pH }\n",
"df"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_4()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_4\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865862&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;... showing only top 20 of 1599 rows&lt;&sol;p&gt;&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame: rowsCount = 1599, columnsCount = 9&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;fixed acidity: Double&bsol;&quot;&gt;fixed acidity&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;11.2&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.9&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.3&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6.7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5.6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;8.9&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;8.9&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;8.5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;8.1&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7.9&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;volatile acidity: Double&bsol;&quot;&gt;volatile acidity&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.700&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.880&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.760&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.280&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.700&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.660&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.600&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.650&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.580&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.500&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.580&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.500&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.615&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.610&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.620&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.620&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.280&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.560&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.590&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.320&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;citric acid: Double?&bsol;&quot;&gt;citric acid&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.04&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.06&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.02&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.36&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.08&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.36&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.00&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.29&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.18&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.19&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.28&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.08&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.51&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;chlorides: Double&bsol;&quot;&gt;chlorides&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.076&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.098&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.092&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.075&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.076&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.075&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.069&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.065&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.073&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.071&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.097&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.071&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.089&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.114&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.176&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.170&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.092&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.368&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.086&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.341&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;total sulfur dioxide: Double?&bsol;&quot;&gt;total sulfur dioxide&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;34.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;67.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;54.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;60.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;34.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;40.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;59.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;21.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;18.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;102.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;65.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;102.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;59.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;29.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;145.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;148.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;103.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;56.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;29.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;56.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;density: Double&bsol;&quot;&gt;density&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99780&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99680&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99700&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99800&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99780&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99780&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99640&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99460&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99680&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99780&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99590&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99780&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99430&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99740&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99860&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99860&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99690&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99680&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99740&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.99690&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;sulphates: Double&bsol;&quot;&gt;sulphates&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.68&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.65&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.58&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.46&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.47&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.57&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.80&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.54&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.80&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.52&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.56&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.88&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.93&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.75&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.28&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.50&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.08&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;alcohol: Double&bsol;&quot;&gt;alcohol&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.400000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.800000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.800000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.800000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.400000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.400000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.400000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;10.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.500000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;10.500000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.200000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;10.500000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.900000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.100000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.200000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.200000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;10.500000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.300000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.000000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;9.200000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;quality: Int&bsol;&quot;&gt;quality&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"], id: 687865862, rootId: 687865862, totalRows: 1599 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865862) });\n",
"\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_4() {\n",
" let elem = document.getElementById(\"iframe_out_4\");\n",
" resize_iframe_out_4(elem);\n",
" setInterval(resize_iframe_out_4, 5000, elem);\n",
" }\n",
" function resize_iframe_out_4(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script> <html theme='dark'>\n",
" <head>\n",
" <style type=\"text/css\">\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover > td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"/* formatting */\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
" </style>\n",
" </head>\n",
" <body>\n",
" <table class=\"dataframe\" id=\"static_df_687865863\"><thead><tr><th class=\"bottomBorder\" style=\"text-align:left\">fixed acidity</th><th class=\"bottomBorder\" style=\"text-align:left\">volatile acidity</th><th class=\"bottomBorder\" style=\"text-align:left\">citric acid</th><th class=\"bottomBorder\" style=\"text-align:left\">chlorides</th><th class=\"bottomBorder\" style=\"text-align:left\">total sulfur dioxide</th><th class=\"bottomBorder\" style=\"text-align:left\">density</th><th class=\"bottomBorder\" style=\"text-align:left\">sulphates</th><th class=\"bottomBorder\" style=\"text-align:left\">alcohol</th><th class=\"bottomBorder\" style=\"text-align:left\">quality</th></tr></thead><tbody><tr><td style=\"vertical-align:top\">7.400000</td><td style=\"vertical-align:top\">0.700000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">0.076000</td><td style=\"vertical-align:top\">34.000000</td><td style=\"vertical-align:top\">0.997800</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">9.400000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.800000</td><td style=\"vertical-align:top\">0.880000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">0.098000</td><td style=\"vertical-align:top\">67.000000</td><td style=\"vertical-align:top\">0.996800</td><td style=\"vertical-align:top\">0.680000</td><td style=\"vertical-align:top\">9.800000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.800000</td><td style=\"vertical-align:top\">0.760000</td><td style=\"vertical-align:top\">0.040000</td><td style=\"vertical-align:top\">0.092000</td><td style=\"vertical-align:top\">54.000000</td><td style=\"vertical-align:top\">0.997000</td><td style=\"vertical-align:top\">0.650000</td><td style=\"vertical-align:top\">9.800000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">11.200000</td><td style=\"vertical-align:top\">0.280000</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">0.075000</td><td style=\"vertical-align:top\">60.000000</td><td style=\"vertical-align:top\">0.998000</td><td style=\"vertical-align:top\">0.580000</td><td style=\"vertical-align:top\">9.800000</td><td style=\"vertical-align:top\">6</td></tr><tr><td style=\"vertical-align:top\">7.400000</td><td style=\"vertical-align:top\">0.700000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">0.076000</td><td style=\"vertical-align:top\">34.000000</td><td style=\"vertical-align:top\">0.997800</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">9.400000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.400000</td><td style=\"vertical-align:top\">0.660000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">0.075000</td><td style=\"vertical-align:top\">40.000000</td><td style=\"vertical-align:top\">0.997800</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">9.400000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.900000</td><td style=\"vertical-align:top\">0.600000</td><td style=\"vertical-align:top\">0.060000</td><td style=\"vertical-align:top\">0.069000</td><td style=\"vertical-align:top\">59.000000</td><td style=\"vertical-align:top\">0.996400</td><td style=\"vertical-align:top\">0.460000</td><td style=\"vertical-align:top\">9.400000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.300000</td><td style=\"vertical-align:top\">0.650000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">0.065000</td><td style=\"vertical-align:top\">21.000000</td><td style=\"vertical-align:top\">0.994600</td><td style=\"vertical-align:top\">0.470000</td><td style=\"vertical-align:top\">10.000000</td><td style=\"vertical-align:top\">7</td></tr><tr><td style=\"vertical-align:top\">7.800000</td><td style=\"vertical-align:top\">0.580000</td><td style=\"vertical-align:top\">0.020000</td><td style=\"vertical-align:top\">0.073000</td><td style=\"vertical-align:top\">18.000000</td><td style=\"vertical-align:top\">0.996800</td><td style=\"vertical-align:top\">0.570000</td><td style=\"vertical-align:top\">9.500000</td><td style=\"vertical-align:top\">7</td></tr><tr><td style=\"vertical-align:top\">7.500000</td><td style=\"vertical-align:top\">0.500000</td><td style=\"vertical-align:top\">0.360000</td><td style=\"vertical-align:top\">0.071000</td><td style=\"vertical-align:top\">102.000000</td><td style=\"vertical-align:top\">0.997800</td><td style=\"vertical-align:top\">0.800000</td><td style=\"vertical-align:top\">10.500000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">6.700000</td><td style=\"vertical-align:top\">0.580000</td><td style=\"vertical-align:top\">0.080000</td><td style=\"vertical-align:top\">0.097000</td><td style=\"vertical-align:top\">65.000000</td><td style=\"vertical-align:top\">0.995900</td><td style=\"vertical-align:top\">0.540000</td><td style=\"vertical-align:top\">9.200000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.500000</td><td style=\"vertical-align:top\">0.500000</td><td style=\"vertical-align:top\">0.360000</td><td style=\"vertical-align:top\">0.071000</td><td style=\"vertical-align:top\">102.000000</td><td style=\"vertical-align:top\">0.997800</td><td style=\"vertical-align:top\">0.800000</td><td style=\"vertical-align:top\">10.500000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">5.600000</td><td style=\"vertical-align:top\">0.615000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">0.089000</td><td style=\"vertical-align:top\">59.000000</td><td style=\"vertical-align:top\">0.994300</td><td style=\"vertical-align:top\">0.520000</td><td style=\"vertical-align:top\">9.900000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.800000</td><td style=\"vertical-align:top\">0.610000</td><td style=\"vertical-align:top\">0.290000</td><td style=\"vertical-align:top\">0.114000</td><td style=\"vertical-align:top\">29.000000</td><td style=\"vertical-align:top\">0.997400</td><td style=\"vertical-align:top\">1.560000</td><td style=\"vertical-align:top\">9.100000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">8.900000</td><td style=\"vertical-align:top\">0.620000</td><td style=\"vertical-align:top\">0.180000</td><td style=\"vertical-align:top\">0.176000</td><td style=\"vertical-align:top\">145.000000</td><td style=\"vertical-align:top\">0.998600</td><td style=\"vertical-align:top\">0.880000</td><td style=\"vertical-align:top\">9.200000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">8.900000</td><td style=\"vertical-align:top\">0.620000</td><td style=\"vertical-align:top\">0.190000</td><td style=\"vertical-align:top\">0.170000</td><td style=\"vertical-align:top\">148.000000</td><td style=\"vertical-align:top\">0.998600</td><td style=\"vertical-align:top\">0.930000</td><td style=\"vertical-align:top\">9.200000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">8.500000</td><td style=\"vertical-align:top\">0.280000</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">0.092000</td><td style=\"vertical-align:top\">103.000000</td><td style=\"vertical-align:top\">0.996900</td><td style=\"vertical-align:top\">0.750000</td><td style=\"vertical-align:top\">10.500000</td><td style=\"vertical-align:top\">7</td></tr><tr><td style=\"vertical-align:top\">8.100000</td><td style=\"vertical-align:top\">0.560000</td><td style=\"vertical-align:top\">0.280000</td><td style=\"vertical-align:top\">0.368000</td><td style=\"vertical-align:top\">56.000000</td><td style=\"vertical-align:top\">0.996800</td><td style=\"vertical-align:top\">1.280000</td><td style=\"vertical-align:top\">9.300000</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7.400000</td><td style=\"vertical-align:top\">0.590000</td><td style=\"vertical-align:top\">0.080000</td><td style=\"vertical-align:top\">0.086000</td><td style=\"vertical-align:top\">29.000000</td><td style=\"vertical-align:top\">0.997400</td><td style=\"vertical-align:top\">0.500000</td><td style=\"vertical-align:top\">9.000000</td><td style=\"vertical-align:top\">4</td></tr><tr><td style=\"vertical-align:top\">7.900000</td><td style=\"vertical-align:top\">0.320000</td><td style=\"vertical-align:top\">0.510000</td><td style=\"vertical-align:top\">0.341000</td><td style=\"vertical-align:top\">56.000000</td><td style=\"vertical-align:top\">0.996900</td><td style=\"vertical-align:top\">1.080000</td><td style=\"vertical-align:top\">9.200000</td><td style=\"vertical-align:top\">6</td></tr></tbody></table>\n",
" </body>\n",
" <script>\n",
" document.getElementById(\"static_df_687865863\").style.display = \"none\";\n",
" </script>\n",
" </html>"
],
"application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"fixed acidity\",\"volatile acidity\",\"citric acid\",\"chlorides\",\"total sulfur dioxide\",\"density\",\"sulphates\",\"alcohol\",\"quality\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double?\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":1599,\"ncol\":9},\"kotlin_dataframe\":[{\"fixed acidity\":7.4,\"volatile acidity\":0.7,\"citric acid\":0.0,\"chlorides\":0.076,\"total sulfur dioxide\":34.0,\"density\":0.9978,\"sulphates\":0.56,\"alcohol\":9.4,\"quality\":5},{\"fixed acidity\":7.8,\"volatile acidity\":0.88,\"citric acid\":0.0,\"chlorides\":0.098,\"total sulfur dioxide\":67.0,\"density\":0.9968,\"sulphates\":0.68,\"alcohol\":9.8,\"quality\":5},{\"fixed acidity\":7.8,\"volatile acidity\":0.76,\"citric acid\":0.04,\"chlorides\":0.092,\"total sulfur dioxide\":54.0,\"density\":0.997,\"sulphates\":0.65,\"alcohol\":9.8,\"quality\":5},{\"fixed acidity\":11.2,\"volatile acidity\":0.28,\"citric acid\":0.56,\"chlorides\":0.075,\"total sulfur dioxide\":60.0,\"density\":0.998,\"sulphates\":0.58,\"alcohol\":9.8,\"quality\":6},{\"fixed acidity\":7.4,\"volatile acidity\":0.7,\"citric acid\":0.0,\"chlorides\":0.076,\"total sulfur dioxide\":34.0,\"density\":0.9978,\"sulphates\":0.56,\"alcohol\":9.4,\"quality\":5},{\"fixed acidity\":7.4,\"volatile acidity\":0.66,\"citric acid\":0.0,\"chlorides\":0.075,\"total sulfur dioxide\":40.0,\"density\":0.9978,\"sulphates\":0.56,\"alcohol\":9.4,\"quality\":5},{\"fixed acidity\":7.9,\"volatile acidity\":0.6,\"citric acid\":0.06,\"chlorides\":0.069,\"total sulfur dioxide\":59.0,\"density\":0.9964,\"sulphates\":0.46,\"alcohol\":9.4,\"quality\":5},{\"fixed acidity\":7.3,\"volatile acidity\":0.65,\"citric acid\":0.0,\"chlorides\":0.065,\"total sulfur dioxide\":21.0,\"density\":0.9946,\"sulphates\":0.47,\"alcohol\":10.0,\"quality\":7},{\"fixed acidity\":7.8,\"volatile acidity\":0.58,\"citric acid\":0.02,\"chlorides\":0.073,\"total sulfur dioxide\":18.0,\"density\":0.9968,\"sulphates\":0.57,\"alcohol\":9.5,\"quality\":7},{\"fixed acidity\":7.5,\"volatile acidity\":0.5,\"citric acid\":0.36,\"chlorides\":0.071,\"total sulfur dioxide\":102.0,\"density\":0.9978,\"sulphates\":0.8,\"alcohol\":10.5,\"quality\":5},{\"fixed acidity\":6.7,\"volatile acidity\":0.58,\"citric acid\":0.08,\"chlorides\":0.097,\"total sulfur dioxide\":65.0,\"density\":0.9959,\"sulphates\":0.54,\"alcohol\":9.2,\"quality\":5},{\"fixed acidity\":7.5,\"volatile acidity\":0.5,\"citric acid\":0.36,\"chlorides\":0.071,\"total sulfur dioxide\":102.0,\"density\":0.9978,\"sulphates\":0.8,\"alcohol\":10.5,\"quality\":5},{\"fixed acidity\":5.6,\"volatile acidity\":0.615,\"citric acid\":0.0,\"chlorides\":0.089,\"total sulfur dioxide\":59.0,\"density\":0.9943,\"sulphates\":0.52,\"alcohol\":9.9,\"quality\":5},{\"fixed acidity\":7.8,\"volatile acidity\":0.61,\"citric acid\":0.29,\"chlorides\":0.114,\"total sulfur dioxide\":29.0,\"density\":0.9974,\"sulphates\":1.56,\"alcohol\":9.1,\"quality\":5},{\"fixed acidity\":8.9,\"volatile acidity\":0.62,\"citric acid\":0.18,\"chlorides\":0.176,\"total sulfur dioxide\":145.0,\"density\":0.9986,\"sulphates\":0.88,\"alcohol\":9.2,\"quality\":5},{\"fixed acidity\":8.9,\"volatile acidity\":0.62,\"citric acid\":0.19,\"chlorides\":0.17,\"total sulfur dioxide\":148.0,\"density\":0.9986,\"sulphates\":0.93,\"alcohol\":9.2,\"quality\":5},{\"fixed acidity\":8.5,\"volatile acidity\":0.28,\"citric acid\":0.56,\"chlorides\":0.092,\"total sulfur dioxide\":103.0,\"density\":0.9969,\"sulphates\":0.75,\"alcohol\":10.5,\"quality\":7},{\"fixed acidity\":8.1,\"volatile acidity\":0.56,\"citric acid\":0.28,\"chlorides\":0.368,\"total sulfur dioxide\":56.0,\"density\":0.9968,\"sulphates\":1.28,\"alcohol\":9.3,\"quality\":5},{\"fixed acidity\":7.4,\"volatile acidity\":0.59,\"citric acid\":0.08,\"chlorides\":0.086,\"total sulfur dioxide\":29.0,\"density\":0.9974,\"sulphates\":0.5,\"alcohol\":9.0,\"quality\":4},{\"fixed acidity\":7.9,\"volatile acidity\":0.32,\"citric acid\":0.51,\"chlorides\":0.341,\"total sulfur dioxide\":56.0,\"density\":0.9969,\"sulphates\":1.08,\"alcohol\":9.2,\"quality\":6}]}"
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Predict wine quality: first approach"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:07.051759Z",
"start_time": "2025-08-04T19:11:06.171066Z"
}
},
"source": [
"// Simple converter function between DataFrame and KotlinDL data representations\n",
"fun <T> DataFrame<T>.toOnHeapDataset(labelColumnName: String): OnHeapDataset {\n",
" return OnHeapDataset.create(\n",
" dataframe = this,\n",
" yColumn = labelColumnName\n",
" )\n",
"}\n",
"\n",
"fun OnHeapDataset.Companion.create(\n",
" dataframe: DataFrame<Any?>,\n",
" yColumn: String\n",
"): OnHeapDataset {\n",
" fun extractX(): Array<FloatArray> =\n",
" dataframe.remove(yColumn).rows()\n",
" .map { (it.values() as List<Float>).toFloatArray() }.toTypedArray()\n",
"\n",
" fun extractY(): FloatArray =\n",
" dataframe.get { yColumn<Float>() }.toList().toFloatArray()\n",
"\n",
" return create(\n",
" ::extractX,\n",
" ::extractY\n",
" )\n",
"}"
],
"outputs": [],
"execution_count": 8
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:08.239873Z",
"start_time": "2025-08-04T19:11:07.966027Z"
}
},
"source": [
"val (train, test) = df.convert { colsOf<Double>() }.toFloat()\n",
" .toOnHeapDataset(labelColumnName = \"quality\")\n",
" .split(0.8)"
],
"outputs": [],
"execution_count": 9
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Define simple neural network with only 2 dense layers"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:11.182470Z",
"start_time": "2025-08-04T19:11:08.910459Z"
}
},
"source": [
"val inputNeurons = train.x[0].size.toLong()\n",
"\n",
"val model = Sequential.of(\n",
" Input(\n",
" inputNeurons,\n",
" ),\n",
" Dense(\n",
" outputSize = (inputNeurons * 10).toInt(),\n",
" activation = Activations.Tanh,\n",
" kernelInitializer = HeNormal(),\n",
" biasInitializer = HeNormal(),\n",
" ),\n",
" Dense(\n",
" outputSize = (inputNeurons * 10).toInt(),\n",
" activation = Activations.Tanh,\n",
" kernelInitializer = HeNormal(),\n",
" biasInitializer = HeNormal(),\n",
" ),\n",
" Dense(\n",
" outputSize = 1,\n",
" activation = Activations.Linear,\n",
" kernelInitializer = HeNormal(),\n",
" biasInitializer = HeNormal(),\n",
" )\n",
")"
],
"outputs": [],
"execution_count": 10
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:11.464569Z",
"start_time": "2025-08-04T19:11:11.208143Z"
}
},
"source": [
"model.compile(optimizer = Adam(), loss = Losses.MSE, metric = Metrics.MAE)"
],
"outputs": [],
"execution_count": 11
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:11.605662Z",
"start_time": "2025-08-04T19:11:11.479856Z"
}
},
"source": [
"model.printSummary()"
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"==============================================================================\n",
"Model type: Sequential\n",
"______________________________________________________________________________\n",
"Layer (type) Output Shape Param # \n",
"==============================================================================\n",
"input_1(Input) [None, 8] 0 \n",
"______________________________________________________________________________\n",
"dense_2(Dense) [None, 80] 720 \n",
"______________________________________________________________________________\n",
"dense_3(Dense) [None, 80] 6480 \n",
"______________________________________________________________________________\n",
"dense_4(Dense) [None, 1] 81 \n",
"______________________________________________________________________________\n",
"==============================================================================\n",
"Total trainable params: 7281\n",
"Total frozen params: 0\n",
"Total params: 7281\n",
"______________________________________________________________________________\n"
]
}
],
"execution_count": 12
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Train it!"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:29.937339Z",
"start_time": "2025-08-04T19:11:11.887298Z"
}
},
"source": [
"val trainHist = model.fit(train, batchSize = 500, epochs=2000)"
],
"outputs": [],
"execution_count": 13
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:30.297752Z",
"start_time": "2025-08-04T19:11:29.971573Z"
}
},
"source": "trainHist.epochHistory.toDataFrame().takeLast()",
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_6()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_6\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865866&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame: rowsCount = 5, columnsCount = 5&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;epochIndex: Int&bsol;&quot;&gt;epochIndex&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1996&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1997&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1998&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1999&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;2000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;lossValue: Double&bsol;&quot;&gt;lossValue&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334454&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334416&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334378&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334341&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334303&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;metricValues: List&lt;Double&gt;&bsol;&quot;&gt;metricValues&lt;&sol;span&gt;&quot;, children: [], rightAlign: false, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.45078158378601074&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.4507482051849365&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.4507148265838623&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.45068153738975525&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.45064806938171387&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;valLossValue: Double&bsol;&quot;&gt;valLossValue&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;valMetricValues: List&lt;Double?&gt;&bsol;&quot;&gt;valMetricValues&lt;&sol;span&gt;&quot;, children: [], rightAlign: false, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"], id: 687865866, rootId: 687865866, totalRows: 5 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865866) });\n",
"\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_6() {\n",
" let elem = document.getElementById(\"iframe_out_6\");\n",
" resize_iframe_out_6(elem);\n",
" setInterval(resize_iframe_out_6, 5000, elem);\n",
" }\n",
" function resize_iframe_out_6(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script> <html theme='dark'>\n",
" <head>\n",
" <style type=\"text/css\">\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover > td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"/* formatting */\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
" </style>\n",
" </head>\n",
" <body>\n",
" <table class=\"dataframe\" id=\"static_df_687865867\"><thead><tr><th class=\"bottomBorder\" style=\"text-align:left\">epochIndex</th><th class=\"bottomBorder\" style=\"text-align:left\">lossValue</th><th class=\"bottomBorder\" style=\"text-align:left\">metricValues</th><th class=\"bottomBorder\" style=\"text-align:left\">valLossValue</th><th class=\"bottomBorder\" style=\"text-align:left\">valMetricValues</th></tr></thead><tbody><tr><td style=\"vertical-align:top\">1996</td><td style=\"vertical-align:top\">0.334454</td><td style=\"vertical-align:top\">[0.45078158378601074]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">1997</td><td style=\"vertical-align:top\">0.334416</td><td style=\"vertical-align:top\">[0.4507482051849365]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">1998</td><td style=\"vertical-align:top\">0.334378</td><td style=\"vertical-align:top\">[0.4507148265838623]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">1999</td><td style=\"vertical-align:top\">0.334341</td><td style=\"vertical-align:top\">[0.45068153738975525]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">2000</td><td style=\"vertical-align:top\">0.334303</td><td style=\"vertical-align:top\">[0.45064806938171387]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr></tbody></table>\n",
" </body>\n",
" <script>\n",
" document.getElementById(\"static_df_687865867\").style.display = \"none\";\n",
" </script>\n",
" </html>"
],
"application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"epochIndex\",\"lossValue\",\"metricValues\",\"valLossValue\",\"valMetricValues\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List<kotlin.Double>\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List<kotlin.Double?>\"}],\"nrow\":5,\"ncol\":5},\"kotlin_dataframe\":[{\"epochIndex\":1996,\"lossValue\":0.3344540596008301,\"metricValues\":[0.45078158378601074],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":1997,\"lossValue\":0.3344161808490753,\"metricValues\":[0.4507482051849365],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":1998,\"lossValue\":0.3343783915042877,\"metricValues\":[0.4507148265838623],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":1999,\"lossValue\":0.33434057235717773,\"metricValues\":[0.45068153738975525],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":2000,\"lossValue\":0.33430275321006775,\"metricValues\":[0.45064806938171387],\"valLossValue\":NaN,\"valMetricValues\":[NaN]}]}"
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's check that our network predicts values more or less correctly:"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:30.766336Z",
"start_time": "2025-08-04T19:11:30.617645Z"
}
},
"source": [
"model.predictSoftly(test.x[9])[0]"
],
"outputs": [
{
"data": {
"text/plain": [
"5.2470083"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 15
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:31.573009Z",
"start_time": "2025-08-04T19:11:31.454306Z"
}
},
"source": [
"test.y[9]"
],
"outputs": [
{
"data": {
"text/plain": [
"5.0"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 16
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Close the model:"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:33.029286Z",
"start_time": "2025-08-04T19:11:32.904035Z"
}
},
"source": [
"model.close()"
],
"outputs": [],
"execution_count": 17
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Predict wine quality: second approach"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:34.342143Z",
"start_time": "2025-08-04T19:11:33.501033Z"
}
},
"source": [
"data class TrainTestSplitResult<T>(\n",
" val trainX: DataFrame<T>,\n",
" val trainY: DataFrame<T>,\n",
" val testX: DataFrame<T>,\n",
" val testY: DataFrame<T>,\n",
")\n",
"\n",
"fun <T> trainTestSplit(\n",
" d: DataFrame<T>,\n",
" col: String,\n",
" trainPart: Double,\n",
"): TrainTestSplitResult<T> {\n",
" val n = d.count()\n",
" val trainN = ceil(n * trainPart).toInt()\n",
"\n",
" val shuffledInd = (0..<n).shuffled()\n",
" val trainInd = shuffledInd.subList(0, trainN)\n",
" val testInd = shuffledInd.subList(trainN, n)\n",
"\n",
" val train = d[trainInd]\n",
" val test = d[testInd]\n",
"\n",
" val trainX = train.select { allExcept(col) }\n",
" val trainY = train.select(col)\n",
"\n",
" val testX = test.select { allExcept(col) }\n",
" val testY = test.select(col)\n",
"\n",
" return TrainTestSplitResult(trainX, trainY, testX, testY)\n",
"}"
],
"outputs": [],
"execution_count": 18
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's create and then train the model as we did before"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:36.294575Z",
"start_time": "2025-08-04T19:11:34.865Z"
}
},
"source": [
"val (trainX, trainY, testX, testY) =\n",
" trainTestSplit(df, \"quality\", 0.8)"
],
"outputs": [],
"execution_count": 19
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:37.272642Z",
"start_time": "2025-08-04T19:11:36.852357Z"
}
},
"source": [
"fun <T> DataFrame<T>.toX(): Array<FloatArray> =\n",
" merge { colsOf<Number>() }.by { it.map { it.toFloat() }.toFloatArray() }.into(\"X\")\n",
" .get { \"X\"<FloatArray>() }\n",
" .toList()\n",
" .toTypedArray()"
],
"outputs": [],
"execution_count": 20
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:38.217463Z",
"start_time": "2025-08-04T19:11:37.974931Z"
}
},
"source": [
"fun <T> DataFrame<T>.toY(): FloatArray = \n",
" get { \"quality\"<Int>() }\n",
" .asIterable()\n",
" .map { it.toFloat() }\n",
" .toFloatArray()"
],
"outputs": [],
"execution_count": 21
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:39.039353Z",
"start_time": "2025-08-04T19:11:38.774209Z"
}
},
"source": [
"val trainXDL = trainX.toX()\n",
"val trainYDL = trainY.toY()\n",
"val testXDL = testX.toX()\n",
"val testYDL = testY.toY()"
],
"outputs": [],
"execution_count": 22
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:39.697144Z",
"start_time": "2025-08-04T19:11:39.554841Z"
}
},
"source": [
"val trainKotlinDLDataset = OnHeapDataset.create({ trainXDL }, { trainYDL })\n",
"val testKotlinDLDataset = OnHeapDataset.create({ testXDL }, { testYDL })"
],
"outputs": [],
"execution_count": 23
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:40.708347Z",
"start_time": "2025-08-04T19:11:40.017912Z"
}
},
"source": [
"val inputNeurons = train.x[0].size.toLong()\n",
"\n",
"val model2 = Sequential.of(\n",
" Input(\n",
" inputNeurons\n",
" ),\n",
" Dense(\n",
" outputSize = (inputNeurons * 10).toInt(),\n",
" activation = Activations.Tanh,\n",
" kernelInitializer = HeNormal(),\n",
" biasInitializer = HeNormal()\n",
" ),\n",
" Dense(\n",
" outputSize = (inputNeurons * 10).toInt(),\n",
" activation = Activations.Tanh,\n",
" kernelInitializer = HeNormal(),\n",
" biasInitializer = HeNormal()\n",
" ),\n",
" Dense(\n",
" outputSize = 1,\n",
" activation = Activations.Linear,\n",
" kernelInitializer = HeNormal(),\n",
" biasInitializer = HeNormal()\n",
" )\n",
")\n",
"model2.compile(optimizer = Adam(), loss = Losses.MSE, metric = Metrics.MAE)\n",
"model2.printSummary()"
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"==============================================================================\n",
"Model type: Sequential\n",
"______________________________________________________________________________\n",
"Layer (type) Output Shape Param # \n",
"==============================================================================\n",
"input_1(Input) [None, 8] 0 \n",
"______________________________________________________________________________\n",
"dense_2(Dense) [None, 80] 720 \n",
"______________________________________________________________________________\n",
"dense_3(Dense) [None, 80] 6480 \n",
"______________________________________________________________________________\n",
"dense_4(Dense) [None, 1] 81 \n",
"______________________________________________________________________________\n",
"==============================================================================\n",
"Total trainable params: 7281\n",
"Total frozen params: 0\n",
"Total params: 7281\n",
"______________________________________________________________________________\n"
]
}
],
"execution_count": 24
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:54.863249Z",
"start_time": "2025-08-04T19:11:41.167286Z"
}
},
"source": [
"val trainHist = model2.fit(train, batchSize = 500, epochs = 2000)\n",
"trainHist.epochHistory.toDataFrame().takeLast()"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_8()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_8\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865870&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame: rowsCount = 5, columnsCount = 5&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;epochIndex: Int&bsol;&quot;&gt;epochIndex&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1996&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1997&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1998&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1999&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;2000&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;lossValue: Double&bsol;&quot;&gt;lossValue&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334714&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334678&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334641&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334605&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.334569&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;metricValues: List&lt;Double&gt;&bsol;&quot;&gt;metricValues&lt;&sol;span&gt;&quot;, children: [], rightAlign: false, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.45107153058052063&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.45104148983955383&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.4510118067264557&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.4509819746017456&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;0.4509516954421997&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.5&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;valLossValue: Double&bsol;&quot;&gt;valLossValue&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;valMetricValues: List&lt;Double?&gt;&bsol;&quot;&gt;valMetricValues&lt;&sol;span&gt;&quot;, children: [], rightAlign: false, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;NaN&bsol;&quot;&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;[&lt;&sol;span&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;NaN&lt;&sol;span&gt;&lt;span class=&bsol;&quot;structural&bsol;&quot;&gt;]&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"], id: 687865870, rootId: 687865870, totalRows: 5 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865870) });\n",
"\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_8() {\n",
" let elem = document.getElementById(\"iframe_out_8\");\n",
" resize_iframe_out_8(elem);\n",
" setInterval(resize_iframe_out_8, 5000, elem);\n",
" }\n",
" function resize_iframe_out_8(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script> <html theme='dark'>\n",
" <head>\n",
" <style type=\"text/css\">\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover > td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"/* formatting */\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
" </style>\n",
" </head>\n",
" <body>\n",
" <table class=\"dataframe\" id=\"static_df_687865871\"><thead><tr><th class=\"bottomBorder\" style=\"text-align:left\">epochIndex</th><th class=\"bottomBorder\" style=\"text-align:left\">lossValue</th><th class=\"bottomBorder\" style=\"text-align:left\">metricValues</th><th class=\"bottomBorder\" style=\"text-align:left\">valLossValue</th><th class=\"bottomBorder\" style=\"text-align:left\">valMetricValues</th></tr></thead><tbody><tr><td style=\"vertical-align:top\">1996</td><td style=\"vertical-align:top\">0.334714</td><td style=\"vertical-align:top\">[0.45107153058052063]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">1997</td><td style=\"vertical-align:top\">0.334678</td><td style=\"vertical-align:top\">[0.45104148983955383]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">1998</td><td style=\"vertical-align:top\">0.334641</td><td style=\"vertical-align:top\">[0.4510118067264557]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">1999</td><td style=\"vertical-align:top\">0.334605</td><td style=\"vertical-align:top\">[0.4509819746017456]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr><tr><td style=\"vertical-align:top\">2000</td><td style=\"vertical-align:top\">0.334569</td><td style=\"vertical-align:top\">[0.4509516954421997]</td><td style=\"vertical-align:top\">NaN</td><td style=\"vertical-align:top\">[NaN]</td></tr></tbody></table>\n",
" </body>\n",
" <script>\n",
" document.getElementById(\"static_df_687865871\").style.display = \"none\";\n",
" </script>\n",
" </html>"
],
"application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"epochIndex\",\"lossValue\",\"metricValues\",\"valLossValue\",\"valMetricValues\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List<kotlin.Double>\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.collections.List<kotlin.Double?>\"}],\"nrow\":5,\"ncol\":5},\"kotlin_dataframe\":[{\"epochIndex\":1996,\"lossValue\":0.33471378684043884,\"metricValues\":[0.45107153058052063],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":1997,\"lossValue\":0.3346775472164154,\"metricValues\":[0.45104148983955383],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":1998,\"lossValue\":0.3346412479877472,\"metricValues\":[0.4510118067264557],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":1999,\"lossValue\":0.334604948759079,\"metricValues\":[0.4509819746017456],\"valLossValue\":NaN,\"valMetricValues\":[NaN]},{\"epochIndex\":2000,\"lossValue\":0.334568589925766,\"metricValues\":[0.4509516954421997],\"valLossValue\":NaN,\"valMetricValues\":[NaN]}]}"
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 25
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:55.328992Z",
"start_time": "2025-08-04T19:11:55.231901Z"
}
},
"source": [
"model2.predictSoftly(testXDL[9])[0]"
],
"outputs": [
{
"data": {
"text/plain": [
"5.4023023"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 26
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:56.007498Z",
"start_time": "2025-08-04T19:11:55.935914Z"
}
},
"source": [
"testYDL[9]"
],
"outputs": [
{
"data": {
"text/plain": [
"6.0"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 27
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also compare predicted and ground truth values to ensure predictions are correct"
]
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:57.516188Z",
"start_time": "2025-08-04T19:11:56.816467Z"
}
},
"source": [
"val predicted = testXDL.mapIndexed { i, _ ->\n",
" round(model2.predictSoftly(testXDL[i])[0]).toInt()\n",
"}.toColumn(\"predicted\")\n",
"\n",
"val ground_truth = testYDL.mapIndexed { i, _ ->\n",
" testYDL[i].toInt()\n",
"}.toColumn(\"ground_truth\")\n",
"\n",
"val predDf = dataFrameOf(predicted, ground_truth)"
],
"outputs": [],
"execution_count": 28
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:58.274177Z",
"start_time": "2025-08-04T19:11:58.184350Z"
}
},
"source": [
"predDf.head()"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_10()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_10\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865874&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame: rowsCount = 5, columnsCount = 2&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;predicted: Int&bsol;&quot;&gt;predicted&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;ground_truth: Int&bsol;&quot;&gt;ground_truth&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"], id: 687865874, rootId: 687865874, totalRows: 5 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865874) });\n",
"\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_10() {\n",
" let elem = document.getElementById(\"iframe_out_10\");\n",
" resize_iframe_out_10(elem);\n",
" setInterval(resize_iframe_out_10, 5000, elem);\n",
" }\n",
" function resize_iframe_out_10(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script> <html theme='dark'>\n",
" <head>\n",
" <style type=\"text/css\">\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover > td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"/* formatting */\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
" </style>\n",
" </head>\n",
" <body>\n",
" <table class=\"dataframe\" id=\"static_df_687865875\"><thead><tr><th class=\"bottomBorder\" style=\"text-align:left\">predicted</th><th class=\"bottomBorder\" style=\"text-align:left\">ground_truth</th></tr></thead><tbody><tr><td style=\"vertical-align:top\">7</td><td style=\"vertical-align:top\">6</td></tr><tr><td style=\"vertical-align:top\">5</td><td style=\"vertical-align:top\">5</td></tr><tr><td style=\"vertical-align:top\">7</td><td style=\"vertical-align:top\">7</td></tr><tr><td style=\"vertical-align:top\">6</td><td style=\"vertical-align:top\">6</td></tr><tr><td style=\"vertical-align:top\">6</td><td style=\"vertical-align:top\">6</td></tr></tbody></table>\n",
" </body>\n",
" <script>\n",
" document.getElementById(\"static_df_687865875\").style.display = \"none\";\n",
" </script>\n",
" </html>"
],
"application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"predicted\",\"ground_truth\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":5,\"ncol\":2},\"kotlin_dataframe\":[{\"predicted\":7,\"ground_truth\":6},{\"predicted\":5,\"ground_truth\":5},{\"predicted\":7,\"ground_truth\":7},{\"predicted\":6,\"ground_truth\":6},{\"predicted\":6,\"ground_truth\":6}]}"
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 29
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:11:59.946126Z",
"start_time": "2025-08-04T19:11:58.837265Z"
}
},
"source": [
"val inds = List(10) { it + 1 }\n",
"val ctab = predDf\n",
" .groupBy { ground_truth }.pivotCounts(inward = false) { predicted }\n",
" .sortBy { ground_truth }\n",
"\n",
"ctab.format { drop(1) }.perRowCol { row, col ->\n",
" val y = col.name().toInt()\n",
" val x = row.ground_truth\n",
" val k = 1.0 - abs(x - y) / 10.0\n",
" background(RgbColor(50, (50 + k * 200).toInt().toShort(), 50))\n",
"}.toHtml()"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_11()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_11\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865876&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;table class=&quot;dataframe&quot; id=&quot;static_df_687865877&quot;&gt;&lt;thead&gt;&lt;tr&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;ground_truth&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;7&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;6&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;5&lt;&sol;th&gt;&lt;th class=&quot;bottomBorder&quot; style=&quot;text-align:left&quot;&gt;4&lt;&sol;th&gt;&lt;&sol;tr&gt;&lt;&sol;thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;4&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;15&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;5&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;33&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;104&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;6&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;7&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;81&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;35&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;7&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;13&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;25&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;tr&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;8&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;2&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;1&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0&lt;&sol;td&gt;&lt;td style=&quot;vertical-align:top&quot;&gt;0&lt;&sol;td&gt;&lt;&sol;tr&gt;&lt;&sol;tbody&gt;&lt;&sol;table&gt;\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame [5 x 5]&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;ground_truth: Int&bsol;&quot;&gt;ground_truth&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;4&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;,&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;8&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;7: Int&bsol;&quot;&gt;7&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#32be32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32d232&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32e632&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;7&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32fa32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;13&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32e632&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;2&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;6: Int&bsol;&quot;&gt;6&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#32d232&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32e632&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;33&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32fa32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;81&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32e632&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;25&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32d232&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;5: Int&bsol;&quot;&gt;5&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#32e632&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;15&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32fa32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;104&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32e632&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;35&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32d232&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32be32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;4: Int&bsol;&quot;&gt;4&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [{ style: &quot;background-color:#32fa32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32e632&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32d232&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32be32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;},{ style: &quot;background-color:#32aa32&quot;, value: &quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;}] }, \n",
"], id: 687865876, rootId: 687865876, totalRows: 5 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865876) });\n",
"\n",
"document.getElementById(&quot;static_df_687865877&quot;).style.display = &quot;none&quot;;\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_11() {\n",
" let elem = document.getElementById(\"iframe_out_11\");\n",
" resize_iframe_out_11(elem);\n",
" setInterval(resize_iframe_out_11, 5000, elem);\n",
" }\n",
" function resize_iframe_out_11(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script>"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 30
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:12:01.141646Z",
"start_time": "2025-08-04T19:12:00.677606Z"
}
},
"source": [
"val predDf2 = predDf.add(\"avg_dev\") { abs(predicted - ground_truth) }"
],
"outputs": [],
"execution_count": 31
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:12:02.093517Z",
"start_time": "2025-08-04T19:12:01.821333Z"
}
},
"source": [
"predDf2.avg_dev.cast<Double>().describe()"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_13()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_13\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865880&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataFrame: rowsCount = 1, columnsCount = 14&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;name: String&bsol;&quot;&gt;name&lt;&sol;span&gt;&quot;, children: [], rightAlign: false, values: [&quot;avg_dev&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;type: String&bsol;&quot;&gt;type&lt;&sol;span&gt;&quot;, children: [], rightAlign: false, values: [&quot;Int&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;count: Int&bsol;&quot;&gt;count&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;319&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;unique: Int&bsol;&quot;&gt;unique&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;3&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;nulls: Int&bsol;&quot;&gt;nulls&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;top: Int&bsol;&quot;&gt;top&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;freq: Int&bsol;&quot;&gt;freq&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;199&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;mean: Double&bsol;&quot;&gt;mean&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.382445&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;std: Double&bsol;&quot;&gt;std&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.499502&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;min: Int&bsol;&quot;&gt;min&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;p25: Double&bsol;&quot;&gt;p25&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;median: Double&bsol;&quot;&gt;median&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;0.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;p75: Double&bsol;&quot;&gt;p75&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1.0&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;max: Int&bsol;&quot;&gt;max&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;2&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"], id: 687865880, rootId: 687865880, totalRows: 1 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865880) });\n",
"\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_13() {\n",
" let elem = document.getElementById(\"iframe_out_13\");\n",
" resize_iframe_out_13(elem);\n",
" setInterval(resize_iframe_out_13, 5000, elem);\n",
" }\n",
" function resize_iframe_out_13(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script> <html theme='dark'>\n",
" <head>\n",
" <style type=\"text/css\">\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover > td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"/* formatting */\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
" </style>\n",
" </head>\n",
" <body>\n",
" <table class=\"dataframe\" id=\"static_df_687865881\"><thead><tr><th class=\"bottomBorder\" style=\"text-align:left\">name</th><th class=\"bottomBorder\" style=\"text-align:left\">type</th><th class=\"bottomBorder\" style=\"text-align:left\">count</th><th class=\"bottomBorder\" style=\"text-align:left\">unique</th><th class=\"bottomBorder\" style=\"text-align:left\">nulls</th><th class=\"bottomBorder\" style=\"text-align:left\">top</th><th class=\"bottomBorder\" style=\"text-align:left\">freq</th><th class=\"bottomBorder\" style=\"text-align:left\">mean</th><th class=\"bottomBorder\" style=\"text-align:left\">std</th><th class=\"bottomBorder\" style=\"text-align:left\">min</th><th class=\"bottomBorder\" style=\"text-align:left\">p25</th><th class=\"bottomBorder\" style=\"text-align:left\">median</th><th class=\"bottomBorder\" style=\"text-align:left\">p75</th><th class=\"bottomBorder\" style=\"text-align:left\">max</th></tr></thead><tbody><tr><td style=\"vertical-align:top\">avg_dev</td><td style=\"vertical-align:top\">Int</td><td style=\"vertical-align:top\">319</td><td style=\"vertical-align:top\">3</td><td style=\"vertical-align:top\">0</td><td style=\"vertical-align:top\">0</td><td style=\"vertical-align:top\">199</td><td style=\"vertical-align:top\">0.382445</td><td style=\"vertical-align:top\">0.499502</td><td style=\"vertical-align:top\">0</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">0.000000</td><td style=\"vertical-align:top\">1.000000</td><td style=\"vertical-align:top\">2</td></tr></tbody></table>\n",
" </body>\n",
" <script>\n",
" document.getElementById(\"static_df_687865881\").style.display = \"none\";\n",
" </script>\n",
" </html>"
],
"application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"name\",\"type\",\"count\",\"unique\",\"nulls\",\"top\",\"freq\",\"mean\",\"std\",\"min\",\"p25\",\"median\",\"p75\",\"max\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.String\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Double\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":1,\"ncol\":14},\"kotlin_dataframe\":[{\"name\":\"avg_dev\",\"type\":\"Int\",\"count\":319,\"unique\":3,\"nulls\":0,\"top\":0,\"freq\":199,\"mean\":0.3824451410658307,\"std\":0.4995019305115917,\"min\":0,\"p25\":0.0,\"median\":0.0,\"p75\":1.0,\"max\":2}]}"
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 32
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:12:02.676139Z",
"start_time": "2025-08-04T19:12:02.520194Z"
}
},
"source": [
"predDf2.sortBy { avg_dev }[(0.7 * (319 - 1)).toInt()]"
],
"outputs": [
{
"data": {
"text/html": [
" <iframe onload=\"o_resize_iframe_out_14()\" style=\"width:100%;\" class=\"result_container\" id=\"iframe_out_14\" frameBorder=\"0\" srcdoc=\" &lt;html theme='dark'&gt;\n",
" &lt;head&gt;\n",
" &lt;style type=&quot;text&sol;css&quot;&gt;\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody &gt; tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover &gt; td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"&sol;* formatting *&sol;\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
":root {\n",
" --scroll-bg: #f5f5f5;\n",
" --scroll-fg: #b3b3b3;\n",
"}\n",
":root[theme=&quot;dark&quot;], :root [data-jp-theme-light=&quot;false&quot;]{\n",
" --scroll-bg: #3c3c3c;\n",
" --scroll-fg: #97e1fb;\n",
"}\n",
"body {\n",
" scrollbar-color: var(--scroll-fg) var(--scroll-bg);\n",
"}\n",
"body::-webkit-scrollbar {\n",
" width: 10px; &sol;* Mostly for vertical scrollbars *&sol;\n",
" height: 10px; &sol;* Mostly for horizontal scrollbars *&sol;\n",
"}\n",
"body::-webkit-scrollbar-thumb {\n",
" background-color: var(--scroll-fg);\n",
"}\n",
"body::-webkit-scrollbar-track {\n",
" background-color: var(--scroll-bg);\n",
"}\n",
" &lt;&sol;style&gt;\n",
" &lt;&sol;head&gt;\n",
" &lt;body&gt;\n",
" &lt;table class=&quot;dataframe&quot; id=&quot;df_687865882&quot;&gt;&lt;&sol;table&gt;\n",
"\n",
"&lt;p class=&quot;dataframe_description&quot;&gt;DataRow: index = 222, columnsCount = 3&lt;&sol;p&gt;\n",
"\n",
" &lt;&sol;body&gt;\n",
" &lt;script&gt;\n",
" (function () {\n",
" window.DataFrame = window.DataFrame || new (function () {\n",
" this.addTable = function (df) {\n",
" let cols = df.cols;\n",
" for (let i = 0; i &lt; cols.length; i++) {\n",
" for (let c of cols[i].children) {\n",
" cols[c].parent = i;\n",
" }\n",
" }\n",
" df.nrow = 0\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" if (df.cols[i].values.length &gt; df.nrow) df.nrow = df.cols[i].values.length\n",
" }\n",
" if (df.id === df.rootId) {\n",
" df.expandedFrames = new Set()\n",
" df.childFrames = {}\n",
" const table = this.getTableElement(df.id)\n",
" table.df = df\n",
" for (let i = 0; i &lt; df.cols.length; i++) {\n",
" let col = df.cols[i]\n",
" if (col.parent === undefined &amp;&amp; col.children.length &gt; 0) col.expanded = true\n",
" }\n",
" } else {\n",
" const rootDf = this.getTableData(df.rootId)\n",
" rootDf.childFrames[df.id] = df\n",
" }\n",
" }\n",
"\n",
" this.computeRenderData = function (df) {\n",
" let result = []\n",
" let pos = 0\n",
" for (let col = 0; col &lt; df.cols.length; col++) {\n",
" if (df.cols[col].parent === undefined)\n",
" pos += this.computeRenderDataRec(df.cols, col, pos, 0, result, false, false)\n",
" }\n",
" for (let i = 0; i &lt; result.length; i++) {\n",
" let row = result[i]\n",
" for (let j = 0; j &lt; row.length; j++) {\n",
" let cell = row[j]\n",
" if (j === 0)\n",
" cell.leftBd = false\n",
" if (j &lt; row.length - 1) {\n",
" let nextData = row[j + 1]\n",
" if (nextData.leftBd) cell.rightBd = true\n",
" else if (cell.rightBd) nextData.leftBd = true\n",
" } else cell.rightBd = false\n",
" }\n",
" }\n",
" return result\n",
" }\n",
"\n",
" this.computeRenderDataRec = function (cols, colId, pos, depth, result, leftBorder, rightBorder) {\n",
" if (result.length === depth) {\n",
" const array = [];\n",
" if (pos &gt; 0) {\n",
" let j = 0\n",
" for (let i = 0; j &lt; pos; i++) {\n",
" let c = result[depth - 1][i]\n",
" j += c.span\n",
" let copy = Object.assign({empty: true}, c)\n",
" array.push(copy)\n",
" }\n",
" }\n",
" result.push(array)\n",
" }\n",
" const col = cols[colId];\n",
" let size = 0;\n",
" if (col.expanded) {\n",
" let childPos = pos\n",
" for (let i = 0; i &lt; col.children.length; i++) {\n",
" let child = col.children[i]\n",
" let childLeft = i === 0 &amp;&amp; (col.children.length &gt; 1 || leftBorder)\n",
" let childRight = i === col.children.length - 1 &amp;&amp; (col.children.length &gt; 1 || rightBorder)\n",
" let childSize = this.computeRenderDataRec(cols, child, childPos, depth + 1, result, childLeft, childRight)\n",
" childPos += childSize\n",
" size += childSize\n",
" }\n",
" } else {\n",
" for (let i = depth + 1; i &lt; result.length; i++)\n",
" result[i].push({id: colId, span: 1, leftBd: leftBorder, rightBd: rightBorder, empty: true})\n",
" size = 1\n",
" }\n",
" let left = leftBorder\n",
" let right = rightBorder\n",
" if (size &gt; 1) {\n",
" left = true\n",
" right = true\n",
" }\n",
" result[depth].push({id: colId, span: size, leftBd: left, rightBd: right})\n",
" return size\n",
" }\n",
"\n",
" this.getTableElement = function (id) {\n",
" return document.getElementById(&quot;df_&quot; + id)\n",
" }\n",
"\n",
" this.getTableData = function (id) {\n",
" return this.getTableElement(id).df\n",
" }\n",
"\n",
" this.createExpander = function (isExpanded) {\n",
" const svgNs = &quot;http:&sol;&sol;www.w3.org&sol;2000&sol;svg&quot;\n",
" let svg = document.createElementNS(svgNs, &quot;svg&quot;)\n",
" svg.classList.add(&quot;expanderSvg&quot;)\n",
" let path = document.createElementNS(svgNs, &quot;path&quot;)\n",
" if (isExpanded) {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;0 -2 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 4 4 4 -4 -1 -1 -3 3Z&quot;)\n",
" } else {\n",
" svg.setAttribute(&quot;viewBox&quot;, &quot;-2 0 8 8&quot;)\n",
" path.setAttribute(&quot;d&quot;, &quot;M1 0 l-1 1 3 3 -3 3 1 1 4 -4Z&quot;)\n",
" }\n",
" path.setAttribute(&quot;fill&quot;, &quot;currentColor&quot;)\n",
" svg.appendChild(path)\n",
" return svg\n",
" }\n",
"\n",
" this.renderTable = function (id) {\n",
"\n",
" let table = this.getTableElement(id)\n",
"\n",
" if (table === null) return\n",
"\n",
" table.innerHTML = &quot;&quot;\n",
"\n",
" let df = table.df\n",
" let rootDf = df.rootId === df.id ? df : this.getTableData(df.rootId)\n",
"\n",
" &sol;&sol; header\n",
" let header = document.createElement(&quot;thead&quot;)\n",
" table.appendChild(header)\n",
"\n",
" let renderData = this.computeRenderData(df)\n",
" for (let j = 0; j &lt; renderData.length; j++) {\n",
" let rowData = renderData[j]\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" let isLastRow = j === renderData.length - 1\n",
" header.appendChild(tr);\n",
" for (let i = 0; i &lt; rowData.length; i++) {\n",
" let cell = rowData[i]\n",
" let th = document.createElement(&quot;th&quot;);\n",
" th.setAttribute(&quot;colspan&quot;, cell.span)\n",
" let colId = cell.id\n",
" let col = df.cols[colId];\n",
" if (!cell.empty) {\n",
" if (col.children.length === 0) {\n",
" th.innerHTML = col.name\n",
" } else {\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" col.expanded = !col.expanded\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(col.expanded))\n",
" link.innerHTML += col.name\n",
" th.appendChild(link)\n",
" }\n",
" }\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (isLastRow)\n",
" classes += &quot; bottomBorder&quot;\n",
" if (classes.length &gt; 0)\n",
" th.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(th)\n",
" }\n",
" }\n",
"\n",
" &sol;&sol; body\n",
" let body = document.createElement(&quot;tbody&quot;)\n",
" table.appendChild(body)\n",
"\n",
" let columns = renderData.pop()\n",
" for (let row = 0; row &lt; df.nrow; row++) {\n",
" let tr = document.createElement(&quot;tr&quot;);\n",
" body.appendChild(tr)\n",
" for (let i = 0; i &lt; columns.length; i++) {\n",
" let cell = columns[i]\n",
" let td = document.createElement(&quot;td&quot;);\n",
" let colId = cell.id\n",
" let col = df.cols[colId]\n",
" let classes = (cell.leftBd ? &quot; leftBorder&quot; : &quot;&quot;) + (cell.rightBd ? &quot; rightBorder&quot; : &quot;&quot;)\n",
" if (col.rightAlign)\n",
" classes += &quot; rightAlign&quot;\n",
" if (classes.length &gt; 0)\n",
" td.setAttribute(&quot;class&quot;, classes)\n",
" tr.appendChild(td)\n",
" let value = col.values[row]\n",
" if (value.frameId !== undefined) {\n",
" let frameId = value.frameId\n",
" let expanded = rootDf.expandedFrames.has(frameId)\n",
" let link = document.createElement(&quot;a&quot;)\n",
" link.className = &quot;expander&quot;\n",
" let that = this\n",
" link.onclick = function () {\n",
" if (rootDf.expandedFrames.has(frameId))\n",
" rootDf.expandedFrames.delete(frameId)\n",
" else rootDf.expandedFrames.add(frameId)\n",
" that.renderTable(id)\n",
" }\n",
" link.appendChild(this.createExpander(expanded))\n",
" link.innerHTML += value.value\n",
" if (expanded) {\n",
" td.appendChild(link)\n",
" td.appendChild(document.createElement(&quot;p&quot;))\n",
" const childTable = document.createElement(&quot;table&quot;)\n",
" childTable.className = &quot;dataframe&quot;\n",
" childTable.id = &quot;df_&quot; + frameId\n",
" let childDf = rootDf.childFrames[frameId]\n",
" childTable.df = childDf\n",
" td.appendChild(childTable)\n",
" this.renderTable(frameId)\n",
" if (childDf.nrow !== childDf.totalRows) {\n",
" const footer = document.createElement(&quot;p&quot;)\n",
" footer.innerText = `... showing only top ${childDf.nrow} of ${childDf.totalRows} rows`\n",
" td.appendChild(footer)\n",
" }\n",
" } else {\n",
" td.appendChild(link)\n",
" }\n",
" } else if (value.style !== undefined) {\n",
" td.innerHTML = value.value\n",
" td.setAttribute(&quot;style&quot;, value.style)\n",
" } else td.innerHTML = value\n",
" this.nodeScriptReplace(td)\n",
" }\n",
" }\n",
" }\n",
"\n",
" this.nodeScriptReplace = function (node) {\n",
" if (this.nodeScriptIs(node) === true) {\n",
" node.parentNode.replaceChild(this.nodeScriptClone(node), node);\n",
" } else {\n",
" let i = -1, children = node.childNodes;\n",
" while (++i &lt; children.length) {\n",
" this.nodeScriptReplace(children[i]);\n",
" }\n",
" }\n",
"\n",
" return node;\n",
" }\n",
"\n",
" this.nodeScriptClone = function (node) {\n",
" let script = document.createElement(&quot;script&quot;);\n",
" script.text = node.innerHTML;\n",
"\n",
" let i = -1, attrs = node.attributes, attr;\n",
" while (++i &lt; attrs.length) {\n",
" script.setAttribute((attr = attrs[i]).name, attr.value);\n",
" }\n",
" return script;\n",
" }\n",
"\n",
" this.nodeScriptIs = function (node) {\n",
" return node.tagName === 'SCRIPT';\n",
" }\n",
" })()\n",
"\n",
" window.call_DataFrame = function (f) {\n",
" return f();\n",
" };\n",
"\n",
" let funQueue = window[&quot;kotlinQueues&quot;] &amp;&amp; window[&quot;kotlinQueues&quot;][&quot;DataFrame&quot;];\n",
" if (funQueue) {\n",
" funQueue.forEach(function (f) {\n",
" f();\n",
" });\n",
" funQueue = [];\n",
" }\n",
"})()\n",
"\n",
"&sol;*&lt;!--*&sol;\n",
"call_DataFrame(function() { DataFrame.addTable({ cols: [{ name: &quot;&lt;span title=&bsol;&quot;predicted: Int&bsol;&quot;&gt;predicted&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;5&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;ground_truth: Int&bsol;&quot;&gt;ground_truth&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;6&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"{ name: &quot;&lt;span title=&bsol;&quot;avg_dev: Int&bsol;&quot;&gt;avg_dev&lt;&sol;span&gt;&quot;, children: [], rightAlign: true, values: [&quot;&lt;span class=&bsol;&quot;formatted&bsol;&quot; title=&bsol;&quot;&bsol;&quot;&gt;&lt;span class=&bsol;&quot;numbers&bsol;&quot;&gt;1&lt;&sol;span&gt;&lt;&sol;span&gt;&quot;] }, \n",
"], id: 687865882, rootId: 687865882, totalRows: 1 } ) });\n",
"&sol;*--&gt;*&sol;\n",
"\n",
"call_DataFrame(function() { DataFrame.renderTable(687865882) });\n",
"\n",
"\n",
" &lt;&sol;script&gt;\n",
" &lt;&sol;html&gt;\"></iframe>\n",
" <script>\n",
" function o_resize_iframe_out_14() {\n",
" let elem = document.getElementById(\"iframe_out_14\");\n",
" resize_iframe_out_14(elem);\n",
" setInterval(resize_iframe_out_14, 5000, elem);\n",
" }\n",
" function resize_iframe_out_14(el) {\n",
" let h = el.contentWindow.document.body.scrollHeight;\n",
" el.height = h === 0 ? 0 : h + 41;\n",
" }\n",
" </script> <html theme='dark'>\n",
" <head>\n",
" <style type=\"text/css\">\n",
" :root {\n",
" --background: #fff;\n",
" --background-odd: #f5f5f5;\n",
" --background-hover: #d9edfd;\n",
" --header-text-color: #474747;\n",
" --text-color: #848484;\n",
" --text-color-dark: #000;\n",
" --text-color-medium: #737373;\n",
" --text-color-pale: #b3b3b3;\n",
" --inner-border-color: #aaa;\n",
" --bold-border-color: #000;\n",
" --link-color: #296eaa;\n",
" --link-color-pale: #296eaa;\n",
" --link-hover: #1a466c;\n",
"}\n",
"\n",
":root[theme=\"dark\"], :root [data-jp-theme-light=\"false\"], .dataframe_dark{\n",
" --background: #303030;\n",
" --background-odd: #3c3c3c;\n",
" --background-hover: #464646;\n",
" --header-text-color: #dddddd;\n",
" --text-color: #b3b3b3;\n",
" --text-color-dark: #dddddd;\n",
" --text-color-medium: #b2b2b2;\n",
" --text-color-pale: #737373;\n",
" --inner-border-color: #707070;\n",
" --bold-border-color: #777777;\n",
" --link-color: #008dc0;\n",
" --link-color-pale: #97e1fb;\n",
" --link-hover: #00688e;\n",
"}\n",
"\n",
"p.dataframe_description {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe {\n",
" font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n",
" font-size: 12px;\n",
" background-color: var(--background);\n",
" color: var(--text-color-dark);\n",
" border: none;\n",
" border-collapse: collapse;\n",
"}\n",
"\n",
"table.dataframe th, td {\n",
" padding: 6px;\n",
" border: 1px solid transparent;\n",
" text-align: left;\n",
"}\n",
"\n",
"table.dataframe th {\n",
" background-color: var(--background);\n",
" color: var(--header-text-color);\n",
"}\n",
"\n",
"table.dataframe td {\n",
" vertical-align: top;\n",
" white-space: nowrap;\n",
"}\n",
"\n",
"table.dataframe th.bottomBorder {\n",
" border-bottom-color: var(--bold-border-color);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(odd) {\n",
" background: var(--background-odd);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:nth-child(even) {\n",
" background: var(--background);\n",
"}\n",
"\n",
"table.dataframe tbody > tr:hover {\n",
" background: var(--background-hover);\n",
"}\n",
"\n",
"table.dataframe a {\n",
" cursor: pointer;\n",
" color: var(--link-color);\n",
" text-decoration: none;\n",
"}\n",
"\n",
"table.dataframe tr:hover > td a {\n",
" color: var(--link-color-pale);\n",
"}\n",
"\n",
"table.dataframe a:hover {\n",
" color: var(--link-hover);\n",
" text-decoration: underline;\n",
"}\n",
"\n",
"table.dataframe img {\n",
" max-width: fit-content;\n",
"}\n",
"\n",
"table.dataframe th.complex {\n",
" background-color: var(--background);\n",
" border: 1px solid var(--background);\n",
"}\n",
"\n",
"table.dataframe .leftBorder {\n",
" border-left-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightBorder {\n",
" border-right-color: var(--inner-border-color);\n",
"}\n",
"\n",
"table.dataframe .rightAlign {\n",
" text-align: right;\n",
"}\n",
"\n",
"table.dataframe .expanderSvg {\n",
" width: 8px;\n",
" height: 8px;\n",
" margin-right: 3px;\n",
"}\n",
"\n",
"table.dataframe .expander {\n",
" display: flex;\n",
" align-items: center;\n",
"}\n",
"\n",
"/* formatting */\n",
"\n",
"table.dataframe .null {\n",
" color: var(--text-color-pale);\n",
"}\n",
"\n",
"table.dataframe .structural {\n",
" color: var(--text-color-medium);\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .dataFrameCaption {\n",
" font-weight: bold;\n",
"}\n",
"\n",
"table.dataframe .numbers {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe td:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"table.dataframe tr:hover .formatted .structural, .null {\n",
" color: var(--text-color-dark);\n",
"}\n",
"\n",
"\n",
" </style>\n",
" </head>\n",
" <body>\n",
" <table class=\"dataframe\" id=\"static_df_687865883\"><thead><tr><th class=\"bottomBorder\" style=\"text-align:left\">predicted</th><th class=\"bottomBorder\" style=\"text-align:left\">ground_truth</th><th class=\"bottomBorder\" style=\"text-align:left\">avg_dev</th></tr></thead><tbody><tr><td style=\"vertical-align:top\">5</td><td style=\"vertical-align:top\">6</td><td style=\"vertical-align:top\">1</td></tr></tbody></table>\n",
" </body>\n",
" <script>\n",
" document.getElementById(\"static_df_687865883\").style.display = \"none\";\n",
" </script>\n",
" </html>"
],
"application/kotlindataframe+json": "{\"$version\":\"2.1.1\",\"metadata\":{\"columns\":[\"predicted\",\"ground_truth\",\"avg_dev\"],\"types\":[{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"},{\"kind\":\"ValueColumn\",\"type\":\"kotlin.Int\"}],\"nrow\":1,\"ncol\":3},\"kotlin_dataframe\":[{\"predicted\":5,\"ground_truth\":6,\"avg_dev\":1}]}"
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"execution_count": 33
},
{
"cell_type": "code",
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:12:04.096796Z",
"start_time": "2025-08-04T19:12:04.033449Z"
}
},
"source": [
"model2.close()"
],
"outputs": [],
"execution_count": 34
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-08-04T19:12:04.609727Z",
"start_time": "2025-08-04T19:12:04.602716Z"
}
},
"cell_type": "code",
"source": "",
"outputs": [],
"execution_count": null
}
],
"metadata": {
"kernelspec": {
"display_name": "Kotlin",
"language": "kotlin",
"name": "kotlin"
},
"language_info": {
"codemirror_mode": "text/x-kotlin",
"file_extension": ".kt",
"mimetype": "text/x-kotlin",
"name": "kotlin",
"nbconvert_exporter": "",
"pygments_lexer": "kotlin",
"version": "1.8.0-dev-707"
},
"ktnbPluginMetadata": {
"projectLibraries": []
}
},
"nbformat": 4,
"nbformat_minor": 1
}