From 7815c86af871ea4213351793c057ee3a111f7aa6 Mon Sep 17 00:00:00 2001 From: Emeli Dral Date: Wed, 1 Nov 2023 14:39:44 +0000 Subject: [PATCH] Update the custom metric example for module 4 --- module4/custom_metric_practice.ipynb | 239 +++++++++++---------------- 1 file changed, 95 insertions(+), 144 deletions(-) diff --git a/module4/custom_metric_practice.ipynb b/module4/custom_metric_practice.ipynb index 77c6fb7..0d49db4 100644 --- a/module4/custom_metric_practice.ipynb +++ b/module4/custom_metric_practice.ipynb @@ -151,8 +151,9 @@ "source": [ "@default_renderer(wrap_type=MyMetric)\n", "class MyMetricRenderer(MetricRenderer):\n", - " def render_json(self, obj: MyMetric) -> dict:\n", - " result = dataclasses.asdict(obj.get_result())\n", + " def render_json(self, obj: MyMetric, include_render: bool = False,\n", + " include: \"IncludeOptions\" = None, exclude: \"IncludeOptions\" = None) -> dict:\n", + " result = obj.get_result().get_dict(include_render, include, exclude)\n", " return result\n", "\n", " def render_html(self, obj: MyMetric) -> List[BaseWidgetInfo]:\n", @@ -181,7 +182,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/opt/homebrew/Caskroom/miniconda/base/envs/py11/lib/python3.11/site-packages/sklearn/datasets/_openml.py:1002: FutureWarning: The default value of `parser` will change from `'liac-arff'` to `'auto'` in 1.4. You can set `parser='auto'` to silence this warning. Therefore, an `ImportError` will be raised from 1.4 if the dataset is dense and pandas is not installed. Note that the pandas parser may return different data types. See the Notes Section in fetch_openml's API doc for details.\n", + "/opt/homebrew/Caskroom/miniconda/base/envs/clean_py11/lib/python3.11/site-packages/sklearn/datasets/_openml.py:1002: FutureWarning: The default value of `parser` will change from `'liac-arff'` to `'auto'` in 1.4. You can set `parser='auto'` to silence this warning. Therefore, an `ImportError` will be raised from 1.4 if the dataset is dense and pandas is not installed. Note that the pandas parser may return different data types. See the Notes Section in fetch_openml's API doc for details.\n", " warn(\n" ] } @@ -264,12 +265,12 @@ "}\n", "</style>\n", "<script>\n", - " var evidently_dashboard_e1a1d05de3cd4f3dbdafc5131c48de34 = {"name": "Report", "widgets": [{"type": "counter", "title": "", "size": 2, "id": "692ee903-3cd6-4e61-b6f2-08dbd16700d8", "details": "", "alertsPosition": null, "alertStats": null, "params": {"counters": [{"value": "", "label": "My metric's value is 1887430.0"}]}, "insights": [], "alerts": [], "tabs": [], "widgets": [], "pageSize": 5}]};\n", - " var additional_graphs_evidently_dashboard_e1a1d05de3cd4f3dbdafc5131c48de34 = {};\n", + " var evidently_dashboard_10aba5c0425544c0885a8f7ac604b1c0 = {"name": "Report", "widgets": [{"type": "counter", "title": "", "size": 2, "id": "92820a49-f662-4a68-8e3f-34b10b591a01", "details": "", "alertsPosition": null, "alertStats": null, "params": {"counters": [{"value": "", "label": "My metric's value is 1887430.0"}]}, "insights": [], "alerts": [], "tabs": [], "widgets": [], "pageSize": 5}]};\n", + " var additional_graphs_evidently_dashboard_10aba5c0425544c0885a8f7ac604b1c0 = {};\n", "</script>\n", "</head>\n", "<body>\n", - "<div id="root_evidently_dashboard_e1a1d05de3cd4f3dbdafc5131c48de34">\n", + "<div id="root_evidently_dashboard_10aba5c0425544c0885a8f7ac604b1c0">\n", " <h1 class="center-align">Loading...</h1>\n", "</div>\n", "<script>var global = globalThis</script>\n", @@ -870,9 +871,9 @@ "</script>\n", "\n", "<script>\n", - "window.drawDashboard(evidently_dashboard_e1a1d05de3cd4f3dbdafc5131c48de34,\n", - " new Map(Object.entries(additional_graphs_evidently_dashboard_e1a1d05de3cd4f3dbdafc5131c48de34)),\n", - " "root_evidently_dashboard_e1a1d05de3cd4f3dbdafc5131c48de34"\n", + "window.drawDashboard(evidently_dashboard_10aba5c0425544c0885a8f7ac604b1c0,\n", + " new Map(Object.entries(additional_graphs_evidently_dashboard_10aba5c0425544c0885a8f7ac604b1c0)),\n", + " "root_evidently_dashboard_10aba5c0425544c0885a8f7ac604b1c0"\n", ");\n", "</script>\n", "</body>\n", @@ -897,6 +898,26 @@ "report.show(mode='inline')" ] }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'{\"version\": \"0.4.8\", \"metrics\": [{\"metric\": \"MyMetric\", \"result\": {\"sum_value\": 1887430.0}}], \"timestamp\": \"2023-10-29 12:39:49.223148\"}'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "report.json()" + ] + }, { "cell_type": "markdown", "metadata": { @@ -917,10 +938,8 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": { - "id": "9xBzsABRqA_t" - }, + "execution_count": 18, + "metadata": {}, "outputs": [], "source": [ "class ColumnMeanByCategoryResult(MetricResult):\n", @@ -928,12 +947,12 @@ " category_name: str\n", " current_x_values: list\n", " current_y_values: list\n", - " reference_x_values: Optional[list] # reference data could absence so we will have None in that case\n", - " reference_y_values: Optional[list] # reference data could absence so we will have None in that case\n", + " reference_x_values: Optional[list]\n", + " reference_y_values: Optional[list]\n", "\n", "class ColumnMeanByCategoryMetric(Metric[ColumnMeanByCategoryResult]):\n", " column_name: str\n", - " category_name: str \n", + " category_name: str\n", "\n", " def __init__(self, column_name: str, category_name: str) -> None:\n", " self.column_name = column_name\n", @@ -943,29 +962,31 @@ " def calculate(self, data: InputData) -> ColumnMeanByCategoryResult:\n", " if data.reference_data is not None:\n", " reference_stat = data.reference_data.groupby(self.category_name).agg({\n", - " self.column_name : 'mean'\n", + " self.column_name: 'mean'\n", " })\n", + "\n", " current_stat = data.current_data.groupby(self.category_name).agg({\n", - " self.column_name : 'mean'\n", + " self.column_name: 'mean'\n", " })\n", + "\n", " current_x_values = current_stat.index.tolist()\n", " current_y_values = current_stat[self.column_name].values.tolist()\n", - " reference_x_values = reference_stat.index.tolist() if data.reference_data is not None else None\n", - " reference_y_values = reference_stat[self.column_name].values.tolist() if data.reference_data is not None else None\n", - " \n", + " reference_x_values = reference_stat.index.tolist() if data.reference_data is not None else None\n", + " reference_y_values = reference_stat[self.column_name].values.tolist() if data.reference_data is not None else None\n", + "\n", " return ColumnMeanByCategoryResult(\n", " column_name = self.column_name,\n", " category_name = self.category_name,\n", " current_x_values = current_x_values,\n", " current_y_values = current_y_values,\n", - " reference_x_values = reference_x_values,\n", - " reference_y_values = reference_y_values,\n", + " reference_x_values = reference_x_values,\n", + " reference_y_values = reference_y_values\n", " )\n", - "\n", + " \n", "@default_renderer(wrap_type=ColumnMeanByCategoryMetric)\n", "class ColumnMeanByCategoryMetricRenderer(MetricRenderer):\n", " def render_json(self, obj: ColumnMeanByCategoryMetric, include_render: bool = False,\n", - " include: \"IncludeOptions\" = None, exclude: \"IncludeOptions\" = None,) -> dict:\n", + " include: \"IncludeOptions\" = None, exclude : \"IncludeOptions\" = None,) -> dict:\n", " result = obj.get_result().get_dict(include_render, include, exclude)\n", " return result\n", "\n", @@ -978,40 +999,56 @@ " reference_figure = go.Figure(go.Bar(x=metric_result.reference_x_values, y=metric_result.reference_y_values))\n", " reference_figure.update_layout(xaxis_title=metric_result.category_name, yaxis_title=metric_result.column_name)\n", " return [\n", - " header_text(label=f\"'{metric_result.column_name}' column mean by '{metric_result.category_name} column'\"),\n", + " header_text(label=f\"'{metric_result.column_name}' column mean by '{metric_result.category_name}'\"),\n", " plotly_figure(title=\"Bar plot (current)\", figure=current_figure, size=WidgetSize.HALF),\n", " plotly_figure(title=\"Bar plot (reference)\", figure=reference_figure, size=WidgetSize.HALF),\n", - " ] \n", - "\n", + " ]\n", " return [\n", - " header_text(label=f\"'{metric_result.column_name}' column mean by '{metric_result.category_name} column'\"),\n", - " plotly_figure(title=\"Bar plot (current)\", figure=current_figure)\n", - " ]" + " header_text(label=f\"'{metric_result.column_name}' column mean by '{metric_result.category_name}'\"),\n", + " plotly_figure(title=\"Bar plot (current)\", figure=current_figure),\n", + " ]\n", + " \n" ] }, { - "cell_type": "markdown", - "metadata": { - "id": "PFUfWbcjBN0Y" - }, + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Index(['age', 'workclass', 'fnlwgt', 'education', 'education-num',\n", + " 'marital-status', 'occupation', 'relationship', 'race', 'sex',\n", + " 'capital-gain', 'capital-loss', 'hours-per-week', 'native-country',\n", + " 'class'],\n", + " dtype='object')" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "Here is how you can include the new metric in the Report.\n", - "\n", - "\n" + "adult.columns" ] }, { "cell_type": "code", - "execution_count": 8, - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 790 - }, - "id": "hu-tYSW7wPkG", - "outputId": "a357bca0-4cac-4789-f9ee-cde983459aa7" - }, + "execution_count": 19, + "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/90/8_2t0pfn6svg2_9zl_0rfx3w0000gn/T/ipykernel_1161/3601783988.py:24: FutureWarning:\n", + "\n", + "The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning.\n", + "\n" + ] + }, { "data": { "text/html": [ @@ -1073,12 +1110,12 @@ "}\n", "</style>\n", "<script>\n", - " var evidently_dashboard_06172157163444bba37ffe15375f47d2 = {"name": "Report", "widgets": [{"type": "counter", "title": "", "size": 2, "id": "14fa9005-96bd-4f05-856d-8f6ae4a69ff7", "details": "", "alertsPosition": null, "alertStats": null, "params": {"counters": [{"value": "", "label": "'age' column mean by 'education column'"}]}, "insights": [], "alerts": [], "tabs": [], "widgets": [], "pageSize": 5}, {"type": "big_graph", "title": "Bar plot (current)", "size": 1, "id": "19aba3af-d800-4b23-b3e6-aa28b5cca695", "details": "", "alertsPosition": null, "alertStats": null, "params": {"data": [{"x": ["10th", "11th", "12th", "1st-4th", "5th-6th", "7th-8th", "9th", "Assoc-acdm", "Assoc-voc", "Bachelors", "Doctorate", "HS-grad", "Masters", "Preschool", "Prof-school", "Some-college"], "y": [37.799557848194546, 32.13873159682899, 32.08487654320987, 46.46694214876033, 43.610441767068274, 49.440042826552464, 40.8110661268556, 37.80227416298168, 38.67835968379447, 38.92955414012739, 47.53700516351119, 39.09647363312844, 44.04256134969325, 42.19753086419753, 45.07985257985258, 35.700281425891184], "type": "bar"}], "layout": {"template": {"data": {"histogram2dcontour": [{"type": "histogram2dcontour", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "choropleth": [{"type": "choropleth", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "histogram2d": [{"type": "histogram2d", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "heatmap": [{"type": "heatmap", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "heatmapgl": [{"type": "heatmapgl", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "contourcarpet": [{"type": "contourcarpet", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "contour": [{"type": "contour", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "surface": [{"type": "surface", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "mesh3d": [{"type": "mesh3d", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "scatter": [{"fillpattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}, "type": "scatter"}], "parcoords": [{"type": "parcoords", "line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterpolargl": [{"type": "scatterpolargl", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "bar": [{"error_x": {"color": "#2a3f5f"}, "error_y": {"color": "#2a3f5f"}, "marker": {"line": {"color": "#E5ECF6", "width": 0.5}, "pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "bar"}], "scattergeo": [{"type": "scattergeo", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterpolar": [{"type": "scatterpolar", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "histogram": [{"marker": {"pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "histogram"}], "scattergl": [{"type": "scattergl", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatter3d": [{"type": "scatter3d", "line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scattermapbox": [{"type": "scattermapbox", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterternary": [{"type": "scatterternary", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scattercarpet": [{"type": "scattercarpet", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "carpet": [{"aaxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "baxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "type": "carpet"}], "table": [{"cells": {"fill": {"color": "#EBF0F8"}, "line": {"color": "white"}}, "header": {"fill": {"color": "#C8D4E3"}, "line": {"color": "white"}}, "type": "table"}], "barpolar": [{"marker": {"line": {"color": "#E5ECF6", "width": 0.5}, "pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "barpolar"}], "pie": [{"automargin": true, "type": "pie"}]}, "layout": {"autotypenumbers": "strict", "colorway": ["#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52"], "font": {"color": "#2a3f5f"}, "hovermode": "closest", "hoverlabel": {"align": "left"}, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": {"bgcolor": "#E5ECF6", "angularaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "radialaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "ternary": {"bgcolor": "#E5ECF6", "aaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "baxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "caxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "coloraxis": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "colorscale": {"sequential": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "sequentialminus": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "diverging": [[0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419"]]}, "xaxis": {"gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "automargin": true, "zerolinewidth": 2}, "yaxis": {"gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "automargin": true, "zerolinewidth": 2}, "scene": {"xaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}, "yaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}, "zaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}}, "shapedefaults": {"line": {"color": "#2a3f5f"}}, "annotationdefaults": {"arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1}, "geo": {"bgcolor": "white", "landcolor": "#E5ECF6", "subunitcolor": "white", "showland": true, "showlakes": true, "lakecolor": "white"}, "title": {"x": 0.05}, "mapbox": {"style": "light"}}}, "xaxis": {"title": {"text": "education"}}, "yaxis": {"title": {"text": "age"}}}}, "insights": [], "alerts": [], "tabs": [], "widgets": [], "pageSize": 5}, {"type": "big_graph", "title": "Bar plot (reference)", "size": 1, "id": "6cff5276-c9f8-4f27-a556-dc3f268f427a", "details": "", "alertsPosition": null, "alertStats": null, "params": {"data": [{"x": ["10th", "11th", "12th", "1st-4th", "5th-6th", "7th-8th", "9th", "Assoc-acdm", "Assoc-voc", "Bachelors", "Doctorate", "HS-grad", "Masters", "Preschool", "Prof-school", "Some-college"], "y": [42.28125, 32.26086956521739, 43.111111111111114, 55.0, 42.45454545454545, 53.333333333333336, 45.4, 35.55555555555556, 37.16216216216216, 37.40571428571429, 47.23076923076923, 38.00911854103344, 42.10204081632653, 42.5, 48.1, 34.54128440366973], "type": "bar"}], "layout": {"template": {"data": {"histogram2dcontour": [{"type": "histogram2dcontour", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "choropleth": [{"type": "choropleth", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "histogram2d": [{"type": "histogram2d", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "heatmap": [{"type": "heatmap", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "heatmapgl": [{"type": "heatmapgl", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "contourcarpet": [{"type": "contourcarpet", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "contour": [{"type": "contour", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "surface": [{"type": "surface", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "mesh3d": [{"type": "mesh3d", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "scatter": [{"fillpattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}, "type": "scatter"}], "parcoords": [{"type": "parcoords", "line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterpolargl": [{"type": "scatterpolargl", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "bar": [{"error_x": {"color": "#2a3f5f"}, "error_y": {"color": "#2a3f5f"}, "marker": {"line": {"color": "#E5ECF6", "width": 0.5}, "pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "bar"}], "scattergeo": [{"type": "scattergeo", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterpolar": [{"type": "scatterpolar", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "histogram": [{"marker": {"pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "histogram"}], "scattergl": [{"type": "scattergl", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatter3d": [{"type": "scatter3d", "line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scattermapbox": [{"type": "scattermapbox", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterternary": [{"type": "scatterternary", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scattercarpet": [{"type": "scattercarpet", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "carpet": [{"aaxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "baxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "type": "carpet"}], "table": [{"cells": {"fill": {"color": "#EBF0F8"}, "line": {"color": "white"}}, "header": {"fill": {"color": "#C8D4E3"}, "line": {"color": "white"}}, "type": "table"}], "barpolar": [{"marker": {"line": {"color": "#E5ECF6", "width": 0.5}, "pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "barpolar"}], "pie": [{"automargin": true, "type": "pie"}]}, "layout": {"autotypenumbers": "strict", "colorway": ["#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52"], "font": {"color": "#2a3f5f"}, "hovermode": "closest", "hoverlabel": {"align": "left"}, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": {"bgcolor": "#E5ECF6", "angularaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "radialaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "ternary": {"bgcolor": "#E5ECF6", "aaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "baxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "caxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "coloraxis": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "colorscale": {"sequential": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "sequentialminus": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "diverging": [[0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419"]]}, "xaxis": {"gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "automargin": true, "zerolinewidth": 2}, "yaxis": {"gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "automargin": true, "zerolinewidth": 2}, "scene": {"xaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}, "yaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}, "zaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}}, "shapedefaults": {"line": {"color": "#2a3f5f"}}, "annotationdefaults": {"arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1}, "geo": {"bgcolor": "white", "landcolor": "#E5ECF6", "subunitcolor": "white", "showland": true, "showlakes": true, "lakecolor": "white"}, "title": {"x": 0.05}, "mapbox": {"style": "light"}}}, "xaxis": {"title": {"text": "education"}}, "yaxis": {"title": {"text": "age"}}}}, "insights": [], "alerts": [], "tabs": [], "widgets": [], "pageSize": 5}]};\n", - " var additional_graphs_evidently_dashboard_06172157163444bba37ffe15375f47d2 = {};\n", + " var evidently_dashboard_1b9a7ae8f5214e15b01c83dda0512ce4 = {"name": "Report", "widgets": [{"type": "counter", "title": "", "size": 2, "id": "3b85c09f-9c58-4e77-b44b-10bdc99bc350", "details": "", "alertsPosition": null, "alertStats": null, "params": {"counters": [{"value": "", "label": "'age' column mean by 'education'"}]}, "insights": [], "alerts": [], "tabs": [], "widgets": [], "pageSize": 5}, {"type": "big_graph", "title": "Bar plot (current)", "size": 2, "id": "26cddf79-9ad5-4d27-b7d7-0b6f65a92435", "details": "", "alertsPosition": null, "alertStats": null, "params": {"data": [{"x": ["10th", "11th", "12th", "1st-4th", "5th-6th", "7th-8th", "9th", "Assoc-acdm", "Assoc-voc", "Bachelors", "Doctorate", "HS-grad", "Masters", "Preschool", "Prof-school", "Some-college"], "y": [37.799557848194546, 32.13873159682899, 32.08487654320987, 46.46694214876033, 43.610441767068274, 49.440042826552464, 40.8110661268556, 37.80227416298168, 38.67835968379447, 38.92955414012739, 47.53700516351119, 39.09647363312844, 44.04256134969325, 42.19753086419753, 45.07985257985258, 35.700281425891184], "type": "bar"}], "layout": {"template": {"data": {"histogram2dcontour": [{"type": "histogram2dcontour", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "choropleth": [{"type": "choropleth", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "histogram2d": [{"type": "histogram2d", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "heatmap": [{"type": "heatmap", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "heatmapgl": [{"type": "heatmapgl", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "contourcarpet": [{"type": "contourcarpet", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "contour": [{"type": "contour", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "surface": [{"type": "surface", "colorbar": {"outlinewidth": 0, "ticks": ""}, "colorscale": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]]}], "mesh3d": [{"type": "mesh3d", "colorbar": {"outlinewidth": 0, "ticks": ""}}], "scatter": [{"fillpattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}, "type": "scatter"}], "parcoords": [{"type": "parcoords", "line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterpolargl": [{"type": "scatterpolargl", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "bar": [{"error_x": {"color": "#2a3f5f"}, "error_y": {"color": "#2a3f5f"}, "marker": {"line": {"color": "#E5ECF6", "width": 0.5}, "pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "bar"}], "scattergeo": [{"type": "scattergeo", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterpolar": [{"type": "scatterpolar", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "histogram": [{"marker": {"pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "histogram"}], "scattergl": [{"type": "scattergl", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatter3d": [{"type": "scatter3d", "line": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scattermapbox": [{"type": "scattermapbox", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scatterternary": [{"type": "scatterternary", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "scattercarpet": [{"type": "scattercarpet", "marker": {"colorbar": {"outlinewidth": 0, "ticks": ""}}}], "carpet": [{"aaxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "baxis": {"endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f"}, "type": "carpet"}], "table": [{"cells": {"fill": {"color": "#EBF0F8"}, "line": {"color": "white"}}, "header": {"fill": {"color": "#C8D4E3"}, "line": {"color": "white"}}, "type": "table"}], "barpolar": [{"marker": {"line": {"color": "#E5ECF6", "width": 0.5}, "pattern": {"fillmode": "overlay", "size": 10, "solidity": 0.2}}, "type": "barpolar"}], "pie": [{"automargin": true, "type": "pie"}]}, "layout": {"autotypenumbers": "strict", "colorway": ["#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52"], "font": {"color": "#2a3f5f"}, "hovermode": "closest", "hoverlabel": {"align": "left"}, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": {"bgcolor": "#E5ECF6", "angularaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "radialaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "ternary": {"bgcolor": "#E5ECF6", "aaxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "baxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}, "caxis": {"gridcolor": "white", "linecolor": "white", "ticks": ""}}, "coloraxis": {"colorbar": {"outlinewidth": 0, "ticks": ""}}, "colorscale": {"sequential": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "sequentialminus": [[0.0, "#0d0887"], [0.1111111111111111, "#46039f"], [0.2222222222222222, "#7201a8"], [0.3333333333333333, "#9c179e"], [0.4444444444444444, "#bd3786"], [0.5555555555555556, "#d8576b"], [0.6666666666666666, "#ed7953"], [0.7777777777777778, "#fb9f3a"], [0.8888888888888888, "#fdca26"], [1.0, "#f0f921"]], "diverging": [[0, "#8e0152"], [0.1, "#c51b7d"], [0.2, "#de77ae"], [0.3, "#f1b6da"], [0.4, "#fde0ef"], [0.5, "#f7f7f7"], [0.6, "#e6f5d0"], [0.7, "#b8e186"], [0.8, "#7fbc41"], [0.9, "#4d9221"], [1, "#276419"]]}, "xaxis": {"gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "automargin": true, "zerolinewidth": 2}, "yaxis": {"gridcolor": "white", "linecolor": "white", "ticks": "", "title": {"standoff": 15}, "zerolinecolor": "white", "automargin": true, "zerolinewidth": 2}, "scene": {"xaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}, "yaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}, "zaxis": {"backgroundcolor": "#E5ECF6", "gridcolor": "white", "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white", "gridwidth": 2}}, "shapedefaults": {"line": {"color": "#2a3f5f"}}, "annotationdefaults": {"arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1}, "geo": {"bgcolor": "white", "landcolor": "#E5ECF6", "subunitcolor": "white", "showland": true, "showlakes": true, "lakecolor": "white"}, "title": {"x": 0.05}, "mapbox": {"style": "light"}}}, "xaxis": {"title": {"text": "education"}}, "yaxis": {"title": {"text": "age"}}}}, "insights": [], "alerts": [], "tabs": [], "widgets": [], "pageSize": 5}]};\n", + " var additional_graphs_evidently_dashboard_1b9a7ae8f5214e15b01c83dda0512ce4 = {};\n", "</script>\n", "</head>\n", "<body>\n", - "<div id="root_evidently_dashboard_06172157163444bba37ffe15375f47d2">\n", + "<div id="root_evidently_dashboard_1b9a7ae8f5214e15b01c83dda0512ce4">\n", " <h1 class="center-align">Loading...</h1>\n", "</div>\n", "<script>var global = globalThis</script>\n", @@ -1679,9 +1716,9 @@ "</script>\n", "\n", "<script>\n", - "window.drawDashboard(evidently_dashboard_06172157163444bba37ffe15375f47d2,\n", - " new Map(Object.entries(additional_graphs_evidently_dashboard_06172157163444bba37ffe15375f47d2)),\n", - " "root_evidently_dashboard_06172157163444bba37ffe15375f47d2"\n", + "window.drawDashboard(evidently_dashboard_1b9a7ae8f5214e15b01c83dda0512ce4,\n", + " new Map(Object.entries(additional_graphs_evidently_dashboard_1b9a7ae8f5214e15b01c83dda0512ce4)),\n", + " "root_evidently_dashboard_1b9a7ae8f5214e15b01c83dda0512ce4"\n", ");\n", "</script>\n", "</body>\n", @@ -1692,7 +1729,7 @@ "" ] }, - "execution_count": 8, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -1702,108 +1739,22 @@ " ColumnMeanByCategoryMetric(column_name='age', category_name='education')\n", "])\n", "\n", - "report.run(reference_data=adult[:1000], current_data=adult[1000:])\n", + "report.run(reference_data=None, current_data=adult[1000:])\n", "report.show(mode='inline')" ] }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'metrics': [{'metric': 'ColumnMeanByCategoryMetric',\n", - " 'result': {'column_name': 'age',\n", - " 'category_name': 'education',\n", - " 'current_x_values': ['10th',\n", - " '11th',\n", - " '12th',\n", - " '1st-4th',\n", - " '5th-6th',\n", - " '7th-8th',\n", - " '9th',\n", - " 'Assoc-acdm',\n", - " 'Assoc-voc',\n", - " 'Bachelors',\n", - " 'Doctorate',\n", - " 'HS-grad',\n", - " 'Masters',\n", - " 'Preschool',\n", - " 'Prof-school',\n", - " 'Some-college'],\n", - " 'current_y_values': [37.799557848194546,\n", - " 32.13873159682899,\n", - " 32.08487654320987,\n", - " 46.46694214876033,\n", - " 43.610441767068274,\n", - " 49.440042826552464,\n", - " 40.8110661268556,\n", - " 37.80227416298168,\n", - " 38.67835968379447,\n", - " 38.92955414012739,\n", - " 47.53700516351119,\n", - " 39.09647363312844,\n", - " 44.04256134969325,\n", - " 42.19753086419753,\n", - " 45.07985257985258,\n", - " 35.700281425891184],\n", - " 'reference_x_values': ['10th',\n", - " '11th',\n", - " '12th',\n", - " '1st-4th',\n", - " '5th-6th',\n", - " '7th-8th',\n", - " '9th',\n", - " 'Assoc-acdm',\n", - " 'Assoc-voc',\n", - " 'Bachelors',\n", - " 'Doctorate',\n", - " 'HS-grad',\n", - " 'Masters',\n", - " 'Preschool',\n", - " 'Prof-school',\n", - " 'Some-college'],\n", - " 'reference_y_values': [42.28125,\n", - " 32.26086956521739,\n", - " 43.111111111111114,\n", - " 55.0,\n", - " 42.45454545454545,\n", - " 53.333333333333336,\n", - " 45.4,\n", - " 35.55555555555556,\n", - " 37.16216216216216,\n", - " 37.40571428571429,\n", - " 47.23076923076923,\n", - " 38.00911854103344,\n", - " 42.10204081632653,\n", - " 42.5,\n", - " 48.1,\n", - " 34.54128440366973]}}]}" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "report.as_dict()" - ] - }, - { - "cell_type": "code", - "execution_count": 10, + "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'{\"version\": \"0.4.8\", \"metrics\": [{\"metric\": \"ColumnMeanByCategoryMetric\", \"result\": {\"column_name\": \"age\", \"category_name\": \"education\", \"current_x_values\": [\"10th\", \"11th\", \"12th\", \"1st-4th\", \"5th-6th\", \"7th-8th\", \"9th\", \"Assoc-acdm\", \"Assoc-voc\", \"Bachelors\", \"Doctorate\", \"HS-grad\", \"Masters\", \"Preschool\", \"Prof-school\", \"Some-college\"], \"current_y_values\": [37.799557848194546, 32.13873159682899, 32.08487654320987, 46.46694214876033, 43.610441767068274, 49.440042826552464, 40.8110661268556, 37.80227416298168, 38.67835968379447, 38.92955414012739, 47.53700516351119, 39.09647363312844, 44.04256134969325, 42.19753086419753, 45.07985257985258, 35.700281425891184], \"reference_x_values\": [\"10th\", \"11th\", \"12th\", \"1st-4th\", \"5th-6th\", \"7th-8th\", \"9th\", \"Assoc-acdm\", \"Assoc-voc\", \"Bachelors\", \"Doctorate\", \"HS-grad\", \"Masters\", \"Preschool\", \"Prof-school\", \"Some-college\"], \"reference_y_values\": [42.28125, 32.26086956521739, 43.111111111111114, 55.0, 42.45454545454545, 53.333333333333336, 45.4, 35.55555555555556, 37.16216216216216, 37.40571428571429, 47.23076923076923, 38.00911854103344, 42.10204081632653, 42.5, 48.1, 34.54128440366973]}}], \"timestamp\": \"2023-10-29 11:45:06.772472\"}'" + "'{\"version\": \"0.4.8\", \"metrics\": [{\"metric\": \"ColumnMeanByCategoryMetric\", \"result\": {\"column_name\": \"age\", \"category_name\": \"education\", \"current_x_values\": [\"10th\", \"11th\", \"12th\", \"1st-4th\", \"5th-6th\", \"7th-8th\", \"9th\", \"Assoc-acdm\", \"Assoc-voc\", \"Bachelors\", \"Doctorate\", \"HS-grad\", \"Masters\", \"Preschool\", \"Prof-school\", \"Some-college\"], \"current_y_values\": [37.799557848194546, 32.13873159682899, 32.08487654320987, 46.46694214876033, 43.610441767068274, 49.440042826552464, 40.8110661268556, 37.80227416298168, 38.67835968379447, 38.92955414012739, 47.53700516351119, 39.09647363312844, 44.04256134969325, 42.19753086419753, 45.07985257985258, 35.700281425891184], \"reference_x_values\": null, \"reference_y_values\": null}}], \"timestamp\": \"2023-10-29 13:12:12.653992\"}'" ] }, - "execution_count": 10, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" }