{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Surrogating a function with a machine learning estimator\n", "\n", "System dynamics generally represents the relationships between model elements as either analytical equations, or lookup tables. However, in some situations we may be presented with relationships that are not well estimated by equations, but involve more than a single input leading to a single output. When confrontied with this situation, other paradigms \n", "\n", "" ] }, { "cell_type": "raw", "metadata": {}, "source": [ ".. image:: ../../../source/models/Manufacturing_Defects/Defects.png\n", " :width: 400 px" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "source": [ "%pylab inline\n", "import pysd\n", "import numpy as np\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "model = pysd.read_vensim('../../models/Manufacturing_Defects/Defects.mdl')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | Unnamed: 0 | \n", "Workday | \n", "Time per Task | \n", "Defect Rate | \n", "
---|---|---|---|---|
0 | \n", "0 | \n", "0.303114 | \n", "0.060810 | \n", "0.023022 | \n", "
1 | \n", "1 | \n", "0.263133 | \n", "0.052325 | \n", "0.023017 | \n", "
2 | \n", "2 | \n", "0.230397 | \n", "0.065387 | \n", "0.015868 | \n", "
3 | \n", "3 | \n", "0.265632 | \n", "0.044866 | \n", "0.032806 | \n", "
4 | \n", "4 | \n", "0.298651 | \n", "0.038648 | \n", "0.035234 | \n", "