{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "

Function for getting scores: Sigmoid fucntion

" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "75.50813375962909\n" ] } ], "source": [ "\n", "mean_stocks = 5\n", "value_stock = 4\n", "\n", "score= (200/(1+math.e**( 0.5*(mean_stocks-value_stock))))\n", "\n", "print(score)\n" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAg4AAAFlCAYAAACDYGA9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy88F64QAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAbn0lEQVR4nO3da3BV1f3G8SckhxOCJEpSMZhwVcRLQU2qBmshSlB0QF7Y4sAwYNUpBS2YaRVKR5KOTnpBp1qVClLwBampItRaoJyZQghSa8AwQ6XVAiLQBGgSSQKph21Y/xeW/IkJuE4ma4Uk389MZtw7++z145mD52GfW5wxxggAAMBCr84eAAAAdB0UBwAAYI3iAAAArFEcAACANYoDAACwRnEAAADWKA4AAMAaxQEAAFijOAAAAGsUBwAAYM1bcSgqKlJcXJzmz5/va0kAANDBvBSH8vJyLVu2TKNGjfKxHAAAcMR5cThx4oSmT5+u5cuX65JLLnG9HAAAcCjB9QJz587VPffco/Hjx+upp54677HRaFTRaLR5+/Tp06qtrVVqaqri4uJcjwoAQLdhjFFDQ4MGDhyoXr067jqB0+Lw2muv6f3331d5ebnV8UVFRSosLHQ5EgAAPcqhQ4eUkZHRYedzVhwOHTqkefPmadOmTUpMTLS6zcKFC5Wfn9+8XVdXp0GDBumjjz5S//79XY2KswRBoM2bNys3N1ehUKizx+kRyNw/MvePzP2rra3ViBEj1K9fvw49r7PisHPnTh07dkxZWVnN+5qamrR161a98MILikajio+Pb3GbcDiscDjc6l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yZ79mzRz/4wQ/05JNPaufOndq4caM+/vhjzZ4928eoPVZHPIZ22j9n0tLSFB8f36qNHjt2rFUjOuOyyy5r8/iEhASlpqY6m7W7aE/mZ5SUlOjBBx/U66+/rvHjx7scs1uJNfOGhgbt2LFDFRUVeuSRRyR98aBmjFFCQoI2bdqk22+/3cvsXVV77ufp6em6/PLLlZKS0rzv6quvljFGhw8f1pVXXul05q6uPZkXFRXp1ltv1Y9+9CNJ0qhRo9S3b1/ddttteuqpp7iC7EBHPYZ22hWH3r17KysrS5FIpMX+SCSiMWPGtHmbnJycVsdv2rRJ2dnZCoVCzmbtLtqTufTFlYZZs2apuLiY5x9jFGvmycnJ2r17t3bt2tX8M3v2bF111VXatWsXX0lvoT3381tvvVWVlZU6ceJE876PPvpIvXr14tt8LbQn88bGRvXq1fIhKD4+XtL//ysYHavDHkNjeillBzvz9p0VK1aYPXv2mPnz55u+ffuaAwcOGGOMWbBggZkxY0bz8WfeSvLYY4+ZPXv2mBUrVvB2zBjFmnlxcbFJSEgwL774oqmqqmr+OX78eGf9EbqcWDP/Mt5VEbtYM29oaDAZGRnmvvvuMx988IEpLS01V155pXnooYc664/Q5cSa+cqVK01CQoJ56aWXzL59+8y2bdtMdna2uemmmzrrj9DlNDQ0mIqKClNRUWEkmWeffdZUVFQ0vwXW1WNopxYHY4x58cUXzeDBg03v3r3NjTfeaEpLS5t/N3PmTDN27NgWx2/ZssXccMMNpnfv3mbIkCFm6dKlnifu+mLJfOzYsUZSq5+ZM2f6H7wLi/V+fjaKQ/vEmvk//vEPM378eNOnTx+TkZFh8vPzTWNjo+epu7ZYM3/++efNNddcY/r06WPS09PN9OnTzeHDhz1P3XVt3rz5vP9/dvUYytdqAwAAa53+rgoAANB1UBwAAIA1igMAALBGcQAAANYoDgAAwBrFAQAAWKM4AAAAaxQHAABgjeIAAACsURwAAIA1igMAALBGcQAAANb+D/bMG75tXjyMAAAAAElFTkSuQmCC", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1e6dab8358774ba1b4a796b47bbf6360", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(IntSlider(value=1, description='w', max=10), FloatSlider(value=1.0, description='amp', m…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import ipywidgets as widgets\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "# set up plot\n", "fig, ax = plt.subplots(figsize=(6, 4))\n", "ax.set_ylim([-4, 4])\n", "ax.grid(True)\n", " \n", "# generate x values\n", "x = np.linspace(0, 2 * np.pi, 100)\n", " \n", " \n", "def my_sine(x, w, amp, phi):\n", " \"\"\"\n", " Return a sine for x with angular frequeny w and amplitude amp.\n", " \"\"\"\n", " return amp*np.sin(w * (x-phi))\n", " \n", " \n", "@widgets.interact(w=(0, 10, 1), amp=(0, 4, .1), phi=(0, 2*np.pi+0.01, 0.01))\n", "def update(w = 1.0, amp=1, phi=0):\n", " \"\"\"Remove old lines from plot and plot new one\"\"\"\n", " [l.remove() for l in ax.lines]\n", " ax.plot(x, my_sine(x, w, amp, phi), color='C0')\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "language_info": { "name": "python" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }