Skip to content

Instantly share code, notes, and snippets.

@ranggakd
Created October 26, 2023 10:58
Show Gist options
  • Save ranggakd/8c606899e530051fd3798f807402234f to your computer and use it in GitHub Desktop.
Save ranggakd/8c606899e530051fd3798f807402234f to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"id": "2m822a8Cou8_"
},
"outputs": [],
"source": [
"import mercury as mr"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"application/mercury+json": {
"allow_download": true,
"code_uid": "App.0.40.25.1-rand4a2e5dd7",
"continuous_update": true,
"description": "Dashboard of experimental result across different regression/forecasting metrics",
"full_screen": true,
"model_id": "mercury-app",
"notify": "{}",
"output": "app",
"schedule": "",
"show_code": false,
"show_prompt": false,
"show_sidebar": true,
"static_notebook": false,
"stop_on_error": false,
"title": "Test",
"widget": "App"
},
"text/html": [
"<h3>Mercury Application</h3><small>This output won't appear in the web app.</small>"
],
"text/plain": [
"mercury.App"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"app = mr.App(\n",
" title='Bug',\n",
" description='There is a bug idk why'\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"application/mercury+json": {
"code_uid": "Note.0.40.16.2-rand86d35e8d",
"model_id": "Note.0.40.16.2-rand86d35e8d",
"value": "---",
"widget": "Note"
},
"text/markdown": [
"---"
],
"text/plain": [
"mercury.Note"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/mercury+json": {
"choices": [
"Test Size",
"Number Nature",
"Magnitude",
"Data Distribution and Patterns",
"Nature of Errors"
],
"code_uid": "Select.0.40.16.11.based-rand66a73dbd",
"disabled": false,
"hidden": false,
"label": "Based on",
"model_id": "ab633b20d8c74a77a5f80c92f4019079",
"url_key": "based",
"value": "Test Size",
"widget": "Select"
},
"application/vnd.jupyter.widget-view+json": {
"model_id": "ab633b20d8c74a77a5f80c92f4019079",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"mercury.Select"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# based on branching\n",
"mr.Note(text='---')\n",
"based_on_mapping = {\n",
" 'Test Size': 'Based on Test Size',\n",
" 'Number Nature': 'Based on Number Nature',\n",
" 'Magnitude': 'Based on Magnitude',\n",
" 'Data Distribution and Patterns': 'Based on Data Distribution and Patterns',\n",
" 'Nature of Errors': 'Based on Nature of Errors'\n",
"}\n",
"based_on_choices = list(based_on_mapping.keys())\n",
"based_on_selection = mr.Select(\n",
" value=based_on_choices[0],\n",
" choices=based_on_choices,\n",
" label='Based on',\n",
" url_key='based'\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"## Based on Test Size"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mr.Markdown(f'## {based_on_mapping.get(based_on_selection.value)}')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"application/mercury+json": {
"choices": [
"Small (1)",
"Small (>1)",
"Mid",
"Large"
],
"code_uid": "Select.0.40.16.38.var-rand06c4041f",
"disabled": false,
"hidden": false,
"label": "Variant",
"model_id": "dab9716d4a4b44dcb80c3b311024afa7",
"url_key": "var",
"value": "Small (1)",
"widget": "Select"
},
"application/vnd.jupyter.widget-view+json": {
"model_id": "dab9716d4a4b44dcb80c3b311024afa7",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"mercury.Select"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# variant branching\n",
"variant_mapping = {\n",
" 'Test Size': {\n",
" 'Small (1)': 'Few data points might cause magnified errors in some metrics. (e.g., a test size of just 1 data point)',\n",
" 'Small (>1)': 'Few data points might cause magnified errors in some metrics. (e.g., a test size of 2 data points)',\n",
" 'Mid': 'A moderate amount of data points. (e.g., test size of 50 data points)',\n",
" 'Large': 'Many data points which can sometimes mask large individual errors. (e.g., test size of 10,000 data points)'\n",
" },\n",
" 'Number Nature': {\n",
" 'Non-zero Real Numbers': 'Standard scenario. (e.g., -5 and 7)',\n",
" 'Real Numbers with Zeros': 'Important for some metrics which cannot handle zeros. (e.g., 0 and 7)',\n",
" 'Negative Numbers Only': 'Metrics could behave differently when dealing with solely negative numbers. (e.g., -5 and -7)',\n",
" 'Positive Numbers Only': 'Standard scenario. (e.g., 5 and 10)',\n",
" 'Very Small Numbers': 'Close to zero but not zero; can test for amplification of error. (e.g., 0.000001 and 0.0001)',\n",
" 'Very Large Numbers': 'Tests for potential overflow or underflow issues in metric calculation. (e.g., 10^10 and 10^11)'\n",
" },\n",
" 'Magnitude': {\n",
" 'Same Magnitude for $y \\\\text{ and } \\hat{y}$': 'Tests the performance when predictions and true values are on the same scale. (e.g., 100 and 105)',\n",
" 'Different Magnitude for $y \\\\text{ and } \\hat{y}$': 'Investigating how metrics react when there is a noticeable scale difference between true and predicted values. (e.g., 1 vs 1000)'\n",
" },\n",
" 'Data Distribution and Patterns': {\n",
" 'Linear Trend': 'Examining cases where there is a consistent increase or decrease in data, indicating a linear trend',\n",
" 'Exponential Growth / Decay': 'Examining cases where there is a consistent increase or decrease in data, indicating a exponential growth / decay',\n",
" 'Quadratic Trend': 'Examining cases where there is a consistent increase or decrease in data, indicating a quadratic trend',\n",
" 'Logarithmic Trend': 'Examining cases where there is a consistent increase or decrease in data, indicating a logarithmic trend',\n",
" 'Sigmoidal/Logistic Trend': 'Examining cases where there is a consistent increase or decrease in data, indicating a sigmoidal/logistic trend',\n",
" 'Seasonality': 'Occurrences of regular fluctuations in data. (e.g., sinusoidal data patterns or sales spikes during the holidays)',\n",
" 'Outliers': 'Situations where there are extreme values that might disproportionately affect metrics. (e.g., series like 1, 2, 3, 1000, 5)',\n",
" 'Repeated Patterns': 'Situations where certain patterns in the data repeat after regular intervals. (e.g., a daily temperature dataset that consistently peaks at midday and dips at midnight like 1, 2, 3, 1, 2, 3, 1, 2, 3....)'\n",
" },\n",
" 'Nature of Errors': {\n",
" 'Systematic Overestimation': 'When predictions are consistently higher than true values. (e.g., true: 1, 2, 3; predicted: 3, 4, 5)',\n",
" 'Systematic Underestimation': 'When predictions are consistently lower than true values. (e.g., true: 3, 4, 5; predicted: 1, 2, 3)',\n",
" 'Random Errors': 'Unpredictable error patterns where predictions sometimes overshoot and sometimes undershoot the true values and none of the predicted values exactly match the true values. (e.g., for a true sequence of 1, 2, 3, 4, 5, a prediction might be 2, 1.5, 4, 3.5, 5.5)'\n",
" }\n",
"}\n",
"variant_choices = list(variant_mapping[based_on_selection.value].keys())\n",
"variant_selection = mr.Select(\n",
" value=variant_choices[0],\n",
" choices=variant_choices,\n",
" label='Variant',\n",
" url_key='var'\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"### Small (1)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/markdown": [
"Few data points might cause magnified errors in some metrics. (e.g., a test size of just 1 data point)"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mr.Markdown(f'### {variant_selection.value}')\n",
"mr.Markdown(f'{variant_mapping[based_on_selection.value][variant_selection.value]}')"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"application/mercury+json": {
"choices": [
"$\\cos(x)$",
"$\\sin(x)$"
],
"code_uid": "Select.0.40.16.182.dataset-randaae62b37",
"disabled": false,
"hidden": false,
"label": "Dataset",
"model_id": "6d0bd840894d4974bb83ac0223c2f343",
"url_key": "dataset",
"value": "$\\cos(x)$",
"widget": "Select"
},
"application/vnd.jupyter.widget-view+json": {
"model_id": "6d0bd840894d4974bb83ac0223c2f343",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"mercury.Select"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# dataset branching\n",
"dataset_mapping = {\n",
" 'Test Size': {\n",
" 'Small (1)':{\n",
" '$\\cos(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$\\sin(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 2\n",
" }\n",
" },\n",
" 'Small (>1)':{\n",
" '$\\cos(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$\\sin(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 2\n",
" }\n",
" },\n",
" 'Mid':{\n",
" '$\\cos(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$\\sin(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 2\n",
" }\n",
" },\n",
" 'Large':{\n",
" '$\\cos(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$\\sin(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 2\n",
" }\n",
" }\n",
" },\n",
" 'Number Nature': {\n",
" 'Non-zero Real Numbers':{\n",
" '$10 \\cdot \\cos(x) + 1$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$10 \\cdot \\sin(x) + 1$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 2\n",
" }\n",
" },\n",
" 'Real Numbers with Zeros':{\n",
" '$\\\\text{int}(10 \\cdot \\cos(x))$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$\\\\text{int}(10 \\cdot \\sin(x))$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 2\n",
" }\n",
" },\n",
" 'Negative Numbers Only':{\n",
" '$10 \\cdot \\cos(x) - 11$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$10 \\cdot \\sin(x) - 11$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Positive Numbers Only':{\n",
" '$10 \\cdot \\cos(x) + 11$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$10 \\cdot \\sin(x) + 11$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Very Small Numbers':{\n",
" '$1 \\\\times 10^{-6} \\cdot \\cos(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$1 \\\\times 10^{-6} \\cdot \\sin(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Very Large Numbers':{\n",
" '$1 \\\\times 10^{11} \\cdot \\cos(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$1 \\\\times 10^{11} \\cdot \\sin(x)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" }\n",
" },\n",
" 'Magnitude': {\n",
" 'Same Magnitude for $y \\\\text{ and } \\hat{y}$':{\n",
" '$100 \\cdot \\cos(x) + 200$':{\n",
" ('OffsetModel 1%', 'OffsetModel 10%'): 2\n",
" },\n",
" '$100 \\cdot \\sin(x) + 200$':{\n",
" ('OffsetModel 1%', 'OffsetModel 10%'): 2\n",
" }\n",
" },\n",
" 'Different Magnitude for $y \\\\text{ and } \\hat{y}$':{\n",
" '$10 \\cdot \\cos(x) + 21$':{\n",
" ('OffsetModel 500%', 'OffsetModel 5000%'): 4\n",
" },\n",
" '$10 \\cdot \\sin(x) + 21$':{\n",
" ('OffsetModel 500%', 'OffsetModel 5000%'): 4\n",
" }\n",
" }\n",
" },\n",
" 'Data Distribution and Patterns': {\n",
" 'Linear Trend':{\n",
" '$5x + 2$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$-5x + 2$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Exponential Growth / Decay':{\n",
" '$2e^{0.5x}$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$2e^{0.5(2\\pi - x)}$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Quadratic Trend':{\n",
" '$x^2$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$-x^2$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Logarithmic Trend':{\n",
" '$10 + 5\\ln(x+1)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$10 - 5\\ln(x+1)$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Sigmoidal/Logistic Trend':{\n",
" '$\\\\frac{10}{1 + e^{-x + 5}}$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" },\n",
" '$-\\\\frac{10}{1 + e^{-x + 5}}$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Seasonality':{\n",
" '$20 \\cdot \\cos(4x) + 50$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Outliers':{\n",
" '$\\\\begin{cases} \\sin(x) & \\\\text{if } \\\\vert\\sin(x)\\\\vert \\leq 0.99 \\\\\\ 1000\\sin(x) & '\n",
" '\\\\text{if } \\\\vert\\sin(x)\\\\vert > 0.99 \\\\end{cases}$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" },\n",
" 'Repeated Patterns':{\n",
" '$(x \\mod 5) + 1$':{\n",
" ('AutoReg', 'OffsetModel 1%'): 1\n",
" }\n",
" }\n",
" },\n",
" 'Nature of Errors': {\n",
" 'Systematic Overestimation':{\n",
" '$10 \\cdot \\cos(x)$':{\n",
" ('OffsetModel 1%', 'OffsetModel 10%'): 2\n",
" }\n",
" },\n",
" 'Systematic Underestimation':{\n",
" '$10 \\cdot \\cos(x)$':{\n",
" ('OffsetModel 1%', 'OffsetModel 10%'): 2\n",
" }\n",
" },\n",
" 'Random Errors':{\n",
" '$10 \\cdot \\cos(x)$':{\n",
" ('OffsetModel 1%', 'OffsetModel 10%'): 2\n",
" }\n",
" }\n",
" }\n",
"}\n",
"dataset_choices = list(dataset_mapping[based_on_selection.value][variant_selection.value].keys())\n",
"dataset_selection = mr.Select(\n",
" value=dataset_choices[0],\n",
" choices=dataset_choices,\n",
" label='Dataset',\n",
" url_key='dataset'\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"#### $\\cos(x)$"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"print(dataset_choices)\n",
"print(dataset_selection.value)\n",
"mr.Markdown(f'#### {dataset_selection.value}')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<details>\n",
" <summary>\n",
" <strong>Summary Tables (click to expand/collapse)</strong>\n",
" </summary>\n",
"\n",
"<br>\n",
"\n",
"| Based on | Variant | Dataset | Model | R2 | MAE | MSE | RMSE | MASE | MAPE | sMAPE | MBDev |\n",
"|--|--|--|--|--|--|--|--|--|--|--|--|\n",
"| Test Size | Small=1 | $\\cos(x)$ | AutoReg |πŸ™…β€β™‚οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel |πŸ™…β€β™‚οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $\\sin(x)$ | AutoReg |πŸ™…β€β™‚οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|☠|☠|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ™…β€β™‚οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|☠|☠|β˜ πŸ“ˆ|\n",
"| | Small=2 | $\\cos(x)$ | AutoReg |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $\\sin(x)$ | AutoReg |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|☠|☠|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|☠|☠|β˜ πŸ“ˆ|\n",
"| | Mid | $\\cos(x)$ | AutoReg |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $\\sin(x)$ | AutoReg |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|☠|πŸ’€|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ›‘|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|☠|☠|β˜ πŸ“ˆ|\n",
"| | Large | $\\cos(x)$ | AutoReg |πŸ›‘|❗|βœ”οΈ|❌|🀬|πŸ‘Œ|❌|πŸ’€πŸ“ˆ|\n",
"| | | | OffsetModel |❗|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $\\sin(x)$ | AutoReg |πŸ›‘|❌|❗|❌|🀬|☠|πŸ’€|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|☠|❗|β˜ πŸ“ˆ|\n",
"| Number Nature | Non-zero Real Numbers | $10 \\cdot \\cos(x) + 1$ | AutoReg |πŸ›‘|☠|☠|☠|🀬|πŸ‘Œ|☠|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|βœ”οΈ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $10 \\cdot \\sin(x) + 1$ | AutoReg |πŸ›‘|πŸ’€|☠|πŸ’€|🀬|❗|πŸ’€|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|βœ”οΈ|πŸ‘Œ|❗|πŸ‘ŒπŸ“ˆ|\n",
"| | Real Numbers | $\\text{int}(10 \\cdot \\cos(x))$ | AutoReg |πŸ›‘|πŸ’€|☠|☠|🀬|☠|☠|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|☠|❌|β˜ πŸ“ˆ|\n",
"| | | $\\text{int}(10 \\cdot \\sin(x))$ | AutoReg |πŸ›‘|πŸ’€|☠|πŸ’€|🀬|☠|πŸ’€|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|βœ”οΈ|☠|❗|β˜ πŸ“ˆ|\n",
"| | Negative Numbers Only | $10 \\cdot \\cos(x) - 11$ | AutoReg |πŸ›‘|☠|☠|☠|🀬|❗|☠|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|βœ”οΈ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $10 \\cdot \\sin(x) - 11$ | AutoReg |πŸ›‘|πŸ’€|☠|πŸ’€|🀬|πŸ‘Œ|πŸ’€|πŸ’€πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|βœ”οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | Positive Numbers Only | $10 \\cdot \\cos(x) + 11$ | AutoReg |πŸ›‘|☠|☠|☠|🀬|πŸ‘Œ|πŸ’€|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $10 \\cdot \\sin(x) + 11$ | AutoReg |πŸ›‘|πŸ’€|☠|πŸ’€|🀬|πŸ‘Œ|πŸ’€|πŸ’€πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|βœ”οΈ|πŸ‘Œ|βœ”οΈ|βœ”οΈπŸ“ˆ|\n",
"| | Very Small Numbers | $1 \\times 10^{-6} \\cdot \\cos(x)$ | AutoReg |πŸ›‘|☠|πŸ‘Œ|☠|🀬|πŸ‘Œ|☠|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|❗|πŸ‘ŒπŸ“ˆ|\n",
"| | | $1 \\times 10^{-6} \\cdot \\sin(x)$ | AutoReg |πŸ›‘|πŸ’€|πŸ‘Œ|πŸ’€|🀬|☠|πŸ’€|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|βœ”οΈ|☠|❗|β˜ πŸ“ˆ|\n",
"| | Very Large Numbers | $1 \\times 10^{11} \\cdot \\cos(x)$ | AutoReg |πŸ›‘|☠|☠|☠|🀬|πŸ‘Œ|☠|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|☠|πŸ‘Œ|❗|πŸ‘Œ|❗|πŸ‘ŒπŸ“ˆ|\n",
"| | | $1 \\times 10^{11} \\cdot \\sin(x)$ | AutoReg |πŸ›‘|πŸ’€|☠|πŸ’€|🀬|☠|πŸ’€|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|☠|πŸ‘Œ|βœ”οΈ|☠|❗|β˜ πŸ“ˆ|\n",
"| Magnitude | Same Magnitude for $y \\text{ and } \\hat{y}$ | $100 \\cdot \\cos(x) + 200$ | OffsetModel 1% |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel 10% |❌|βœ”οΈ|☠|βœ”οΈ|🀬|πŸ‘Œ|βœ”οΈ|βœ”οΈπŸ“ˆ|\n",
"| | | $100 \\cdot \\sin(x) + 200$ | OffsetModel 1% |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|βœ”οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel 10% |πŸ’€|❗|☠|❗|🀬|πŸ‘Œ|❗|β—πŸ“ˆ|\n",
"| | Different Magnitude for $y \\text{ and } \\hat{y}$ | $10 \\cdot \\cos(x) + 21$ | OffsetModel 500% |πŸ›‘|☠|☠|☠|🀬|πŸ‘Œ|☠|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel 5000% |πŸ›‘|☠|☠|☠|🀬|πŸ’€|☠|β˜ πŸ“ˆ|\n",
"| | | $10 \\cdot \\sin(x) + 21$ | OffsetModel 500% |πŸ›‘|☠|☠|☠|🀬|βœ”οΈ|☠|β˜ πŸ“ˆ|\n",
"| | | | OffsetModel 5000% |πŸ›‘|☠|☠|☠|🀬|πŸ’€|☠|β˜ πŸ“ˆ|\n",
"| Data Distribution and Patterns | Linear Trend | $5x + 2$ | AutoReg |πŸ’―|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❌|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $-5x + 2$ | AutoReg |πŸ’―|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❌|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | Exponential Growth/Decay | $2e^{0.5x}$ | AutoReg |πŸ’―|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $2e^{0.5(2\\pi - x)}$ | AutoReg |πŸ’―|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“‰|\n",
"| | | | OffsetModel |❌|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|❗|β—πŸ“ˆ|\n",
"| | Quadratic Trend | $x^2$ | AutoReg |πŸ’―|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $-x^2$ | AutoReg |πŸ’―|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | Logarithmic Trend | $10 + 5\\ln(x+1)$ | AutoReg |❗|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel |βœ”οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $10 - 5\\ln(x+1)$ | AutoReg |❗|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ’€|πŸ’€πŸ“‰|\n",
"| | | | OffsetModel |βœ”οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|❗|βŒπŸ“ˆ|\n",
"| | Sigmoidal/Logistic Trend | $\\frac{10}{1 + e^{-x + 5}}$ | AutoReg |πŸ›‘|πŸ’€|πŸ’€|πŸ’€|🀬|πŸ‘Œ|❗|β—πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | | $-\\frac{10}{1 + e^{-x + 5}}$ | AutoReg |πŸ›‘|πŸ’€|πŸ’€|πŸ’€|🀬|πŸ‘Œ|❗|β—πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|🀬|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | Seasonality | $20 \\cdot \\cos(4x) + 50$ | AutoReg |πŸ›‘|❗|☠|❌|🀬|πŸ‘Œ|❌|β—πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|βœ”οΈ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| | Outliers | ![outliers math func](https://raw.githubusercontent.com/ranggakd/DAIly/main/ideas/regression_forecasting_metrics/assets/outliers_formula_b40.png) | AutoReg |πŸ›‘|❗|☠|❗|🀬|☠|☠|β˜ πŸ“‰|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|❌|πŸ‘Œ|βœ”οΈ|☠|☠|β˜ πŸ“ˆ|\n",
"| | Repeated Patterns | $(x \\mod 5) + 1$ | AutoReg |πŸ›‘|πŸ’€|πŸ’€|πŸ’€|❗|πŸ‘Œ|πŸ’€|πŸ’€πŸ“ˆ|\n",
"| | | | OffsetModel |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘ŒπŸ“ˆ|\n",
"| Nature of Errors | Systematic Overestimation | $10 \\cdot \\cos(x)$ | OffsetModel 1% |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|❗|πŸ‘ŒπŸ“ˆ|\n",
"| | | | OffsetModel 10% |❌|βœ”οΈ|❗|βœ”οΈ|🀬|πŸ‘Œ|πŸ’€|β—πŸ“ˆ|\n",
"| | Systematic Underestimation | $10 \\cdot \\cos(x)$ | OffsetModel 1% |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|❗|πŸ‘ŒπŸ“‰|\n",
"| | | | OffsetModel 10% |❌|βœ”οΈ|❗|❗|🀬|πŸ‘Œ|πŸ’€|β—πŸ“‰|\n",
"| | Random Errors | $10 \\cdot \\cos(x)$ | RandomOffsetModel 1% |πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|πŸ‘Œ|❗|πŸ‘Œ|❗|βœ”οΈπŸ“‰|\n",
"| | | | RandomOffsetModel 10% |❌|βœ”οΈ|❗|βœ”οΈ|🀬|πŸ‘Œ|πŸ’€|βŒπŸ“ˆ|\n",
"\n",
"</details>"
]
}
],
"metadata": {
"colab": {
"include_colab_link": true,
"provenance": []
},
"kernelspec": {
"display_name": "rf_metrics",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment