This repository has been archived on 2023-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
va-project/presentation_notebook.ipynb

109 lines
12 KiB
Text
Raw Normal View History

2023-05-29 15:09:57 +00:00
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1>Function for getting scores: Sigmoid fucntion</h1>"
]
},
{
"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+Lw2muv6f3331d5ebnV8UVFRSosLHQ5EgAAPcqhQ4eUkZHRYedzVhwOHTqkefPmadOmTUpMTLS6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KCDOS8OU6dOVU1NjX7605+qqqpK1113ndavX6/Bgwe7XhoAAHQwLy+OnDNnjubMmeNjKQAA4BDfVQEAAKxRHAAAgDWKAwAAsEZxAAA
"text/plain": [
"<Figure size 600x400 with 1 Axes>"
]
},
"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
}