hexsha
stringlengths
40
40
size
int64
6
14.9M
ext
stringclasses
1 value
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
6
260
max_stars_repo_name
stringlengths
6
119
max_stars_repo_head_hexsha
stringlengths
40
41
max_stars_repo_licenses
sequence
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
6
260
max_issues_repo_name
stringlengths
6
119
max_issues_repo_head_hexsha
stringlengths
40
41
max_issues_repo_licenses
sequence
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
6
260
max_forks_repo_name
stringlengths
6
119
max_forks_repo_head_hexsha
stringlengths
40
41
max_forks_repo_licenses
sequence
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
avg_line_length
float64
2
1.04M
max_line_length
int64
2
11.2M
alphanum_fraction
float64
0
1
cells
sequence
cell_types
sequence
cell_type_groups
sequence
e7e2a8a0139a6473d207f83f44d64d4f4d802107
22,541
ipynb
Jupyter Notebook
Tp_xy/TP1_mde amine_.ipynb
nevermind78/Proba_stat_4_LM
49a54c9e8b77eb2dfe688591c38014c0c8945489
[ "Unlicense" ]
7
2021-10-04T09:12:21.000Z
2022-01-01T14:45:09.000Z
Tp_xy/TP1_mde amine_.ipynb
SidiahmedHABIB/Proba_stat_4_LM
712ec4a3078136405fb7c32c61f3d0eebd6ca899
[ "Unlicense" ]
null
null
null
Tp_xy/TP1_mde amine_.ipynb
SidiahmedHABIB/Proba_stat_4_LM
712ec4a3078136405fb7c32c61f3d0eebd6ca899
[ "Unlicense" ]
12
2020-10-30T23:35:53.000Z
2021-12-08T23:35:41.000Z
27.897277
821
0.445144
[ [ [ "\n# Nom et prénom\n# TP1 Probabilité et statistique\n<html>\n <head>\n <title>HTML Base Tag Example</title>\n <base href = \"https://github.com/nevermind78/Proba_stat_4_LM\" />\n </head>\n <body>\n <img src = \"https://th.bing.com/th/id/OIP.Quijt6_GuJ-OzuMSNQ_S1gHaHa?pid=Api&rs=1\" width=\"200\" alt = \"Logo Image\"/>\n </body>\n\n</html>\n", "_____no_output_____" ] ], [ [ "from __future__ import print_function\nimport numpy as np\nimport pandas as pd\nfrom ipywidgets import interact, interactive, fixed, interact_manual\nimport ipywidgets as widgets", "_____no_output_____" ] ], [ [ "## Probabilités - approche fréquentiste\n### Définition par la fréquence relative :\n* une expérience d’ensemble fondamental est exécutée plusieurs fois sous les mêmes conditions.\n* Pour chaque événement E de , n(E) est le nombre de fois où l’événement E survient lors des n premières répétitions de l’expérience.\n* P(E), la probabilité de l’événement E est définie de la manière suivante :\n\n$$P(E)=\\lim_{n\\to\\infty}\\dfrac{n(E)}{n} $$ ", "_____no_output_____" ], [ "## Simulation d'un dé parfait", "_____no_output_____" ] ], [ [ "# seed the random number generator\nnp.random.seed(1)\n\n# Example: sampling \n#\n# do not forget that Python arrays are zero-indexed,\n# and the 2nd argument to NumPy arange must be incremented by 1\n# if you want to include that value\nn = 6\nk = 200000\nT=np.random.choice(np.arange(1, n+1), k, replace=True)\nunique, counts = np.unique(T, return_counts=True)\ndic=dict(zip(unique, counts))\ndf=pd.DataFrame(list(dic.items()),columns=['i','Occurence'])\ndf.set_index(['i'], inplace=True)\ndf['Freq']=df['Occurence']/k\ndf['P({i})']='{}'.format(1/6)\ndf", "_____no_output_____" ] ], [ [ "## Ajouter de l'intéraction ", "_____no_output_____" ] ], [ [ "def dice_sim(k=100):\n n = 6 \n T=np.random.choice(np.arange(1, n+1), k, replace=True)\n unique, counts = np.unique(T, return_counts=True)\n dic=dict(zip(unique, counts))\n df=pd.DataFrame(list(dic.items()),columns=['i','Occurence'])\n df.set_index(['i'], inplace=True)\n df['Freq']=df['Occurence']/k\n df['P({i})']='{0:.3f}'.format(1/6)\n return df\n ", "_____no_output_____" ], [ "dice_sim(100)", "_____no_output_____" ], [ "interact(dice_sim,k=widgets.IntSlider(min=1000, max=50000, step=500, value=10));", "_____no_output_____" ] ], [ [ "## Cas d'un dé truqué", "_____no_output_____" ] ], [ [ "p=[0.1, 0.1, 0.1, 0.1,0.1,0.5]\nsum(p)", "_____no_output_____" ], [ "def dice_sim(k=100,q=[[0.1, 0.1, 0.1, 0.1,0.1,0.5],[0.2, 0.1, 0.2, 0.1,0.1,0.3]]):\n n = 6\n qq=q\n T=np.random.choice(np.arange(1, n+1), k, replace=True,p=qq)\n unique, counts = np.unique(T, return_counts=True)\n dic=dict(zip(unique, counts))\n df=pd.DataFrame(list(dic.items()),columns=['i','Occurence'])\n df.set_index(['i'], inplace=True)\n df['Freq']=df['Occurence']/k\n df['P({i})']=['{0:.3f}'.format(j) for j in q]\n return df", "_____no_output_____" ], [ "interact(dice_sim,k=widgets.IntSlider(min=1000, max=50000, step=500, value=10));", "_____no_output_____" ] ], [ [ "## Exercice 1: \n\nTester l'intéraction précédente pour plusieurs valeurs de `p`\nDonner votre conclusion :", "_____no_output_____" ] ], [ [ "# Conclusion \n\n\n\n\n", "_____no_output_____" ] ], [ [ "## Permutation Aléatoire", "_____no_output_____" ] ], [ [ "np.random.seed(2)\n\nm = 1\nn = 10\n\nv = np.arange(m, n+1)\nprint('v =', v)\n\nnp.random.shuffle(v)\nprint('v, shuffled =', v)", "v = [ 1 2 3 4 5 6 7 8 9 10]\nv, shuffled = [ 5 2 6 1 8 3 4 7 10 9]\n" ] ], [ [ "## Exercice 2\nVérifier que les permutation aléatoires sont uniforme , c'est à dire que la probabilité de générer une permutation d'élement de {1,2,3} est 1/6.\nEn effet les permutations de {1,2,3} sont :\n* 1 2 3\n* 1 3 2\n* 2 1 3\n* 2 3 1\n* 3 1 2\n* 3 2 1\n", "_____no_output_____" ] ], [ [ "k =10\nm = 1\nn = 3\nv = np.arange(m, n+1)\nT=[]\nfor i in range(k):\n np.random.shuffle(v)\n w=np.copy(v)\n T.append(w)", "_____no_output_____" ], [ "TT=[str(i) for i in T]\nTT", "_____no_output_____" ], [ "k =1000\nm = 1\nn = 3\nv = np.arange(m, n+1)\nT=[]\nfor i in range(k):\n np.random.shuffle(v)\n w=np.copy(v)\n T.append(w)\n\nTT=[str(i) for i in T]\nunique, counts = np.unique(TT, return_counts=True)\ndic=dict(zip(unique, counts))\ndf=pd.DataFrame(list(dic.items()),columns=['i','Occurence'])\ndf.set_index(['i'], inplace=True)\ndf['Freq']=df['Occurence']/k\ndf['P({i,j,k})']='{0:.3f}'.format(1/6)\ndf", "_____no_output_____" ] ], [ [ "### Donner votre conclusion en expliquant le script ", "_____no_output_____" ] ], [ [ "## Explication \n\n\n\n\n\n\n\n\n", "_____no_output_____" ] ], [ [ "## Probabilité conditionnelle ", "_____no_output_____" ], [ "Rappelons que l'interprétation fréquentiste de la probabilité conditionnelle basée sur un grand nombre `n` de répétitions d'une expérience est $ P (A | B) ≈ n_ {AB} / n_ {B} $, où $ n_ {AB} $ est le nombre de fois où $ A \\cap B $ se produit et $ n_ {B} $ est le nombre de fois où $ B $ se produit. Essayons cela par simulation et vérifions les résultats de l'exemple 2.2.5. Utilisons donc [`numpy.random.choice`] (https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.random.choice.html) pour simuler les familles` n`, chacun avec deux enfants.\n", "_____no_output_____" ] ], [ [ "np.random.seed(34)\n\nn = 10**5\nchild1 = np.random.choice([1,2], n, replace=True) \nchild2 = np.random.choice([1,2], n, replace=True) \n\nprint('child1:\\n{}\\n'.format(child1))\n\nprint('child2:\\n{}\\n'.format(child2))", "child1:\n[2 1 1 ... 1 2 1]\n\nchild2:\n[2 2 2 ... 2 2 1]\n\n" ] ], [ [ "Ici, «child1» est un «tableau NumPy» de longueur «n», où chaque élément est un 1 ou un 2. En laissant 1 pour «fille» et 2 pour «garçon», ce «tableau» représente le sexe du enfant aîné dans chacune des familles «n». De même, «enfant2» représente le sexe du plus jeune enfant de chaque famille.\n", "_____no_output_____" ] ], [ [ "np.random.choice([\"girl\", \"boy\"], n, replace=True)", "_____no_output_____" ] ], [ [ "mais il est plus pratique de travailler avec des valeurs numériques.\n\nSoit $ A $ l'événement où les deux enfants sont des filles et $ B $ l'événement où l'aîné est une fille. Suivant l'interprétation fréquentiste, nous comptons le nombre de répétitions où $ B $ s'est produit et le nommons `n_b`, et nous comptons également le nombre de répétitions où $ A \\cap B $ s'est produit et le nommons` n_ab`. Enfin, nous divisons `n_ab` par` n_b` pour approximer $ P (A | B) $.", "_____no_output_____" ] ], [ [ "n_b = np.sum(child1==1)\nn_ab = np.sum((child1==1) & (child2==1))\n\nprint('P(both girls | elder is girl) = {:0.2F}'.format(n_ab / n_b))", "P(both girls | elder is girl) = 0.50\n" ] ], [ [ "L'esperluette `&` est un élément par élément $ AND $, donc `n_ab` est le nombre de familles où le premier et le deuxième enfant sont des filles. Lorsque nous avons exécuté ce code, nous avons obtenu 0,50, confirmant notre réponse $ P (\\text {les deux filles | l'aîné est une fille}) = 1/2 $.\n\nSoit maintenant $ A $ l'événement où les deux enfants sont des filles et $ B $ l'événement selon lequel au moins l'un des enfants est une fille. Alors $ A \\cap B $ est le même, mais `n_b` doit compter le nombre de familles où au moins un enfant est une fille. Ceci est accompli avec l'opérateur élémentaire $ OR $ `|` (ce n'est pas une barre de conditionnement; c'est un $ OR $ inclusif, retournant `True` si au moins un élément est` True`).", "_____no_output_____" ] ], [ [ "n_b = np.sum((child1==1) | (child2==2))\nn_ab = np.sum((child1==1) & (child2==1))\n\nprint('P(both girls | at least one girl) = {:0.2F}'.format(n_ab / n_b))", "P(both girls | at least one girl) = 0.33\n" ] ], [ [ "Pour nous, le résultat était de 0,33, confirmant que $ P (\\text {les deux filles | au moins une fille}) = 1/3 $.", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ] ]
e7e2ae4085607041ae3e7ad535ae5d06fed1568c
45,388
ipynb
Jupyter Notebook
src/math_bot/model/GloVeSiameseLSTM.ipynb
AlinGeorgescu/Math-Bot
bf9d2a9c373bd85574a11c11e33526c46723df01
[ "MIT" ]
3
2021-06-01T16:10:18.000Z
2021-08-06T00:37:14.000Z
src/math_bot/model/GloVeSiameseLSTM.ipynb
AlinGeorgescu/Math-Bot
bf9d2a9c373bd85574a11c11e33526c46723df01
[ "MIT" ]
null
null
null
src/math_bot/model/GloVeSiameseLSTM.ipynb
AlinGeorgescu/Math-Bot
bf9d2a9c373bd85574a11c11e33526c46723df01
[ "MIT" ]
null
null
null
36.81103
586
0.574822
[ [ [ "# [Math-Bot] Siamese LSTM: Detecting duplicates\n\n<img src=\"media/uni_logo.png\"/>\n\n<b>Author: Alin-Andrei Georgescu 2021</b>\n\nWelcome to my notebook! It explores the Siamese networks applied to natural language processing. The model is intended to detect duplicates, in other words to check if two sentences are similar.\nThe model uses \"Long short-term memory\" (LSTM) neural networks, which are an artificial recurrent neural networks (RNNs). This version uses GloVe pretrained vectors.\n\n## Outline\n\n- [Overview](#0)\n- [Part 1: Importing the Data](#1)\n - [1.1 Loading in the data](#1.1)\n - [1.2 Converting a sentence to a tensor](#1.2)\n - [1.3 Understanding and building the iterator](#1.3)\n- [Part 2: Defining the Siamese model](#2)\n - [2.1 Understanding and building the Siamese Network](#2.1)\n - [2.2 Implementing Hard Negative Mining](#2.2)\n- [Part 3: Training](#3)\n- [Part 4: Evaluation](#4)\n- [Part 5: Making predictions](#5)\n\n<a name='0'></a>\n### Overview\n\nGeneral ideas:\n- Designing a Siamese networks model\n- Implementing the triplet loss\n- Evaluating accuracy\n- Using cosine similarity between the model's outputted vectors\n- Working with Trax and Numpy libraries in Python 3\n\nThe LSTM cell's architecture (source: https://www.researchgate.net/figure/The-structure-of-the-LSTM-unit_fig2_331421650):\n<img src=\"https://www.researchgate.net/profile/Xiaofeng-Yuan-4/publication/331421650/figure/fig2/AS:771405641695233@1560928845927/The-structure-of-the-LSTM-unit.png\" style=\"width:600px;height:300px;\"/>\n\n\n\nI will start by preprocessing the data, then I will build a classifier that will identify whether two sentences are the same or not. \n\n\nI tokenized the data, then split the dataset into training and testing sets. I loaded pretrained GloVe word embeddings and built a sentence's vector by averaging the composing word's vectors. The model takes in the two sentence embeddings, runs them through an LSTM, and then compares the outputs of the two sub networks using cosine similarity.\n\nThis notebook has been built based on Coursera's <a href=\"https://www.coursera.org/specializations/natural-language-processing\">Natural Language Processing Specialization</a>.\n", "_____no_output_____" ], [ "<a name='1'></a>\n# Part 1: Importing the Data\n<a name='1.1'></a>\n### 1.1 Loading in the data\n\nFirst step in building a model is building a dataset. I used three datasets in building my model:\n- the Quora Question Pairs\n- edited SICK dataset\n- custom Maths duplicates dataset\n\nRun the cell below to import some of the needed packages. ", "_____no_output_____" ] ], [ [ "import os\nimport re\nimport nltk\nfrom nltk.corpus import stopwords\nnltk.download('punkt')\nnltk.download('stopwords')\nnltk.download('wordnet')\n\nimport numpy as np\nimport pandas as pd\nimport random as rnd\n\n!pip install textcleaner\nimport textcleaner as tc\n\n!pip install trax\nimport trax\nfrom trax import layers as tl\nfrom trax.supervised import training\nfrom trax.fastmath import numpy as fastnp\n\n!pip install gensim\nfrom gensim.models import KeyedVectors\nfrom gensim.scripts.glove2word2vec import glove2word2vec\n\nfrom collections import defaultdict\n\n# set random seeds\nrnd.seed(34)", "_____no_output_____" ] ], [ [ "**Notice that in this notebook Trax's numpy is referred to as `fastnp`, while regular numpy is referred to as `np`.**\n\nNow the dataset and word embeddings will get loaded and the data processed.", "_____no_output_____" ] ], [ [ "data = pd.read_csv(\"data/merged_dataset.csv\", encoding=\"utf-8\")\n\nN = len(data)\nprint(\"Number of sentence pairs: \", N)\n\ndata.head()\n\n!wget -O data/glove.840B.300d.zip nlp.stanford.edu/data/glove.840B.300d.zip\n!unzip -d data data/glove.840B.300d.zip\n!rm data/glove.840B.300d.zip\nvec_model = KeyedVectors.load_word2vec_format(\"data/glove.840B.300d.txt\", binary=False, no_header=True) ", "_____no_output_____" ] ], [ [ "Then I split the data into a train and test set. The test set will be used later to evaluate the model.", "_____no_output_____" ] ], [ [ "N_dups = len(data[data.is_duplicate == 1])\n\n# Take 90% of the duplicates for the train set\nN_train = int(N_dups * 0.9)\nprint(N_train)\n\n# Take the rest of the duplicates for the test set + an equal number of non-dups\nN_test = (N_dups - N_train) * 2\nprint(N_test)\n\ndata_train = data[: N_train]\n# Shuffle the train set\ndata_train = data_train.sample(frac=1)\n\ndata_test = data[N_train : N_train + N_test]\n# Shuffle the test set\ndata_test = data_test.sample(frac=1)\n\nprint(\"Train set: \", len(data_train), \"; Test set: \", len(data_test))\n\n# Remove the unneeded data to some memory\ndel(data)", "_____no_output_____" ], [ "S1_train_words = np.array(data_train[\"sentence1\"])\nS2_train_words = np.array(data_train[\"sentence2\"])\n\nS1_test_words = np.array(data_test[\"sentence1\"])\nS2_test_words = np.array(data_test[\"sentence2\"])\ny_test = np.array(data_test[\"is_duplicate\"])\n\ndel(data_train)\ndel(data_test)", "_____no_output_____" ] ], [ [ "Above, you have seen that the model only takes the duplicated sentences for training.\nAll this has a purpose, as the data generator will produce batches $([s1_1, s1_2, s1_3, ...]$, $[s2_1, s2_2,s2_3, ...])$, where $s1_i$ and $s2_k$ are duplicate if and only if $i = k$.\n\nAn example of how the data looks is shown below.", "_____no_output_____" ] ], [ [ "print(\"TRAINING SENTENCES:\\n\")\nprint(\"Sentence 1: \", S1_train_words[0])\nprint(\"Sentence 2: \", S2_train_words[0], \"\\n\")\nprint(\"Sentence 1: \", S1_train_words[5])\nprint(\"Sentence 2: \", S2_train_words[5], \"\\n\")\n\nprint(\"TESTING SENTENCES:\\n\")\nprint(\"Sentence 1: \", S1_test_words[0])\nprint(\"Sentence 2: \", S2_test_words[0], \"\\n\")\nprint(\"is_duplicate =\", y_test[0], \"\\n\")", "_____no_output_____" ] ], [ [ "The first step is to tokenize the sentences using a custom tokenizer defined below.", "_____no_output_____" ] ], [ [ "# Create arrays\nS1_train = np.empty_like(S1_train_words)\nS2_train = np.empty_like(S2_train_words)\n\nS1_test = np.empty_like(S1_test_words)\nS2_test = np.empty_like(S2_test_words)", "_____no_output_____" ], [ "def data_tokenizer(sentence):\n \"\"\"Tokenizer function - cleans and tokenizes the data\n\n Args:\n sentence (str): The input sentence.\n Returns:\n list: The transformed input sentence.\n \"\"\"\n \n if sentence == \"\":\n return \"\"\n\n sentence = tc.lower_all(sentence)[0]\n\n # Change tabs to spaces\n sentence = re.sub(r\"\\t+_+\", \" \", sentence)\n # Change short forms\n sentence = re.sub(r\"\\'ve\", \" have\", sentence)\n sentence = re.sub(r\"(can\\'t|can not)\", \"cannot\", sentence)\n sentence = re.sub(r\"n\\'t\", \" not\", sentence)\n sentence = re.sub(r\"I\\'m\", \"I am\", sentence)\n sentence = re.sub(r\" m \", \" am \", sentence)\n sentence = re.sub(r\"(\\'re| r )\", \" are \", sentence)\n sentence = re.sub(r\"\\'d\", \" would \", sentence)\n sentence = re.sub(r\"\\'ll\", \" will \", sentence)\n sentence = re.sub(r\"(\\d+)(k)\", r\"\\g<1>000\", sentence)\n # Make word separations\n sentence = re.sub(r\"(\\+|-|\\*|\\/|\\^|\\.)\", \" $1 \", sentence)\n # Remove irrelevant stuff, nonprintable characters and spaces\n sentence = re.sub(r\"(\\'s|\\'S|\\'|\\\"|,|[^ -~]+)\", \"\", sentence)\n sentence = tc.strip_all(sentence)[0]\n\n if sentence == \"\":\n return \"\"\n\n return tc.token_it(tc.lemming(sentence))[0]", "_____no_output_____" ], [ "for idx in range(len(S1_train_words)):\n S1_train[idx] = data_tokenizer(S1_train_words[idx])\n\nfor idx in range(len(S2_train_words)):\n S2_train[idx] = data_tokenizer(S2_train_words[idx])\n \nfor idx in range(len(S1_test_words)): \n S1_test[idx] = data_tokenizer(S1_test_words[idx])\n\nfor idx in range(len(S2_test_words)): \n S2_test[idx] = data_tokenizer(S2_test_words[idx])", "_____no_output_____" ] ], [ [ "<a name='1.2'></a>\n### 1.2 Converting a sentence to a tensor\n\nThe next step is to convert every sentence to a tensor, or an array of numbers, using the word embeddings loaded above.", "_____no_output_____" ] ], [ [ "stop_words = set(stopwords.words('english'))\n\n# Converting sentences to vectors. OOV words or stopwords will be discarded.\nS1_train_vec = np.empty_like(S1_train)\nfor i in range(len(S1_train)):\n S1_train_vec[i] = np.zeros((300,))\n for word in S1_train[i]:\n if word not in stop_words and word in vec_model.key_to_index:\n S1_train_vec[i] += vec_model[word]\n S1_train[i] = S1_train_vec[i] / len(S1_train[i])\n\nS2_train_vec = np.empty_like(S2_train)\nfor i in range(len(S2_train)):\n S2_train_vec[i] = np.zeros((300,))\n for word in S2_train[i]:\n if word not in stop_words and word in vec_model.key_to_index:\n S2_train_vec[i] += vec_model[word]\n S2_train[i] = S2_train_vec[i] / len(S2_train[i])\n\n\nS1_test_vec = np.empty_like(S1_test)\nfor i in range(len(S1_test)):\n S1_test_vec[i] = np.zeros((300,))\n for word in S1_test[i]:\n if word not in stop_words and word in vec_model.key_to_index:\n S1_test_vec[i] += vec_model[word]\n S1_test[i] = S1_test_vec[i] / len(S1_test[i])\n\nS2_test_vec = np.empty_like(S2_test)\nfor i in range(len(S2_test)):\n S2_test_vec[i] = np.zeros((300,))\n for word in S2_test[i]:\n if word not in stop_words and word in vec_model.key_to_index:\n S2_test_vec[i] += vec_model[word]\n S2_test[i] = S2_test_vec[i] / len(S2_test[i])", "_____no_output_____" ], [ "print(\"FIRST SENTENCE IN TRAIN SET:\\n\")\nprint(S1_train_words[0], \"\\n\") \nprint(\"ENCODED VERSION:\")\nprint(S1_train[0],\"\\n\")\ndel(S1_train_words)\ndel(S2_train_words)\n\nprint(\"FIRST SENTENCE IN TEST SET:\\n\")\nprint(S1_test_words[0], \"\\n\")\nprint(\"ENCODED VERSION:\")\nprint(S1_test[0])\ndel(S1_test_words)\ndel(S2_test_words)", "_____no_output_____" ] ], [ [ "Now, the train set must be split into a training/validation set so that it can be used to train and evaluate the Siamese model.", "_____no_output_____" ] ], [ [ "# Splitting the data\ncut_off = int(len(S1_train) * .8)\ntrain_S1, train_S2 = S1_train[: cut_off], S2_train[: cut_off]\nval_S1, val_S2 = S1_train[cut_off :], S2_train[cut_off :]\nprint(\"Number of duplicate sentences: \", len(S1_train))\nprint(\"The length of the training set is: \", len(train_S1))\nprint(\"The length of the validation set is: \", len(val_S1))", "_____no_output_____" ] ], [ [ "<a name='1.3'></a>\n### 1.3 Understanding and building the iterator \n\nGiven the compational limits, we need to split our data into batches. In this notebook, I built a data generator that takes in $S1$ and $S2$ and returned a batch of size `batch_size` in the following format $([s1_1, s1_2, s1_3, ...]$, $[s2_1, s2_2,s2_3, ...])$. The tuple consists of two arrays and each array has `batch_size` sentences. Again, $s1_i$ and $s2_i$ are duplicates, but they are not duplicates with any other elements in the batch. \n\nThe command `next(data_generator)` returns the next batch. This iterator returns a pair of arrays of sentences, which will later be used in the model.\n\n**The ideas behind:** \n- The generator returns shuffled batches of data. To achieve this without modifying the actual sentence lists, a list containing the indexes of the sentences is created. This list can be shuffled and used to get random batches everytime the index is reset.\n- Append elements of $S1$ and $S2$ to `input1` and `input2` respectively.", "_____no_output_____" ] ], [ [ "def data_generator(S1, S2, batch_size, shuffle=False):\n \"\"\"Generator function that yields batches of data\n\n Args:\n S1 (list): List of transformed (to tensor) sentences.\n S2 (list): List of transformed (to tensor) sentences.\n batch_size (int): Number of elements per batch.\n shuffle (bool, optional): If the batches should be randomnized or not. Defaults to False.\n Yields:\n tuple: Of the form (input1, input2) with types (numpy.ndarray, numpy.ndarray)\n NOTE: input1: inputs to your model [s1a, s2a, s3a, ...] i.e. (s1a,s1b) are duplicates\n input2: targets to your model [s1b, s2b,s3b, ...] i.e. (s1a,s2i) i!=a are not duplicates\n \"\"\"\n\n input1 = []\n input2 = []\n idx = 0\n len_s = len(S1)\n sentence_indexes = [*range(len_s)]\n\n if shuffle:\n rnd.shuffle(sentence_indexes)\n\n while True:\n if idx >= len_s:\n # If idx is greater than or equal to len_q, reset it\n idx = 0\n # Shuffle to get random batches if shuffle is set to True\n if shuffle:\n rnd.shuffle(sentence_indexes)\n\n s1 = S1[sentence_indexes[idx]]\n s2 = S2[sentence_indexes[idx]]\n\n idx += 1\n\n input1.append(s1)\n input2.append(s2)\n\n if len(input1) == batch_size:\n b1 = []\n b2 = []\n for s1, s2 in zip(input1, input2):\n # Append s1\n b1.append(s1)\n # Append s2\n b2.append(s2)\n\n # Use b1 and b2\n yield np.array(b1).reshape((batch_size, 1, -1)), np.array(b2).reshape((batch_size, 1, -1))\n\n # reset the batches\n input1, input2 = [], []", "_____no_output_____" ], [ "batch_size = 2\nres1, res2 = next(data_generator(train_S1, train_S2, batch_size))\nprint(\"First sentences :\\n\", res1, \"\\n Shape: \", res1.shape)\nprint(\"Second sentences :\\n\", res2, \"\\n Shape: \", res2.shape)", "_____no_output_____" ] ], [ [ "Now we can go ahead and start building the neural network, as we have a data generator.", "_____no_output_____" ], [ "<a name='2'></a>\n# Part 2: Defining the Siamese model\n\n<a name='2.1'></a>\n\n### 2.1 Understanding and building the Siamese Network \n\nA Siamese network is a neural network which uses the same weights while working in tandem on two different input vectors to compute comparable output vectors. The Siamese network model proposed in this notebook looks like this:\n\n<img src=\"media/siamese.png\" style=\"width:600px;height:300px;\"/>\n\nThe sentences' embeddings are passed to an LSTM layer, the output vectors, $v_1$ and $v_2$, are normalized, and finally a triplet loss is used to get the corresponding cosine similarity for each pair of sentences. The triplet loss makes use of a baseline (anchor) input that is compared to a positive (truthy) input and a negative (falsy) input. The distance from the baseline (anchor) input to the positive (truthy) input is minimized, and the distance from the baseline (anchor) input to the negative (falsy) input is maximized. In math equations, the following is maximized:\n\n$$\\mathcal{L}(A, P, N)=\\max \\left(\\|\\mathrm{f}(A)-\\mathrm{f}(P)\\|^{2}-\\|\\mathrm{f}(A)-\\mathrm{f}(N)\\|^{2}+\\alpha, 0\\right)$$\n\n$A$ is the anchor input, for example $s1_1$, $P$ the duplicate input, for example, $s2_1$, and $N$ the negative input (the non duplicate sentence), for example $s2_2$.<br>\n$\\alpha$ is a margin - how much the duplicates are pushed from the non duplicates. \n<br>\n\n**The ideas behind:**\n- Trax library is used in implementing the model.\n- `tl.Serial`: Combinator that applies layers serially (by function composition) allowing the set up the overall structure of the feedforward.\n- `tl.LSTM` The LSTM layer. \n- `tl.Mean`: Computes the mean across a desired axis. Mean uses one tensor axis to form groups of values and replaces each group with the mean value of that group.\n- `tl.Fn` Layer with no weights that applies the function f - vector normalization in this case.\n- `tl.parallel`: It is a combinator layer (like `Serial`) that applies a list of layers in parallel to its inputs.\n", "_____no_output_____" ] ], [ [ "def Siamese(d_model=300):\n \"\"\"Returns a Siamese model.\n\n Args:\n d_model (int, optional): Depth of the model. Defaults to 128.\n mode (str, optional): \"train\", \"eval\" or \"predict\", predict mode is for fast inference. Defaults to \"train\".\n\n Returns:\n trax.layers.combinators.Parallel: A Siamese model. \n \"\"\"\n\n def normalize(x): # normalizes the vectors to have L2 norm 1\n return x / fastnp.sqrt(fastnp.sum(x * x, axis=-1, keepdims=True))\n\n s_processor = tl.Serial( # Processor will run on S1 and S2.\n tl.LSTM(d_model), # LSTM layer\n tl.Mean(axis=1), # Mean over columns\n tl.Fn('Normalize', lambda x: normalize(x)) # Apply normalize function\n ) # Returns one vector of shape [batch_size, d_model].\n \n # Run on S1 and S2 in parallel.\n model = tl.Parallel(s_processor, s_processor)\n return model\n", "_____no_output_____" ] ], [ [ "Setup the Siamese network model.", "_____no_output_____" ] ], [ [ "# Check the model\nmodel = Siamese(d_model=300)\nprint(model)", "_____no_output_____" ] ], [ [ "<a name='2.2'></a>\n\n### 2.2 Implementing Hard Negative Mining\n\n\nNow it's the time to implement the `TripletLoss`.\nAs explained earlier, loss is composed of two terms. One term utilizes the mean of all the non duplicates, the second utilizes the *closest negative*. The loss expression is then:\n \n\\begin{align}\n \\mathcal{Loss_1(A,P,N)} &=\\max \\left( -cos(A,P) + mean_{neg} +\\alpha, 0\\right) \\\\\n \\mathcal{Loss_2(A,P,N)} &=\\max \\left( -cos(A,P) + closest_{neg} +\\alpha, 0\\right) \\\\\n\\mathcal{Loss(A,P,N)} &= mean(Loss_1 + Loss_2) \\\\\n\\end{align}", "_____no_output_____" ] ], [ [ "def TripletLossFn(v1, v2, margin=0.25):\n \"\"\"Custom Loss function.\n\n Args:\n v1 (numpy.ndarray): Array with dimension (batch_size, model_dimension) associated to S1.\n v2 (numpy.ndarray): Array with dimension (batch_size, model_dimension) associated to S2.\n margin (float, optional): Desired margin. Defaults to 0.25.\n\n Returns:\n jax.interpreters.xla.DeviceArray: Triplet Loss.\n \"\"\"\n\n scores = fastnp.dot(v1, v2.T) # pairwise cosine sim\n batch_size = len(scores)\n\n positive = fastnp.diagonal(scores) # the positive ones (duplicates)\n negative_without_positive = scores - 2.0 * fastnp.eye(batch_size)\n\n closest_negative = fastnp.max(negative_without_positive, axis=1)\n negative_zero_on_duplicate = (1.0 - fastnp.eye(batch_size)) * scores\n mean_negative = fastnp.sum(negative_zero_on_duplicate, axis=1) / (batch_size - 1)\n\n triplet_loss1 = fastnp.maximum(0.0, margin - positive + closest_negative)\n triplet_loss2 = fastnp.maximum(0.0, margin - positive + mean_negative)\n triplet_loss = fastnp.mean(triplet_loss1 + triplet_loss2)\n \n return triplet_loss", "_____no_output_____" ], [ "v1 = np.array([[0.26726124, 0.53452248, 0.80178373],[0.5178918 , 0.57543534, 0.63297887]])\nv2 = np.array([[0.26726124, 0.53452248, 0.80178373],[-0.5178918 , -0.57543534, -0.63297887]])\nTripletLossFn(v2,v1)\nprint(\"Triplet Loss:\", TripletLossFn(v2,v1))", "_____no_output_____" ] ], [ [ "**Expected Output:**\n```CPP\nTriplet Loss: 1.0\n``` ", "_____no_output_____" ] ], [ [ "from functools import partial\ndef TripletLoss(margin=1):\n # Trax layer creation\n triplet_loss_fn = partial(TripletLossFn, margin=margin)\n return tl.Fn(\"TripletLoss\", triplet_loss_fn)", "_____no_output_____" ] ], [ [ "<a name='3'></a>\n\n# Part 3: Training\n\nThe next step is model training - defining the cost function and the optimizer, feeding in the built model. But first I will define the data generators used in the model.", "_____no_output_____" ] ], [ [ "batch_size = 512\ntrain_generator = data_generator(train_S1, train_S2, batch_size)\nval_generator = data_generator(val_S1, val_S2, batch_size)\nprint(\"train_S1.shape \", train_S1.shape)\nprint(\"val_S1.shape \", val_S1.shape)", "_____no_output_____" ] ], [ [ "Now, I will define the training step. Each training iteration is defined as an `epoch`, each epoch being an iteration over all the data, using the training iterator.\n\n**The ideas behind:**\n- Two tasks are needed: `TrainTask` and `EvalTask`.\n- The training runs in a trax loop `trax.supervised.training.Loop`.\n- Pass the other parameters to a loop.", "_____no_output_____" ] ], [ [ "def train_model(Siamese, TripletLoss, lr_schedule, train_generator=train_generator, val_generator=val_generator, output_dir=\"trax_model/\"):\n \"\"\"Training the Siamese Model\n\n Args:\n Siamese (function): Function that returns the Siamese model.\n TripletLoss (function): Function that defines the TripletLoss loss function.\n lr_schedule (function): Trax multifactor schedule function.\n train_generator (generator, optional): Training generator. Defaults to train_generator.\n val_generator (generator, optional): Validation generator. Defaults to val_generator.\n output_dir (str, optional): Path to save model to. Defaults to \"trax_model/\".\n\n Returns:\n trax.supervised.training.Loop: Training loop for the model.\n \"\"\"\n\n output_dir = os.path.expanduser(output_dir)\n\n train_task = training.TrainTask(\n labeled_data=train_generator,\n loss_layer=TripletLoss(),\n optimizer=trax.optimizers.Adam(0.01),\n lr_schedule=lr_schedule\n )\n\n eval_task = training.EvalTask(\n labeled_data=val_generator,\n metrics=[TripletLoss()]\n )\n\n training_loop = training.Loop(Siamese(),\n train_task,\n eval_tasks=[eval_task],\n output_dir=output_dir,\n random_seed=34)\n\n return training_loop", "_____no_output_____" ], [ "train_steps = 1500\nlr_schedule = trax.lr.warmup_and_rsqrt_decay(400, 0.01)\ntraining_loop = train_model(Siamese, TripletLoss, lr_schedule)\ntraining_loop.run(train_steps)", "_____no_output_____" ] ], [ [ "<a name='4'></a>\n\n# Part 4: Evaluation", "_____no_output_____" ], [ "To determine the accuracy of the model, the test set that was configured earlier is used. While the training used only positive examples, the test data, S1_test, S2_test and y_test, is setup as pairs of sentences, some of which are duplicates some are not. \nThis routine runs all the test sentences pairs through the model, computes the cosine simlarity of each pair, thresholds it and compares the result to y_test - the correct response from the data set. The results are accumulated to produce an accuracy.\n\n**The ideas behind:** \n - The model loops through the incoming data in batch_size chunks.\n - The output vectors are computed and their cosine similarity is thresholded.", "_____no_output_____" ] ], [ [ "def classify(test_S1, test_S2, y, threshold, model, data_generator=data_generator, batch_size=64):\n \"\"\"Function to test the model. Calculates some metrics, such as precision, accuracy, recall and F1 score.\n\n Args:\n test_S1 (numpy.ndarray): Array of S1 sentences.\n test_S2 (numpy.ndarray): Array of S2 sentences.\n y (numpy.ndarray): Array of actual target.\n threshold (float): Desired threshold.\n model (trax.layers.combinators.Parallel): The Siamese model.\n data_generator (function): Data generator function. Defaults to data_generator.\n batch_size (int, optional): Size of the batches. Defaults to 64.\n\n Returns:\n (float, float, float, float): Accuracy, precision, recall and F1 score of the model.\n \"\"\"\n\n true_pos = 0\n true_neg = 0\n false_pos = 0\n false_neg = 0\n\n for i in range(0, len(test_S1), batch_size):\n to_process = len(test_S1) - i\n\n if to_process < batch_size:\n batch_size = to_process\n\n s1, s2 = next(data_generator(test_S1[i : i + batch_size], test_S2[i : i + batch_size], batch_size, shuffle=False))\n y_test = y[i : i + batch_size]\n\n v1, v2 = model((s1, s2))\n\n for j in range(batch_size):\n d = np.dot(v1[j], v2[j].T)\n res = d > threshold\n\n if res == 1:\n if y_test[j] == res:\n true_pos += 1\n else:\n false_pos += 1\n else:\n if y_test[j] == res:\n true_neg += 1\n else:\n false_neg += 1\n\n accuracy = (true_pos + true_neg) / (true_pos + true_neg + false_pos + false_neg)\n precision = true_pos / (true_pos + false_pos)\n recall = true_pos / (true_pos + false_neg)\n f1_score = 2 * precision * recall / (precision + recall)\n \n return (accuracy, precision, recall, f1_score)", "_____no_output_____" ], [ "print(len(S1_test))", "_____no_output_____" ], [ "# Loading in the saved model\nmodel = Siamese()\nmodel.init_from_file(\"trax_model/model.pkl.gz\")\n# Evaluating it\naccuracy, precision, recall, f1_score = classify(S1_test, S2_test, y_test, 0.7, model, batch_size=512) \nprint(\"Accuracy\", accuracy)\nprint(\"Precision\", precision)\nprint(\"Recall\", recall)\nprint(\"F1 score\", f1_score)", "_____no_output_____" ] ], [ [ "<a name='5'></a>\n\n# Part 5: Making predictions\n\nIn this section the model will be put to work. It will be wrapped in a function called `predict` which takes two sentences as input and returns $1$ or $0$, depending on whether the pair is a duplicate or not. \n\nBut first, we need to embed the sentences.", "_____no_output_____" ] ], [ [ "def predict(sentence1, sentence2, threshold, model, data_generator=data_generator, verbose=False):\n \"\"\"Function for predicting if two sentences are duplicates.\n\n Args:\n sentence1 (str): First sentence.\n sentence2 (str): Second sentence.\n threshold (float): Desired threshold.\n model (trax.layers.combinators.Parallel): The Siamese model.\n data_generator (function): Data generator function. Defaults to data_generator.\n verbose (bool, optional): If the results should be printed out. Defaults to False.\n\n Returns:\n bool: True if the sentences are duplicates, False otherwise.\n \"\"\"\n\n s1 = data_tokenizer(sentence1) # tokenize\n S1 = np.zeros((300,))\n for word in s1:\n if word not in stop_words and word in vec_model.key_to_index:\n S1 += vec_model[word]\n S1 = S1 / len(s1)\n \n s2 = data_tokenizer(sentence2) # tokenize\n S2 = np.zeros((300,))\n for word in s2:\n if word not in stop_words and word in vec_model.key_to_index:\n S1 += vec_model[word]\n S2 = S2 / len(s2)\n\n S1, S2 = next(data_generator([S1], [S2], 1))\n\n v1, v2 = model((S1, S2))\n d = np.dot(v1[0], v2[0].T)\n res = d > threshold\n \n if verbose == True:\n print(\"S1 = \", S1, \"\\nS2 = \", S2)\n print(\"d = \", d)\n print(\"res = \", res)\n\n return res", "_____no_output_____" ] ], [ [ "Now we can test the model's ability to make predictions.", "_____no_output_____" ] ], [ [ "sentence1 = \"I love running in the park.\"\nsentence2 = \"I like running in park?\"\n# 1 means it is duplicated, 0 otherwise\npredict(sentence1 , sentence2, 0.7, model, verbose=True)", "_____no_output_____" ] ], [ [ "The Siamese network is capable of catching complicated structures. Concretely, it can identify sentence duplicates although the sentences do not have many words in common.", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ] ]
e7e2b0e4c66604e869d67cf8d4e44fdb534af2d7
30,172
ipynb
Jupyter Notebook
notebook/self-study/2.regression.ipynb
KangByungWook/tensorflow
10e553637f9837779352f64deb5986c194bb7bfc
[ "MIT" ]
null
null
null
notebook/self-study/2.regression.ipynb
KangByungWook/tensorflow
10e553637f9837779352f64deb5986c194bb7bfc
[ "MIT" ]
null
null
null
notebook/self-study/2.regression.ipynb
KangByungWook/tensorflow
10e553637f9837779352f64deb5986c194bb7bfc
[ "MIT" ]
null
null
null
212.478873
16,104
0.897322
[ [ [ "# Regression", "_____no_output_____" ] ], [ [ "import tensorflow as tf\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# 텐서플로우 시드 설정\ntf.set_random_seed(1)\n\n# 넘파이 랜덤 시드 설정.\nnp.random.seed(1)\n\n# -1부터 1사이값을 100개로 쪼갬.\nx = np.linspace(-1, 1, 100)[:, np.newaxis] # shape (100, 1)\n\n# 0을 평균으로 하고 분산값이 0.1인 값들을 x의 크기만큼 배열로 만든다.\nnoise = np.random.normal(0, 0.1, size=x.shape)\n\n# x^2 + noise 연산.\ny = np.power(x, 2) + noise # shape (100, 1) + some noise\n\n# 차트에 그린다.\nplt.scatter(x, y)\n\n# 차트를 출력\nplt.show()\n\ntf_x = tf.placeholder(tf.float32, x.shape) # input x\ntf_y = tf.placeholder(tf.float32, y.shape) # input y\n\n# hidden layer 생성\n# relu activation function을 사용.\n# tf.layers.dense(입력, 유닛 갯수, acitvation function)\n# hidden유닛 갯수가 많아질수록 곡선이 좀더 유연해진다.\nl1 = tf.layers.dense(tf_x, 10, tf.nn.relu) # hidden layer1\n\nl2 = tf.layers.dense(l1, 5, tf.nn.relu) # hidden layer2\n\n# 출력 노드.\noutput = tf.layers.dense(l2, 1) # output layer\n\n# 노드를 거친 값과 실제값의 차이를 mean_square하여 구한다.\nloss = tf.losses.mean_squared_error(tf_y, output) # compute cost\n\n# optimizer를 생성하고.\noptimizer = tf.train.GradientDescentOptimizer(learning_rate=0.5)\n\n# loss를 최소화하는 방향으로 optimize를 수행한다.\ntrain_op = optimizer.minimize(loss)\n\nsess = tf.Session() # 세션 생성.\nsess.run(tf.global_variables_initializer()) # 그래프의 variable타입을 초기화.\n\nplt.ion() # 새로운 차트를 생성.\nplt.show()\n\n# 학습을 100번 수행.\nfor step in range(100):\n # 실제값과 출력값을 비교하면서 loss를 최소화하는 방향으로 학습을 진행.\n _, l, pred = sess.run([train_op, loss, output], {tf_x: x, tf_y: y})\n if step % 5 == 0:\n # plot and show learning process\n plt.cla()\n plt.scatter(x, y)\n plt.plot(x, pred, 'r-', lw=5)\n plt.text(0.5, 0, 'Loss=%.4f' % l, fontdict={'size': 20, 'color': 'red'})\n # 0.1초 간격으로 시뮬레이션.\n plt.pause(0.1)\n\nplt.ioff()\nplt.show()", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code" ] ]
e7e2b9ce353154539b6970685b0d9c8603ac4511
5,792
ipynb
Jupyter Notebook
Chapter6_ObjectOriented/vector2d.ipynb
Hasideluxe/UdemyPythonPro
67f3b55ebdacc9024ffbcf4fd4d3268a9d3bd760
[ "MIT" ]
null
null
null
Chapter6_ObjectOriented/vector2d.ipynb
Hasideluxe/UdemyPythonPro
67f3b55ebdacc9024ffbcf4fd4d3268a9d3bd760
[ "MIT" ]
null
null
null
Chapter6_ObjectOriented/vector2d.ipynb
Hasideluxe/UdemyPythonPro
67f3b55ebdacc9024ffbcf4fd4d3268a9d3bd760
[ "MIT" ]
null
null
null
24.23431
266
0.462535
[ [ [ "from math import sqrt\nfrom functools import total_ordering\n\n@total_ordering\nclass Vector2D:\n def __init__(self, x=0, y=0):\n self.x = x\n self.y = y\n\n def __call__(self):\n print(\"Calling the __call__ function!\")\n return self.__repr__()\n\n def __repr__(self):\n return 'vector.Vector2D({}, {})'.format(self.x, self.y)\n\n def __str__(self):\n return '({}, {})'.format(self.x, self.y)\n\n def __bool__(self):\n return bool(abs(self))\n\n def __abs__(self):\n return sqrt(pow(self.x, 2) + pow(self.y, 2))\n\n def __eq__(self, other_vector):\n if self.x == other_vector.x and self.y == other_vector.y:\n return True\n else:\n return False\n\n def __lt__(self, other_vector):\n if abs(self) < abs(other_vector):\n return True\n else:\n return False\n \n def __add__(self, other_vector):\n x = self.x + other_vector.x\n y = self.y + other_vector.y\n return Vector2D(x, y)\n\n def __add__(self, other_vector):\n x = self.x + other_vector.x\n y = self.y + other_vector.y\n return Vector2D(x, y)\n\n def __sub__(self, other_vector):\n x = self.x - other_vector.x\n y = self.y - other_vector.y\n return Vector2D(x, y)\n\n def __mul__(self, other):\n if isinstance(other, Vector2D):\n return self.x * other.x + self.y * other.y\n else:\n return Vector2D(self.x * other, self.y * other)\n\n def __truediv__(self, other):\n return Vector2D(self.x / other, self.y / other)", "_____no_output_____" ], [ "v1 = Vector2D(0, 0)\nprint(repr(v1))\nprint(str(v1))\nv2 = Vector2D(1, 1)\nprint(repr(v2))\nprint(str(v2))", "vector.Vector2D(0, 0)\n(0, 0)\nvector.Vector2D(1, 1)\n(1, 1)\n" ], [ "print(v1 + v2)\nprint(v1 - v2)\nprint(v1 * v2)\nprint(v2 / 5.0)", "(1, 1)\n(-1, -1)\n0\n(0.2, 0.2)\n" ], [ "print(abs(v2))", "1.4142135623730951\n" ], [ "print(v1 == v2)\n\nv3 = Vector2D(2, 2)\nv4 = Vector2D(2, 2)\n\nprint(v3 == v4)", "False\nTrue\n" ], [ "if v3:\n print(\"yes\")\nif v1:\n print(\"v1 - yes\")\nelse:\n print(\"v1 - no\")", "yes\nv1 - no\n" ], [ "v5 = Vector2D(2, 3)\nv6 = Vector2D(-1, 2)\n\nprint(v5 < v6)\nprint(v5 <= v6)\nprint(v5 > v6)\nprint(v5 >= v6)\nprint(v5 == v6)\nprint(v5 != v6)", "False\nFalse\nTrue\nTrue\nFalse\nTrue\n" ], [ "v5()", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e2c51195667ec4dde3657c95b42a140e8fdd35
605,006
ipynb
Jupyter Notebook
tutorials/Bert_SQUAD_Interpret.ipynb
cspanda/captum
8ec1f0e48b652676a8690d087751d86a4e9939b4
[ "BSD-3-Clause" ]
1
2021-02-03T00:43:17.000Z
2021-02-03T00:43:17.000Z
tutorials/Bert_SQUAD_Interpret.ipynb
cspanda/captum
8ec1f0e48b652676a8690d087751d86a4e9939b4
[ "BSD-3-Clause" ]
9
2021-06-28T20:24:29.000Z
2022-02-27T09:39:32.000Z
tutorials/Bert_SQUAD_Interpret.ipynb
cspanda/captum
8ec1f0e48b652676a8690d087751d86a4e9939b4
[ "BSD-3-Clause" ]
1
2021-09-26T01:31:46.000Z
2021-09-26T01:31:46.000Z
471.923557
243,852
0.92866
[ [ [ "# Interpreting BERT Models (Part 1)", "_____no_output_____" ], [ "In this notebook we demonstrate how to interpret Bert models using `Captum` library. In this particular case study we focus on a fine-tuned Question Answering model on SQUAD dataset using transformers library from Hugging Face: https://huggingface.co/transformers/\n\nWe show how to use interpretation hooks to examine and better understand embeddings, sub-embeddings, bert, and attention layers. \n\nNote: Before running this tutorial, please install `seaborn`, `pandas` and `matplotlib`, `transformers`(from hugging face) python packages.", "_____no_output_____" ] ], [ [ "import os\nimport sys\n\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn as nn\n\nfrom transformers import BertTokenizer, BertForQuestionAnswering, BertConfig\n\nfrom captum.attr import visualization as viz\nfrom captum.attr import IntegratedGradients, LayerConductance, LayerIntegratedGradients\nfrom captum.attr import configure_interpretable_embedding_layer, remove_interpretable_embedding_layer", "_____no_output_____" ], [ "device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")", "_____no_output_____" ] ], [ [ "The first step is to fine-tune BERT model on SQUAD dataset. This can be easiy accomplished by following the steps described in hugging face's official web site: https://github.com/huggingface/transformers#run_squadpy-fine-tuning-on-squad-for-question-answering \n\nNote that the fine-tuning is done on a `bert-base-uncased` pre-trained model.", "_____no_output_____" ], [ "After we pretrain the model, we can load the tokenizer and pre-trained BERT model using the commands described below. ", "_____no_output_____" ] ], [ [ "# replace <PATH-TO-SAVED-MODEL> with the real path of the saved model\nmodel_path = '<PATH-TO-SAVED-MODEL>'\n\n# load model\nmodel = BertForQuestionAnswering.from_pretrained(model_path)\nmodel.to(device)\nmodel.eval()\nmodel.zero_grad()\n\n# load tokenizer\ntokenizer = BertTokenizer.from_pretrained(model_path)", "_____no_output_____" ] ], [ [ "A helper function to perform forward pass of the model and make predictions.", "_____no_output_____" ] ], [ [ "def predict(inputs, token_type_ids=None, position_ids=None, attention_mask=None):\n return model(inputs, token_type_ids=token_type_ids,\n position_ids=position_ids, attention_mask=attention_mask, )", "_____no_output_____" ] ], [ [ "Defining a custom forward function that will allow us to access the start and end postitions of our prediction using `position` input argument.", "_____no_output_____" ] ], [ [ "def squad_pos_forward_func(inputs, token_type_ids=None, position_ids=None, attention_mask=None, position=0):\n pred = predict(inputs,\n token_type_ids=token_type_ids,\n position_ids=position_ids,\n attention_mask=attention_mask)\n pred = pred[position]\n return pred.max(1).values", "_____no_output_____" ] ], [ [ "Let's compute attributions with respect to the `BertEmbeddings` layer.\n\nTo do so, we need to define baselines / references, numericalize both the baselines and the inputs. We will define helper functions to achieve that.\n\nThe cell below defines numericalized special tokens that will be later used for constructing inputs and corresponding baselines/references.", "_____no_output_____" ] ], [ [ "ref_token_id = tokenizer.pad_token_id # A token used for generating token reference\nsep_token_id = tokenizer.sep_token_id # A token used as a separator between question and text and it is also added to the end of the text.\ncls_token_id = tokenizer.cls_token_id # A token used for prepending to the concatenated question-text word sequence", "_____no_output_____" ] ], [ [ "Below we define a set of helper function for constructing references / baselines for word tokens, token types and position ids. We also provide separate helper functions that allow to construct the sub-embeddings and corresponding baselines / references for all sub-embeddings of `BertEmbeddings` layer.", "_____no_output_____" ] ], [ [ "def construct_input_ref_pair(question, text, ref_token_id, sep_token_id, cls_token_id):\n question_ids = tokenizer.encode(question, add_special_tokens=False)\n text_ids = tokenizer.encode(text, add_special_tokens=False)\n\n # construct input token ids\n input_ids = [cls_token_id] + question_ids + [sep_token_id] + text_ids + [sep_token_id]\n\n # construct reference token ids \n ref_input_ids = [cls_token_id] + [ref_token_id] * len(question_ids) + [sep_token_id] + \\\n [ref_token_id] * len(text_ids) + [sep_token_id]\n\n return torch.tensor([input_ids], device=device), torch.tensor([ref_input_ids], device=device), len(question_ids)\n\ndef construct_input_ref_token_type_pair(input_ids, sep_ind=0):\n seq_len = input_ids.size(1)\n token_type_ids = torch.tensor([[0 if i <= sep_ind else 1 for i in range(seq_len)]], device=device)\n ref_token_type_ids = torch.zeros_like(token_type_ids, device=device)# * -1\n return token_type_ids, ref_token_type_ids\n\ndef construct_input_ref_pos_id_pair(input_ids):\n seq_length = input_ids.size(1)\n position_ids = torch.arange(seq_length, dtype=torch.long, device=device)\n # we could potentially also use random permutation with `torch.randperm(seq_length, device=device)`\n ref_position_ids = torch.zeros(seq_length, dtype=torch.long, device=device)\n\n position_ids = position_ids.unsqueeze(0).expand_as(input_ids)\n ref_position_ids = ref_position_ids.unsqueeze(0).expand_as(input_ids)\n return position_ids, ref_position_ids\n \ndef construct_attention_mask(input_ids):\n return torch.ones_like(input_ids)\n\ndef construct_bert_sub_embedding(input_ids, ref_input_ids,\n token_type_ids, ref_token_type_ids,\n position_ids, ref_position_ids):\n input_embeddings = interpretable_embedding1.indices_to_embeddings(input_ids)\n ref_input_embeddings = interpretable_embedding1.indices_to_embeddings(ref_input_ids)\n\n input_embeddings_token_type = interpretable_embedding2.indices_to_embeddings(token_type_ids)\n ref_input_embeddings_token_type = interpretable_embedding2.indices_to_embeddings(ref_token_type_ids)\n\n input_embeddings_position_ids = interpretable_embedding3.indices_to_embeddings(position_ids)\n ref_input_embeddings_position_ids = interpretable_embedding3.indices_to_embeddings(ref_position_ids)\n \n return (input_embeddings, ref_input_embeddings), \\\n (input_embeddings_token_type, ref_input_embeddings_token_type), \\\n (input_embeddings_position_ids, ref_input_embeddings_position_ids)\n \ndef construct_whole_bert_embeddings(input_ids, ref_input_ids, \\\n token_type_ids=None, ref_token_type_ids=None, \\\n position_ids=None, ref_position_ids=None):\n input_embeddings = interpretable_embedding.indices_to_embeddings(input_ids, token_type_ids=token_type_ids, position_ids=position_ids)\n ref_input_embeddings = interpretable_embedding.indices_to_embeddings(ref_input_ids, token_type_ids=token_type_ids, position_ids=position_ids)\n \n return input_embeddings, ref_input_embeddings\n", "_____no_output_____" ] ], [ [ "Let's define the `question - text` pair that we'd like to use as an input for our Bert model and interpret what the model was forcusing on when predicting an answer to the question from given input text ", "_____no_output_____" ] ], [ [ "question, text = \"What is important to us?\", \"It is important to us to include, empower and support humans of all kinds.\"", "_____no_output_____" ] ], [ [ "Let's numericalize the question, the input text and generate corresponding baselines / references for all three sub-embeddings (word, token type and position embeddings) types using our helper functions defined above.", "_____no_output_____" ] ], [ [ "input_ids, ref_input_ids, sep_id = construct_input_ref_pair(question, text, ref_token_id, sep_token_id, cls_token_id)\ntoken_type_ids, ref_token_type_ids = construct_input_ref_token_type_pair(input_ids, sep_id)\nposition_ids, ref_position_ids = construct_input_ref_pos_id_pair(input_ids)\nattention_mask = construct_attention_mask(input_ids)\n\nindices = input_ids[0].detach().tolist()\nall_tokens = tokenizer.convert_ids_to_tokens(indices)", "_____no_output_____" ] ], [ [ "Also, let's define the ground truth for prediction's start and end positions.", "_____no_output_____" ] ], [ [ "ground_truth = 'to include, empower and support humans of all kinds'\n\nground_truth_tokens = tokenizer.encode(ground_truth, add_special_tokens=False)\nground_truth_end_ind = indices.index(ground_truth_tokens[-1])\nground_truth_start_ind = ground_truth_end_ind - len(ground_truth_tokens) + 1", "_____no_output_____" ] ], [ [ "Now let's make predictions using input, token type, position id and a default attention mask.", "_____no_output_____" ] ], [ [ "start_scores, end_scores = predict(input_ids, \\\n token_type_ids=token_type_ids, \\\n position_ids=position_ids, \\\n attention_mask=attention_mask)\n\n\nprint('Question: ', question)\nprint('Predicted Answer: ', ' '.join(all_tokens[torch.argmax(start_scores) : torch.argmax(end_scores)+1]))", "Question: What is important to us?\nPredicted Answer: to include , em ##power and support humans of all kinds\n" ] ], [ [ "There are two different ways of computing the attributions for `BertEmbeddings` layer. One option is to use `LayerIntegratedGradients` and compute the attributions with respect to that layer. The second option is to pre-compute the embeddings and wrap the actual embeddings with `InterpretableEmbeddingBase`. The pre-computation of embeddings for the second option is necessary because integrated gradients scales the inputs and that won't be meaningful on the level of word / token indices.\n\nSince using `LayerIntegratedGradients` is simpler, let's use it here.", "_____no_output_____" ] ], [ [ "lig = LayerIntegratedGradients(squad_pos_forward_func, model.bert.embeddings)\n\nattributions_start, delta_start = lig.attribute(inputs=input_ids,\n baselines=ref_input_ids,\n additional_forward_args=(token_type_ids, position_ids, attention_mask, 0),\n return_convergence_delta=True)\nattributions_end, delta_end = lig.attribute(inputs=input_ids, baselines=ref_input_ids,\n additional_forward_args=(token_type_ids, position_ids, attention_mask, 1),\n return_convergence_delta=True)", "_____no_output_____" ] ], [ [ "A helper function to summarize attributions for each word token in the sequence.", "_____no_output_____" ] ], [ [ "def summarize_attributions(attributions):\n attributions = attributions.sum(dim=-1).squeeze(0)\n attributions = attributions / torch.norm(attributions)\n return attributions", "_____no_output_____" ], [ "attributions_start_sum = summarize_attributions(attributions_start)\nattributions_end_sum = summarize_attributions(attributions_end)", "_____no_output_____" ], [ "# storing couple samples in an array for visualization purposes\nstart_position_vis = viz.VisualizationDataRecord(\n attributions_start_sum,\n torch.max(torch.softmax(start_scores[0], dim=0)),\n torch.argmax(start_scores),\n torch.argmax(start_scores),\n str(ground_truth_start_ind),\n attributions_start_sum.sum(), \n all_tokens,\n delta_start)\n\nend_position_vis = viz.VisualizationDataRecord(\n attributions_end_sum,\n torch.max(torch.softmax(end_scores[0], dim=0)),\n torch.argmax(end_scores),\n torch.argmax(end_scores),\n str(ground_truth_end_ind),\n attributions_end_sum.sum(), \n all_tokens,\n delta_end)\n\nprint('\\033[1m', 'Visualizations For Start Position', '\\033[0m')\nviz.visualize_text([start_position_vis])\n\nprint('\\033[1m', 'Visualizations For End Position', '\\033[0m')\nviz.visualize_text([end_position_vis])", "\u001b[1m Visualizations For Start Position \u001b[0m\n" ], [ "from IPython.display import Image\nImage(filename='img/bert/visuals_of_start_end_predictions.png')", "_____no_output_____" ] ], [ [ "From the results above we can tell that for predicting start position our model is focusing more on the question side. More specifically on the tokens `what` and `important`. It has also slight focus on the token sequence `to us` in the text side.\n\nIn contrast to that, for predicting end position, our model focuses more on the text side and has relative high attribution on the last end position token `kinds`.", "_____no_output_____" ], [ "# Multi-Embedding attribution", "_____no_output_____" ], [ "Now let's look into the sub-embeddings of `BerEmbeddings` and try to understand the contributions and roles of each of them for both start and end predicted positions.\n\nTo do so, we'd need to place interpretation hooks in each three of them.\n\nNote that we could perform attribution by using `LayerIntegratedGradients` as well but in that case we have to call attribute three times for each sub-layer since currently `LayerIntegratedGradients` takes only a layer at a time. In the future we plan to support multi-layer attribution and will be able to perform attribution by only calling attribute once. \n\n`configure_interpretable_embedding_layer` function will help us to place interpretation hooks on each sub-layer. It returns `InterpretableEmbeddingBase` layer for each sub-embedding and can be used to access the embedding vectors. \n\nNote that we need to remove InterpretableEmbeddingBase wrapper from our model using remove_interpretable_embedding_layer function after we finish interpretation.\n", "_____no_output_____" ] ], [ [ "interpretable_embedding1 = configure_interpretable_embedding_layer(model, 'bert.embeddings.word_embeddings')\ninterpretable_embedding2 = configure_interpretable_embedding_layer(model, 'bert.embeddings.token_type_embeddings')\ninterpretable_embedding3 = configure_interpretable_embedding_layer(model, 'bert.embeddings.position_embeddings')", "_____no_output_____" ] ], [ [ "`BertEmbeddings` has three sub-embeddings, namely, `word_embeddings`, `token_type_embeddings` and `position_embeddings` and this time we would like to attribute to each of them independently.\n`construct_bert_sub_embedding` helper function helps us to construct input embeddings and corresponding references in a separation.", "_____no_output_____" ] ], [ [ "(input_embed, ref_input_embed), (token_type_ids_embed, ref_token_type_ids_embed), (position_ids_embed, ref_position_ids_embed) = construct_bert_sub_embedding(input_ids, ref_input_ids, \\\n token_type_ids=token_type_ids, ref_token_type_ids=ref_token_type_ids, \\\n position_ids=position_ids, ref_position_ids=ref_position_ids)", "_____no_output_____" ] ], [ [ "Now let's create an instance of `IntegratedGradients` and compute the attributions with respect to all those embeddings both for the start and end positions and summarize them for each word token.", "_____no_output_____" ] ], [ [ "ig = IntegratedGradients(squad_pos_forward_func)\n\nattributions_start = ig.attribute(inputs=(input_embed, token_type_ids_embed, position_ids_embed),\n baselines=(ref_input_embed, ref_token_type_ids_embed, ref_position_ids_embed),\n additional_forward_args=(attention_mask, 0))\nattributions_end = ig.attribute(inputs=(input_embed, token_type_ids_embed, position_ids_embed),\n baselines=(ref_input_embed, ref_token_type_ids_embed, ref_position_ids_embed),\n additional_forward_args=(attention_mask, 1))\n\nattributions_start_word = summarize_attributions(attributions_start[0])\nattributions_end_word = summarize_attributions(attributions_end[0])\n\nattributions_start_token_type = summarize_attributions(attributions_start[1])\nattributions_end_token_type = summarize_attributions(attributions_end[1])\n\nattributions_start_position = summarize_attributions(attributions_start[2])\nattributions_end_position = summarize_attributions(attributions_end[2])\n", "_____no_output_____" ] ], [ [ "An auxilary function that will help us to compute topk attributions and corresponding indices", "_____no_output_____" ] ], [ [ "def get_topk_attributed_tokens(attrs, k=5):\n values, indices = torch.topk(attrs, k)\n top_tokens = [all_tokens[idx] for idx in indices]\n return top_tokens, values, indices", "_____no_output_____" ] ], [ [ "Removing interpretation hooks from all layers after finishing attribution.", "_____no_output_____" ] ], [ [ "remove_interpretable_embedding_layer(model, interpretable_embedding1)\nremove_interpretable_embedding_layer(model, interpretable_embedding2)\nremove_interpretable_embedding_layer(model, interpretable_embedding3)", "_____no_output_____" ] ], [ [ "Computing topk attributions for all sub-embeddings and placing them in pandas dataframes for better visualization.", "_____no_output_____" ] ], [ [ "top_words_start, top_words_val_start, top_word_ind_start = get_topk_attributed_tokens(attributions_start_word)\ntop_words_end, top_words_val_end, top_words_ind_end = get_topk_attributed_tokens(attributions_end_word)\n\ntop_token_type_start, top_token_type_val_start, top_token_type_ind_start = get_topk_attributed_tokens(attributions_start_token_type)\ntop_token_type_end, top_token_type_val_end, top_token_type_ind_end = get_topk_attributed_tokens(attributions_end_token_type)\n\ntop_pos_start, top_pos_val_start, pos_ind_start = get_topk_attributed_tokens(attributions_start_position)\ntop_pos_end, top_pos_val_end, pos_ind_end = get_topk_attributed_tokens(attributions_end_position)\n\ndf_start = pd.DataFrame({'Word(Index), Attribution': [\"{} ({}), {}\".format(word, pos, round(val.item(),2)) for word, pos, val in zip(top_words_start, top_word_ind_start, top_words_val_start)],\n 'Token Type(Index), Attribution': [\"{} ({}), {}\".format(ttype, pos, round(val.item(),2)) for ttype, pos, val in zip(top_token_type_start, top_token_type_ind_start, top_words_val_start)],\n 'Position(Index), Attribution': [\"{} ({}), {}\".format(position, pos, round(val.item(),2)) for position, pos, val in zip(top_pos_start, pos_ind_start, top_pos_val_start)]})\ndf_start.style.apply(['cell_ids: False'])\n\ndf_end = pd.DataFrame({'Word(Index), Attribution': [\"{} ({}), {}\".format(word, pos, round(val.item(),2)) for word, pos, val in zip(top_words_end, top_words_ind_end, top_words_val_end)],\n 'Token Type(Index), Attribution': [\"{} ({}), {}\".format(ttype, pos, round(val.item(),2)) for ttype, pos, val in zip(top_token_type_end, top_token_type_ind_end, top_words_val_end)],\n 'Position(Index), Attribution': [\"{} ({}), {}\".format(position, pos, round(val.item(),2)) for position, pos, val in zip(top_pos_end, pos_ind_end, top_pos_val_end)]})\ndf_end.style.apply(['cell_ids: False'])\n\n['{}({})'.format(token, str(i)) for i, token in enumerate(all_tokens)]", "_____no_output_____" ] ], [ [ "Below we can see top 5 attribution results from all three embedding types in predicting start positions.", "_____no_output_____" ], [ "#### Top 5 attributed embeddings for start position", "_____no_output_____" ] ], [ [ "df_start", "_____no_output_____" ] ], [ [ "Word embeddings help to focus more on the surrounding tokens of the predicted answer's start position to such as em, ##power and ,. It also has high attribution for the tokens in the question such as what and ?.\n\nIn contrast to to word embedding, token embedding type focuses more on the tokens in the text part such as important,em and start token to.\n\nPosition embedding also has high attribution score for the tokens surrounding to such as us and important. In addition to that, similar to word embedding we observe important tokens from the question.\n\nWe can perform similar analysis, and visualize top 5 attributed tokens for all three embedding types, also for the end position prediction.\n", "_____no_output_____" ], [ "#### Top 5 attributed embeddings for end position", "_____no_output_____" ] ], [ [ "df_end", "_____no_output_____" ] ], [ [ "It is interesting to observe high concentration of highly attributed tokens such as `of`, `kinds`, `support` and `##power` for end position prediction.\n\nThe token `kinds`, which is the correct predicted token appears to have high attribution score both according word and position embeddings.\n", "_____no_output_____" ], [ "# Interpreting Bert Layers", "_____no_output_____" ], [ "Now let's look into the layers of our network. More specifically we would like to look into the distribution of attribution scores for each token across all layers in Bert model and dive deeper into specific tokens. \nWe do that using one of layer attribution algorithms, namely, layer conductance. However, we encourage you to try out and compare the results with other algorithms as well.\n\n\nLet's configure `InterpretableEmbeddingsBase` again, in this case in order to interpret the layers of our model.", "_____no_output_____" ] ], [ [ "interpretable_embedding = configure_interpretable_embedding_layer(model, 'bert.embeddings')", "_____no_output_____" ] ], [ [ "Let's iterate over all layers and compute the attributions for all tokens. In addition to that let's also choose a specific token that we would like to examine in detail, specified by an id `token_to_explain` and store related information in a separate array.\n\n\nNote: Since below code is iterating over all layers it can take over 5 seconds. Please be patient!", "_____no_output_____" ] ], [ [ "layer_attrs_start = []\nlayer_attrs_end = []\n\n# The token that we would like to examine separately.\ntoken_to_explain = 23 # the index of the token that we would like to examine more thoroughly\nlayer_attrs_start_dist = []\nlayer_attrs_end_dist = []\n\ninput_embeddings, ref_input_embeddings = construct_whole_bert_embeddings(input_ids, ref_input_ids, \\\n token_type_ids=token_type_ids, ref_token_type_ids=ref_token_type_ids, \\\n position_ids=position_ids, ref_position_ids=ref_position_ids)\n\nfor i in range(model.config.num_hidden_layers):\n lc = LayerConductance(squad_pos_forward_func, model.bert.encoder.layer[i])\n layer_attributions_start = lc.attribute(inputs=input_embeddings, baselines=ref_input_embeddings, additional_forward_args=(token_type_ids, position_ids,attention_mask, 0))[0]\n layer_attributions_end = lc.attribute(inputs=input_embeddings, baselines=ref_input_embeddings, additional_forward_args=(token_type_ids, position_ids,attention_mask, 1))[0]\n \n layer_attrs_start.append(summarize_attributions(layer_attributions_start).cpu().detach().tolist())\n layer_attrs_end.append(summarize_attributions(layer_attributions_end).cpu().detach().tolist())\n\n # storing attributions of the token id that we would like to examine in more detail in token_to_explain\n layer_attrs_start_dist.append(layer_attributions_start[0,token_to_explain,:].cpu().detach().tolist())\n layer_attrs_end_dist.append(layer_attributions_end[0,token_to_explain,:].cpu().detach().tolist())\n", "_____no_output_____" ] ], [ [ "The plot below represents a heat map of attributions across all layers and tokens for the start position prediction. \nIt is interesting to observe that the question word `what` gains increasingly high attribution from layer one to nine. In the last three layers that importance is slowly diminishing. \nIn contrary to `what` token, many other tokens have negative or close to zero attribution in the first 6 layers. \n\nWe start seeing slightly higher attribution in tokens `important`, `us` and `to`. Interestingly token `em` is also assigned high attribution score which is remarkably high the last three layers.\nAnd lastly, our correctly predicted token `to` for the start position gains increasingly positive attribution has relatively high attribution especially in the last two layers.\n", "_____no_output_____" ] ], [ [ "fig, ax = plt.subplots(figsize=(15,5))\nxticklabels=all_tokens\nyticklabels=list(range(1,13))\nax = sns.heatmap(np.array(layer_attrs_start), xticklabels=xticklabels, yticklabels=yticklabels, linewidth=0.2)\nplt.xlabel('Tokens')\nplt.ylabel('Layers')\nplt.show()", "_____no_output_____" ] ], [ [ "Now let's examine the heat map of the attributions for the end position prediction. In the case of end position prediction we again observe high attribution scores for the token `what` in the last 11 layers.\nThe correctly predicted end token `kinds` has positive attribution across all layers and it is especially prominent in the last two layers.", "_____no_output_____" ] ], [ [ "fig, ax = plt.subplots(figsize=(15,5))\n\nxticklabels=all_tokens\nyticklabels=list(range(1,13))\nax = sns.heatmap(np.array(layer_attrs_end), xticklabels=xticklabels, yticklabels=yticklabels, linewidth=0.2) #, annot=True\nplt.xlabel('Tokens')\nplt.ylabel('Layers')\n\nplt.show()", "_____no_output_____" ] ], [ [ "It is interesting to note that when we compare the heat maps of start and end position, overall the colors for start position prediction on the map have darker intensities. This implies that there are less tokens that attribute positively to the start position prediction and there are more tokens which are negative indicators or signals of start position prediction.", "_____no_output_____" ], [ "Now let's dig deeper into specific tokens and look into the distribution of attributions per layer for the token `kinds` in the start and end positions. The box plot diagram below shows the presence of outliers especially in the first four layers and in layer 8. We also observe that for start position prediction interquartile range slowly decreases as we go deeper into the layers and finally it is dimishing.\n\n", "_____no_output_____" ] ], [ [ "fig, ax = plt.subplots(figsize=(20,10))\nax = sns.boxplot(data=layer_attrs_start_dist)\nplt.xlabel('Layers')\nplt.ylabel('Attribution')\nplt.show()", "_____no_output_____" ] ], [ [ "Now let's plot same distribution but for the prediction of the end position. Here attribution has larger positive values across all layers and the interquartile range doesn't change much when moving deeper into the layers.", "_____no_output_____" ] ], [ [ "fig, ax = plt.subplots(figsize=(20,10))\nax = sns.boxplot(data=layer_attrs_end_dist)\nplt.xlabel('Layers')\nplt.ylabel('Attribution')\nplt.show()", "_____no_output_____" ] ], [ [ "Now, let's remove interpretation hooks, since we finished interpretation at this point", "_____no_output_____" ] ], [ [ "remove_interpretable_embedding_layer(model, interpretable_embedding)", "_____no_output_____" ] ], [ [ "In addition to that we can also look into the distribution of attributions in each layer for any input token. This will help us to better understand and compare the distributional patterns of attributions across multiple layers. We can for example represent attributions as a probability density function (pdf) and compute the entropy of it in order to estimate the entropy of attributions in each layer. This can be easily computed using a histogram.", "_____no_output_____" ] ], [ [ "def pdf_attr(attrs, bins=100):\n return np.histogram(attrs, bins=bins, density=True)[0]", "_____no_output_____" ] ], [ [ "In this particular case let's compute the pdf for the attributions at end positions `kinds`. We can however do it for all tokens.\n\nWe will compute and visualize the pdfs and entropies using Shannon's Entropy measure for each layer for token `kinds`.", "_____no_output_____" ] ], [ [ "layer_attrs_end_pdf = map(lambda layer_attrs_end_dist: pdf_attr(layer_attrs_end_dist), layer_attrs_end_dist)\nlayer_attrs_end_pdf = np.array(list(layer_attrs_end_pdf))\n\n# summing attribution along embedding diemension for each layer\n# size: #layers\nattr_sum = np.array(layer_attrs_end_dist).sum(-1)\n\n# size: #layers\nlayer_attrs_end_pdf_norm = np.linalg.norm(layer_attrs_end_pdf, axis=-1, ord=1)\n\n#size: #bins x #layers\nlayer_attrs_end_pdf = np.transpose(layer_attrs_end_pdf)\n\n#size: #bins x #layers\nlayer_attrs_end_pdf = np.divide(layer_attrs_end_pdf, layer_attrs_end_pdf_norm, where=layer_attrs_end_pdf_norm!=0)", "_____no_output_____" ] ], [ [ "The plot below visualizes the probability mass function (pmf) of attributions for each layer for the end position token `kinds`. From the plot we can observe that the distributions are taking bell-curved shapes with different means and variances.\nWe can now use attribution pdfs to compute entropies in the next cell.", "_____no_output_____" ] ], [ [ "fig, ax = plt.subplots(figsize=(20,10))\nplt.plot(layer_attrs_end_pdf)\nplt.xlabel('Bins')\nplt.ylabel('Density')\nplt.legend(['Layer '+ str(i) for i in range(1,13)])\nplt.show()", "_____no_output_____" ] ], [ [ "Below we calculate and visualize attribution entropies based on Shannon entropy measure where the x-axis corresponds to the number of layers and the y-axis corresponds to the total attribution in that layer. The size of the circles for each (layer, total_attribution) pair correspond to the normalized entropy value at that point.\n\nIn this particular example, we observe that the entropy doesn't change much from layer to layer, however in a general case entropy can provide us an intuition about the distributional characteristics of attributions in each layer and can be useful especially when comparing it across multiple tokens.\n", "_____no_output_____" ] ], [ [ "fig, ax = plt.subplots(figsize=(20,10))\n\n# replacing 0s with 1s. np.log(1) = 0 and np.log(0) = -inf\nlayer_attrs_end_pdf[layer_attrs_end_pdf == 0] = 1\nlayer_attrs_end_pdf_log = np.log2(layer_attrs_end_pdf)\n\n# size: #layers\nentropies= -(layer_attrs_end_pdf * layer_attrs_end_pdf_log).sum(0)\n\nplt.scatter(np.arange(12), attr_sum, s=entropies * 100)\nplt.xlabel('Layers')\nplt.ylabel('Total Attribution')\nplt.show()", "_____no_output_____" ] ], [ [ "In the Part 2 of this tutorial we will to go deeper into attention layers, heads and compare the attributions with the attention weight matrices, study and discuss related statistics.", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ] ]
e7e2c856520828e81bdfa488cf290f32e35bf8c6
13,642
ipynb
Jupyter Notebook
spk_vq_cae.ipynb
tong-wu-umn/spike-compression-autoencoder
83746fbe21c6c8c06291b5ddb0cdf7f37ed00b3d
[ "Apache-2.0" ]
4
2020-03-12T09:22:55.000Z
2020-11-25T19:53:40.000Z
spk_vq_cae.ipynb
tong-wu-umn/spike-compression-autoencoder
83746fbe21c6c8c06291b5ddb0cdf7f37ed00b3d
[ "Apache-2.0" ]
null
null
null
spk_vq_cae.ipynb
tong-wu-umn/spike-compression-autoencoder
83746fbe21c6c8c06291b5ddb0cdf7f37ed00b3d
[ "Apache-2.0" ]
null
null
null
30.450893
129
0.55747
[ [ [ "from __future__ import print_function\nimport numpy as np\nimport time\nimport matplotlib.pyplot as plt\nimport line_profiler\nimport scipy.io as sio\nimport math\nimport collections\n\nimport torch\nfrom torch import optim\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\nfrom torch.utils.data import Dataset, DataLoader, RandomSampler, BatchSampler\nfrom sklearn.metrics import mean_squared_error\n\nfrom model.model_v2 import spk_vq_vae_resnet\nfrom model.utils import SpikeDataset\n\ngpu = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")", "_____no_output_____" ] ], [ [ "## Parameter Configuration", "_____no_output_____" ] ], [ [ "# %% global parameters\nspk_ch = 4\nspk_dim = 64 # for Wave_Clus\n# spk_dim = 48 # for HC1 and Neuropixels\nlog_interval = 10\nbeta = 0.15\nvq_num = 128\ncardinality = 32\ndropRate = 0.2\nbatch_size = 48\ntest_batch_size = 1000\n\n\"\"\"\norg_dim = param[0]\nconv1_ch = param[1]\nconv2_ch = param[2]\nconv0_ker = param[3]\nconv1_ker = param[4]\nconv2_ker = param[5]\nself.vq_dim = param[6]\nself.vq_num = param[7]\ncardinality = param[8]\ndropRate = param[9]\n\"\"\"\nparam_resnet_v2 = [spk_ch, 256, 16, 1, 3, 1, int(spk_dim/4), vq_num, cardinality, dropRate]", "_____no_output_____" ] ], [ [ "## Preparing data loaders", "_____no_output_____" ] ], [ [ "noise_file = './data/noisy_spks.mat'\nclean_file = './data/clean_spks.mat'\n\nargs = collections.namedtuple\n\n# training set purposely distorted to train denoising autoencoder\nargs.data_path = noise_file\nargs.train_portion = .5\nargs.train_mode = True\ntrain_noise = SpikeDataset(args)\n\n# clean dataset for training\nargs.data_path = clean_file\nargs.train_portion = .5\nargs.train_mode = True\ntrain_clean = SpikeDataset(args)\n\n# noisy datast for training\nargs.data_path = noise_file\nargs.train_portion = .5\nargs.train_mode = False\ntest_noise = SpikeDataset(args)\n\n# clean dataset for testing\nargs.data_path = clean_file\nargs.train_portion = .5\nargs.train_mode = False\ntest_clean = SpikeDataset(args)\n\nbatch_cnt = int(math.ceil(len(train_noise) / batch_size))\n\n# normalization\nd_mean, d_std = train_clean.get_normalizer()\n\ntrain_clean.apply_norm(d_mean, d_std)\ntrain_noise.apply_norm(d_mean, d_std)\ntest_clean.apply_norm(d_mean, d_std)\ntest_noise.apply_norm(d_mean, d_std)", "_____no_output_____" ] ], [ [ "## Model definition", "_____no_output_____" ] ], [ [ "# %% create model\nmodel = spk_vq_vae_resnet(param_resnet_v2).to(gpu)\n\n# %% loss and optimization function\ndef loss_function(recon_x, x, commit_loss, vq_loss):\n recon_loss = F.mse_loss(recon_x, x, reduction='sum')\n return recon_loss + beta * commit_loss + vq_loss, recon_loss\n\noptimizer = optim.Adam(model.parameters(), lr=1e-3, weight_decay=1e-4, amsgrad=True)", "_____no_output_____" ], [ "def train(epoch):\n model.train()\n train_loss = 0\n batch_sampler = BatchSampler(RandomSampler(range(len(train_noise))), batch_size=batch_size, drop_last=False)\n for batch_idx, ind in enumerate(batch_sampler):\n in_data = train_noise[ind].to(gpu)\n out_data = train_clean[ind].to(gpu)\n\n optimizer.zero_grad()\n recon_batch, commit_loss, vq_loss = model(in_data)\n loss, recon_loss = loss_function(recon_batch, out_data, commit_loss, vq_loss)\n loss.backward(retain_graph=True)\n model.bwd()\n optimizer.step()\n \n train_loss += recon_loss.item() / (spk_dim * spk_ch)\n if batch_idx % log_interval == 0:\n print('Train Epoch: {} [{}/{} ({:.0f}%)]\\tLoss: {:.4f}'.format(\n epoch, batch_idx * len(in_data), len(train_noise),\n 100. * batch_idx / batch_cnt, recon_loss.item()))\n \n average_train_loss = train_loss / len(train_noise)\n print('====> Epoch: {} Average train loss: {:.5f}'.format(\n epoch, average_train_loss))\n return average_train_loss", "_____no_output_____" ], [ "# model logging\nbest_val_loss = 10\ncur_train_loss = 1\ndef save_model(val_loss, train_loss):\n\tglobal best_val_loss, cur_train_loss\n\tif val_loss < best_val_loss:\n\t\tbest_val_loss = val_loss\n\t\tcur_train_loss = train_loss\n\t\ttorch.save(model.state_dict(), './spk_vq_vae_temp.pt')", "_____no_output_____" ], [ "def test(epoch, test_mode=True):\n if test_mode:\n model.eval()\n model.embed_reset()\n test_loss = 0\n recon_sig = torch.rand(1, spk_ch, spk_dim)\n org_sig = torch.rand(1, spk_ch, spk_dim)\n with torch.no_grad():\n batch_sampler = BatchSampler(RandomSampler(range(len(test_noise))), batch_size=test_batch_size, drop_last=False)\n for batch_idx, ind in enumerate(batch_sampler):\n in_data = test_noise[ind].to(gpu)\n out_data = test_clean[ind].to(gpu)\n\n recon_batch, commit_loss, vq_loss = model(in_data)\n _, recon_loss = loss_function(recon_batch, out_data, commit_loss, vq_loss)\n \n recon_sig = torch.cat((recon_sig, recon_batch.data.cpu()), dim=0)\n org_sig = torch.cat((org_sig, out_data.data.cpu()), dim=0)\n \n test_loss += recon_loss.item() / (spk_dim * spk_ch)\n\n average_test_loss = test_loss / len(test_noise)\n print('====> Epoch: {} Average test loss: {:.5f}'.format(\n epoch, average_test_loss))\n\n if epoch % 10 == 0:\n plt.figure(figsize=(7,5))\n plt.bar(np.arange(vq_num), model.embed_freq / model.embed_freq.sum())\n plt.ylabel('Probability of Activation', fontsize=16)\n plt.xlabel('Index of codewords', fontsize=16)\n plt.show()\n\n return average_test_loss, recon_sig[1:], org_sig[1:]", "_____no_output_____" ] ], [ [ "## Training", "_____no_output_____" ] ], [ [ "train_loss_history = []\ntest_loss_history = []\n\nepochs = 500\nstart_time = time.time()\n\nfor epoch in range(1, epochs + 1):\n train_loss = train(epoch)\n test_loss, _, _ = test(epoch)\n save_model(test_loss, train_loss)\n \n train_loss_history.append(train_loss)\n test_loss_history.append(test_loss)\n \nprint(\"--- %s seconds ---\" % (time.time() - start_time))\nprint('Minimal train/testing losses are {:.4f} and {:.4f} with index {}\\n'\n .format(cur_train_loss, best_val_loss, test_loss_history.index(min(test_loss_history))))\n\n# plot train and test loss history over epochs\nplt.figure(1)\nepoch_axis = range(1, len(train_loss_history) + 1)\nplt.plot(epoch_axis, train_loss_history, 'bo')\nplt.plot(epoch_axis, test_loss_history, 'b+')\nplt.xlabel('Epochs')\nplt.ylabel('Loss')\nplt.show()", "_____no_output_____" ] ], [ [ "## Result evaluation", "_____no_output_____" ], [ "### a. Visualization of mostly used VQ vectors", "_____no_output_____" ] ], [ [ "# select the best performing model\nmodel.load_state_dict(torch.load('./spk_vq_vae_temp.pt'))\n\nembed_idx = np.argsort(model.embed_freq)\nembed_sort = model.embed.weight.data.cpu().numpy()[embed_idx]\n\n# Visualizing activation pattern of VQ codes on testing dataset (the first 8 mostly activated)\nplt.figure()\nn_row, n_col = 1, 8\nf, axarr = plt.subplots(n_row, n_col, figsize=(n_col*2, n_row*2))\nfor i in range(8):\n axarr[i].plot(embed_sort[i], 'r')\n axarr[i].axis('off')\nplt.show()", "_____no_output_____" ] ], [ [ "### b. Compression ratio", "_____no_output_____" ] ], [ [ "# %% spike recon\ntrain_mean, train_std = torch.from_numpy(d_mean), torch.from_numpy(d_std)\n_, val_spks, test_spks = test(10)\n\n# calculate compression ratio\nvq_freq = model.embed_freq / sum(model.embed_freq)\nvq_freq = vq_freq[vq_freq != 0]\nvq_log2 = np.log2(vq_freq)\nbits = -sum(np.multiply(vq_freq, vq_log2))\ncr = spk_ch * spk_dim * 16 / (param_resnet_v2[2] * bits)\nprint('compression ratio is {:.2f} with {:.2f}-bit.'.format(cr, bits))", "_____no_output_____" ] ], [ [ "### c. MSE error", "_____no_output_____" ] ], [ [ "recon_spks = val_spks * train_std + train_mean\ntest_spks_v2 = test_spks * train_std + train_mean\n\nrecon_spks = recon_spks.view(-1, spk_dim)\ntest_spks_v2 = test_spks_v2.view(-1, spk_dim)\n\nrecon_err = torch.norm(recon_spks-test_spks_v2, p=2, dim=1) / torch.norm(test_spks_v2, p=2, dim=1)\n\nprint('mean of recon_err is {:.4f}'.format(torch.mean(recon_err)))\nprint('std of recon_err is {:.4f}'.format(torch.std(recon_err)))", "_____no_output_____" ] ], [ [ "### d. SNDR of reconstructed spikes", "_____no_output_____" ] ], [ [ "recon_spks_new = recon_spks.numpy()\ntest_spks_new = test_spks_v2.numpy()\n\ndef cal_sndr(org_data, recon_data):\n org_norm = np.linalg.norm(org_data, axis=1)\n err_norm = np.linalg.norm(org_data-recon_data, axis=1)\n return np.mean(20*np.log10(org_norm / err_norm)), np.std(20*np.log10(org_norm / err_norm))\n\ncur_sndr, sndr_std = cal_sndr(test_spks_new, recon_spks_new)\nprint('SNDR is {:.4f} with std {:.4f}'.format(cur_sndr, sndr_std))", "_____no_output_____" ] ], [ [ "### e. Visualization of reconstructed spikes chosen at random", "_____no_output_____" ] ], [ [ "rand_val_idx = np.random.permutation(len(recon_spks_new))\n\nplt.figure()\nn_row, n_col = 3, 8\nspks_to_show = test_spks_new[rand_val_idx[:n_row*n_col]]\nymax, ymin = np.amax(spks_to_show), np.amin(spks_to_show)\nf, axarr = plt.subplots(n_row, n_col, figsize=(n_col*3, n_row*3))\nfor i in range(n_row):\n for j in range(n_col):\n axarr[i, j].plot(recon_spks_new[rand_val_idx[i*n_col+j]], 'r')\n axarr[i, j].plot(test_spks_new[rand_val_idx[i*n_col+j]], 'b')\n axarr[i, j].set_ylim([ymin*1.1, ymax*1.1])\n axarr[i, j].axis('off')\nplt.show()", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e2cb7a740160f932e1b9659282f084bb868199
4,688
ipynb
Jupyter Notebook
notebooks/local-notebooks/Email-Parsing.ipynb
DrSnowbird/tensorflow-python3-jupyter
54af80e1e401e7e8254fdd15f8d35795b6360710
[ "Apache-2.0" ]
10
2018-12-08T02:56:41.000Z
2022-03-09T09:25:03.000Z
notebooks/local-notebooks/Email-Parsing.ipynb
DrSnowbird/conda-nonroot-docker
ee4ecc7f4060c22c69cd01ae5114094f8781afc3
[ "Apache-2.0" ]
1
2020-01-07T06:27:59.000Z
2020-04-04T17:06:05.000Z
notebooks/local-notebooks/Email-Parsing.ipynb
DrSnowbird/conda-nonroot-docker
ee4ecc7f4060c22c69cd01ae5114094f8781afc3
[ "Apache-2.0" ]
3
2019-09-23T04:53:26.000Z
2022-03-10T06:05:13.000Z
63.351351
1,202
0.643558
[ [ [ "import email\n\n#msg = email.message_from_string(myString) \n\nf = open('/data/inbox/1.', 'w')\nmsg = email.message_from_file(f)\nf.close()\n\nparser = email.parser.HeaderParser()\nheaders = parser.parsestr(msg.as_string())\n\nfor h in headers.items():\n print(h)", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code" ] ]
e7e2d39e9e33a4e63d7f73beff6a5a9e266c9bf1
15,400
ipynb
Jupyter Notebook
demo/tentative/demo_centre-building.ipynb
suflaj/nemesys
669fd4fd2e27d1923930643b9b2bed9e1ed600f3
[ "Apache-2.0" ]
null
null
null
demo/tentative/demo_centre-building.ipynb
suflaj/nemesys
669fd4fd2e27d1923930643b9b2bed9e1ed600f3
[ "Apache-2.0" ]
23
2021-10-21T00:46:22.000Z
2022-01-04T00:11:44.000Z
demo/tentative/demo_centre-building.ipynb
suflaj/nemesys
669fd4fd2e27d1923930643b9b2bed9e1ed600f3
[ "Apache-2.0" ]
null
null
null
21.300138
183
0.501948
[ [ [ "# Neural Memory System - Centre building", "_____no_output_____" ], [ "## Environment setup", "_____no_output_____" ] ], [ [ "import os\nfrom pathlib import Path", "_____no_output_____" ], [ "CURRENT_FOLDER = Path(os.getcwd())", "_____no_output_____" ], [ "CD_KEY = \"--CENTRE_BUILDING_DEMO_IN_ROOT\"\n\nif (\n CD_KEY not in os.environ\n or os.environ[CD_KEY] is None\n or len(os.environ[CD_KEY]) == 0\n or os.environ[CD_KEY] == \"false\"\n):\n %cd -q ../../..\n \n ROOT_FOLDER = Path(os.getcwd()).relative_to(os.getcwd())\n CURRENT_FOLDER = CURRENT_FOLDER.relative_to(ROOT_FOLDER.absolute())\n \nos.environ[CD_KEY] = \"true\"", "_____no_output_____" ], [ "print(f\"Root folder: {ROOT_FOLDER}\")\nprint(f\"Current folder: {CURRENT_FOLDER}\")", "Root folder: .\nCurrent folder: nemesys/demo/tentative\n" ] ], [ [ "## Modules", "_____no_output_____" ] ], [ [ "from itertools import product\nimport math\nimport struct\n\nimport numpy as np\nimport torch\nimport torch.nn\n\nfrom nemesys.hashing.minhashing.numpy_minhash import NumPyMinHash\nfrom nemesys.modelling.analysers.modules.pytorch_analyser_lstm import PyTorchAnalyserLSTM\nfrom nemesys.modelling.decoders.modules.pytorch_decoder_conv2d import PyTorchDecoderConv2D\nfrom nemesys.modelling.encoders.modules.pytorch_encoder_linear import PyTorchEncoderLinear\nfrom nemesys.modelling.routers.concatenation.minhash.minhash_concatenation_router import (\n MinHashConcatenationRouter\n)\nfrom nemesys.modelling.stores.pytorch_list_store import PyTorchListStore\nfrom nemesys.modelling.synthesisers.modules.pytorch_synthesiser_linear import PyTorchSynthesiserLinear", "_____no_output_____" ], [ "torch.set_printoptions(sci_mode=False)", "_____no_output_____" ] ], [ [ "## Components setup", "_____no_output_____" ], [ "### Sizes", "_____no_output_____" ] ], [ [ "EMBEDDING_SIZE = 4", "_____no_output_____" ], [ "ANALYSER_CLASS_NAMES = (\"statement\",)\nANALYSER_OUTPUT_SIZE = EMBEDDING_SIZE", "_____no_output_____" ], [ "ENCODER_OUTPUT_SIZE = 3", "_____no_output_____" ], [ "DECODER_IN_CHANNELS = 1\nDECODER_OUT_CHANNELS = 3\nDECODER_KERNEL_SIZE = (1, ENCODER_OUTPUT_SIZE)", "_____no_output_____" ], [ "MINHASH_N_PERMUTATIONS = 4\nMINHASH_SEED = 0", "_____no_output_____" ] ], [ [ "### Embedding setup", "_____no_output_____" ] ], [ [ "allowed_letters = [chr(x) for x in range(ord(\"A\"), ord(\"Z\") + 1)]\nvocabulary = [\"\".join(x) for x in product(*([allowed_letters] * 3))]\nword_to_index = {word: i for i, word in enumerate(vocabulary)}", "_____no_output_____" ], [ "embedding = torch.nn.Embedding(\n num_embeddings=len(word_to_index),\n embedding_dim=EMBEDDING_SIZE,\n max_norm=math.sqrt(EMBEDDING_SIZE),\n)", "_____no_output_____" ] ], [ [ "### Analyser setup", "_____no_output_____" ] ], [ [ "analyser = PyTorchAnalyserLSTM(\n class_names=ANALYSER_CLASS_NAMES,\n input_size=EMBEDDING_SIZE,\n hidden_size=ANALYSER_OUTPUT_SIZE,\n batch_first=True,\n)", "_____no_output_____" ] ], [ [ "### Encoder setup", "_____no_output_____" ] ], [ [ "encoder = PyTorchEncoderLinear(\n in_features=ANALYSER_OUTPUT_SIZE,\n out_features=ENCODER_OUTPUT_SIZE,\n content_key=\"content\",\n)", "_____no_output_____" ] ], [ [ "### Store setup", "_____no_output_____" ] ], [ [ "store = PyTorchListStore()", "_____no_output_____" ] ], [ [ "### Decoder setup", "_____no_output_____" ] ], [ [ "decoder = PyTorchDecoderConv2D(\n in_channels = DECODER_IN_CHANNELS,\n out_channels = DECODER_OUT_CHANNELS,\n kernel_size = DECODER_KERNEL_SIZE,\n)", "_____no_output_____" ] ], [ [ "### Router setup", "_____no_output_____" ], [ "#### MinHash setup", "_____no_output_____" ] ], [ [ "def tensor_to_numpy(x: torch.Tensor):\n x = x.reshape((x.shape[0], -1)) # Preserve batches\n x = np.array(x, dtype=np.float32)\n \n return x\n\n\ndef preprocess_function(element):\n element_as_bytes = struct.pack(\"<f\", float(element))\n element_as_int = np.fromstring(\n element_as_bytes, dtype=np.uint32\n ).astype(np.uint64)[0]\n\n return element_as_int\n\ndef numpy_to_tensor(x: np.ndarray):\n x_floats = np.vectorize(lambda x: x / ((2 ** 32) - 1))(x)\n \n return torch.tensor(x_floats, dtype=torch.float32)", "_____no_output_____" ], [ "minhash = NumPyMinHash(\n n_permutations=MINHASH_N_PERMUTATIONS,\n seed=MINHASH_SEED,\n preprocess_function=preprocess_function,\n)", "_____no_output_____" ] ], [ [ "#### Continuing router setup", "_____no_output_____" ] ], [ [ "router = MinHashConcatenationRouter(minhash_instance=minhash)", "_____no_output_____" ] ], [ [ "### Synthesiser setup", "_____no_output_____" ], [ "## Runs", "_____no_output_____" ], [ "### Data preparation", "_____no_output_____" ] ], [ [ "inputs = [\"AAA\", \"ABA\", \"BDC\"]\nhas_a = [1 if \"A\" in x else 0 for x in inputs]", "_____no_output_____" ], [ "input_indices = [word_to_index[word] for word in inputs]\ninput_indices = torch.tensor(input_indices)\nprint(input_indices)", "tensor([ 0, 26, 756])\n" ], [ "output_tensor = torch.tensor(has_a)\nprint(output_tensor)", "tensor([1, 1, 0])\n" ] ], [ [ "### Embedding run", "_____no_output_____" ] ], [ [ "embeddings = embedding(input_indices)\nprint(embeddings)", "tensor([[ 0.0733, 1.6564, 0.0727, 1.0186],\n [ 0.3968, -0.2372, -1.5747, -0.4124],\n [ 0.2069, 0.6105, -0.5933, -0.8433]], grad_fn=<EmbeddingBackward>)\n" ] ], [ [ "### Analyser run", "_____no_output_____" ] ], [ [ "analyser_output = analyser(embeddings.reshape(len(inputs), 1, -1))\n\nfor class_name in ANALYSER_CLASS_NAMES:\n print(f\"{class_name}:\")\n print(analyser_output[class_name][\"content\"])", "statement:\ntensor([[ 0.0044, 0.1220, -0.0175, -0.2743],\n [-0.0601, -0.0471, -0.1271, 0.2379],\n [-0.1024, 0.0011, -0.0486, 0.1101]], grad_fn=<IndexBackward>)\n" ] ], [ [ "### Encoder run", "_____no_output_____" ] ], [ [ "encoder_output = encoder(analyser_output[\"statement\"])\nprint(encoder_output)", "{'content': tensor([[ 0.1218, -0.0339, 0.0212],\n [-0.0465, 0.0300, 0.0055],\n [-0.0192, -0.0080, 0.0010]], grad_fn=<MmBackward>)}\n" ] ], [ [ "### Store run", "_____no_output_____" ] ], [ [ "store.append(encoder_output[\"content\"])\nprint(store)", "[tensor([[ 0.1218, -0.0339, 0.0212],\n [-0.0465, 0.0300, 0.0055],\n [-0.0192, -0.0080, 0.0010]])]\n" ] ], [ [ "### Decoder run", "_____no_output_____" ] ], [ [ "decoder_output = decoder(store)\nprint(decoder_output)", "{'content': tensor([[[[ 0.4530],\n [ 0.5088],\n [ 0.4872]],\n\n [[ 0.4030],\n [ 0.4953],\n [ 0.4768]],\n\n [[-0.1114],\n [-0.0418],\n [-0.0639]]]], grad_fn=<ThnnConv2DBackward>)}\n" ] ], [ [ "### Router run", "_____no_output_____" ] ], [ [ "router_input = decoder_output[\"content\"].squeeze(dim=0)", "_____no_output_____" ], [ "router_output = router(router_input)", "/tmp/ipykernel_27340/3174470834.py:10: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead\n element_as_int = np.fromstring(\n" ], [ "router_output = numpy_to_tensor(router_output)\nprint(router_output)", "tensor([[0.4881, 0.8373, 0.6695, 0.0170, 0.7944, 0.6838, 0.8554, 0.2267, 0.2587,\n 0.0597, 0.3019, 0.7954],\n [0.8945, 0.7646, 0.3306, 0.5174, 0.5584, 0.1036, 0.1118, 0.1061, 0.2825,\n 0.2752, 0.6448, 0.2994],\n [0.9799, 0.3582, 0.8451, 0.7665, 0.2921, 0.9583, 0.6857, 0.8045, 0.6184,\n 0.1507, 0.1753, 0.6196]])\n" ] ], [ [ "### Synthesiser run", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ] ]
e7e2dfd26469131c297b433d5b28f8aa76c056b5
19,325
ipynb
Jupyter Notebook
00_quickstart/09_Detect_Model_Bias_Clarify.ipynb
MarcusFra/workshop
83f16d41f5e10f9c23242066f77a14bb61ac78d7
[ "Apache-2.0" ]
2,327
2020-03-01T09:47:34.000Z
2021-11-25T12:38:42.000Z
00_quickstart/09_Detect_Model_Bias_Clarify.ipynb
MarcusFra/workshop
83f16d41f5e10f9c23242066f77a14bb61ac78d7
[ "Apache-2.0" ]
209
2020-03-01T17:14:12.000Z
2021-11-08T20:35:42.000Z
00_quickstart/09_Detect_Model_Bias_Clarify.ipynb
MarcusFra/workshop
83f16d41f5e10f9c23242066f77a14bb61ac78d7
[ "Apache-2.0" ]
686
2020-03-03T17:24:51.000Z
2021-11-25T23:39:12.000Z
28.973013
381
0.588719
[ [ [ "# Detect Model Bias with Amazon SageMaker Clarify", "_____no_output_____" ], [ "\n## Amazon Science: _[How Clarify helps machine learning developers detect unintended bias](https://www.amazon.science/latest-news/how-clarify-helps-machine-learning-developers-detect-unintended-bias)_ \n\n[<img src=\"img/amazon_science_clarify.png\" width=\"100%\" align=\"left\">](https://www.amazon.science/latest-news/how-clarify-helps-machine-learning-developers-detect-unintended-bias)", "_____no_output_____" ], [ "# Terminology\n\n* **Bias**: \nAn imbalance in the training data or the prediction behavior of the model across different groups, such as age or income bracket. Biases can result from the data or algorithm used to train your model. For instance, if an ML model is trained primarily on data from middle-aged individuals, it may be less accurate when making predictions involving younger and older people.\n\n* **Bias metric**: \nA function that returns numerical values indicating the level of a potential bias.\n\n* **Bias report**:\nA collection of bias metrics for a given dataset, or a combination of a dataset and a model.\n\n* **Label**:\nFeature that is the target for training a machine learning model. Referred to as the observed label or observed outcome.\n\n* **Positive label values**:\nLabel values that are favorable to a demographic group observed in a sample. In other words, designates a sample as having a positive result.\n\n* **Negative label values**:\nLabel values that are unfavorable to a demographic group observed in a sample. In other words, designates a sample as having a negative result.\n\n* **Facet**:\nA column or feature that contains the attributes with respect to which bias is measured.\n\n* **Facet value**:\nThe feature values of attributes that bias might favor or disfavor.", "_____no_output_____" ], [ "# Posttraining Bias Metrics\nhttps://docs.aws.amazon.com/sagemaker/latest/dg/clarify-measure-post-training-bias.html\n\n* **Difference in Positive Proportions in Predicted Labels (DPPL)**:\nMeasures the difference in the proportion of positive predictions between the favored facet a and the disfavored facet d.\n\n* **Disparate Impact (DI)**:\nMeasures the ratio of proportions of the predicted labels for the favored facet a and the disfavored facet d.\n\n* **Difference in Conditional Acceptance (DCAcc)**:\nCompares the observed labels to the labels predicted by a model and assesses whether this is the same across facets for predicted positive outcomes (acceptances).\n\n* **Difference in Conditional Rejection (DCR)**:\nCompares the observed labels to the labels predicted by a model and assesses whether this is the same across facets for negative outcomes (rejections).\n\n* **Recall Difference (RD)**:\nCompares the recall of the model for the favored and disfavored facets.\n\n* **Difference in Acceptance Rates (DAR)**:\nMeasures the difference in the ratios of the observed positive outcomes (TP) to the predicted positives (TP + FP) between the favored and disfavored facets.\n\n* **Difference in Rejection Rates (DRR)**:\nMeasures the difference in the ratios of the observed negative outcomes (TN) to the predicted negatives (TN + FN) between the disfavored and favored facets.\n\n* **Accuracy Difference (AD)**:\nMeasures the difference between the prediction accuracy for the favored and disfavored facets.\n\n* **Treatment Equality (TE)**:\nMeasures the difference in the ratio of false positives to false negatives between the favored and disfavored facets.\n\n* **Conditional Demographic Disparity in Predicted Labels (CDDPL)**:\nMeasures the disparity of predicted labels between the facets as a whole, but also by subgroups.\n\n* **Counterfactual Fliptest (FT)**:\nExamines each member of facet d and assesses whether similar members of facet a have different model predictions.\n", "_____no_output_____" ] ], [ [ "import boto3\nimport sagemaker\nimport pandas as pd\nimport numpy as np\n\nsess = sagemaker.Session()\nbucket = sess.default_bucket()\nregion = boto3.Session().region_name\n\nimport botocore.config\n\nconfig = botocore.config.Config(\n user_agent_extra='dsoaws/1.0'\n)\n\nsm = boto3.Session().client(service_name=\"sagemaker\", \n region_name=region,\n config=config)", "_____no_output_____" ], [ "%store -r role", "_____no_output_____" ], [ "import matplotlib.pyplot as plt\n\n%matplotlib inline\n%config InlineBackend.figure_format='retina'", "_____no_output_____" ] ], [ [ "# Test data for bias\n\nWe created test data in JSONLines format to match the model inputs. ", "_____no_output_____" ] ], [ [ "test_data_bias_path = \"./data-clarify/test_data_bias.jsonl\"", "_____no_output_____" ], [ "!head -n 1 $test_data_bias_path", "_____no_output_____" ] ], [ [ "### Upload the data", "_____no_output_____" ] ], [ [ "test_data_bias_s3_uri = sess.upload_data(bucket=bucket, key_prefix=\"bias/test_data_bias\", path=test_data_bias_path)\ntest_data_bias_s3_uri", "_____no_output_____" ], [ "!aws s3 ls $test_data_bias_s3_uri", "_____no_output_____" ], [ "%store test_data_bias_s3_uri", "_____no_output_____" ] ], [ [ "# Run Posttraining Model Bias Analysis", "_____no_output_____" ] ], [ [ "%store -r pipeline_name", "_____no_output_____" ], [ "print(pipeline_name)", "_____no_output_____" ], [ "%%time\n\nimport time\nfrom pprint import pprint\n\nexecutions_response = sm.list_pipeline_executions(PipelineName=pipeline_name)[\"PipelineExecutionSummaries\"]\npipeline_execution_status = executions_response[0][\"PipelineExecutionStatus\"]\nprint(pipeline_execution_status)\n\nwhile pipeline_execution_status == \"Executing\":\n try:\n executions_response = sm.list_pipeline_executions(PipelineName=pipeline_name)[\"PipelineExecutionSummaries\"]\n pipeline_execution_status = executions_response[0][\"PipelineExecutionStatus\"]\n except Exception as e:\n print(\"Please wait...\")\n time.sleep(30)\n\npprint(executions_response)", "_____no_output_____" ] ], [ [ "# List Pipeline Execution Steps\n", "_____no_output_____" ] ], [ [ "pipeline_execution_status = executions_response[0][\"PipelineExecutionStatus\"]\nprint(pipeline_execution_status)", "_____no_output_____" ], [ "pipeline_execution_arn = executions_response[0][\"PipelineExecutionArn\"]\nprint(pipeline_execution_arn)", "_____no_output_____" ], [ "from pprint import pprint\n\nsteps = sm.list_pipeline_execution_steps(PipelineExecutionArn=pipeline_execution_arn)\n\npprint(steps)", "_____no_output_____" ] ], [ [ "# View Created Model\n_Note: If the trained model did not pass the Evaluation step (> accuracy threshold), it will not be created._", "_____no_output_____" ] ], [ [ "for execution_step in steps[\"PipelineExecutionSteps\"]:\n if execution_step[\"StepName\"] == \"CreateModel\":\n model_arn = execution_step[\"Metadata\"][\"Model\"][\"Arn\"]\n break\nprint(model_arn)\n\npipeline_model_name = model_arn.split(\"/\")[-1]\nprint(pipeline_model_name)", "_____no_output_____" ] ], [ [ "# SageMakerClarifyProcessor", "_____no_output_____" ] ], [ [ "from sagemaker import clarify\n\nclarify_processor = clarify.SageMakerClarifyProcessor(\n role=role, \n instance_count=1, \n instance_type=\"ml.c5.2xlarge\", \n sagemaker_session=sess\n)", "_____no_output_____" ] ], [ [ "# Writing DataConfig and ModelConfig\nA `DataConfig` object communicates some basic information about data I/O to Clarify. We specify where to find the input dataset, where to store the output, the target column (`label`), the header names, and the dataset type.\n\nSimilarly, the `ModelConfig` object communicates information about your trained model and `ModelPredictedLabelConfig` provides information on the format of your predictions. \n\n**Note**: To avoid additional traffic to your production models, SageMaker Clarify sets up and tears down a dedicated endpoint when processing. `ModelConfig` specifies your preferred instance type and instance count used to run your model on during Clarify's processing.", "_____no_output_____" ], [ "## DataConfig", "_____no_output_____" ] ], [ [ "bias_report_prefix = \"bias/report-{}\".format(pipeline_model_name)\n\nbias_report_output_path = \"s3://{}/{}\".format(bucket, bias_report_prefix)\n\ndata_config = clarify.DataConfig(\n s3_data_input_path=test_data_bias_s3_uri,\n s3_output_path=bias_report_output_path,\n label=\"star_rating\",\n features=\"features\",\n # label must be last, features in exact order as passed into model\n headers=[\"review_body\", \"product_category\", \"star_rating\"],\n dataset_type=\"application/jsonlines\",\n)", "_____no_output_____" ] ], [ [ "## ModelConfig", "_____no_output_____" ] ], [ [ "model_config = clarify.ModelConfig(\n model_name=pipeline_model_name,\n instance_type=\"ml.m5.4xlarge\",\n instance_count=1,\n content_type=\"application/jsonlines\",\n accept_type=\"application/jsonlines\",\n # {\"features\": [\"the worst\", \"Digital_Software\"]}\n content_template='{\"features\":$features}',\n)", "_____no_output_____" ] ], [ [ "## _Note: `label` is set to the JSON key for the model prediction results_", "_____no_output_____" ] ], [ [ "predictions_config = clarify.ModelPredictedLabelConfig(label=\"predicted_label\")", "_____no_output_____" ] ], [ [ "## BiasConfig", "_____no_output_____" ] ], [ [ "bias_config = clarify.BiasConfig(\n label_values_or_threshold=[\n 5,\n 4,\n ], # needs to be int or str for continuous dtype, needs to be >1 for categorical dtype\n facet_name=\"product_category\",\n)", "_____no_output_____" ] ], [ [ "# Run Clarify Job", "_____no_output_____" ] ], [ [ "clarify_processor.run_post_training_bias(\n data_config=data_config,\n data_bias_config=bias_config,\n model_config=model_config,\n model_predicted_label_config=predictions_config,\n # methods='all', # FlipTest requires all columns to be numeric\n methods=[\"DPPL\", \"DI\", \"DCA\", \"DCR\", \"RD\", \"DAR\", \"DRR\", \"AD\", \"TE\"],\n wait=False,\n logs=False,\n)", "_____no_output_____" ], [ "run_post_training_bias_processing_job_name = clarify_processor.latest_job.job_name\nrun_post_training_bias_processing_job_name", "_____no_output_____" ], [ "from IPython.core.display import display, HTML\n\ndisplay(\n HTML(\n '<b>Review <a target=\"blank\" href=\"https://console.aws.amazon.com/sagemaker/home?region={}#/processing-jobs/{}\">Processing Job</a></b>'.format(\n region, run_post_training_bias_processing_job_name\n )\n )\n)", "_____no_output_____" ], [ "from IPython.core.display import display, HTML\n\ndisplay(\n HTML(\n '<b>Review <a target=\"blank\" href=\"https://console.aws.amazon.com/cloudwatch/home?region={}#logStream:group=/aws/sagemaker/ProcessingJobs;prefix={};streamFilter=typeLogStreamPrefix\">CloudWatch Logs</a> After About 5 Minutes</b>'.format(\n region, run_post_training_bias_processing_job_name\n )\n )\n)", "_____no_output_____" ], [ "from IPython.core.display import display, HTML\n\ndisplay(\n HTML(\n '<b>Review <a target=\"blank\" href=\"https://s3.console.aws.amazon.com/s3/buckets/{}?prefix={}/\">S3 Output Data</a> After The Processing Job Has Completed</b>'.format(\n bucket, bias_report_prefix\n )\n )\n)", "_____no_output_____" ], [ "from pprint import pprint\n\nrunning_processor = sagemaker.processing.ProcessingJob.from_processing_name(\n processing_job_name=run_post_training_bias_processing_job_name, sagemaker_session=sess\n)\n\nprocessing_job_description = running_processor.describe()\n\npprint(processing_job_description)", "_____no_output_____" ], [ "running_processor.wait(logs=False)", "_____no_output_____" ] ], [ [ "# Download Report From S3", "_____no_output_____" ] ], [ [ "!aws s3 ls $bias_report_output_path/", "_____no_output_____" ], [ "!aws s3 cp --recursive $bias_report_output_path ./generated_bias_report/", "_____no_output_____" ], [ "from IPython.core.display import display, HTML\n\ndisplay(HTML('<b>Review <a target=\"blank\" href=\"./generated_bias_report/report.html\">Bias Report</a></b>'))", "_____no_output_____" ] ], [ [ "# View Bias Report in Studio\nIn Studio, you can view the results under the experiments tab.\n\n<img src=\"img/bias_report.gif\">\n\nEach bias metric has detailed explanations with examples that you can explore.\n\n<img src=\"img/bias_detail.gif\">\n\nYou could also summarize the results in a handy table!\n\n<img src=\"img/bias_report_chart.gif\">", "_____no_output_____" ], [ "# Release Resources", "_____no_output_____" ] ], [ [ "%%html\n\n<p><b>Shutting down your kernel for this notebook to release resources.</b></p>\n<button class=\"sm-command-button\" data-commandlinker-command=\"kernelmenu:shutdown\" style=\"display:none;\">Shutdown Kernel</button>\n \n<script>\ntry {\n els = document.getElementsByClassName(\"sm-command-button\");\n els[0].click();\n}\ncatch(err) {\n // NoOp\n} \n</script>", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ], [ "code" ] ]
e7e2e25c47bc9d536a1d5dcd4a5128be5a6db558
13,607
ipynb
Jupyter Notebook
coles.ipynb
adambadge/coles-scraper
d388eabfc00e6e78002a28c69b66b825684df604
[ "MIT" ]
4
2020-10-27T23:49:21.000Z
2022-03-04T22:21:57.000Z
coles.ipynb
adambadge/coles-scraper
d388eabfc00e6e78002a28c69b66b825684df604
[ "MIT" ]
1
2020-07-16T03:37:41.000Z
2021-06-29T02:41:56.000Z
coles.ipynb
adambadge/coles-scraper
d388eabfc00e6e78002a28c69b66b825684df604
[ "MIT" ]
2
2020-11-29T03:45:45.000Z
2022-03-04T22:22:00.000Z
76.44382
714
0.593371
[ [ [ "import requests\n\nurl = 'https://api.coles.com.au/customer/v1/coles/products/search?limit=20&q=Drinks&start=40&storeId=7716&type=SKU'\nh = {\n'Accept-Encoding': 'gzip'\n,'Connection': 'keep-alive'\n,'Accept': '*/*' \n,'User-Agent': 'Shopmate/3.4.1 (iPhone; iOS 11.4.1; Scale/3.00)'\n,'X-Coles-API-Key': '046bc0d4-3854-481f-80dc-85f9e846503d'\n,'X-Coles-API-Secret': 'e6ab96ff-453b-45ba-a2be-ae8d7c12cadf'\n,'Accept-Language': 'en-AU;q=1'\n}\n\nr = requests.get(url, headers=h)", "_____no_output_____" ], [ "j = r.json()\n", "_____no_output_____" ], [ "results = j['Results']", "_____no_output_____" ], [ "print(len(results))", "20\n" ], [ "for x in results:\n print(x['Name'])", "Mango Juice\nLemonade Gazoz Drink\nPineapple Juice Box 250mL\n100% Apple Juice Box 200mL\nGuava Nectar Fruit Drink\nApricot Nectar Fruit Drink\nCranberry Fruit Drink\nLow Sugar Cranberry Drink\nCranberry Blueberry Drink\nTropical Fruit Drink\nOrange Fruit Drink\nCranberry Fruit Drink\nApple Fruit Drink\nTropical Fruit Drink Chilled\nChilled Orange Fruit Drink\nHot Lemon Drink\nCola Soft Drink\nProbiotic Drink Blueberry\nLychee Aloe Vera Drink\nAloe Vera Drink\n" ], [ "for value in results:\n print(value.values())", "dict_values([4978690, 'Natural Spring Water 600ml', '24 pack', 'Frantelle', '/customer/v1/coles/products/images/4978690.jpg', [{'Aisle': 'GROCERY', 'Order': 9999.0, 'Description': 'Grocery', 'AisleSide': None, 'Facing': 0, 'Shelf': 0, 'LayoutId': '0259', 'LayoutName': 'DRINKS - WATER'}, {'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0259', 'LayoutName': 'DRINKS - WATER'}], None, [{'Label': 'drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'Online 3'}}]])\ndict_values([7365777, 'Classic Can Soft Drink 24 pack', '375mL', 'Coca-Cola', '/customer/v1/coles/products/images/7365777.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Left', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0304', 'LayoutName': 'DRINKS - CANS BULK PACK'}], None, [{'Label': 'drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'Online 3'}}]])\ndict_values([7366022, 'Pepsi Max 375mL Cans Soft Drink', '24 pack', 'Schweppes', '/customer/v1/coles/products/images/7366022.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Left', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0304', 'LayoutName': 'DRINKS - CANS BULK PACK'}], [{'PromotionId': 173021527, 'Type': 'Value (Excl FP)', 'Description': '1/2 Price', 'Price': 10.5, 'WasPrice': 21.0, 'SaveAmount': 10.5, 'UnitPrice': '$1.17 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-08-08T00:00:00', 'EndDate': '2018-08-14T23:59:59', 'SavePercent': 50.0}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([9391574, 'Solo Lemon 375mL Cans Soft Drink', '24 pack', 'Schweppes', '/customer/v1/coles/products/images/9391574.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Left', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0304', 'LayoutName': 'DRINKS - CANS BULK PACK'}], [{'PromotionId': 173021559, 'Type': 'Value (Excl FP)', 'Description': '1/2 Price', 'Price': 10.5, 'WasPrice': 21.0, 'SaveAmount': 10.5, 'UnitPrice': '$1.17 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-08-08T00:00:00', 'EndDate': '2018-08-14T23:59:59', 'SavePercent': 50.0}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([2383341, 'Original Green Energy Drink 275mL Cans', '4 pack', 'V', '/customer/v1/coles/products/images/2383341.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], [{'PromotionId': 165505563, 'Type': 'Value (Excl FP)', 'Description': '30% Off', 'Price': 6.0, 'WasPrice': 9.35, 'SaveAmount': 3.35, 'UnitPrice': '$5.45 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-08-08T00:00:00', 'EndDate': '2018-08-14T23:59:59', 'SavePercent': 35.83}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([2894147, 'Guarana Energy Drink Fridge Pack', '10 pack', 'V', '/customer/v1/coles/products/images/2894147.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([7388750, 'Guava Energy Drink', '500mL', 'Rockstar', '/customer/v1/coles/products/images/7388750.jpg', None, None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([8464796, 'Classic Cans Soft Drink 30 pack', '375mL', 'Coca-Cola', '/customer/v1/coles/products/images/8464796.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Left', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0304', 'LayoutName': 'DRINKS - CANS BULK PACK'}], [{'PromotionId': 171861648, 'Type': 'Value (Excl FP)', 'Description': '40% Off', 'Price': 18.0, 'WasPrice': 34.45, 'SaveAmount': 16.45, 'UnitPrice': '$1.60 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-08-08T00:00:00', 'EndDate': '2018-08-14T23:59:59', 'SavePercent': 47.75}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([3190570, 'Pure 4x250ml', '4 pack', 'V Energy Drink', '/customer/v1/coles/products/images/3190570.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], [{'PromotionId': 165505647, 'Type': 'Value (Excl FP)', 'Description': '30% Off', 'Price': 6.0, 'WasPrice': 9.35, 'SaveAmount': 3.35, 'UnitPrice': '$6.00 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-08-08T00:00:00', 'EndDate': '2018-08-14T23:59:59', 'SavePercent': 35.83}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([3190569, 'Energy Drink Deadpool Can Limited Edition', '250mL', 'V', '/customer/v1/coles/products/images/3190569.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([3190580, 'Lewis Hamilton Grape', '500mL', 'Monster Energy', '/customer/v1/coles/products/images/3190580.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([2383363, 'Energy Drink Blue 4 x 275ml Cans', '4 pack', 'V', '/customer/v1/coles/products/images/2383363.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], [{'PromotionId': 165505631, 'Type': 'Value (Excl FP)', 'Description': '30% Off', 'Price': 6.0, 'WasPrice': 9.35, 'SaveAmount': 3.35, 'UnitPrice': '$5.45 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-08-08T00:00:00', 'EndDate': '2018-08-14T23:59:59', 'SavePercent': 35.83}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([1492443, 'Zero 250mL Cans Energy Drink 4 Pack', '4 pack', 'Red Bull', '/customer/v1/coles/products/images/1492443.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([3192495, 'Energy Drink 473mL', '4 pack', 'Red Bull', '/customer/v1/coles/products/images/3192495.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([2785017, 'Sugar Free Original Energy Drink Can', '473mL', 'Red Bull', '/customer/v1/coles/products/images/2785017.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([2785108, 'Zero Ultra Energy Drink Cans 4 Pack', '500ml', 'Monster', '/customer/v1/coles/products/images/2785108.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], [{'PromotionId': 172314178, 'Type': 'Value (Excl FP)', 'Description': '40% Off', 'Price': 7.0, 'WasPrice': 11.7, 'SaveAmount': 4.7, 'UnitPrice': '$3.50 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-08-08T00:00:00', 'EndDate': '2018-08-14T23:59:59', 'SavePercent': 40.17}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([2787147, 'Ultra Can Energy Drink', '500mL', 'Monster', '/customer/v1/coles/products/images/2787147.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([1492454, 'Zero Energy Drink Can', '250mL', 'Red Bull', '/customer/v1/coles/products/images/1492454.jpg', [{'Aisle': '6', 'Order': 6.0, 'Description': 'Aisle 6', 'AisleSide': 'Right', 'Facing': 0, 'Shelf': 0, 'LayoutId': '0256', 'LayoutName': 'DRINKS - LIFESTYLE'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([3269705, 'Tortured Orchard Raspberry Lemonade Energy Drink Can', '250mL', 'V', '/customer/v1/coles/products/images/3269705.jpg', [{'Aisle': None, 'Order': 9999.0, 'Description': None, 'AisleSide': None, 'Facing': 0, 'Shelf': 0, 'LayoutId': '0608', 'LayoutName': 'FLEX - FOOTY FINALS'}], None, [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\ndict_values([1046120, 'Original Chilled Can Energy Drink', '250mL', 'Mother', '/customer/v1/coles/products/images/1046120.jpg', [{'Aisle': 'SERVICE', 'Order': 9999.0, 'Description': 'Service desk', 'AisleSide': 'Front of Store', 'Facing': 0, 'Shelf': 0, 'LayoutId': '9049', 'LayoutName': 'COLD DRINK - OD290/330'}], [{'PromotionId': 170376039, 'Type': 'Every Day', 'Description': None, 'Price': 2.0, 'WasPrice': None, 'SaveAmount': None, 'UnitPrice': '$8.00 per 1L', 'UnitOfMeasure': 'EA', 'PriceDescription': None, 'StartDate': '2018-07-04T00:00:00', 'EndDate': '2018-10-14T23:59:59', 'SavePercent': None}], [{'Label': 'Drinks', 'Name': 'Drinks', 'TagType': {'Label': 'online-3', 'Name': 'online-3'}}]])\n" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code" ] ]
e7e2e6f5e07cc2909aa6839419bd2945080d7a7c
447,835
ipynb
Jupyter Notebook
covid_study_ver_cbc_4_sao.ipynb
hikmetc/COVID-19-AI
c5623131c851bd6d79a76039823df2c8d8bb908f
[ "MIT" ]
null
null
null
covid_study_ver_cbc_4_sao.ipynb
hikmetc/COVID-19-AI
c5623131c851bd6d79a76039823df2c8d8bb908f
[ "MIT" ]
null
null
null
covid_study_ver_cbc_4_sao.ipynb
hikmetc/COVID-19-AI
c5623131c851bd6d79a76039823df2c8d8bb908f
[ "MIT" ]
null
null
null
140.343153
114,140
0.833499
[ [ [ "# Covid 19 Prediction Study - CBC", "_____no_output_____" ], [ "### Importing libraries", "_____no_output_____" ] ], [ [ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n", "_____no_output_____" ] ], [ [ "## Baskent Data", "_____no_output_____" ] ], [ [ "# başkent university data\nveriler = pd.read_excel(r'covid data 05.xlsx')", "_____no_output_____" ], [ "# başkent uni data\nprint('total number of pcr results: ',len(veriler['pcr']))\nprint('number of positive pcr results: ',len(veriler[veriler['pcr']=='positive']))\nprint('number of negative pcr results: ',len(veriler[veriler['pcr']=='negative']))", "total number of pcr results: 1391\nnumber of positive pcr results: 707\nnumber of negative pcr results: 684\n" ] ], [ [ "## Sao Paulo dataset", "_____no_output_____" ] ], [ [ "veri_saopaulo = pd.read_excel(r'sao_dataset.xlsx' )", "_____no_output_____" ], [ "\nprint('total number of pcr results: ',len(veri_saopaulo['SARS-Cov-2 exam result']))\nprint('number of positive pcr results: ',len(veri_saopaulo[veri_saopaulo['SARS-Cov-2 exam result']=='positive']))\nprint('number of negative pcr results: ',len(veri_saopaulo[veri_saopaulo['SARS-Cov-2 exam result']=='negative']))", "total number of pcr results: 5644\nnumber of positive pcr results: 558\nnumber of negative pcr results: 5086\n" ], [ "veri_saopaulo_l = list(veri_saopaulo.columns)\nveri_saopaulo_l", "_____no_output_____" ], [ "veri_saopaulo_l2 = ['Hematocrit', 'Hemoglobin', 'Platelets', 'Mean platelet volume ', \n'Red blood Cells', 'Lymphocytes', 'Mean corpuscular hemoglobin concentration\\xa0(MCHC)',\n 'Leukocytes', 'Basophils', 'Mean corpuscular hemoglobin (MCH)', 'Eosinophils',\n 'Mean corpuscular volume (MCV)', 'Monocytes','Red blood cell distribution width (RDW)']", "_____no_output_____" ], [ "len(veri_saopaulo_l2)", "_____no_output_____" ], [ "veriler_sao_cbc = veri_saopaulo[['Hemoglobin','Hematocrit', 'Lymphocytes', 'Leukocytes'\n ,'Mean corpuscular hemoglobin (MCH)','Mean corpuscular hemoglobin concentration (MCHC)'\n ,'Mean corpuscular volume (MCV)','Monocytes','Neutrophils','Basophils','Eosinophils'\n ,'Red blood Cells','Red blood cell distribution width (RDW)','Platelets','SARS-Cov-2 exam result']]\nveriler_sao_cbc = veriler_sao_cbc.dropna(axis=0)\nveriler_sao_cbc.describe()", "_____no_output_____" ], [ "# PCR result to integer (0: negative, 1: positive)\n\nfrom sklearn.preprocessing import LabelEncoder\n\nle = LabelEncoder()\nveriler_sao_cbc[\"PCR_result\"] = le.fit_transform(veriler_sao_cbc[\"SARS-Cov-2 exam result\"])\nveriler_sao_cbc.head()", "_____no_output_____" ], [ "# Sao Paulo Data\nprint('total number of pcr results: ',len(veriler_sao_cbc['SARS-Cov-2 exam result']))\nprint('number of positive pcr results: ',len(veriler_sao_cbc[veriler_sao_cbc['SARS-Cov-2 exam result']=='positive']))\nprint('number of negative pcr results: ',len(veriler_sao_cbc[veriler_sao_cbc['SARS-Cov-2 exam result']=='negative']))", "total number of pcr results: 513\nnumber of positive pcr results: 75\nnumber of negative pcr results: 438\n" ], [ "# select random 75 rows to reach balanced data\n\nsaopaulo_negative = veriler_sao_cbc[veriler_sao_cbc['SARS-Cov-2 exam result']=='negative']\nsaopaulo_negative75 = saopaulo_negative.sample(n = 75)", "_____no_output_____" ], [ "saopaulo_negative75", "_____no_output_____" ], [ "saopaulo_positive75 = veriler_sao_cbc[veriler_sao_cbc['SARS-Cov-2 exam result']=='positive']", "_____no_output_____" ], [ "saopaulo_positive75", "_____no_output_____" ], [ "#concatinating positive and negative datasets\n\nsaopaulo_last = [saopaulo_positive75,saopaulo_negative75]\n\nsaopaulo_lastdf = pd.concat(saopaulo_last)", "_____no_output_____" ], [ "saopaulo_lastdf", "_____no_output_____" ], [ "Xs = saopaulo_lastdf[['Hemoglobin','Hematocrit', 'Lymphocytes', 'Leukocytes'\n ,'Mean corpuscular hemoglobin (MCH)','Mean corpuscular hemoglobin concentration (MCHC)'\n ,'Mean corpuscular volume (MCV)','Monocytes','Neutrophils','Basophils','Eosinophils'\n ,'Red blood Cells','Red blood cell distribution width (RDW)','Platelets']].values\n\nYs = saopaulo_lastdf['PCR_result'].values", "_____no_output_____" ] ], [ [ "### Baskent Data features (demographic data)", "_____no_output_____" ] ], [ [ "# Exporting demographical data to excel\n\nveriler.describe().to_excel(r'/Users/hikmetcancubukcu/Desktop/covidai/veriler başkent covid/covid cbc demographic2.xlsx')", "_____no_output_____" ], [ "veriler.info()", "<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 1391 entries, 0 to 1390\nData columns (total 24 columns):\n # Column Non-Null Count Dtype \n--- ------ -------------- ----- \n 0 hastano 1391 non-null int64 \n 1 yasiondalik 1391 non-null float64\n 2 cinsiyet 1391 non-null object \n 3 alanin_aminotransferaz 1391 non-null int64 \n 4 aspartat_aminotransferaz 1391 non-null int64 \n 5 basophils 1391 non-null float64\n 6 c_reactive_protein 1391 non-null float64\n 7 eosinophils 1391 non-null float64\n 8 hb 1391 non-null float64\n 9 hct 1391 non-null float64\n 10 kreatinin 1391 non-null float64\n 11 laktat_dehidrogenaz 1391 non-null int64 \n 12 lenfosit 1391 non-null float64\n 13 lokosit 1391 non-null float64\n 14 mch 1391 non-null float64\n 15 mchc 1391 non-null float64\n 16 mcv 1391 non-null float64\n 17 monocytes 1391 non-null float64\n 18 notrofil 1391 non-null float64\n 19 rbc 1391 non-null float64\n 20 rdw 1391 non-null float64\n 21 total_bilirubin 1391 non-null float64\n 22 trombosit 1391 non-null float64\n 23 pcr 1391 non-null object \ndtypes: float64(18), int64(4), object(2)\nmemory usage: 260.9+ KB\n" ] ], [ [ "### Baskent Data preprocessing", "_____no_output_____" ] ], [ [ "# Gender to integer (0 : E, 1 : K)\n\nfrom sklearn.preprocessing import LabelEncoder\n\nle = LabelEncoder()\nveriler[\"gender\"] = le.fit_transform(veriler[\"cinsiyet\"])\n\n", "_____no_output_____" ], [ "# Pcr to numeric values (negative : 0 , positive : 1)\n\nveriler[\"pcr_result\"] = le.fit_transform(veriler[\"pcr\"])\n\n", "_____no_output_____" ], [ "veriler.info() # başkent uni data", "<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 1391 entries, 0 to 1390\nData columns (total 26 columns):\n # Column Non-Null Count Dtype \n--- ------ -------------- ----- \n 0 hastano 1391 non-null int64 \n 1 yasiondalik 1391 non-null float64\n 2 cinsiyet 1391 non-null object \n 3 alanin_aminotransferaz 1391 non-null int64 \n 4 aspartat_aminotransferaz 1391 non-null int64 \n 5 basophils 1391 non-null float64\n 6 c_reactive_protein 1391 non-null float64\n 7 eosinophils 1391 non-null float64\n 8 hb 1391 non-null float64\n 9 hct 1391 non-null float64\n 10 kreatinin 1391 non-null float64\n 11 laktat_dehidrogenaz 1391 non-null int64 \n 12 lenfosit 1391 non-null float64\n 13 lokosit 1391 non-null float64\n 14 mch 1391 non-null float64\n 15 mchc 1391 non-null float64\n 16 mcv 1391 non-null float64\n 17 monocytes 1391 non-null float64\n 18 notrofil 1391 non-null float64\n 19 rbc 1391 non-null float64\n 20 rdw 1391 non-null float64\n 21 total_bilirubin 1391 non-null float64\n 22 trombosit 1391 non-null float64\n 23 pcr 1391 non-null object \n 24 gender 1391 non-null int64 \n 25 pcr_result 1391 non-null int64 \ndtypes: float64(18), int64(6), object(2)\nmemory usage: 282.7+ KB\n" ], [ "# Dependent & Independent variables (cbc)\n\nX = veriler[['hb','hct','lenfosit','lokosit','mch','mchc','mcv','monocytes','notrofil',\n 'basophils','eosinophils', 'rbc','rdw','trombosit']].values\nY = veriler['pcr_result'].values", "_____no_output_____" ], [ "# Train - Test Spilt (80% - 20%)\n\nfrom sklearn.model_selection import train_test_split\nx_train, x_test,y_train,y_test = train_test_split(X,Y,stratify=Y,test_size=0.20, random_state=0)\n", "_____no_output_____" ], [ "print('n of test set', len(y_test))\nprint('n of train set', len(y_train))", "n of test set 279\nn of train set 1112\n" ], [ "# Standardization\n\nfrom sklearn.preprocessing import StandardScaler\n\nsc = StandardScaler()\nX_train = sc.fit_transform(x_train)\nX_test = sc.fit_transform(x_test)", "_____no_output_____" ], [ "#confusion matrix function\n\nfrom sklearn.metrics import classification_report, confusion_matrix\nimport itertools\ndef plot_confusion_matrix(cm, classes,\n normalize=False,\n title='Confusion matrix',\n cmap=plt.cm.Blues):\n \"\"\"\n This function prints and plots the confusion matrix.\n Normalization can be applied by setting `normalize=True`.\n \"\"\"\n if normalize:\n cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n print(\"Normalized confusion matrix\")\n else:\n print('Confusion matrix, without normalization')\n\n print(cm)\n\n plt.imshow(cm, interpolation='nearest', cmap=cmap)\n plt.title(title)\n plt.colorbar()\n tick_marks = np.arange(len(classes))\n plt.xticks(tick_marks, classes, rotation=45)\n plt.yticks(tick_marks, classes)\n\n fmt = '.2f' if normalize else 'd'\n thresh = cm.max() / 2.\n for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):\n plt.text(j, i, format(cm[i, j], fmt),\n horizontalalignment=\"center\",\n color=\"white\" if cm[i, j] > thresh else \"black\")\n\n plt.tight_layout()\n plt.ylabel('True label')\n plt.xlabel('Predicted label')\n", "_____no_output_____" ] ], [ [ "### Logistic Regression", "_____no_output_____" ] ], [ [ "# importing library\n\nfrom sklearn.linear_model import LogisticRegression", "_____no_output_____" ], [ "logr= LogisticRegression(random_state=0)", "_____no_output_____" ], [ "logr.fit(X_train,y_train)", "_____no_output_____" ], [ "y_hat= logr.predict(X_test)\nyhat_logr = logr.predict_proba(X_test)\ny_hat22 = y_hat", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(y_test, y_hat, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[116 26]\n [ 30 107]]\n" ], [ "print (classification_report(y_test, y_hat))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.80 0.78 0.79 137\n 1 0.79 0.82 0.81 142\n\n accuracy 0.80 279\n macro avg 0.80 0.80 0.80 279\nweighted avg 0.80 0.80 0.80 279\n\nprecision : positive predictive value\nrecall : sensitivity\n" ], [ "# 10 fold cross validation\n\nfrom sklearn.model_selection import cross_val_score\n''' \n1. estimator : classifier (bizim durum)\n2. X\n3. Y\n4. cv : kaç katlamalı\n\n'''\nbasari = cross_val_score(estimator = logr, X=X_train, y=y_train , cv = 10)\nprint(basari.mean())\nprint(basari.std())", "0.7967744530244529\n0.020836508667640717\n" ], [ "# sao paulo external validation - logistic regression", "_____no_output_____" ], [ "y_hats= logr.predict(Xs)\n\nyhats_logr = logr.predict_proba(Xs)\ny_hats22 = y_hats", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(Ys, y_hats22, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[67 8]\n [31 44]]\n" ], [ "print (classification_report(Ys, y_hats))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.85 0.59 0.69 75\n 1 0.68 0.89 0.77 75\n\n accuracy 0.74 150\n macro avg 0.76 0.74 0.73 150\nweighted avg 0.76 0.74 0.73 150\n\nprecision : positive predictive value\nrecall : sensitivity\n" ] ], [ [ "### Support Vector Machines", "_____no_output_____" ] ], [ [ "from sklearn.svm import SVC\nsvc= SVC(kernel=\"rbf\",probability=True)", "_____no_output_____" ], [ "svc.fit(X_train, y_train)\nyhat= svc.predict(X_test)\nyhat_svm = svc.predict_proba(X_test)\nyhat4 = yhat # svm prediction => yhat4", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(y_test, yhat4, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[116 26]\n [ 26 111]]\n" ], [ "print (classification_report(y_test, yhat4))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.81 0.81 0.81 137\n 1 0.82 0.82 0.82 142\n\n accuracy 0.81 279\n macro avg 0.81 0.81 0.81 279\nweighted avg 0.81 0.81 0.81 279\n\nprecision : positive predictive value\nrecall : sensitivity\n" ], [ "# 10 fold cross validation\n\nfrom sklearn.model_selection import cross_val_score\n''' \n1. estimator : classifier (bizim durum)\n2. X\n3. Y\n4. cv : kaç katlamalı\n\n'''\nbasari = cross_val_score(estimator = svc, X=X_train, y=y_train , cv = 10)\nprint(basari.mean())\nprint(basari.std())", "0.8084298584298585\n0.029357583533502745\n" ], [ "# SAO PAULO EXTERNAL VALIDATION\n\ny_hats4= svc.predict(Xs)\n\nyhats2_svc = svc.predict_proba(Xs)\n\n", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(Ys, y_hats4, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[70 5]\n [25 50]]\n" ], [ "print (classification_report(Ys, y_hats4))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.91 0.67 0.77 75\n 1 0.74 0.93 0.82 75\n\n accuracy 0.80 150\n macro avg 0.82 0.80 0.80 150\nweighted avg 0.82 0.80 0.80 150\n\nprecision : positive predictive value\nrecall : sensitivity\n" ] ], [ [ "### RANDOM FOREST CLASSIFIER", "_____no_output_____" ] ], [ [ "from sklearn.ensemble import RandomForestClassifier\nrfc= RandomForestClassifier(n_estimators=200,criterion=\"entropy\")", "_____no_output_____" ], [ "rfc.fit(X_train,y_train)\nyhat7= rfc.predict(X_test)\nyhat_rf = rfc.predict_proba(X_test)\n", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(y_test, yhat7, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[114 28]\n [ 20 117]]\n" ], [ "print (classification_report(y_test, yhat7))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.81 0.85 0.83 137\n 1 0.85 0.80 0.83 142\n\n accuracy 0.83 279\n macro avg 0.83 0.83 0.83 279\nweighted avg 0.83 0.83 0.83 279\n\nprecision : positive predictive value\nrecall : sensitivity\n" ], [ "# 10 fold cross validation\n\nfrom sklearn.model_selection import cross_val_score\n''' \n1. estimator : classifier (bizim durum)\n2. X\n3. Y\n4. cv : kaç katlamalı\n\n'''\nbasari = cross_val_score(estimator = rfc, X=X_train, y=y_train , cv = 10)\nprint(basari.mean())\nprint(basari.std())", "0.827324646074646\n0.03390914967191843\n" ], [ "# SAO PAULO EXTERNAL VALIDATION\n\nyhats7= rfc.predict(Xs)\n\nyhats7_rfc = rfc.predict_proba(Xs)\n", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(Ys, yhats7, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[68 7]\n [24 51]]\n" ], [ "print (classification_report(Ys, yhats7))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.88 0.68 0.77 75\n 1 0.74 0.91 0.81 75\n\n accuracy 0.79 150\n macro avg 0.81 0.79 0.79 150\nweighted avg 0.81 0.79 0.79 150\n\nprecision : positive predictive value\nrecall : sensitivity\n" ] ], [ [ "### XGBOOST", "_____no_output_____" ] ], [ [ "from sklearn.ensemble import GradientBoostingClassifier\nclassifier = GradientBoostingClassifier()", "_____no_output_____" ], [ "classifier.fit(X_train, y_train)\nyhat8 = classifier.predict(X_test)\nyhat_xgboost = classifier.predict_proba(X_test)\n", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(y_test, yhat8, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[109 33]\n [ 22 115]]\n" ], [ "print (classification_report(y_test, yhat8))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.78 0.84 0.81 137\n 1 0.83 0.77 0.80 142\n\n accuracy 0.80 279\n macro avg 0.80 0.80 0.80 279\nweighted avg 0.81 0.80 0.80 279\n\nprecision : positive predictive value\nrecall : sensitivity\n" ], [ "# 10 fold cross validation\n\nfrom sklearn.model_selection import cross_val_score\n''' \n1. estimator : classifier (bizim durum)\n2. X\n3. Y\n4. cv : kaç katlamalı\n\n'''\nbasari = cross_val_score(estimator = rfc, X=X_train, y=y_train , cv = 10)\nprint(basari.mean())\nprint(basari.std())", "0.8363014800514801\n0.0310012414545756\n" ], [ "# SAO PAULO EXTERNAL VALIDATION\n\ny_hats8= classifier.predict(Xs)\ny_hats_xgboost = classifier.predict_proba(Xs)\n", "_____no_output_____" ], [ "# Compute confusion matrix\ncnf_matrix = confusion_matrix(Ys, y_hats8, labels=[1,0])\nnp.set_printoptions(precision=2)\n\n\n# Plot non-normalized confusion matrix\nplt.figure()\nplot_confusion_matrix(cnf_matrix, classes=['PCR positive','PCR negative'],normalize= False, title='Confusion matrix')", "Confusion matrix, without normalization\n[[64 11]\n [28 47]]\n" ], [ "print (classification_report(Ys, y_hats8))\n\nprint('precision : positive predictive value')\nprint('recall : sensitivity')", " precision recall f1-score support\n\n 0 0.81 0.63 0.71 75\n 1 0.70 0.85 0.77 75\n\n accuracy 0.74 150\n macro avg 0.75 0.74 0.74 150\nweighted avg 0.75 0.74 0.74 150\n\nprecision : positive predictive value\nrecall : sensitivity\n" ] ], [ [ "## ROC & AUC", "_____no_output_____" ] ], [ [ "#baskent dataset\n\nfrom sklearn.metrics import roc_curve, auc\n\n\n\nlogr_fpr, logr_tpr, threshold = roc_curve(y_test, yhat_logr[:,1]) # logr roc data\nauc_logr = auc(logr_fpr, logr_tpr)\n\n\n\nsvm_fpr, svm_tpr, threshold = roc_curve(y_test, yhat_svm[:,1]) # svm roc data\nauc_svm = auc(svm_fpr, svm_tpr)\n\n\n\nrf_fpr, rf_tpr, threshold = roc_curve(y_test, yhat_rf[:,1]) # rf roc data\nauc_rf = auc(rf_fpr, rf_tpr)\n\nxgboost_fpr, xgboost_tpr, threshold = roc_curve(y_test, yhat_xgboost[:,1]) # xgboost roc data\nauc_xgboost = auc(xgboost_fpr, xgboost_tpr)\n\n\n\n\nplt.figure(figsize=(4, 4), dpi=300)\n\n\nplt.plot(rf_fpr, rf_tpr, linestyle='-', label='Random Forest (AUC = %0.3f)' % auc_rf)\nplt.plot(logr_fpr, logr_tpr, linestyle='-', label='Logistic (AUC = %0.3f)' % auc_logr)\nplt.plot(svm_fpr, svm_tpr, linestyle='-', label='SVM (AUC = %0.3f)' % auc_svm)\nplt.plot(xgboost_fpr, xgboost_tpr, linestyle='-', label='XGBoost (AUC = %0.3f)' % auc_xgboost)\n\n\n\n\n\n\n\n\nplt.xlabel('False Positive Rate')\nplt.ylabel('True Positive Rate')\n\nplt.legend(fontsize=8)\n\nplt.show()\n\n", "_____no_output_____" ], [ "# sao paulo dataset\n\nfrom sklearn.metrics import roc_curve, auc\n\n\n\nlogr_fpr, logr_tpr, threshold = roc_curve(Ys, yhats_logr[:,1]) # logr roc data\nauc_logr = auc(logr_fpr, logr_tpr)\n\n\n\nsvm_fpr, svm_tpr, threshold = roc_curve(Ys, yhats2_svc[:,1]) # svm roc data\nauc_svm = auc(svm_fpr, svm_tpr)\n\n\n\nrf_fpr, rf_tpr, threshold = roc_curve(Ys, yhats7_rfc[:,1]) # rf roc data\nauc_rf = auc(rf_fpr, rf_tpr)\n\nxgboost_fpr, xgboost_tpr, threshold = roc_curve(Ys, y_hats_xgboost[:,1]) # xgboost roc data\nauc_xgboost = auc(xgboost_fpr, xgboost_tpr)\n\n\n\n\nplt.figure(figsize=(4, 4), dpi=300)\n\nplt.plot(xgboost_fpr, xgboost_tpr, linestyle='-', label='XGBoost (AUC = %0.3f)' % auc_xgboost)\nplt.plot(rf_fpr, rf_tpr, linestyle='-', label='Random Forest (AUC = %0.3f)' % auc_rf)\nplt.plot(svm_fpr, svm_tpr, linestyle='-', label='SVM (AUC = %0.3f)' % auc_svm)\nplt.plot(logr_fpr, logr_tpr, linestyle='-', label='Logistic (AUC = %0.3f)' % auc_logr)\n\n\n\n\n\n\n\n\nplt.xlabel('False Positive Rate')\nplt.ylabel('True Positive Rate')\n\nplt.legend(fontsize=8)\n\nplt.show()\n\n", "_____no_output_____" ], [ "\nyhat22= y_hat22*1\n#yhat22 = [item for sublist in yhat22 for item in sublist]\n\nyhat33= yhat4*1\nyhat44= yhat7*1\nyhat55= yhat8*1\n\nroc_data_array = [yhat55,yhat22,yhat33,yhat44,y_test]\n\nroc_data = pd.DataFrame(data=roc_data_array)", "_____no_output_____" ], [ "roc_data.transpose().to_excel(r'roc_covid_cbc_last.xlsx')", "_____no_output_____" ], [ "# validation data cbc\n\n\nyhat222= y_hats22*1\n#yhat22 = [item for sublist in yhat22 for item in sublist]\n\nyhat333= y_hats4*1\nyhat444= yhats7*1\nyhat555= y_hats8*1\n\nroc_data_array = [yhat555,yhat222,yhat333,yhat444,Ys]\n\nroc_data = pd.DataFrame(data=roc_data_array)\nroc_data.transpose().to_excel(r'roc_covid_cbc_last_val.xlsx')", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ] ]
e7e2f3b1725841bf6610660dd2f4bbf18727eca6
10,424
ipynb
Jupyter Notebook
examples/notebooks/50_cartoee_quickstart.ipynb
Yisheng-Li/geemap
0594917a4acedfebb85879cfe2bcb6a406a55f39
[ "MIT" ]
1
2022-02-08T13:34:17.000Z
2022-02-08T13:34:17.000Z
examples/notebooks/50_cartoee_quickstart.ipynb
Yisheng-Li/geemap
0594917a4acedfebb85879cfe2bcb6a406a55f39
[ "MIT" ]
null
null
null
examples/notebooks/50_cartoee_quickstart.ipynb
Yisheng-Li/geemap
0594917a4acedfebb85879cfe2bcb6a406a55f39
[ "MIT" ]
null
null
null
30.479532
587
0.592383
[ [ [ "<a href=\"https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/50_cartoee_quickstart.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"/></a>\n\nUncomment the following line to install [geemap](https://geemap.org) and [cartopy](https://scitools.org.uk/cartopy/docs/latest/installing.html#installing) if needed. Keep in mind that cartopy can be challenging to install. If you are unable to install cartopy on your computer, you can try Google Colab with this the [notebook example](https://colab.research.google.com/github/giswqs/geemap/blob/master/examples/notebooks/cartoee_colab.ipynb). \n\nSee below the commands to install cartopy and geemap using conda/mamba:\n\n```\nconda create -n carto python=3.8\nconda activate carto\nconda install mamba -c conda-forge\nmamba install cartopy scipy -c conda-forge\nmamba install geemap -c conda-forge\njupyter notebook\n```", "_____no_output_____" ] ], [ [ "# !pip install cartopy scipy\n# !pip install geemap", "_____no_output_____" ] ], [ [ "# How to create publication quality maps using `cartoee`\n\n`cartoee` is a lightweight module to aid in creatig publication quality maps from Earth Engine processing results without having to download data. The `cartoee` package does this by requesting png images from EE results (which are usually good enough for visualization) and `cartopy` is used to create the plots. Utility functions are available to create plot aethetics such as gridlines or color bars. **The notebook and the geemap cartoee module ([cartoee.py](https://geemap.org/cartoee)) were contributed by [Kel Markert](https://github.com/KMarkert). A huge thank you to him.**", "_____no_output_____" ] ], [ [ "%pylab inline\n\nimport ee\nimport geemap\n\n# import the cartoee functionality from geemap\nfrom geemap import cartoee", "_____no_output_____" ], [ "geemap.ee_initialize()", "_____no_output_____" ] ], [ [ "## Plotting an image\n\nIn this first example we will explore the most basic functionality including plotting and image, adding a colorbar, and adding visual aethetic features. Here we will use SRTM data to plot global elevation.", "_____no_output_____" ] ], [ [ "# get an image\nsrtm = ee.Image(\"CGIAR/SRTM90_V4\")", "_____no_output_____" ], [ "# geospatial region in format [E,S,W,N]\nregion = [180, -60, -180, 85] # define bounding box to request data\nvis = {'min':0, 'max':3000} # define visualization parameters for image", "_____no_output_____" ], [ "fig = plt.figure(figsize=(15, 10))\n\n# use cartoee to get a map\nax = cartoee.get_map(srtm, region=region, vis_params=vis)\n\n# add a colorbar to the map using the visualization params we passed to the map\ncartoee.add_colorbar(ax, vis, loc=\"bottom\", label=\"Elevation\", orientation=\"horizontal\")\n\n# add gridlines to the map at a specified interval\ncartoee.add_gridlines(ax, interval=[60,30], linestyle=\":\")\n\n# add coastlines using the cartopy api\nax.coastlines(color=\"red\")\n\nshow()", "_____no_output_____" ] ], [ [ "This is a decent map for minimal amount of code. But we can also easily use matplotlib colormaps to visualize our EE results to add more color. Here we add a `cmap` keyword to the `.get_map()` and `.add_colorbar()` functions.", "_____no_output_____" ] ], [ [ "fig = plt.figure(figsize=(15, 10))\n\ncmap = \"gist_earth\" # colormap we want to use\n# cmap = \"terrain\"\n\n# use cartoee to get a map\nax = cartoee.get_map(srtm, region=region, vis_params=vis, cmap=cmap)\n\n# add a colorbar to the map using the visualization params we passed to the map\ncartoee.add_colorbar(ax, vis, cmap=cmap, loc=\"right\", label=\"Elevation\", orientation=\"vertical\")\n\n# add gridlines to the map at a specified interval\ncartoee.add_gridlines(ax, interval=[60,30], linestyle=\"--\")\n\n# add coastlines using the cartopy api\nax.coastlines(color=\"red\")\n\nax.set_title(label = 'Global Elevation Map', fontsize=15)\n\nshow()", "_____no_output_____" ] ], [ [ "## Plotting an RGB image\n\n`cartoee` also allows for plotting of RGB image results directly. Here is an example of plotting a Landsat false-color scene.", "_____no_output_____" ] ], [ [ "# get a landsat image to visualize\nimage = ee.Image('LANDSAT/LC08/C01/T1_SR/LC08_044034_20140318')\n\n# define the visualization parameters to view\nvis ={\"bands\": ['B5', 'B4', 'B3'], \"min\": 0, \"max\":5000, \"gamma\":1.3}", "_____no_output_____" ], [ "fig = plt.figure(figsize=(15, 10))\n\n# use cartoee to get a map\nax = cartoee.get_map(image, vis_params=vis)\n\n# pad the view for some visual appeal\ncartoee.pad_view(ax)\n\n# add the gridlines and specify that the xtick labels be rotated 45 degrees\ncartoee.add_gridlines(ax,interval=0.5,xtick_rotation=45,linestyle=\":\")\n\n# add the coastline\nax.coastlines(color=\"yellow\")\n\nshow()", "_____no_output_____" ] ], [ [ "By default, if a region is not provided via the `region` keyword the whole extent of the image will be plotted as seen in the previous Landsat example. We can also zoom to a specific region of an image by defining the region to plot.", "_____no_output_____" ] ], [ [ "fig = plt.figure(figsize=(15, 10))\n\n# here is the bounding box of the map extent we want to use\n# formatted a [E,S,W,N]\nzoom_region = [-121.8025, 37.3458, -122.6265, 37.9178]\n\n# plot the map over the region of interest\nax = cartoee.get_map(image, vis_params=vis, region=zoom_region)\n\n# add the gridlines and specify that the xtick labels be rotated 45 degrees\ncartoee.add_gridlines(ax, interval=0.15, xtick_rotation=45, linestyle=\":\")\n\n# add coastline\nax.coastlines(color=\"yellow\")\n\nshow()", "_____no_output_____" ] ], [ [ "## Adding north arrow and scale bar", "_____no_output_____" ] ], [ [ "fig = plt.figure(figsize=(15, 10))\n\n# here is the bounding box of the map extent we want to use\n# formatted a [E,S,W,N]\nzoom_region = [-121.8025, 37.3458, -122.6265, 37.9178]\n\n# plot the map over the region of interest\nax = cartoee.get_map(image, vis_params=vis, region=zoom_region)\n\n# add the gridlines and specify that the xtick labels be rotated 45 degrees\ncartoee.add_gridlines(ax, interval=0.15, xtick_rotation=45, linestyle=\":\")\n\n# add coastline\nax.coastlines(color=\"yellow\")\n\n# add north arrow\ncartoee.add_north_arrow(ax, text=\"N\", xy=(0.05, 0.25), text_color=\"white\", arrow_color=\"white\", fontsize=20)\n\n# add scale bar\ncartoee.add_scale_bar_lite(ax, length=10, xy=(0.1, 0.05), fontsize=20, color=\"white\", unit=\"km\")\n\nax.set_title(label = 'Landsat False Color Composite (Band 5/4/3)', fontsize=15)\n\nshow()", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e3005dc906f41de1d4ebc7e072cfd99e827509
30,446
ipynb
Jupyter Notebook
heart_with_python.ipynb
tpalczew/heart_with_python
5ae4eb2e905a6a5db7f599f7806b881156b0d2f2
[ "MIT" ]
null
null
null
heart_with_python.ipynb
tpalczew/heart_with_python
5ae4eb2e905a6a5db7f599f7806b881156b0d2f2
[ "MIT" ]
null
null
null
heart_with_python.ipynb
tpalczew/heart_with_python
5ae4eb2e905a6a5db7f599f7806b881156b0d2f2
[ "MIT" ]
null
null
null
390.333333
29,000
0.947711
[ [ [ "import matplotlib.pyplot as plt\nimport numpy as np", "_____no_output_____" ], [ "plt.figure(figsize = [8, 7])\nt = np.arange(0,2*np.pi, 0.1)\nx = 16*np.sin(t)**3\ny = 13*np.cos(t)-5*np.cos(2*t)-2*np.cos(3*t)-np.cos(4*t)\nplt.plot(x,y)\nplt.title(\"Heart with Python\")", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code" ] ]
e7e315fbe89f6824927a3762f19f2fdde6ad172a
5,546
ipynb
Jupyter Notebook
Argentina - Mondiola Rock - 90 pts/Practica/TP1/ejercicio 8/.ipynb_checkpoints/Ejercicio 8-checkpoint.ipynb
parolaraul/itChallengeML2017
c7e5d65ff5f9207342158dc2818638062ce3c220
[ "MIT" ]
1
2020-10-08T16:19:18.000Z
2020-10-08T16:19:18.000Z
Argentina - Mondiola Rock - 90 pts/Practica/TP1/ejercicio 8/Ejercicio 8.ipynb
parolaraul/itChallengeML2017
c7e5d65ff5f9207342158dc2818638062ce3c220
[ "MIT" ]
null
null
null
Argentina - Mondiola Rock - 90 pts/Practica/TP1/ejercicio 8/Ejercicio 8.ipynb
parolaraul/itChallengeML2017
c7e5d65ff5f9207342158dc2818638062ce3c220
[ "MIT" ]
null
null
null
31.511364
362
0.598089
[ [ [ "# EJERCICIO 8\nEl trigo es uno de los tres granos más ampliamente producidos globalmente, junto al maíz y el arroz, y el más ampliamente consumido por el hombre en la civilización occidental desde la antigüedad. El grano de trigo es utilizado para hacer harina, harina integral, sémola, cerveza y una gran variedad de productos alimenticios.\nSe requiere clasificar semillas de trigo pertenecientes a las variedades Kama, Rosa y Canadiense.\nSe cuenta con 70 muestras de cada una de las variedades, a cuyas semillas se le realizaron mediciones de diferentes propiedades geométricas: Área, perímetro, compacidad, largo, ancho, coeficiente de asimetría, largo del carpelo (todos valores reales continuos).\nUtilice perceptrones o una red neuronal artificial (según resulte más conveniente) para lograr producir un clasificador de los tres tipos de semillas de trigo a partir de las muestras obtenidas. Informe el criterio empleado para decidir el tipo de clasificador entrenado y la arquitectura y los parámetros usados en su entrenamiento (según corresponda).\nUtilice para el entrenamiento sólo el 90% de las muestras disponibles de cada variedad. Informe la matriz de confusión que produce el mejor clasificador obtenido al evaluarlo con las muestras de entrenamiento e indique la matriz que ese clasificador produce al usarlo sobre el resto de las muestras reservadas para prueba.", "_____no_output_____" ] ], [ [ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport mpld3\n%matplotlib inline\nmpld3.enable_notebook()\nfrom cperceptron import Perceptron\nfrom cbackpropagation import ANN #, Identidad, Sigmoide\nimport patrones as magia\ndef progreso(ann, X, T, y=None, n=-1, E=None):\n if n % 20 == 0:\n print(\"Pasos: {0} - Error: {1:.32f}\".format(n, E)) \ndef progresoPerceptron(perceptron, X, T, n):\n y = perceptron.evaluar(X)\n incorrectas = (T != y).sum()\n print(\"Pasos: {0}\\tIncorrectas: {1}\\n\".format(n, incorrectas))", "_____no_output_____" ], [ "semillas = np.load('semillas.npy')\n\ndatos = semillas[:, :-1]\ntipos = semillas[:, -1]\n\n# tipos == 1 --> Kama\n# tipos == 2 --> Rosa\n# tipos == 3 --> Canadiense", "_____no_output_____" ], [ "#Armo Patrones\nclases, patronesEnt, patronesTest = magia.generar_patrones(\n magia.escalar(datos),tipos,90)\nX, T = magia.armar_patrones_y_salida_esperada(clases,patronesEnt)\nXtest, Ttest = magia.armar_patrones_y_salida_esperada(clases,patronesEnt)", "_____no_output_____" ], [ "# Crea la red neuronal\nocultas = 10\nentradas = X.shape[1]\nsalidas = T.shape[1]\nann = ANN(entradas, ocultas, salidas)\nann.reiniciar()", "_____no_output_____" ], [ "#Entreno\nE, n = ann.entrenar_rprop(X, T, min_error=0, max_pasos=5000, callback=progreso, frecuencia_callback=1000)\nprint(\"\\nRed entrenada en {0} pasos con un error de {1:.32f}\".format(n, E))", "Pasos: 1000 - Error: 0.00205722829422903775650754987225\nPasos: 2000 - Error: 0.00067306802543931458244347298958\nPasos: 3000 - Error: 0.00026668858335486984043397051813\nPasos: 4000 - Error: 0.00013392867423468472125140660278\nPasos: 5000 - Error: 0.00007582658158353847816738474430\n\nRed entrenada en 5000 pasos con un error de 0.00007582658158353847816738474430\n" ], [ "#Evaluo\nY = (ann.evaluar(Xtest) >= 0.97)\nmagia.matriz_de_confusion(Ttest,Y)", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ] ]
e7e32245a76ac6535783706e0949b1a88cc3669e
128,889
ipynb
Jupyter Notebook
code/first_try/.ipynb_checkpoints/transformer_encoder-checkpoint.ipynb
steveyu323/motor_embedding
65b05e024ca5a0aa339330eff6b63927af5ce4aa
[ "MIT" ]
null
null
null
code/first_try/.ipynb_checkpoints/transformer_encoder-checkpoint.ipynb
steveyu323/motor_embedding
65b05e024ca5a0aa339330eff6b63927af5ce4aa
[ "MIT" ]
null
null
null
code/first_try/.ipynb_checkpoints/transformer_encoder-checkpoint.ipynb
steveyu323/motor_embedding
65b05e024ca5a0aa339330eff6b63927af5ce4aa
[ "MIT" ]
null
null
null
30.448618
1,250
0.526119
[ [ [ "# Model Description\n- Apply a transformer based model to pfam/unirep_50 data and extract the embedding features\n> In this tutorial, we train nn.TransformerEncoder model on a language modeling task. The language modeling task is to assign a probability for the likelihood of a given word (or a sequence of words) to follow a sequence of words. A sequence of tokens are passed to the embedding layer first, followed by a positional encoding layer to account for the order of the word (see the next paragraph for more details). The nn.TransformerEncoder consists of multiple layers of nn.TransformerEncoderLayer. Along with the input sequence, a square attention mask is required because the self-attention layers in nn.TransformerEncoder are only allowed to attend the earlier positions in the sequence. For the language modeling task, any tokens on the future positions should be masked. To have the actual words, the output of nn.TransformerEncoder model is sent to the final Linear layer, which is followed by a log-Softmax function.\n\n## Math and model formulation and code reference:\n- Attention is all you need https://arxiv.org/abs/1706.03762\n- ResNet https://towardsdatascience.com/understanding-and-visualizing-resnets-442284831be8\n- MIT Visualization http://jalammar.github.io/illustrated-transformer/\n- An Annotated transformer http://nlp.seas.harvard.edu/2018/04/03/attention.html#a-real-world-example", "_____no_output_____" ] ], [ [ "import math\nimport torch.nn as nn\nimport argparse\nimport random\nimport warnings\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch import optim\nimport torch.backends.cudnn as cudnn\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data import Dataset\nfrom torch.autograd import Variable\nimport itertools\nimport pandas as pd\n# seed = 7\n# torch.manual_seed(seed)\n# np.random.seed(seed)\n\npfamA_motors = pd.read_csv(\"../data/pfamA_motors.csv\")\ndf_dev = pd.read_csv(\"../data/df_dev.csv\")\npfamA_motors = pfamA_motors.iloc[:,1:]\nclan_train_dat = pfamA_motors.groupby(\"clan\").head(4000)\nclan_train_dat = clan_train_dat.sample(frac=1).reset_index(drop=True)\nclan_test_dat = pfamA_motors.loc[~pfamA_motors[\"id\"].isin(clan_train_dat[\"id\"]),:].groupby(\"clan\").head(400)\n\nclan_train_dat.shape\n\ndef df_to_tup(dat):\n data = []\n for i in range(dat.shape[0]):\n row = dat.iloc[i,:]\n tup = (row[\"seq\"],row[\"clan\"])\n data.append(tup)\n return data\n\nclan_training_data = df_to_tup(clan_train_dat)\nclan_test_data = df_to_tup(clan_test_dat)\nfor seq,clan in clan_training_data:\n print(seq)\n print(clan)\n break\n\naminoacid_list = [\n 'A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L',\n 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y'\n]\nclan_list = [\"actin_like\",\"tubulin_c\",\"tubulin_binding\",\"p_loop_gtpase\"]\n \naa_to_ix = dict(zip(aminoacid_list, np.arange(1, 21)))\nclan_to_ix = dict(zip(clan_list, np.arange(0, 4)))\n\ndef word_to_index(seq,to_ix):\n \"Returns a list of indices (integers) from a list of words.\"\n return [to_ix.get(word, 0) for word in seq]\n\nix_to_aa = dict(zip(np.arange(1, 21), aminoacid_list))\nix_to_clan = dict(zip(np.arange(0, 4), clan_list))\n\ndef index_to_word(ixs,ix_to): \n \"Returns a list of words, given a list of their corresponding indices.\"\n return [ix_to.get(ix, 'X') for ix in ixs]\n\ndef prepare_sequence(seq):\n idxs = word_to_index(seq[0:-1],aa_to_ix)\n return torch.tensor(idxs, dtype=torch.long)\n\ndef prepare_labels(seq):\n idxs = word_to_index(seq[1:],aa_to_ix)\n return torch.tensor(idxs, dtype=torch.long)\n\nprepare_labels('YCHXXXXX')\n\n", "DGRIPQRDVAAKLVIVMVGLPARGKSYITKKLQRYLSWQQHESRIFNVGNRRRNAAGIKTSARANSGQALDPPVEAATI\np_loop_gtpase\n" ], [ "# set device\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\ndevice", "_____no_output_____" ], [ "class PositionalEncoding(nn.Module):\n \"\"\"\n PositionalEncoding module injects some information about the relative or absolute position of\n the tokens in the sequence. The positional encodings have the same dimension as the embeddings \n so that the two can be summed. Here, we use sine and cosine functions of different frequencies.\n \"\"\"\n def __init__(self, d_model, dropout=0.1, max_len=5000):\n super(PositionalEncoding, self).__init__()\n self.dropout = nn.Dropout(p=dropout)\n\n pe = torch.zeros(max_len, d_model)\n position = torch.arange(0, max_len, dtype=torch.float).unsqueeze(1)\n div_term = torch.exp(torch.arange(0, d_model, 2).float() * (-math.log(10000.0) / d_model))\n pe[:, 0::2] = torch.sin(position * div_term)\n pe[:, 1::2] = torch.cos(position * div_term)\n pe = pe.unsqueeze(0).transpose(0, 1)\n \n# pe[:, 0::2] = torch.sin(position * div_term)\n# pe[:, 1::2] = torch.cos(position * div_term)\n# pe = pe.unsqueeze(0)\n \n self.register_buffer('pe', pe)\n\n def forward(self, x):\n# x = x + self.pe[:x.size(0), :]\n# print(\"x.size() : \", x.size())\n# print(\"self.pe.size() :\", self.pe[:x.size(0),:,:].size())\n x = torch.add(x ,Variable(self.pe[:x.size(0),:,:], requires_grad=False))\n return self.dropout(x)", "_____no_output_____" ], [ "\n \nclass TransformerModel(nn.Module):\n\n def __init__(self, ntoken, ninp, nhead, nhid, nlayers, dropout=0.5):\n super(TransformerModel, self).__init__()\n from torch.nn import TransformerEncoder, TransformerEncoderLayer\n self.model_type = 'Transformer'\n self.src_mask = None\n self.pos_encoder = PositionalEncoding(ninp)\n encoder_layers = TransformerEncoderLayer(ninp, nhead, nhid, dropout)\n self.transformer_encoder = TransformerEncoder(encoder_layers, nlayers)\n self.encoder = nn.Embedding(ntoken, ninp)\n self.ninp = ninp\n self.decoder = nn.Linear(ninp, ntoken)\n\n self.init_weights()\n\n def _generate_square_subsequent_mask(self, sz):\n mask = (torch.triu(torch.ones(sz, sz)) == 1).transpose(0, 1)\n mask = mask.float().masked_fill(mask == 0, float('-inf')).masked_fill(mask == 1, float(0.0))\n return mask\n\n def init_weights(self):\n initrange = 0.1\n self.encoder.weight.data.uniform_(-initrange, initrange)\n self.decoder.bias.data.zero_()\n self.decoder.weight.data.uniform_(-initrange, initrange)\n\n def forward(self, src):\n if self.src_mask is None or self.src_mask.size(0) != src.size(0):\n device = src.device\n mask = self._generate_square_subsequent_mask(src.size(0)).to(device)\n self.src_mask = mask\n# print(\"src.device: \", src.device)\n src = self.encoder(src) * math.sqrt(self.ninp)\n# print(\"self.encoder(src) size: \", src.size())\n src = self.pos_encoder(src)\n# print(\"elf.pos_encoder(src) size: \", src.size())\n output = self.transformer_encoder(src, self.src_mask)\n# print(\"output size: \", output.size())\n output = self.decoder(output)\n return output", "_____no_output_____" ], [ "ntokens = len(aminoacid_list) + 1 # the size of vocabulary\nemsize = 12 # embedding dimension\nnhid = 100 # the dimension of the feedforward network model in nn.TransformerEncoder\nnlayers = 6 # the number of nn.TransformerEncoderLayer in nn.TransformerEncoder\nnhead = 12 # the number of heads in the multiheadattention models\ndropout = 0.1 # the dropout value\nmodel = TransformerModel(ntokens, emsize, nhead, nhid, nlayers, dropout)", "_____no_output_____" ], [ "import time", "_____no_output_____" ], [ "criterion = nn.CrossEntropyLoss()\nlr = 3.0 # learning rate\noptimizer = torch.optim.SGD(model.parameters(), lr=lr)\nscheduler = torch.optim.lr_scheduler.StepLR(optimizer, 1.0, gamma=0.95)\n\nmodel.to(device)\nmodel.train() # Turn on the train mode", "_____no_output_____" ], [ "start_time = time.time()\nprint_every = 1\nloss_vector = []\n\nfor epoch in np.arange(0, df_dev.shape[0]): \n seq = df_dev.iloc[epoch, 6]\n sentence_in = prepare_sequence(seq)\n targets = prepare_labels(seq)\n# sentence_in = sentence_in.to(device = device)\n sentence_in = sentence_in.unsqueeze(1).to(device = device)\n targets = targets.to(device = device)\n \n optimizer.zero_grad()\n output = model(sentence_in)\n \n print(\"targets size: \", targets.size())\n loss = criterion(output.view(-1, ntokens), targets)\n loss.backward()\n torch.nn.utils.clip_grad_norm_(model.parameters(), 0.5)\n optimizer.step()\n if epoch % print_every == 0:\n print(f\"At Epoch: %.1f\"% epoch)\n print(f\"Loss %.4f\"% loss)\n loss_vector.append(loss)\n break\n \n", "targets size: torch.Size([115])\nAt Epoch: 0.0\nLoss 4.3648\n" ], [ "start_time = time.time()\nprint_every = 1000\n# loss_vector = []\n\nfor epoch in np.arange(0, df_dev.shape[0]): \n seq = df_dev.iloc[epoch, 6]\n \n sentence_in = prepare_sequence(seq)\n targets = prepare_labels(seq)\n# sentence_in = sentence_in.to(device = device)\n sentence_in = sentence_in.unsqueeze(1).to(device = device)\n targets = targets.to(device = device)\n \n optimizer.zero_grad()\n output = model(sentence_in)\n \n# print(\"targets size: \", targets.size())\n loss = criterion(output.view(-1, ntokens), targets)\n loss.backward()\n torch.nn.utils.clip_grad_norm_(model.parameters(), 0.5)\n optimizer.step()\n if epoch % print_every == 0:\n print(f\"At Epoch: %.1f\"% epoch)\n print(f\"Loss %.4f\"% loss)\n elapsed = time.time() - start_time\n print(f\"time elapsed %.4f\"% elapsed)\n torch.save(model.state_dict(), \"../data/transformer_encoder_201012.pt\")\n# loss_vector.append(loss)\n\n ", "At Epoch: 0.0\nLoss 8.4750\ntime elapsed 0.0296\nAt Epoch: 1000.0\nLoss 3.0725\ntime elapsed 23.4438\nAt Epoch: 2000.0\nLoss 3.2927\ntime elapsed 45.1294\nAt Epoch: 3000.0\nLoss 2.9190\ntime elapsed 66.5057\nAt Epoch: 4000.0\nLoss 3.0607\ntime elapsed 87.3455\nAt Epoch: 5000.0\nLoss 2.9439\ntime elapsed 108.5937\nAt Epoch: 6000.0\nLoss 3.0892\ntime elapsed 129.0390\nAt Epoch: 7000.0\nLoss 3.0167\ntime elapsed 149.5365\nAt Epoch: 8000.0\nLoss 3.0786\ntime elapsed 170.1348\nAt Epoch: 9000.0\nLoss 2.8547\ntime elapsed 193.8191\nAt Epoch: 10000.0\nLoss 3.0577\ntime elapsed 215.4009\nAt Epoch: 11000.0\nLoss 2.8724\ntime elapsed 237.3885\nAt Epoch: 12000.0\nLoss 2.9954\ntime elapsed 258.8655\nAt Epoch: 13000.0\nLoss 2.9179\ntime elapsed 279.4901\nAt Epoch: 14000.0\nLoss 2.9298\ntime elapsed 300.0160\nAt Epoch: 15000.0\nLoss 2.9484\ntime elapsed 321.0145\nAt Epoch: 16000.0\nLoss 2.8884\ntime elapsed 342.1072\nAt Epoch: 17000.0\nLoss 2.8484\ntime elapsed 363.1312\nAt Epoch: 18000.0\nLoss 2.8564\ntime elapsed 384.3074\nAt Epoch: 19000.0\nLoss 2.8983\ntime elapsed 404.7843\nAt Epoch: 20000.0\nLoss 2.9394\ntime elapsed 425.4477\nAt Epoch: 21000.0\nLoss 2.9441\ntime elapsed 445.9871\nAt Epoch: 22000.0\nLoss 3.0404\ntime elapsed 467.5490\nAt Epoch: 23000.0\nLoss 2.9080\ntime elapsed 488.7186\nAt Epoch: 24000.0\nLoss 2.9070\ntime elapsed 509.4235\nAt Epoch: 25000.0\nLoss 2.9876\ntime elapsed 530.4340\nAt Epoch: 26000.0\nLoss 2.8721\ntime elapsed 551.2129\nAt Epoch: 27000.0\nLoss 2.9223\ntime elapsed 572.3205\nAt Epoch: 28000.0\nLoss 3.0041\ntime elapsed 593.1280\nAt Epoch: 29000.0\nLoss 2.9332\ntime elapsed 614.2564\nAt Epoch: 30000.0\nLoss 2.9536\ntime elapsed 635.6761\nAt Epoch: 31000.0\nLoss 2.9049\ntime elapsed 656.7652\nAt Epoch: 32000.0\nLoss 2.9010\ntime elapsed 678.9555\nAt Epoch: 33000.0\nLoss 3.0228\ntime elapsed 701.3504\nAt Epoch: 34000.0\nLoss 2.8772\ntime elapsed 723.1934\nAt Epoch: 35000.0\nLoss 2.9568\ntime elapsed 743.8592\nAt Epoch: 36000.0\nLoss 3.0205\ntime elapsed 764.2397\nAt Epoch: 37000.0\nLoss 2.9290\ntime elapsed 785.0874\nAt Epoch: 38000.0\nLoss 2.9392\ntime elapsed 805.7109\nAt Epoch: 39000.0\nLoss 2.9803\ntime elapsed 826.0186\nAt Epoch: 40000.0\nLoss 3.3199\ntime elapsed 846.4928\nAt Epoch: 41000.0\nLoss 3.0244\ntime elapsed 867.0773\nAt Epoch: 42000.0\nLoss 2.9066\ntime elapsed 888.0423\nAt Epoch: 43000.0\nLoss 3.0540\ntime elapsed 908.6464\nAt Epoch: 44000.0\nLoss 2.8792\ntime elapsed 929.9293\nAt Epoch: 45000.0\nLoss 2.8411\ntime elapsed 951.4267\nAt Epoch: 46000.0\nLoss 2.8649\ntime elapsed 974.1426\nAt Epoch: 47000.0\nLoss 3.0632\ntime elapsed 995.3097\nAt Epoch: 48000.0\nLoss 2.8977\ntime elapsed 1016.0418\nAt Epoch: 49000.0\nLoss 2.8232\ntime elapsed 1036.8268\nAt Epoch: 50000.0\nLoss 2.9775\ntime elapsed 1057.6992\nAt Epoch: 51000.0\nLoss 2.8774\ntime elapsed 1078.1217\nAt Epoch: 52000.0\nLoss 3.0089\ntime elapsed 1099.0703\nAt Epoch: 53000.0\nLoss 3.0592\ntime elapsed 1119.7085\nAt Epoch: 54000.0\nLoss 2.9713\ntime elapsed 1140.3441\nAt Epoch: 55000.0\nLoss 3.1734\ntime elapsed 1160.6746\nAt Epoch: 56000.0\nLoss 3.0600\ntime elapsed 1181.5164\nAt Epoch: 57000.0\nLoss 3.0501\ntime elapsed 1203.4995\nAt Epoch: 58000.0\nLoss 2.9531\ntime elapsed 1224.1511\nAt Epoch: 59000.0\nLoss 3.1052\ntime elapsed 1244.6471\nAt Epoch: 60000.0\nLoss 3.0830\ntime elapsed 1267.7761\nAt Epoch: 61000.0\nLoss 3.2620\ntime elapsed 1288.7117\nAt Epoch: 62000.0\nLoss 3.0715\ntime elapsed 1309.3894\nAt Epoch: 63000.0\nLoss 2.9098\ntime elapsed 1331.1903\nAt Epoch: 64000.0\nLoss 3.0716\ntime elapsed 1353.5770\nAt Epoch: 65000.0\nLoss 3.0372\ntime elapsed 1374.6066\nAt Epoch: 66000.0\nLoss 2.8375\ntime elapsed 1395.4844\nAt Epoch: 67000.0\nLoss 2.8937\ntime elapsed 1416.3880\nAt Epoch: 68000.0\nLoss 3.0458\ntime elapsed 1437.1701\nAt Epoch: 69000.0\nLoss 2.9471\ntime elapsed 1457.8177\nAt Epoch: 70000.0\nLoss 2.8958\ntime elapsed 1478.3414\nAt Epoch: 71000.0\nLoss 2.8441\ntime elapsed 1499.9152\nAt Epoch: 72000.0\nLoss 3.0838\ntime elapsed 1520.5460\nAt Epoch: 73000.0\nLoss 2.9954\ntime elapsed 1543.2272\nAt Epoch: 74000.0\nLoss 2.8729\ntime elapsed 1564.0716\nAt Epoch: 75000.0\nLoss 2.9577\ntime elapsed 1584.8576\nAt Epoch: 76000.0\nLoss 2.8508\ntime elapsed 1605.4031\nAt Epoch: 77000.0\nLoss 3.0296\ntime elapsed 1626.2475\nAt Epoch: 78000.0\nLoss 3.1241\ntime elapsed 1646.9719\nAt Epoch: 79000.0\nLoss 3.0788\ntime elapsed 1667.8616\nAt Epoch: 80000.0\nLoss 2.9333\ntime elapsed 1691.5064\nAt Epoch: 81000.0\nLoss 2.9634\ntime elapsed 1714.5915\nAt Epoch: 82000.0\nLoss 3.0049\ntime elapsed 1737.5477\nAt Epoch: 83000.0\nLoss 2.9076\ntime elapsed 1758.6892\nAt Epoch: 84000.0\nLoss 3.0611\ntime elapsed 1779.7354\nAt Epoch: 85000.0\nLoss 3.1268\ntime elapsed 1800.5026\nAt Epoch: 86000.0\nLoss 3.0537\ntime elapsed 1821.2306\nAt Epoch: 87000.0\nLoss 3.0465\ntime elapsed 1842.5739\nAt Epoch: 88000.0\nLoss 2.9932\ntime elapsed 1863.4517\nAt Epoch: 89000.0\nLoss 2.9754\ntime elapsed 1883.9016\nAt Epoch: 90000.0\nLoss 2.9752\ntime elapsed 1904.9715\nAt Epoch: 91000.0\nLoss 3.0308\ntime elapsed 1925.6555\nAt Epoch: 92000.0\nLoss 3.4525\ntime elapsed 1946.2182\nAt Epoch: 93000.0\nLoss 2.9289\ntime elapsed 1966.9721\nAt Epoch: 94000.0\nLoss 3.0368\ntime elapsed 1987.7996\nAt Epoch: 95000.0\nLoss 2.7917\ntime elapsed 2009.1464\nAt Epoch: 96000.0\nLoss 2.9012\ntime elapsed 2033.3650\nAt Epoch: 97000.0\nLoss 2.9937\ntime elapsed 2054.6392\nAt Epoch: 98000.0\nLoss 3.0972\ntime elapsed 2075.4421\nAt Epoch: 99000.0\nLoss 3.1194\ntime elapsed 2096.3616\nAt Epoch: 100000.0\nLoss 2.9343\ntime elapsed 2117.2292\nAt Epoch: 101000.0\nLoss 3.0200\ntime elapsed 2138.0234\nAt Epoch: 102000.0\nLoss 3.2507\ntime elapsed 2158.6976\nAt Epoch: 103000.0\nLoss 2.9581\ntime elapsed 2180.0396\nAt Epoch: 104000.0\nLoss 3.2382\ntime elapsed 2202.0479\nAt Epoch: 105000.0\nLoss 3.0344\ntime elapsed 2223.0734\nAt Epoch: 106000.0\nLoss 2.9038\ntime elapsed 2244.1027\nAt Epoch: 107000.0\nLoss 2.9855\ntime elapsed 2265.6176\nAt Epoch: 108000.0\nLoss 3.0731\ntime elapsed 2286.5905\nAt Epoch: 109000.0\nLoss 3.2424\ntime elapsed 2307.5373\nAt Epoch: 110000.0\nLoss 2.9557\ntime elapsed 2328.5830\nAt Epoch: 111000.0\nLoss 2.8459\ntime elapsed 2349.3629\nAt Epoch: 112000.0\nLoss 3.1116\ntime elapsed 2369.8899\nAt Epoch: 113000.0\nLoss 2.8973\ntime elapsed 2391.1698\nAt Epoch: 114000.0\nLoss 3.0910\ntime elapsed 2412.4004\nAt Epoch: 115000.0\nLoss 3.0290\ntime elapsed 2433.3900\nAt Epoch: 116000.0\nLoss 2.8997\ntime elapsed 2454.9702\nAt Epoch: 117000.0\nLoss 3.0588\ntime elapsed 2476.0218\nAt Epoch: 118000.0\nLoss 3.0554\ntime elapsed 2497.6892\nAt Epoch: 119000.0\nLoss 2.9734\ntime elapsed 2519.9516\nAt Epoch: 120000.0\nLoss 3.1741\ntime elapsed 2544.0268\nAt Epoch: 121000.0\nLoss 2.9140\ntime elapsed 2565.9631\nAt Epoch: 122000.0\nLoss 2.8833\ntime elapsed 2586.9483\nAt Epoch: 123000.0\nLoss 3.0268\ntime elapsed 2607.9265\nAt Epoch: 124000.0\nLoss 2.9004\ntime elapsed 2630.8401\nAt Epoch: 125000.0\nLoss 3.0086\ntime elapsed 2651.4247\nAt Epoch: 126000.0\nLoss 3.0224\ntime elapsed 2672.0303\nAt Epoch: 127000.0\nLoss 3.2991\ntime elapsed 2693.3880\nAt Epoch: 128000.0\nLoss 3.1404\ntime elapsed 2714.1731\nAt Epoch: 129000.0\nLoss 3.0332\ntime elapsed 2736.7471\nAt Epoch: 130000.0\nLoss 3.2477\ntime elapsed 2759.7213\nAt Epoch: 131000.0\nLoss 3.1290\ntime elapsed 2780.8084\nAt Epoch: 132000.0\nLoss 2.9785\ntime elapsed 2802.3767\nAt Epoch: 133000.0\nLoss 2.9272\ntime elapsed 2822.8847\nAt Epoch: 134000.0\nLoss 2.9764\ntime elapsed 2843.6123\nAt Epoch: 135000.0\nLoss 3.2959\ntime elapsed 2864.3198\nAt Epoch: 136000.0\nLoss 2.9485\ntime elapsed 2885.0592\nAt Epoch: 137000.0\nLoss 3.1048\ntime elapsed 2906.0318\nAt Epoch: 138000.0\nLoss 2.8635\ntime elapsed 2926.9689\nAt Epoch: 139000.0\nLoss 3.2045\ntime elapsed 2947.7551\nAt Epoch: 140000.0\nLoss 3.0406\ntime elapsed 2968.8903\nAt Epoch: 141000.0\nLoss 2.9509\ntime elapsed 2989.9148\nAt Epoch: 142000.0\nLoss 2.9764\ntime elapsed 3010.8331\nAt Epoch: 143000.0\nLoss 3.0912\ntime elapsed 3031.6044\nAt Epoch: 144000.0\nLoss 3.0150\ntime elapsed 3052.5004\nAt Epoch: 145000.0\nLoss 3.0335\ntime elapsed 3075.1163\nAt Epoch: 146000.0\nLoss 2.9631\ntime elapsed 3098.1154\nAt Epoch: 147000.0\nLoss 3.0329\ntime elapsed 3121.1964\nAt Epoch: 148000.0\nLoss 3.4890\ntime elapsed 3143.0822\nAt Epoch: 149000.0\nLoss 2.9324\ntime elapsed 3164.6447\nAt Epoch: 150000.0\nLoss 2.8988\ntime elapsed 3188.3173\nAt Epoch: 151000.0\nLoss 2.9578\ntime elapsed 3208.9634\nAt Epoch: 152000.0\nLoss 3.0209\ntime elapsed 3229.6342\nAt Epoch: 153000.0\nLoss 3.4023\ntime elapsed 3251.5514\nAt Epoch: 154000.0\nLoss 2.9682\ntime elapsed 3273.0930\n" ], [ "torch.save(model.state_dict(), \"../data/transformer_encoder_201012.pt\")", "_____no_output_____" ], [ "print(\"done\")", "done\n" ], [ "ntokens = len(aminoacid_list) + 1 # the size of vocabulary\nemsize = 128 # embedding dimension\nnhid = 100 # the dimension of the feedforward network model in nn.TransformerEncoder\nnlayers = 3 # the number of nn.TransformerEncoderLayer in nn.TransformerEncoder\nnhead = 12 # the number of heads in the multiheadattention models\ndropout = 0.1 # the dropout value\nmodel = TransformerModel(ntokens, emsize, nhead, nhid, nlayers, dropout)", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e32b42e2b84f3c6d1d86a6ece8056489abc5c5
5,338
ipynb
Jupyter Notebook
03-fundamentals-of-python/04-processing-files.ipynb
incidentfrog/rcsc18_lessons
452a369410fd4bf86b40c081986929a12a29a1f8
[ "CC-BY-4.0" ]
1
2018-09-05T08:13:52.000Z
2018-09-05T08:13:52.000Z
03-fundamentals-of-python/04-processing-files.ipynb
incidentfrog/rcsc18_lessons
452a369410fd4bf86b40c081986929a12a29a1f8
[ "CC-BY-4.0" ]
null
null
null
03-fundamentals-of-python/04-processing-files.ipynb
incidentfrog/rcsc18_lessons
452a369410fd4bf86b40c081986929a12a29a1f8
[ "CC-BY-4.0" ]
23
2018-09-05T08:13:54.000Z
2018-12-18T16:00:05.000Z
24.943925
110
0.560135
[ [ [ "# Analyzing Data from Multiple Files", "_____no_output_____" ], [ "We now have almost everything we need to process all our data files.\nThe only thing that's missing is a library with a rather unpleasant name:", "_____no_output_____" ], [ "The `glob` library contains a function, also called `glob`,\nthat finds files and directories whose names match a pattern.\nWe provide those patterns as strings:\nthe character `*` matches zero or more characters,\nwhile `?` matches any one character.\nWe can use this to get the names of all the CSV files in the current directory:", "_____no_output_____" ], [ "As these examples show,\n`glob.glob`'s result is a list of file and directory paths in arbitrary order.\nThis means we can loop over it\nto do something with each filename in turn.\nIn our case,\nthe \"something\" we want to do is generate a set of plots for each file in our inflammation dataset.\nIf we want to start by analyzing just the first three files in alphabetical order, we can use the\n`sorted` built-in function to generate a new sorted list from the `glob.glob` output:", "_____no_output_____" ], [ "Sure enough,\nthe maxima of the first two data sets show exactly the same ramp as the first,\nand their minima show the same staircase structure;\na different situation has been revealed in the third dataset,\nwhere the maxima are a bit less regular, but the minima are consistently zero.", "_____no_output_____" ], [ "\n<section class=\"challenge panel panel-success\">\n<div class=\"panel-heading\">\n<h2><span class=\"fa fa-pencil\"></span> Challenge: Plotting Differences</h2>\n</div>\n\n\n<div class=\"panel-body\">\n\n<p>Plot the difference between the average of the first dataset\nand the average of the second dataset,\ni.e., the difference between the leftmost plot of the first two figures.</p>\n\n</div>\n\n</section>\n", "_____no_output_____" ], [ "\n<section class=\"solution panel panel-primary\">\n<div class=\"panel-heading\">\n<h2><span class=\"fa fa-eye\"></span> Solution</h2>\n</div>\n\n</section>\n", "_____no_output_____" ], [ "\n<section class=\"challenge panel panel-success\">\n<div class=\"panel-heading\">\n<h2><span class=\"fa fa-pencil\"></span> Challenge: Generate Composite Statistics</h2>\n</div>\n\n\n<div class=\"panel-body\">\n\n<p>Use each of the files once to generate a dataset containing values averaged over all patients:</p>\n\n</div>\n\n</section>\n", "_____no_output_____" ], [ "Then use pyplot to generate average, max, and min for all patients.", "_____no_output_____" ], [ "\n<section class=\"solution panel panel-primary\">\n<div class=\"panel-heading\">\n<h2><span class=\"fa fa-eye\"></span> Solution</h2>\n</div>\n\n</section>\n", "_____no_output_____" ], [ "---\nThe material in this notebook is derived from the Software Carpentry lessons\n&copy; [Software Carpentry](http://software-carpentry.org/) under the terms\nof the [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) license.", "_____no_output_____" ] ] ]
[ "markdown" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ] ]
e7e3363d365c76f9273c7d6db0dcc85efe21628b
272,681
ipynb
Jupyter Notebook
docs/source/examples/meridional_overturning.ipynb
gustavo-marques/mom6-tools
5c7d95ed5449317529a45c35333ade4a36f3f2b1
[ "Apache-2.0" ]
null
null
null
docs/source/examples/meridional_overturning.ipynb
gustavo-marques/mom6-tools
5c7d95ed5449317529a45c35333ade4a36f3f2b1
[ "Apache-2.0" ]
null
null
null
docs/source/examples/meridional_overturning.ipynb
gustavo-marques/mom6-tools
5c7d95ed5449317529a45c35333ade4a36f3f2b1
[ "Apache-2.0" ]
null
null
null
1,036.809886
139,224
0.955017
[ [ [ "# Meridional Overturning\n\n`mom6_tools.moc` functions for computing and plotting meridional overturning. \n\nThe goal of this notebook is the following:\n\n1) server as an example on to compute a meridional overturning streamfunction (global and Atalntic) from CESM/MOM output; \n\n2) evaluate model experiments by comparing transports against observed estimates;\n\n3) compare model results vs. another model results (TODO).", "_____no_output_____" ] ], [ [ "%matplotlib inline\nimport matplotlib\nimport numpy as np\nimport xarray as xr\n# mom6_tools\nfrom mom6_tools.moc import *\nfrom mom6_tools.m6toolbox import check_time_interval, genBasinMasks \nimport matplotlib.pyplot as plt\n", "_____no_output_____" ], [ "# The following parameters must be set accordingly\n######################################################\n# case name - must be changed for each configuration\ncase_name = 'g.c2b6.GNYF.T62_t061.long_run_nuopc.001'\n# Path to the run directory\npath = \"/glade/scratch/gmarques/g.c2b6.GNYF.T62_t061.long_run_nuopc.001/run/\"\n# initial and final years for computing time mean\nyear_start = 80\nyear_end = 90\n# add your name and email address below\nauthor = 'Gustavo Marques ([email protected])'\n######################################################\n# create an empty class object\nclass args:\n pass\n\nargs.infile = path\nargs.static = 'g.c2b6.GNYF.T62_t061.long_run_nuopc.001.mom6.static.nc'\nargs.monthly = 'g.c2b6.GNYF.T62_t061.long_run_nuopc.001.mom6.hm_*nc'\nargs.year_start = year_start\nargs.year_end = year_end\nargs.case_name = case_name\nargs.label = ''\nargs.savefigs = False", "_____no_output_____" ], [ "stream = True\n# mom6 grid\ngrd = MOM6grid(args.infile+args.static)\ndepth = grd.depth_ocean\n# remote Nan's, otherwise genBasinMasks won't work\ndepth[numpy.isnan(depth)] = 0.0\nbasin_code = m6toolbox.genBasinMasks(grd.geolon, grd.geolat, depth)\n\n# load data\nds = xr.open_mfdataset(args.infile+args.monthly,decode_times=False)\n# convert time in years\nds['time'] = ds.time/365.\nti = args.year_start\ntf = args.year_end\n# check if data includes years between ti and tf\ncheck_time_interval(ti,tf,ds)\n\n# create a ndarray subclass\nclass C(numpy.ndarray): pass\n\nif 'vmo' in ds.variables:\n varName = 'vmo'; conversion_factor = 1.e-9\nelif 'vh' in ds.variables:\n varName = 'vh'; conversion_factor = 1.e-6\n if 'zw' in ds.variables: conversion_factor = 1.e-9 # Backwards compatible for when we had wrong units for 'vh'\nelse: raise Exception('Could not find \"vh\" or \"vmo\" in file \"%s\"'%(args.infile+args.static))\n \n\ntmp = np.ma.masked_invalid(ds[varName].sel(time=slice(ti,tf)).mean('time').data)\ntmp = tmp[:].filled(0.)\nVHmod = tmp.view(C)\nVHmod.units = ds[varName].units\n\n\nZmod = m6toolbox.get_z(ds, depth, varName)\n\nif args.case_name != '': case_name = args.case_name + ' ' + args.label\nelse: case_name = rootGroup.title + ' ' + args.label\n", "MOM6 grid successfully loaded... \n\n11.16428 64.78855 [391, 434]\n" ], [ "# Global MOC\nm6plot.setFigureSize([16,9],576,debug=False)\naxis = plt.gca()\ncmap = plt.get_cmap('dunnePM')\nz = Zmod.min(axis=-1); psiPlot = MOCpsi(VHmod)*conversion_factor\npsiPlot = 0.5 * (psiPlot[0:-1,:]+psiPlot[1::,:])\n#yy = y[1:,:].max(axis=-1)+0*z\nyy = grd.geolat_c[:,:].max(axis=-1)+0*z\nprint(z.shape, yy.shape, psiPlot.shape)\nci=m6plot.pmCI(0.,40.,5.)\nplotPsi(yy, z, psiPlot, ci, 'Global MOC [Sv]')\nplt.xlabel(r'Latitude [$\\degree$N]')\nplt.suptitle(case_name)\n#findExtrema(yy, z, psiPlot, max_lat=-30.)\n#findExtrema(yy, z, psiPlot, min_lat=25.)\n#findExtrema(yy, z, psiPlot, min_depth=2000., mult=-1.)", "(60, 458) (60, 458) (60, 458)\n" ], [ "# Atlantic MOC\nm6plot.setFigureSize([16,9],576,debug=False)\ncmap = plt.get_cmap('dunnePM')\nm = 0*basin_code; m[(basin_code==2) | (basin_code==4) | (basin_code==6) | (basin_code==7) | (basin_code==8)]=1\nci=m6plot.pmCI(0.,22.,2.)\nz = (m*Zmod).min(axis=-1); psiPlot = MOCpsi(VHmod, vmsk=m*numpy.roll(m,-1,axis=-2))*conversion_factor\npsiPlot = 0.5 * (psiPlot[0:-1,:]+psiPlot[1::,:])\n#yy = y[1:,:].max(axis=-1)+0*z\nyy = grd.geolat_c[:,:].max(axis=-1)+0*z\nplotPsi(yy, z, psiPlot, ci, 'Atlantic MOC [Sv]')\nplt.xlabel(r'Latitude [$\\degree$N]')\nplt.suptitle(case_name)\n#findExtrema(yy, z, psiPlot, min_lat=26.5, max_lat=27.) # RAPID\n#findExtrema(yy, z, psiPlot, max_lat=-33.)\n#findExtrema(yy, z, psiPlot)\n#findExtrema(yy, z, psiPlot, min_lat=5.)\n", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code" ] ]
e7e34d3113355e4704374c6ab32fe88b6def3155
30,228
ipynb
Jupyter Notebook
(b)intro 2.ipynb
fahimalamabir/scalable_machine_learning_Apache_Spark
04f2057f2575f5dc5aa4563f6ad8ca7818fd0c52
[ "Apache-2.0" ]
null
null
null
(b)intro 2.ipynb
fahimalamabir/scalable_machine_learning_Apache_Spark
04f2057f2575f5dc5aa4563f6ad8ca7818fd0c52
[ "Apache-2.0" ]
null
null
null
(b)intro 2.ipynb
fahimalamabir/scalable_machine_learning_Apache_Spark
04f2057f2575f5dc5aa4563f6ad8ca7818fd0c52
[ "Apache-2.0" ]
null
null
null
26.148789
531
0.450112
[ [ [ "try:\n from pyspark import SparkContext, SparkConf\n from pyspark.sql import SparkSession\nexcept ImportError as e:\n printmd('<<<<<!!!!! Please restart your kernel after installing Apache Spark !!!!!>>>>>')", "_____no_output_____" ], [ "sc = SparkContext.getOrCreate(SparkConf().setMaster(\"local[*]\"))\n\nspark = SparkSession \\\n .builder \\\n .getOrCreate()", "_____no_output_____" ] ], [ [ "Mean = $\\frac{1}{n} \\sum_{i=1}^n a_i$", "_____no_output_____" ] ], [ [ "# create a rdd from 0 to 99\nrdd = sc.parallelize(range(100))\nsum_ = rdd.sum()\nn = rdd.count()\nmean = sum_/n\nprint(mean)", "49.5\n" ] ], [ [ "Median <br>\n(1) sort the list <br>\n(2) pick the middle element <br>", "_____no_output_____" ] ], [ [ "rdd.collect()", "_____no_output_____" ], [ "rdd.sortBy(lambda x:x).collect()", "_____no_output_____" ] ], [ [ "To access the middle element, we need to access the index.", "_____no_output_____" ] ], [ [ "rdd.sortBy(lambda x:x).zipWithIndex().collect()", "_____no_output_____" ], [ "sortedandindexed = rdd.sortBy(lambda x:x).zipWithIndex().map(lambda x:x)\nn = sortedandindexed.count()\nif (n%2 == 1):\n index = (n-1)/2;\n print(sortedandindexed.lookup(index))\nelse:\n index1 = (n/2)-1\n index2 = n/2\n value1 = sortedandindexed.lookup(index1)[0]\n value2 = sortedandindexed.lookup(index2)[0]\n print((value1 + value2)/2)", "49.5\n" ] ], [ [ "Standard Deviation:<br>\n - tells you how wide the is spread around the mean<br>\n so if SD is low, all the values should be close to the mean<br>\n - to calculate it first calculate the mean $\\bar{x}$<br>\n - SD = $\\sqrt{\\frac{1}{N}\\sum_{i=1}^N(x_i - \\bar{x})^2}$<br>", "_____no_output_____" ] ], [ [ "from math import sqrt\nsum_ = rdd.sum()\nn = rdd.count()\nmean = sum_/n\nsqrt(rdd.map(lambda x: pow(x-mean,2)).sum()/n)", "_____no_output_____" ] ], [ [ "Skewness<br>\n- tells us how asymmetric data is spread around the mean <br>\n- check positive skew, negative skew <br>\n- Skew = $\\frac{1}{n}\\frac{\\sum_{j=1}^n (x_j- \\bar{x})^3}{\\text{SD}^3}$, x_j= individual value", "_____no_output_____" ] ], [ [ "sd= sqrt(rdd.map(lambda x: pow(x-mean,2)).sum()/n)\nn = float(n) # to round off\nskw = (1/n)*rdd.map(lambda x : pow(x- mean,3)/pow(sd,3)).sum()\nskw", "_____no_output_____" ] ], [ [ "Kurtosis<br>\n\n- tells us the shape of the data<br>\n- indicates outlier content within the data<br>\n- kurt = $\\frac{1}{n}\\frac{\\sum_{j=1}^n (x_j- \\bar{x})^4}{\\text{SD}^4}$, x_j= individual value\n", "_____no_output_____" ] ], [ [ "(1/n)*rdd.map(lambda x : pow(x- mean,4)/pow(sd,4)).sum()\n", "_____no_output_____" ] ], [ [ "Covariance \\& Correlation<br>\n\n- how two columns interact with each other<br>\n- how all columns interact with each other<br>\n- cov(X,Y) = $\\frac{1}{n} \\sum_{i=1}^n (x_i-\\bar{x})(y_i -\\bar{y})$", "_____no_output_____" ] ], [ [ "rddX = sc.parallelize(range(100))\nrddY = sc.parallelize(range(100))", "_____no_output_____" ], [ "# to avoid loss of precision use float\nmeanX = rddX.sum()/float(rddX.count())\nmeanY = rddY.sum()/float(rddY.count())", "_____no_output_____" ], [ "# since we need to use rddx, rddy same time we need to zip them together\nrddXY = rddX.zip(rddY)\ncovXY = rddXY.map(lambda x:(x[0]-meanX)*(x[1]-meanY)).sum()/rddXY.count()\ncovXY", "_____no_output_____" ] ], [ [ "Correlation\n\n- corr(X,Y) =$ \\frac{\\text{cov(X,Y)}}{SD_X SD_Y}$\n<br>\n\nMeasure of dependency - Correlation<br>\n +1 Columns totally correlate<br>\n 0 columns show no interaction<br>\n -1 inverse dependency", "_____no_output_____" ] ], [ [ "from math import sqrt\nn = rddXY.count()\nmean = sum_/n\nSDX = sqrt(rdd.map(lambda x: pow(x-meanX,2)).sum()/n)\nSDY = sqrt(rdd.map(lambda y: pow(y-meanY,2)).sum()/n)\ncorrXY = covXY/(SDX *SDY)\ncorrXY", "_____no_output_____" ], [ "# corellation matrix in practice\nimport random\nfrom pyspark.mllib.stat import Statistics\ncol1 = sc.parallelize(range(100))\ncol2 = sc.parallelize(range(100,200))\ncol3 = sc.parallelize(list(reversed(range(100))))\ncol4 = sc.parallelize(random.sample(range(100),100))\ndata = col1\ndata.take(5)", "_____no_output_____" ], [ "data1 = col1.zip(col2)\ndata1.take(5)", "_____no_output_____" ] ], [ [ "Welcome to exercise one of week two of “Apache Spark for Scalable Machine Learning on BigData”. In this exercise you’ll read a DataFrame in order to perform a simple statistical analysis. Then you’ll rebalance the dataset. No worries, we’ll explain everything to you, let’s get started.\n\nLet’s create a data frame from a remote file by downloading it:\n", "_____no_output_____" ] ], [ [ "# delete files from previous runs\n!rm -f hmp.parquet*\n\n# download the file containing the data in PARQUET format\n!wget https://github.com/IBM/coursera/raw/master/hmp.parquet\n \n# create a dataframe out of it\ndf = spark.read.parquet('hmp.parquet')\n\n# register a corresponding query table\ndf.createOrReplaceTempView('df')", "--2020-11-06 02:38:52-- https://github.com/IBM/coursera/raw/master/hmp.parquet\nResolving github.com (github.com)... 140.82.114.3\nConnecting to github.com (github.com)|140.82.114.3|:443... connected.\nHTTP request sent, awaiting response... 301 Moved Permanently\nLocation: https://github.com/IBM/skillsnetwork/raw/master/hmp.parquet [following]\n--2020-11-06 02:38:52-- https://github.com/IBM/skillsnetwork/raw/master/hmp.parquet\nReusing existing connection to github.com:443.\nHTTP request sent, awaiting response... 302 Found\nLocation: https://raw.githubusercontent.com/IBM/skillsnetwork/master/hmp.parquet [following]\n--2020-11-06 02:38:53-- https://raw.githubusercontent.com/IBM/skillsnetwork/master/hmp.parquet\nResolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.52.133\nConnecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.52.133|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 932997 (911K) [application/octet-stream]\nSaving to: ‘hmp.parquet’\n\nhmp.parquet 100%[===================>] 911.13K 3.79MB/s in 0.2s \n\n2020-11-06 02:38:53 (3.79 MB/s) - ‘hmp.parquet’ saved [932997/932997]\n\n" ] ], [ [ "This is a classical classification data set. One thing we always do during data analysis is checking if the classes are balanced. In other words, if there are more or less the same number of example in each class. Let’s find out by a simple aggregation using SQL.\n", "_____no_output_____" ] ], [ [ "from pyspark.sql.functions import col\ncounts = df.groupBy('class').count().orderBy('count')\ndisplay(counts)", "_____no_output_____" ], [ "df.groupBy('class').count().show()", "+--------------+-----+\n| class|count|\n+--------------+-----+\n| Use_telephone|15225|\n| Standup_chair|25417|\n| Eat_meat|31236|\n| Getup_bed|45801|\n| Drink_glass|42792|\n| Pour_water|41673|\n| Comb_hair|23504|\n| Walk|92254|\n| Climb_stairs|40258|\n| Sitdown_chair|25036|\n| Liedown_bed|11446|\n|Descend_stairs|15375|\n| Brush_teeth|29829|\n| Eat_soup| 6683|\n+--------------+-----+\n\n" ], [ "spark.sql('select class,count(*) from df group by class').show()", "+--------------+--------+\n| class|count(1)|\n+--------------+--------+\n| Use_telephone| 15225|\n| Standup_chair| 25417|\n| Eat_meat| 31236|\n| Getup_bed| 45801|\n| Drink_glass| 42792|\n| Pour_water| 41673|\n| Comb_hair| 23504|\n| Walk| 92254|\n| Climb_stairs| 40258|\n| Sitdown_chair| 25036|\n| Liedown_bed| 11446|\n|Descend_stairs| 15375|\n| Brush_teeth| 29829|\n| Eat_soup| 6683|\n+--------------+--------+\n\n" ] ], [ [ "This looks nice, but it would be nice if we can aggregate further to obtain some quantitative metrics on the imbalance like, min, max, mean and standard deviation. If we divide max by min we get a measure called minmax ration which tells us something about the relationship between the smallest and largest class. Again, let’s first use SQL for those of you familiar with SQL. Don’t be scared, we’re used nested sub-selects, basically selecting from a result of a SQL query like it was a table. All within on SQL statement.\n", "_____no_output_____" ] ], [ [ "spark.sql('''\n select \n *,\n max/min as minmaxratio -- compute minmaxratio based on previously computed values\n from (\n select \n min(ct) as min, -- compute minimum value of all classes\n max(ct) as max, -- compute maximum value of all classes\n mean(ct) as mean, -- compute mean between all classes\n stddev(ct) as stddev -- compute standard deviation between all classes\n from (\n select\n count(*) as ct -- count the number of rows per class and rename it to ct\n from df -- access the temporary query table called df backed by DataFrame df\n group by class -- aggrecate over class\n )\n ) \n''').show()", "+----+-----+------------------+------------------+-----------------+\n| min| max| mean| stddev| minmaxratio|\n+----+-----+------------------+------------------+-----------------+\n|6683|92254|31894.928571428572|21284.893716741157|13.80427951518779|\n+----+-----+------------------+------------------+-----------------+\n\n" ] ], [ [ "The same query can be expressed using the DataFrame API. Again, don’t be scared. It’s just a sequential expression of transformation steps. You now an choose which syntax you like better.\n", "_____no_output_____" ] ], [ [ "df.show()\ndf.printSchema()", "+---+---+---+--------------------+-----------+\n| x| y| z| source| class|\n+---+---+---+--------------------+-----------+\n| 22| 49| 35|Accelerometer-201...|Brush_teeth|\n| 22| 49| 35|Accelerometer-201...|Brush_teeth|\n| 22| 52| 35|Accelerometer-201...|Brush_teeth|\n| 22| 52| 35|Accelerometer-201...|Brush_teeth|\n| 21| 52| 34|Accelerometer-201...|Brush_teeth|\n| 22| 51| 34|Accelerometer-201...|Brush_teeth|\n| 20| 50| 35|Accelerometer-201...|Brush_teeth|\n| 22| 52| 34|Accelerometer-201...|Brush_teeth|\n| 22| 50| 34|Accelerometer-201...|Brush_teeth|\n| 22| 51| 35|Accelerometer-201...|Brush_teeth|\n| 21| 51| 33|Accelerometer-201...|Brush_teeth|\n| 20| 50| 34|Accelerometer-201...|Brush_teeth|\n| 21| 49| 33|Accelerometer-201...|Brush_teeth|\n| 21| 49| 33|Accelerometer-201...|Brush_teeth|\n| 20| 51| 35|Accelerometer-201...|Brush_teeth|\n| 18| 49| 34|Accelerometer-201...|Brush_teeth|\n| 19| 48| 34|Accelerometer-201...|Brush_teeth|\n| 16| 53| 34|Accelerometer-201...|Brush_teeth|\n| 18| 52| 35|Accelerometer-201...|Brush_teeth|\n| 18| 51| 32|Accelerometer-201...|Brush_teeth|\n+---+---+---+--------------------+-----------+\nonly showing top 20 rows\n\nroot\n |-- x: integer (nullable = true)\n |-- y: integer (nullable = true)\n |-- z: integer (nullable = true)\n |-- source: string (nullable = true)\n |-- class: string (nullable = true)\n\n" ], [ "from pyspark.sql.functions import col, min, max, mean, stddev\n\ndf \\\n .groupBy('class') \\\n .count() \\\n .select([ \n min(col(\"count\")).alias('min'), \n max(col(\"count\")).alias('max'), \n mean(col(\"count\")).alias('mean'), \n stddev(col(\"count\")).alias('stddev') \n ]) \\\n .select([\n col('*'),\n (col(\"max\") / col(\"min\")).alias('minmaxratio')\n ]) \\\n .show()\n", "+----+-----+------------------+------------------+-----------------+\n| min| max| mean| stddev| minmaxratio|\n+----+-----+------------------+------------------+-----------------+\n|6683|92254|31894.928571428572|21284.893716741157|13.80427951518779|\n+----+-----+------------------+------------------+-----------------+\n\n" ] ], [ [ "Now it’s time for you to work on the data set. First, please create a table of all classes with the respective counts, but this time, please order the table by the count number, ascending.\n", "_____no_output_____" ] ], [ [ "df1 = df.groupBy('class').count()\ndf1.sort('count',ascending=True).show()", "+--------------+-----+\n| class|count|\n+--------------+-----+\n| Eat_soup| 6683|\n| Liedown_bed|11446|\n| Use_telephone|15225|\n|Descend_stairs|15375|\n| Comb_hair|23504|\n| Sitdown_chair|25036|\n| Standup_chair|25417|\n| Brush_teeth|29829|\n| Eat_meat|31236|\n| Climb_stairs|40258|\n| Pour_water|41673|\n| Drink_glass|42792|\n| Getup_bed|45801|\n| Walk|92254|\n+--------------+-----+\n\n" ] ], [ [ "Pixiedust is a very sophisticated library. It takes care of sorting as well. Please modify the bar chart so that it gets sorted by the number of elements per class, ascending. Hint: It’s an option available in the UI once rendered using the display() function.\n", "_____no_output_____" ] ], [ [ "import pixiedust\nfrom pyspark.sql.functions import col\ncounts = df.groupBy('class').count().orderBy('count')\ndisplay(counts)", "_____no_output_____" ] ], [ [ "Imbalanced classes can cause pain in machine learning. Therefore let’s rebalance. In the flowing we limit the number of elements per class to the amount of the least represented class. This is called undersampling. Other ways of rebalancing can be found here:\n\n[https://machinelearningmastery.com/tactics-to-combat-imbalanced-classes-in-your-machine-learning-dataset/](https://machinelearningmastery.com/tactics-to-combat-imbalanced-classes-in-your-machine-learning-dataset?cm_mmc=Email_Newsletter-_-Developer_Ed%2BTech-_-WW_WW-_-SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-ML0201EN-SkillsNetwork-20647446&cm_mmca1=000026UJ&cm_mmca2=10006555&cm_mmca3=M12345678&cvosrc=email.Newsletter.M12345678&cvo_campaign=000026UJ)\n", "_____no_output_____" ] ], [ [ "from pyspark.sql.functions import min\n\n# create a lot of distinct classes from the dataset\nclasses = [row[0] for row in df.select('class').distinct().collect()]\n\n# compute the number of elements of the smallest class in order to limit the number of samples per calss\nmin = df.groupBy('class').count().select(min('count')).first()[0]\n\n# define the result dataframe variable\ndf_balanced = None\n\n# iterate over distinct classes\nfor cls in classes:\n \n # only select examples for the specific class within this iteration\n # shuffle the order of the elements (by setting fraction to 1.0 sample works like shuffle)\n # return only the first n samples\n df_temp = df \\\n .filter(\"class = '\"+cls+\"'\") \\\n .sample(False, 1.0) \\\n .limit(min)\n \n # on first iteration, assing df_temp to empty df_balanced\n if df_balanced == None: \n df_balanced = df_temp\n # afterwards, append vertically\n else:\n df_balanced=df_balanced.union(df_temp)", "_____no_output_____" ] ], [ [ "Please verify, by using the code cell below, if df_balanced has the same number of elements per class. You should get 6683 elements per class.\n", "_____no_output_____" ] ], [ [ "$$$", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e3778f6cf9a740cbd15c4985d5178b19d6d5ba
35,627
ipynb
Jupyter Notebook
NLP Basics.ipynb
SaiAdityaGarlapati/nlp-peronsal-archive
b197123f4e4f93c6dd2e06d4cacf56744a7bd259
[ "MIT" ]
null
null
null
NLP Basics.ipynb
SaiAdityaGarlapati/nlp-peronsal-archive
b197123f4e4f93c6dd2e06d4cacf56744a7bd259
[ "MIT" ]
null
null
null
NLP Basics.ipynb
SaiAdityaGarlapati/nlp-peronsal-archive
b197123f4e4f93c6dd2e06d4cacf56744a7bd259
[ "MIT" ]
null
null
null
37.541623
1,535
0.58248
[ [ [ "#!pip install nltk", "Collecting nltk\n Downloading https://files.pythonhosted.org/packages/6f/ed/9c755d357d33bc1931e157f537721efb5b88d2c583fe593cc09603076cc3/nltk-3.4.zip (1.4MB)\nRequirement already satisfied: six in c:\\users\\aditya\\anaconda3\\envs\\tensor_flow\\lib\\site-packages (from nltk) (1.12.0)\nCollecting singledispatch (from nltk)\n Downloading https://files.pythonhosted.org/packages/c5/10/369f50bcd4621b263927b0a1519987a04383d4a98fb10438042ad410cf88/singledispatch-3.4.0.3-py2.py3-none-any.whl\nBuilding wheels for collected packages: nltk\n Building wheel for nltk (setup.py): started\n Building wheel for nltk (setup.py): finished with status 'done'\n Stored in directory: C:\\Users\\Aditya\\AppData\\Local\\pip\\Cache\\wheels\\4b\\c8\\24\\b2343664bcceb7147efeb21c0b23703a05b23fcfeaceaa2a1e\nSuccessfully built nltk\nInstalling collected packages: singledispatch, nltk\nSuccessfully installed nltk-3.4 singledispatch-3.4.0.3\n" ] ], [ [ "Importing NLTK packages\n", "_____no_output_____" ] ], [ [ "import nltk\nimport pandas as pd", "_____no_output_____" ], [ "restuarant = pd.read_csv(\"User_restaurants_reviews.csv\")", "_____no_output_____" ], [ "restuarant.head()", "_____no_output_____" ], [ "from nltk.tokenize import sent_tokenize, word_tokenize \nexample_text = restuarant[\"Review\"][1]\nprint(example_text)", "I learned that if an electric slicer is used the blade becomes hot enough to start to cook the prosciutto.\n" ], [ "nltk.download('stopwords')", "[nltk_data] Downloading package stopwords to\n[nltk_data] C:\\Users\\Aditya\\AppData\\Roaming\\nltk_data...\n[nltk_data] Package stopwords is already up-to-date!\n" ] ], [ [ "Importing stopwords and filtering data using list comprehension", "_____no_output_____" ] ], [ [ "from nltk.corpus import stopwords \nstop_words = set(stopwords.words('english')) ##Selecting the stop words we want\nprint(len(stop_words))\nprint(stop_words)", "179\n{'have', 'didn', 'below', 'herself', 'my', 'the', 'when', 'y', 'for', 'how', 'had', 'because', 'between', 'some', 'this', 'themselves', 'a', 'ours', \"you're\", 'shan', 'nor', 'own', \"doesn't\", 'will', 'so', 'mustn', 'same', 'over', 'she', 'doing', 'mightn', 's', 'during', 'we', 'them', \"wasn't\", 'did', 'after', 'why', \"don't\", 'himself', 'yourselves', 've', 'itself', 'into', \"wouldn't\", 'haven', 'now', 'against', 'weren', 'just', 'once', \"you've\", \"aren't\", 'not', 'all', 'be', 'him', 'ma', \"needn't\", 'having', \"hadn't\", 'been', 'yourself', 'these', 'were', 'his', 're', \"haven't\", 'more', 'll', 'theirs', 'no', 'before', 'on', 'only', 'couldn', 'can', 't', 'while', \"couldn't\", 'was', 'from', 'me', 'here', 'hadn', 'their', 'who', \"you'll\", 'do', 'm', 'any', 'about', 'if', 'what', \"mustn't\", 'of', 'has', 'further', 'wouldn', 'aren', 'wasn', 'by', 'hasn', 'very', \"hasn't\", \"weren't\", 'is', 'hers', \"shouldn't\", 'it', \"didn't\", 'whom', 'that', 'again', \"that'll\", 'being', 'those', 'too', 'i', 'he', 'you', 'yours', 'off', 'your', 'in', 'out', 'as', 'to', 'most', 'isn', 'they', 'other', 'and', 'shouldn', 'd', 'ourselves', 'its', 'up', 'or', \"shan't\", 'few', 'above', \"won't\", 'which', \"mightn't\", 'down', 'where', 'does', 'until', \"she's\", 'with', 'each', 'o', 'needn', \"it's\", \"isn't\", 'than', 'then', 'should', 'her', 'through', 'at', 'doesn', 'am', 'but', 'under', \"you'd\", 'don', 'are', 'ain', 'such', 'both', 'won', \"should've\", 'there', 'an', 'our', 'myself'}\n" ], [ "nltk.download('punkt')", "[nltk_data] Downloading package punkt to\n[nltk_data] C:\\Users\\Aditya\\AppData\\Roaming\\nltk_data...\n[nltk_data] Unzipping tokenizers\\punkt.zip.\n" ], [ "word_tokens = word_tokenize(example_text)\nprint(word_tokens)", "['I', 'learned', 'that', 'if', 'an', 'electric', 'slicer', 'is', 'used', 'the', 'blade', 'becomes', 'hot', 'enough', 'to', 'start', 'to', 'cook', 'the', 'prosciutto', '.']\n" ], [ "filtered_sentence = [word for word in word_tokens if not word in stop_words] \nprint(filtered_sentence)", "['I', 'learned', 'electric', 'slicer', 'used', 'blade', 'becomes', 'hot', 'enough', 'start', 'cook', 'prosciutto', '.']\n" ] ], [ [ "Stemming the sentence", "_____no_output_____" ] ], [ [ "from nltk.stem import PorterStemmer \nstemmer = PorterStemmer()", "_____no_output_____" ], [ "stem_tokens=[stemmer.stem(word) for word in word_tokens]\nprint(stem_tokens)", "['I', 'learn', 'that', 'if', 'an', 'electr', 'slicer', 'is', 'use', 'the', 'blade', 'becom', 'hot', 'enough', 'to', 'start', 'to', 'cook', 'the', 'prosciutto', '.']\n" ] ], [ [ "Comparing the stemmed sentence using jaccard similarity", "_____no_output_____" ] ], [ [ "from sklearn.metrics import jaccard_similarity_score\n\nscore = jaccard_similarity_score(word_tokens,stem_tokens)\nprint(score)", "0.8095238095238095\n" ], [ "nltk.download('averaged_perceptron_tagger')", "[nltk_data] Downloading package averaged_perceptron_tagger to\n[nltk_data] C:\\Users\\Aditya\\AppData\\Roaming\\nltk_data...\n[nltk_data] Unzipping taggers\\averaged_perceptron_tagger.zip.\n" ], [ "#Write a function to get all the possible POS tags of NLTK?\ntext = word_tokenize(\"And then therefore it was something completely different\")\nnltk.pos_tag(text)", "_____no_output_____" ], [ "nltk.download('tagsets')", "[nltk_data] Downloading package tagsets to\n[nltk_data] C:\\Users\\Aditya\\AppData\\Roaming\\nltk_data...\n[nltk_data] Unzipping help\\tagsets.zip.\n" ], [ "def all_pos_tags():\n print(nltk.help.upenn_tagset())\n\nall_pos_tags()", "$: dollar\n $ -$ --$ A$ C$ HK$ M$ NZ$ S$ U.S.$ US$\n'': closing quotation mark\n ' ''\n(: opening parenthesis\n ( [ {\n): closing parenthesis\n ) ] }\n,: comma\n ,\n--: dash\n --\n.: sentence terminator\n . ! ?\n:: colon or ellipsis\n : ; ...\nCC: conjunction, coordinating\n & 'n and both but either et for less minus neither nor or plus so\n therefore times v. versus vs. whether yet\nCD: numeral, cardinal\n mid-1890 nine-thirty forty-two one-tenth ten million 0.5 one forty-\n seven 1987 twenty '79 zero two 78-degrees eighty-four IX '60s .025\n fifteen 271,124 dozen quintillion DM2,000 ...\nDT: determiner\n all an another any both del each either every half la many much nary\n neither no some such that the them these this those\nEX: existential there\n there\nFW: foreign word\n gemeinschaft hund ich jeux habeas Haementeria Herr K'ang-si vous\n lutihaw alai je jour objets salutaris fille quibusdam pas trop Monte\n terram fiche oui corporis ...\nIN: preposition or conjunction, subordinating\n astride among uppon whether out inside pro despite on by throughout\n below within for towards near behind atop around if like until below\n next into if beside ...\nJJ: adjective or numeral, ordinal\n third ill-mannered pre-war regrettable oiled calamitous first separable\n ectoplasmic battery-powered participatory fourth still-to-be-named\n multilingual multi-disciplinary ...\nJJR: adjective, comparative\n bleaker braver breezier briefer brighter brisker broader bumper busier\n calmer cheaper choosier cleaner clearer closer colder commoner costlier\n cozier creamier crunchier cuter ...\nJJS: adjective, superlative\n calmest cheapest choicest classiest cleanest clearest closest commonest\n corniest costliest crassest creepiest crudest cutest darkest deadliest\n dearest deepest densest dinkiest ...\nLS: list item marker\n A A. B B. C C. D E F First G H I J K One SP-44001 SP-44002 SP-44005\n SP-44007 Second Third Three Two * a b c d first five four one six three\n two\nMD: modal auxiliary\n can cannot could couldn't dare may might must need ought shall should\n shouldn't will would\nNN: noun, common, singular or mass\n common-carrier cabbage knuckle-duster Casino afghan shed thermostat\n investment slide humour falloff slick wind hyena override subhumanity\n machinist ...\nNNP: noun, proper, singular\n Motown Venneboerger Czestochwa Ranzer Conchita Trumplane Christos\n Oceanside Escobar Kreisler Sawyer Cougar Yvette Ervin ODI Darryl CTCA\n Shannon A.K.C. Meltex Liverpool ...\nNNPS: noun, proper, plural\n Americans Americas Amharas Amityvilles Amusements Anarcho-Syndicalists\n Andalusians Andes Andruses Angels Animals Anthony Antilles Antiques\n Apache Apaches Apocrypha ...\nNNS: noun, common, plural\n undergraduates scotches bric-a-brac products bodyguards facets coasts\n divestitures storehouses designs clubs fragrances averages\n subjectivists apprehensions muses factory-jobs ...\nPDT: pre-determiner\n all both half many quite such sure this\nPOS: genitive marker\n ' 's\nPRP: pronoun, personal\n hers herself him himself hisself it itself me myself one oneself ours\n ourselves ownself self she thee theirs them themselves they thou thy us\nPRP$: pronoun, possessive\n her his mine my our ours their thy your\nRB: adverb\n occasionally unabatingly maddeningly adventurously professedly\n stirringly prominently technologically magisterially predominately\n swiftly fiscally pitilessly ...\nRBR: adverb, comparative\n further gloomier grander graver greater grimmer harder harsher\n healthier heavier higher however larger later leaner lengthier less-\n perfectly lesser lonelier longer louder lower more ...\nRBS: adverb, superlative\n best biggest bluntest earliest farthest first furthest hardest\n heartiest highest largest least less most nearest second tightest worst\nRP: particle\n aboard about across along apart around aside at away back before behind\n by crop down ever fast for forth from go high i.e. in into just later\n low more off on open out over per pie raising start teeth that through\n under unto up up-pp upon whole with you\nSYM: symbol\n % & ' '' ''. ) ). * + ,. < = > @ A[fj] U.S U.S.S.R * ** ***\nTO: \"to\" as preposition or infinitive marker\n to\nUH: interjection\n Goodbye Goody Gosh Wow Jeepers Jee-sus Hubba Hey Kee-reist Oops amen\n huh howdy uh dammit whammo shucks heck anyways whodunnit honey golly\n man baby diddle hush sonuvabitch ...\nVB: verb, base form\n ask assemble assess assign assume atone attention avoid bake balkanize\n bank begin behold believe bend benefit bevel beware bless boil bomb\n boost brace break bring broil brush build ...\nVBD: verb, past tense\n dipped pleaded swiped regummed soaked tidied convened halted registered\n cushioned exacted snubbed strode aimed adopted belied figgered\n speculated wore appreciated contemplated ...\nVBG: verb, present participle or gerund\n telegraphing stirring focusing angering judging stalling lactating\n hankerin' alleging veering capping approaching traveling besieging\n encrypting interrupting erasing wincing ...\nVBN: verb, past participle\n multihulled dilapidated aerosolized chaired languished panelized used\n experimented flourished imitated reunifed factored condensed sheared\n unsettled primed dubbed desired ...\nVBP: verb, present tense, not 3rd person singular\n predominate wrap resort sue twist spill cure lengthen brush terminate\n appear tend stray glisten obtain comprise detest tease attract\n emphasize mold postpone sever return wag ...\nVBZ: verb, present tense, 3rd person singular\n bases reconstructs marks mixes displeases seals carps weaves snatches\n slumps stretches authorizes smolders pictures emerges stockpiles\n seduces fizzes uses bolsters slaps speaks pleads ...\nWDT: WH-determiner\n that what whatever which whichever\nWP: WH-pronoun\n that what whatever whatsoever which who whom whosoever\nWP$: WH-pronoun, possessive\n whose\nWRB: Wh-adverb\n how however whence whenever where whereby whereever wherein whereof why\n``: opening quotation mark\n ` ``\nNone\n" ], [ "#Write a function to remove punctuation in NLTK\n\ndef remove_punctuation(s):\n words = nltk.word_tokenize(s)\n words=[word.lower() for word in words if word.isalpha()]\n print(words)\nstr1 = restuarant[\"Review\"][12]\nremove_punctuation(str1)", "['now', 'i', 'am', 'getting', 'angry', 'and', 'i', 'want', 'my', 'damn', 'pho']\n" ], [ "#Write a function to remove stop words in NLTK\n\ndef remove_stop_words(s):\n word_tokens = word_tokenize(s)\n print(word_tokens)\n filtered_sentence = [word for word in word_tokens if not word in stop_words] \n print(filtered_sentence)\nstr1 = restuarant[\"Review\"][20]\nremove_stop_words(str1)", "['That', 'was', \"n't\", 'even', 'all', 'that', 'great', 'to', 'begin', 'with', '?']\n['That', \"n't\", 'even', 'great', 'begin', '?']\n" ], [ "#Write a function to tokenise a sentence in NLTK\n\ndef tokenize_sentence(s):\n word_tokens = word_tokenize(s)\n print(word_tokens)\nstr1 = restuarant[\"Review\"][20]\ntokenize_sentence(str1)", "['That', 'was', \"n't\", 'even', 'all', 'that', 'great', 'to', 'begin', 'with', '?']\n" ], [ "Write a function to check whether the word is a German word or not? https://stackoverflow.com/questions/3788870/how-to-check-if-a-word-is-an-english-word-with-python\n\nWrite a function to get the human names from the text below: President Abraham Lincoln suspended the writ of habeas corpus in the Civil War. President Franklin D. Roosevelt claimed emergency powers to fight the Great Depression and World War II. President George W. Bush adopted an expansive concept of White House power after 9/11. President Barack Obama used executive action to shield some undocumented immigrants from deportation.\n\nWrite a function to create a word cloud using Python (with or without NLTK)", "_____no_output_____" ] ], [ [ "#jupyter kernelspec install-self --user\n1. Remove stop words from the content by using NLTK English stop words\n\n2. Get the stem by using Stemming\n\n3. Get the Similarity between two strings by using Jaccard Similarity\n\n4. Write a function to get all the possible POS tags of NLTK?\n\n5. Write a function to check whether the word is a German word or not?\nhttps://stackoverflow.com/questions/3788870/how-to-check-if-a-word-is-an-english-word-with-python\n\n6. Write a function to remove punctuation in NLTK\n\n7. Write a function to remove stop words using NLTK\n\n8. Write a function to tokenize a single sentence using NLTK\n\n9. Write a function to get the human names from the text below:\nPresident Abraham Lincoln suspended the writ of habeas corpus in the Civil War. President Franklin D. Roosevelt claimed emergency powers to fight the Great Depression and World War II. President George W. Bush adopted an expansive concept of White House power after 9/11. President Barack Obama used executive action to shield some undocumented immigrants from deportation.\n\n10. Write a function to create a word cloud using Python (with or without NLTK)\n\n11. How to get alpha numeric characters as tokens in NLTK\n\n12. How to remove all punctuation marks and non-alpha numeric characters?\n\n13. How to create a new corpus with NLTK?\n\n14. How to change the NLTK Download directory in Code?\n\n15. Show a small sample with pyStatParser\n\n16. How to get phrasses form text entries?\n\n17. How to use Chunk Extraction in NLTK?\n\n18. UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xcb in position 0: ordinal not in range(128)\nFix this issue\n\n19. Generate tag from text content\n\n20. Show a simple NLTK sample using Stanford NER Algorithm\n\n21. How to tokenize a string in NLTK?\n\n22. How to replace 1,2,3.. with “1st, 2nd, 3rd”\nHow to generate strings like “1st, 2nd, 3rd ..”\n\n23. How to extract number from text:\nHow to get the price from Kijiji or Craiglist content\n\n24. How to classify documents into categories\n\n25. Identify the language from the text\n\n26. Check grammar in the sentence by using Python\n\n27. Write a simple example to show dependency parsing in NLTK?\n\n28. Identify place in this sentence\nBolt was born on 21 August 1986 to parents Wellesley and Jennifer Bolt in Sherwood Content, a small town in Jamaica.\nHe has a brother, Sadiki, and a sister, Sherine.\nHis parents ran the local grocery store in the rural area, and Bolt spent his time playing cricket and football in the street with his brother, later saying, “When I was young, I didn’t really think about anything other than sports.”\nAs the reigning 200 m champion at both the World Youth and World Junior championships, Bolt hoped to take a clean sweep of the world 200 m championships in the Senior World Championships in Paris.\n\n29. Find all cities in this page:\n\n30. Convert “spamming” to “spam” by using Lemmatizer\n\n31. Write a simple code to show Perceptron tagger\n\n32. Write an example code to show PunktSentenceTokenizer\n\n33. Convert past tense “gave” to present tense “give” by using NLTK\n\n34. Write a code to show WordNetLemmatizer\n\n35. Write a code show MultiNomial Naive Bayes and NLTK\n\n36. Write an example to show NLTK Collocation\n\n37. Identify Gender from the given sentence by using NLTK\nKelly and John went to meet Ryan and Jenni. But Jenni was not there when they reached the place.\n\n38. Write a code showcase FreqDist in python\n\n39. Do a sentiment analysis on thie sentence\nI love this sandwich\n\n40. Collect nouns from this sentence\nI am John from Toronto\n\n41. Compute N Grams in this sentence\nBolt was born on 21 August 1986 to parents Wellesley and Jennifer Bolt in Sherwood Content, a small town in Jamaica.\nHe has a brother, Sadiki, and a sister, Sherine.\nHis parents ran the local grocery store in the rural area, and Bolt spent his time playing cricket and football in the street with his brother, later saying, “When I was young, I didn’t really think about anything other than sports.”\nAs the reigning 200 m champion at both the World Youth and World Junior championships, Bolt hoped to take a clean sweep of the world 200 m championships in the Senior World Championships in Paris.\n\n42. Write a code to use WordNik\n\n43. Find meaning of “Dunk” by using Cambring API\nhttps://dictionary-api.cambridge.org/\n\n44. How to count the frequency of bigram?\nUse the sentence below\nI love Canada . I am so in love with Canada . Canada is great . samsung is great . I really really love Canadian cities. America can never beat Canada . Canada is better than America\n\n45. Count the verbs in this sentence:\nBolt was born on 21 August 1986 to parents Wellesley and Jennifer Bolt in Sherwood Content, a small town in Jamaica.\nHe has a brother, Sadiki, and a sister, Sherine.\nHis parents ran the local grocery store in the rural area, and Bolt spent his time playing cricket and football in the street with his brother, later saying, “When I was young, I didn’t really think about anything other than sports.”\nAs the reigning 200 m champion at both the World Youth and World Junior championships, Bolt hoped to take a clean sweep of the world 200 m championships in the Senior World Championships in Paris.\n\n46. Show a simple example using ANTLR\nhttps://www.antlr.org/\n\n47. Simple example to show Latent Semantic Modeling in NLTK\n\n48. Show an exmple for Singular Value Decomposition\n\n49. Use LDA in NLTK\n\n50. Show a simple example using NLTK GAE\nhttps://github.com/rutherford/nltk-gae\n\n51. Show a simple exaple using Penn Treebank\n\n52. Do a simple Sentiment Analysis with NLTK and Naive Bayes\n\n53. Write a code to get top terms with TF-IDF score\n\n54. Compare two sentences\n\n55. Find the probability of a word in a given sentence\n\n56. Compare “car” and “äutomobile” by using Wordnet\n\n57. Check the frequency of similar words\n\n58. Show an example using MaltParser\n\n59. Identify the subject of the sentence\n\n60. How to extract word from Synset? Show an example\n\n61. Generate sentences by using\n\n62. Print random sentences like in Lorem Ipsum\n\n63. Count ngrams in the sentence below:\nBolt was born on 21 August 1986 to parents Wellesley and Jennifer Bolt in Sherwood Content, a small town in Jamaica.\nHe has a brother, Sadiki, and a sister, Sherine.\nHis parents ran the local grocery store in the rural area, and Bolt spent his time playing cricket and football in the street with his brother, later saying, “When I was young, I didn’t really think about anything other than sports.”\nAs the reigning 200 m champion at both the World Youth and World Junior championships, Bolt hoped to take a clean sweep of the world 200 m championships in the Senior World Championships in Paris.\n\n64. Use MaltParser in Python\n\n65. Generate tags on any celebrity’s tweets?\n\n66. Write a code to show TF-IDF\n\n67. Classify moview reviews as “good” or “bad” by using NLTK\n\n68. Show a sample for Alignment model in NLTK\n\n69. How to save an alignment model in NLTK?\n\n70. Find verbs in the given sentence\nBolt was born on 21 August 1986 to parents Wellesley and Jennifer Bolt in Sherwood Content, a small town in Jamaica.\nHe has a brother, Sadiki, and a sister, Sherine.\nHis parents ran the local grocery store in the rural area, and Bolt spent his time playing cricket and football in the street with his brother, later saying, “When I was young, I didn’t really think about anything other than sports.”\nAs the reigning 200 m champion at both the World Youth and World Junior championships, Bolt hoped to take a clean sweep of the world 200 m championships in the Senior World Championships in Paris.\n\n71. Get Named Entities from the sentence\nBolt was born on 21 August 1986 to parents Wellesley and Jennifer Bolt in Sherwood Content, a small town in Jamaica.\nHe has a brother, Sadiki, and a sister, Sherine.\nHis parents ran the local grocery store in the rural area, and Bolt spent his time playing cricket and football in the street with his brother, later saying, “When I was young, I didn’t really think about anything other than sports.”\nAs the reigning 200 m champion at both the World Youth and World Junior championships, Bolt hoped to take a clean sweep of the world 200 m championships in the Senior World Championships in Paris.\n\n72. Write a code to use Vader Sentiment Analyzer\n\n73. Generat Random text in Python\n\n74. Find the cosine similarity of two sentences\nJulie loves me more than Linda loves me\nJane likes me more than Julie loves me\n\n75. Show an example using ViterbiParser\n\n76. Show a simple sentiment analysis by using Pointwise Mutual Information\n\n77. Use NER to find persons\n\n78. How to parse multiple sentences using MaltParser?\n\n79. Find the tense of the sentence\n\n80. How to calculate BLEU score for a sentence\n\n81. How to find given word is singular or not?\n\n82. How to identify contractions in a given sentence\n\n83. Find the similarity between “cheap” and “low price” by using NLTK\n\n84. In the given sentence “John” spelled wrong as “Jhon”. How to find biblical names and fix these typos?\n\n85. Show an exmple to use Metaphones in NLTK or Python\n\n86. Show an example to use FuzzyWuzzy\n\n87. How to use Stanford Relation Extractor?\n\n88. Show an example to find the named entities\n\n89. Find the Sentiment by using SentiWordNet\n\n90. Create a custom Corpus by using NLTK?\n\n91. Show an example to extract relationships using NLTK?\n\n92. Fix this code issue\n\n93. Identify short form in the sentence by using NLTK\n“ty. U did an awesome job. However, It would b gr8 If you type w/o short forms”\n\n94. How to auto label the given texts\n\n95. Identify food names in the given sentence\nI had some Chips and Turkey for the lunch. Later I had some ice cream and rice in the evening.\n\n96. Find the specific phrase by using NLTK Regex\nThe pizza was awesome and brilliant\n\n97. Convert these lines to two sentences by using Sentence tokenizer?\nFig. 2 shows a U.S.A. map. However, this is not exactly right\n\n98. How to convert this positive sentence to negative\nAnna is a great girl and she learn things quickly.\n\n99. Find the general synonyms\n\n100. Show an example to extract useful sentences by using NLTK\n", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ] ]
e7e38181ab1c5567661e90d62ed6909d9290814c
516,797
ipynb
Jupyter Notebook
ids_R.ipynb
MadhavJivrajani/IDS2019_Project
8eae458b0eebc39e1eecda0b8bbbf33f714574c8
[ "MIT" ]
null
null
null
ids_R.ipynb
MadhavJivrajani/IDS2019_Project
8eae458b0eebc39e1eecda0b8bbbf33f714574c8
[ "MIT" ]
null
null
null
ids_R.ipynb
MadhavJivrajani/IDS2019_Project
8eae458b0eebc39e1eecda0b8bbbf33f714574c8
[ "MIT" ]
null
null
null
418.12055
214,182
0.900241
[ [ [ "library(tidyverse) ", "── \u001b[1mAttaching packages\u001b[22m ─────────────────────────────────────── tidyverse 1.2.1 ──\n\u001b[32m✔\u001b[39m \u001b[34mggplot2\u001b[39m 3.2.1 \u001b[32m✔\u001b[39m \u001b[34mpurrr \u001b[39m 0.3.3\n\u001b[32m✔\u001b[39m \u001b[34mtibble \u001b[39m 2.1.3 \u001b[32m✔\u001b[39m \u001b[34mdplyr \u001b[39m 0.8.3\n\u001b[32m✔\u001b[39m \u001b[34mtidyr \u001b[39m 1.0.0 \u001b[32m✔\u001b[39m \u001b[34mstringr\u001b[39m 1.4.0\n\u001b[32m✔\u001b[39m \u001b[34mreadr \u001b[39m 1.3.1 \u001b[32m✔\u001b[39m \u001b[34mforcats\u001b[39m 0.4.0\n── \u001b[1mConflicts\u001b[22m ────────────────────────────────────────── tidyverse_conflicts() ──\n\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mfilter()\u001b[39m masks \u001b[34mstats\u001b[39m::filter()\n\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mlag()\u001b[39m masks \u001b[34mstats\u001b[39m::lag()\n" ], [ "library(tidyverse) # general\nlibrary(countrycode) # continent\nlibrary(rworldmap) # quick country-level heat maps\nlibrary(gridExtra) # plots\nlibrary(broom)", "Loading required package: sp\n### Welcome to rworldmap ###\nFor a short introduction type : \t vignette('rworldmap')\n\nAttaching package: ‘gridExtra’\n\nThe following object is masked from ‘package:dplyr’:\n\n combine\n\n" ], [ "ensureCranPkg <- function(pkg) {\n if(!suppressWarnings(requireNamespace(pkg, quietly = TRUE))) {\n install.packages(pkg)\n }\n}", "_____no_output_____" ], [ "ensureCranPkg(\"ggalt\")\nensureCranPkg(\"tidyverse\")\nensureCranPkg(\"countrycode\")\nensureCranPkg(\"rworldmap\")\nensureCranPkg(\"gridExtra\")", "Installing package into ‘/home/anand/R/x86_64-pc-linux-gnu-library/3.4’\n(as ‘lib’ is unspecified)\nalso installing the dependency ‘proj4’\n\nWarning message in install.packages(pkg):\n“installation of package ‘proj4’ had non-zero exit status”Warning message in install.packages(pkg):\n“installation of package ‘ggalt’ had non-zero exit status”" ], [ "data <- read_csv(\"datasets/this_is_only_for_reference.csv\")", "Parsed with column specification:\ncols(\n country = \u001b[31mcol_character()\u001b[39m,\n year = \u001b[32mcol_double()\u001b[39m,\n sex = \u001b[31mcol_character()\u001b[39m,\n age = \u001b[31mcol_character()\u001b[39m,\n suicides_no = \u001b[32mcol_double()\u001b[39m,\n population = \u001b[32mcol_double()\u001b[39m,\n `suicides/100k pop` = \u001b[32mcol_double()\u001b[39m,\n `country-year` = \u001b[31mcol_character()\u001b[39m,\n `HDI for year` = \u001b[32mcol_double()\u001b[39m,\n `gdp_for_year ($)` = \u001b[32mcol_number()\u001b[39m,\n `gdp_per_capita ($)` = \u001b[32mcol_double()\u001b[39m,\n generation = \u001b[31mcol_character()\u001b[39m\n)\n" ], [ "data <- data %>% \n select(-c(`HDI for year`, `suicides/100k pop`)) %>%\n rename(gdp_for_year = `gdp_for_year ($)`, \n gdp_per_capita = `gdp_per_capita ($)`, \n country_year = `country-year`) %>%\n as.data.frame()", "_____no_output_____" ], [ "data <- data %>%\n filter(year != 2016) %>% # I therefore exclude 2016 data\n select(-country_year)", "_____no_output_____" ], [ "minimum_years <- data %>%\n group_by(country) %>%\n summarize(rows = n(), \n years = rows / 12) %>%\n arrange(years)\n\ndata <- data %>%\n filter(!(country %in% head(minimum_years$country, 7)))", "_____no_output_____" ], [ "library(countrycode)", "_____no_output_____" ], [ "data$age <- gsub(\" years\", \"\", data$age)\ndata$sex <- ifelse(data$sex == \"male\", \"Male\", \"Female\")\n\n\n# getting continent data:\ndata$continent <- countrycode(sourcevar = data[, \"country\"],\n origin = \"country.name\",\n destination = \"continent\")\n\n# Nominal factors\ndata_nominal <- c('country', 'sex', 'continent')\ndata[data_nominal] <- lapply(data[data_nominal], function(x){factor(x)})\n\n\n# Making age ordinal\ndata$age <- factor(data$age, \n ordered = T, \n levels = c(\"5-14\",\n \"15-24\", \n \"25-34\", \n \"35-54\", \n \"55-74\", \n \"75+\"))\n\n# Making generation ordinal\ndata$generation <- factor(data$generation, \n ordered = T, \n levels = c(\"G.I. Generation\", \n \"Silent\",\n \"Boomers\", \n \"Generation X\", \n \"Millenials\", \n \"Generation Z\"))\n\ndata <- as_tibble(data)\n\n\n# the global rate over the time period will be useful:\n\nglobal_average <- (sum(as.numeric(data$suicides_no)) / sum(as.numeric(data$population))) * 100000", "_____no_output_____" ], [ "continent <- data %>%\n group_by(continent) %>%\n summarize(suicide_per_100k = (sum(as.numeric(suicides_no)) / sum(as.numeric(population))) * 100000) %>%\n arrange(suicide_per_100k)\n\ncontinent$continent <- factor(continent$continent, ordered = T, levels = continent$continent)\n\ncontinent_plot <- ggplot(continent, aes(x = continent, y = suicide_per_100k, fill = continent)) + \n geom_bar(stat = \"identity\") + \n labs(title = \"Global Suicides (per 100k), by Continent\",\n x = \"Continent\", \n y = \"Suicides per 100k\", \n fill = \"Continent\") +\n theme(legend.position = \"none\", title = element_text(size = 10)) + \n scale_y_continuous(breaks = seq(0, 20, 1), minor_breaks = F)", "_____no_output_____" ], [ "continent_plot", "_____no_output_____" ], [ "country <- data %>%\n group_by(country, continent) %>%\n summarize(n = n(), \n suicide_per_100k = (sum(as.numeric(suicides_no)) / sum(as.numeric(population))) * 100000) %>%\n arrange(desc(suicide_per_100k))\n\ncountry$country <- factor(country$country, \n ordered = T, \n levels = rev(country$country))\n\nggplot(country, aes(x = country, y = suicide_per_100k, fill = continent)) + \n geom_bar(stat = \"identity\") + \n geom_hline(yintercept = global_average, linetype = 2, color = \"grey35\", size = 1) +\n labs(title = \"Global suicides per 100k, by Country\",\n x = \"Country\", \n y = \"Suicides per 100k\", \n fill = \"Continent\") +\n coord_flip() +\n scale_y_continuous(breaks = seq(0, 45, 2)) + \n theme(legend.position = \"bottom\")", "_____no_output_____" ], [ "age_plot <- data %>%\n group_by(age) %>%\n summarize(suicide_per_100k = (sum(as.numeric(suicides_no)) / sum(as.numeric(population))) * 100000) %>%\n ggplot(aes(x = age, y = suicide_per_100k, fill = age)) + \n geom_bar(stat = \"identity\") + \n labs(title = \"Global suicides per 100k, by Age\",\n x = \"Age\", \n y = \"Suicides per 100k\") +\n theme(legend.position = \"none\") + \n scale_y_continuous(breaks = seq(0, 30, 1), minor_breaks = F)", "_____no_output_____" ], [ "age_plot", "_____no_output_____" ], [ "glimpse(data)", "Observations: 27,492\nVariables: 10\n$ country \u001b[3m\u001b[38;5;246m<fct>\u001b[39m\u001b[23m Albania, Albania, Albania, Albania, Albania, Albania, …\n$ year \u001b[3m\u001b[38;5;246m<dbl>\u001b[39m\u001b[23m 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, 1987, …\n$ sex \u001b[3m\u001b[38;5;246m<fct>\u001b[39m\u001b[23m Male, Male, Female, Male, Male, Female, Female, Female…\n$ age \u001b[3m\u001b[38;5;246m<ord>\u001b[39m\u001b[23m 15-24, 35-54, 15-24, 75+, 25-34, 75+, 35-54, 25-34, 55…\n$ suicides_no \u001b[3m\u001b[38;5;246m<dbl>\u001b[39m\u001b[23m 21, 16, 14, 1, 9, 1, 6, 4, 1, 0, 0, 0, 2, 17, 1, 14, 4…\n$ population \u001b[3m\u001b[38;5;246m<dbl>\u001b[39m\u001b[23m 312900, 308000, 289700, 21800, 274300, 35600, 278800, …\n$ gdp_for_year \u001b[3m\u001b[38;5;246m<dbl>\u001b[39m\u001b[23m 2156624900, 2156624900, 2156624900, 2156624900, 215662…\n$ gdp_per_capita \u001b[3m\u001b[38;5;246m<dbl>\u001b[39m\u001b[23m 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796,…\n$ generation \u001b[3m\u001b[38;5;246m<ord>\u001b[39m\u001b[23m Generation X, Silent, Generation X, G.I. Generation, B…\n$ continent \u001b[3m\u001b[38;5;246m<fct>\u001b[39m\u001b[23m Europe, Europe, Europe, Europe, Europe, Europe, Europe…\n" ], [ "corrplot.mixed(corr = cor(data[,c(\"year\",\"suicides_no\",\"population\",\"gdp_for_year\",\"gdp_per_capita\")]))", "_____no_output_____" ], [ "library(corrplot)", "corrplot 0.84 loaded\n" ], [ "country_mean_gdp <- data %>%\n group_by(country, continent) %>%\n summarize(suicide_per_100k = (sum(as.numeric(suicides_no)) / sum(as.numeric(population))) * 100000, \n gdp_per_capita = mean(gdp_per_capita))\n\nggplot(country_mean_gdp, aes(x = gdp_per_capita, y = suicide_per_100k, col = continent)) + \n geom_point() + \n scale_x_continuous(labels=scales::dollar_format(prefix=\"$\"), breaks = seq(0, 70000, 10000)) + \n labs(title = \"Correlation between GDP (per capita) and Suicides per 100k\", \n subtitle = \"Plot containing every country\",\n x = \"GDP (per capita)\", \n y = \"Suicides per 100k\", \n col = \"Continent\") ", "_____no_output_____" ], [ "data", "_____no_output_____" ], [ "data['gdp_per_capita ($)']", "_____no_output_____" ], [ "x=data.frame(data['gdp_per_capita ($)'])", "_____no_output_____" ], [ "y=data.frame(data['suicides/100k pop'])", "_____no_output_____" ], [ "plot(x,y,pch=19)", "_____no_output_____" ], [ "p <- plot(data['gdp_per_capita ($)'],data['suicides/100k pop'],pch=19)\nfit <- lm(y~poly(x,2,raw=TRUE)) \nprint(p)", "_____no_output_____" ], [ "data %>%\n group_by(continent, age) %>%\n summarize(n = n(), \n suicides = sum(as.numeric(suicides_no)), \n population = sum(as.numeric(population)), \n suicide_per_100k = (suicides / population) * 100000) %>%\n ggplot(aes(x = continent, y = suicide_per_100k, fill = age)) + \n geom_bar(stat = \"identity\", position = \"dodge\") + \n geom_hline(yintercept = global_average, linetype = 2, color = \"grey35\", size = 1) +\n labs(title = \"Age Disparity, by Continent\",\n x = \"Continent\", \n y = \"Suicides per 100k\", \n fill = \"Age\")", "_____no_output_____" ], [ "library(tidyr)\nlibrary(purrr)", "_____no_output_____" ], [ "ggplot(gdp_suicide_no_outliers, aes(x = gdp_per_capita, y = suicide_per_100k, col = continent)) + \n geom_point() + \n geom_smooth(method = \"lm\", aes(group = 1)) + \n scale_x_continuous(labels=scales::dollar_format(prefix=\"$\"), breaks = seq(0, 70000, 10000)) + \n labs(title = \"Correlation between GDP (per capita) and Suicides per 100k\", \n subtitle = \"Plot with high CooksD countries removed (5/93 total)\",\n x = \"GDP (per capita)\", \n y = \"Suicides per 100k\", \n col = \"Continent\") + \n theme(legend.position = \"none\")", "_____no_output_____" ], [ "gdp_suicide_no_outliers <- model1 %>%\n augment() %>%\n arrange(desc(.cooksd)) %>%\n filter(.cooksd < 4/nrow(.)) %>% # removes 5/93 countries\n inner_join(country_mean_gdp, by = c(\"suicide_per_100k\", \"gdp_per_capita\")) %>%\n select(country, continent, gdp_per_capita, suicide_per_100k)\n\n", "_____no_output_____" ], [ "data_second <- read_csv(\"datasets/this_is_only_for_reference.csv\")", "Parsed with column specification:\ncols(\n country = \u001b[31mcol_character()\u001b[39m,\n year = \u001b[32mcol_double()\u001b[39m,\n sex = \u001b[31mcol_character()\u001b[39m,\n age = \u001b[31mcol_character()\u001b[39m,\n suicides_no = \u001b[32mcol_double()\u001b[39m,\n population = \u001b[32mcol_double()\u001b[39m,\n `suicides/100k pop` = \u001b[32mcol_double()\u001b[39m,\n `country-year` = \u001b[31mcol_character()\u001b[39m,\n `HDI for year` = \u001b[32mcol_double()\u001b[39m,\n `gdp_for_year ($)` = \u001b[32mcol_number()\u001b[39m,\n `gdp_per_capita ($)` = \u001b[32mcol_double()\u001b[39m,\n generation = \u001b[31mcol_character()\u001b[39m\n)\n" ], [ "sapply(data_second, function(x) mean(is.na(df)))", "Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”Warning message in is.na(df):\n“is.na() applied to non-(list or vector) of type 'closure'”" ], [ "model1 <- lm(suicide_per_100k ~ gdp_per_capita, data = country_mean_gdp)", "_____no_output_____" ], [ "gdp_suicide_no_outliers <- model1 %>%\n augment() %>%\n arrange(desc(.cooksd)) %>%\n filter(.cooksd < 4/nrow(.)) %>% # removes 5/93 countries\n inner_join(country_mean_gdp, by = c(\"suicide_per_100k\", \"gdp_per_capita\")) %>%\n select(country, continent, gdp_per_capita, suicide_per_100k)", "_____no_output_____" ], [ "model2 <- lm(suicide_per_100k ~ gdp_per_capita, data = gdp_suicide_no_outliers)", "_____no_output_____" ], [ "summary(model2)", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e38cea1ccd510b490732b6c8c87962ecf25192
29,512
ipynb
Jupyter Notebook
2. Training and Detection.ipynb
luchaoshi45/tensorflow_jupyter_cnn
342f8cd8dabc661aaa6ccd99b2c3c4a9ad12bdc3
[ "MIT" ]
null
null
null
2. Training and Detection.ipynb
luchaoshi45/tensorflow_jupyter_cnn
342f8cd8dabc661aaa6ccd99b2c3c4a9ad12bdc3
[ "MIT" ]
null
null
null
2. Training and Detection.ipynb
luchaoshi45/tensorflow_jupyter_cnn
342f8cd8dabc661aaa6ccd99b2c3c4a9ad12bdc3
[ "MIT" ]
null
null
null
26.927007
398
0.550725
[ [ [ "# 0. Setup Paths", "_____no_output_____" ] ], [ [ "import os", "_____no_output_____" ], [ "CUSTOM_MODEL_NAME = 'my_ssd_mobnet' \nPRETRAINED_MODEL_NAME = 'ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8'\nPRETRAINED_MODEL_URL = 'http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz'\nTF_RECORD_SCRIPT_NAME = 'generate_tfrecord.py'\nLABEL_MAP_NAME = 'label_map.pbtxt'", "_____no_output_____" ], [ "paths = {\n 'WORKSPACE_PATH': os.path.join('Tensorflow', 'workspace'),\n 'SCRIPTS_PATH': os.path.join('Tensorflow','scripts'),\n 'APIMODEL_PATH': os.path.join('Tensorflow','models'),\n 'ANNOTATION_PATH': os.path.join('Tensorflow', 'workspace','annotations'),\n 'IMAGE_PATH': os.path.join('Tensorflow', 'workspace','images'),\n 'MODEL_PATH': os.path.join('Tensorflow', 'workspace','models'),\n 'PRETRAINED_MODEL_PATH': os.path.join('Tensorflow', 'workspace','pre-trained-models'),\n 'CHECKPOINT_PATH': os.path.join('Tensorflow', 'workspace','models',CUSTOM_MODEL_NAME), \n 'OUTPUT_PATH': os.path.join('Tensorflow', 'workspace','models',CUSTOM_MODEL_NAME, 'export'), \n 'TFJS_PATH':os.path.join('Tensorflow', 'workspace','models',CUSTOM_MODEL_NAME, 'tfjsexport'), \n 'TFLITE_PATH':os.path.join('Tensorflow', 'workspace','models',CUSTOM_MODEL_NAME, 'tfliteexport'), \n 'PROTOC_PATH':os.path.join('Tensorflow','protoc')\n }", "_____no_output_____" ], [ "files = {\n 'PIPELINE_CONFIG':os.path.join('Tensorflow', 'workspace','models', CUSTOM_MODEL_NAME, 'pipeline.config'),\n 'TF_RECORD_SCRIPT': os.path.join(paths['SCRIPTS_PATH'], TF_RECORD_SCRIPT_NAME), \n 'LABELMAP': os.path.join(paths['ANNOTATION_PATH'], LABEL_MAP_NAME)\n}", "_____no_output_____" ], [ "for path in paths.values():\n if not os.path.exists(path):\n if os.name == 'posix':\n !mkdir -p {path}\n if os.name == 'nt':\n !mkdir {path}", "_____no_output_____" ] ], [ [ "# 1. Download TF Models Pretrained Models from Tensorflow Model Zoo and Install TFOD", "_____no_output_____" ] ], [ [ "# https://www.tensorflow.org/install/source_windows", "_____no_output_____" ], [ "if os.name=='nt':\n !pip install wget\n import wget", "_____no_output_____" ], [ "if not os.path.exists(os.path.join(paths['APIMODEL_PATH'], 'research', 'object_detection')):\n !git clone https://github.com/tensorflow/models {paths['APIMODEL_PATH']}", "_____no_output_____" ], [ "# Install Tensorflow Object Detection \nif os.name=='posix': \n !apt-get install protobuf-compiler\n !cd Tensorflow/models/research && protoc object_detection/protos/*.proto --python_out=. && cp object_detection/packages/tf2/setup.py . && python -m pip install . \n \nif os.name=='nt':\n url=\"https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-win64.zip\"\n wget.download(url)\n !move protoc-3.15.6-win64.zip {paths['PROTOC_PATH']}\n !cd {paths['PROTOC_PATH']} && tar -xf protoc-3.15.6-win64.zip\n os.environ['PATH'] += os.pathsep + os.path.abspath(os.path.join(paths['PROTOC_PATH'], 'bin')) \n !cd Tensorflow/models/research && protoc object_detection/protos/*.proto --python_out=. && copy object_detection\\\\packages\\\\tf2\\\\setup.py setup.py && python setup.py build && python setup.py install\n !cd Tensorflow/models/research/slim && pip install -e . ", "_____no_output_____" ], [ "VERIFICATION_SCRIPT = os.path.join(paths['APIMODEL_PATH'], 'research', 'object_detection', 'builders', 'model_builder_tf2_test.py')\n# Verify Installation\n!python {VERIFICATION_SCRIPT}", "_____no_output_____" ], [ "!pip install pyyaml\n!pip install tensorflow_io\n!pip install protobuf\n!pip install scipy\n!pip install pillow\n!pip install matplotlib\n!pip install pandas\n!pip install pycocotools", "_____no_output_____" ], [ "!pip install tensorflow --upgrade", "_____no_output_____" ], [ "!pip uninstall protobuf matplotlib -y\n!pip install protobuf matplotlib==3.2", "_____no_output_____" ], [ "import object_detection", "_____no_output_____" ], [ "if os.name =='posix':\n !wget {PRETRAINED_MODEL_URL}\n !mv {PRETRAINED_MODEL_NAME+'.tar.gz'} {paths['PRETRAINED_MODEL_PATH']}\n !cd {paths['PRETRAINED_MODEL_PATH']} && tar -zxvf {PRETRAINED_MODEL_NAME+'.tar.gz'}\nif os.name == 'nt':\n wget.download(PRETRAINED_MODEL_URL)\n !move {PRETRAINED_MODEL_NAME+'.tar.gz'} {paths['PRETRAINED_MODEL_PATH']}\n !cd {paths['PRETRAINED_MODEL_PATH']} && tar -zxvf {PRETRAINED_MODEL_NAME+'.tar.gz'}", "_____no_output_____" ] ], [ [ "# 2. Create Label Map", "_____no_output_____" ] ], [ [ "labels = [{'name':'stone', 'id':1}, {'name':'cloth', 'id':2}, {'name':'scissors', 'id':3}]\n\nwith open(files['LABELMAP'], 'w') as f:\n for label in labels:\n f.write('item { \\n')\n f.write('\\tname:\\'{}\\'\\n'.format(label['name']))\n f.write('\\tid:{}\\n'.format(label['id']))\n f.write('}\\n')", "_____no_output_____" ] ], [ [ "# 3. Create TF records", "_____no_output_____" ] ], [ [ "# OPTIONAL IF RUNNING ON COLAB\nARCHIVE_FILES = os.path.join(paths['IMAGE_PATH'], 'archive.tar.gz')\nif os.path.exists(ARCHIVE_FILES):\n !tar -zxvf {ARCHIVE_FILES}", "_____no_output_____" ], [ "if not os.path.exists(files['TF_RECORD_SCRIPT']):\n !git clone https://github.com/nicknochnack/GenerateTFRecord {paths['SCRIPTS_PATH']}", "_____no_output_____" ], [ "!python {files['TF_RECORD_SCRIPT']} -x {os.path.join(paths['IMAGE_PATH'], 'train')} -l {files['LABELMAP']} -o {os.path.join(paths['ANNOTATION_PATH'], 'train.record')} \n!python {files['TF_RECORD_SCRIPT']} -x {os.path.join(paths['IMAGE_PATH'], 'test')} -l {files['LABELMAP']} -o {os.path.join(paths['ANNOTATION_PATH'], 'test.record')} ", "_____no_output_____" ] ], [ [ "# 4. Copy Model Config to Training Folder", "_____no_output_____" ] ], [ [ "if os.name =='posix':\n !cp {os.path.join(paths['PRETRAINED_MODEL_PATH'], PRETRAINED_MODEL_NAME, 'pipeline.config')} {os.path.join(paths['CHECKPOINT_PATH'])}\nif os.name == 'nt':\n !copy {os.path.join(paths['PRETRAINED_MODEL_PATH'], PRETRAINED_MODEL_NAME, 'pipeline.config')} {os.path.join(paths['CHECKPOINT_PATH'])}", "_____no_output_____" ] ], [ [ "# 5. Update Config For Transfer Learning", "_____no_output_____" ] ], [ [ "import tensorflow as tf\nfrom object_detection.utils import config_util\nfrom object_detection.protos import pipeline_pb2\nfrom google.protobuf import text_format", "_____no_output_____" ], [ "config = config_util.get_configs_from_pipeline_file(files['PIPELINE_CONFIG'])", "_____no_output_____" ], [ "config", "_____no_output_____" ], [ "pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()\nwith tf.io.gfile.GFile(files['PIPELINE_CONFIG'], \"r\") as f: \n proto_str = f.read() \n text_format.Merge(proto_str, pipeline_config) ", "_____no_output_____" ], [ "pipeline_config.model.ssd.num_classes = len(labels)\npipeline_config.train_config.batch_size = 4\npipeline_config.train_config.fine_tune_checkpoint = os.path.join(paths['PRETRAINED_MODEL_PATH'], PRETRAINED_MODEL_NAME, 'checkpoint', 'ckpt-0')\npipeline_config.train_config.fine_tune_checkpoint_type = \"detection\"\npipeline_config.train_input_reader.label_map_path= files['LABELMAP']\npipeline_config.train_input_reader.tf_record_input_reader.input_path[:] = [os.path.join(paths['ANNOTATION_PATH'], 'train.record')]\npipeline_config.eval_input_reader[0].label_map_path = files['LABELMAP']\npipeline_config.eval_input_reader[0].tf_record_input_reader.input_path[:] = [os.path.join(paths['ANNOTATION_PATH'], 'test.record')]", "_____no_output_____" ], [ "config_text = text_format.MessageToString(pipeline_config) \nwith tf.io.gfile.GFile(files['PIPELINE_CONFIG'], \"wb\") as f: \n f.write(config_text) ", "_____no_output_____" ] ], [ [ "# 6. Train the model", "_____no_output_____" ] ], [ [ "!pip install lvis\n!pip install gin\n!pip install gin-config\n!pip install tensorflow_addons", "_____no_output_____" ], [ "TRAINING_SCRIPT = os.path.join(paths['APIMODEL_PATH'], 'research', 'object_detection', 'model_main_tf2.py')", "_____no_output_____" ], [ "command = \"python {} --model_dir={} --pipeline_config_path={} --num_train_steps=2000\".format(TRAINING_SCRIPT, paths['CHECKPOINT_PATH'],files['PIPELINE_CONFIG'])", "_____no_output_____" ], [ "print(command)", "_____no_output_____" ], [ "#!{command}", "_____no_output_____" ] ], [ [ "# 7. Evaluate the Model", "_____no_output_____" ] ], [ [ "command = \"python {} --model_dir={} --pipeline_config_path={} --checkpoint_dir={}\".format(TRAINING_SCRIPT, paths['CHECKPOINT_PATH'],files['PIPELINE_CONFIG'], paths['CHECKPOINT_PATH'])", "_____no_output_____" ], [ "print(command)", "_____no_output_____" ], [ "#!{command}", "_____no_output_____" ] ], [ [ "# 8. Load Train Model From Checkpoint", "_____no_output_____" ] ], [ [ "import os\nimport tensorflow as tf\nfrom object_detection.utils import label_map_util\nfrom object_detection.utils import visualization_utils as viz_utils\nfrom object_detection.builders import model_builder\nfrom object_detection.utils import config_util", "_____no_output_____" ], [ "# Load pipeline config and build a detection model\nconfigs = config_util.get_configs_from_pipeline_file(files['PIPELINE_CONFIG'])\ndetection_model = model_builder.build(model_config=configs['model'], is_training=False)\n\n# Restore checkpoint\nckpt = tf.compat.v2.train.Checkpoint(model=detection_model)\nckpt.restore(os.path.join(paths['CHECKPOINT_PATH'], 'ckpt-3')).expect_partial()\n\[email protected]\ndef detect_fn(image):\n image, shapes = detection_model.preprocess(image)\n prediction_dict = detection_model.predict(image, shapes)\n detections = detection_model.postprocess(prediction_dict, shapes)\n return detections", "_____no_output_____" ] ], [ [ "# 9. Detect from an Image", "_____no_output_____" ] ], [ [ "import cv2 \nimport numpy as np\nfrom matplotlib import pyplot as plt\n%matplotlib inline", "_____no_output_____" ], [ "category_index = label_map_util.create_category_index_from_labelmap(files['LABELMAP'])", "_____no_output_____" ], [ "IMAGE_PATH = os.path.join(paths['IMAGE_PATH'], 'test', 'scissors.ce01a4a7-a850-11ec-85bd-005056c00008.jpg')", "_____no_output_____" ], [ "img = cv2.imread(IMAGE_PATH)\nimage_np = np.array(img)\n\ninput_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32)\ndetections = detect_fn(input_tensor)\n\nnum_detections = int(detections.pop('num_detections'))\ndetections = {key: value[0, :num_detections].numpy()\n for key, value in detections.items()}\ndetections['num_detections'] = num_detections\n\n# detection_classes should be ints.\ndetections['detection_classes'] = detections['detection_classes'].astype(np.int64)\n\nlabel_id_offset = 1\nimage_np_with_detections = image_np.copy()\n\nviz_utils.visualize_boxes_and_labels_on_image_array(\n image_np_with_detections,\n detections['detection_boxes'],\n detections['detection_classes']+label_id_offset,\n detections['detection_scores'],\n category_index,\n use_normalized_coordinates=True,\n max_boxes_to_draw=5,\n min_score_thresh=.8,\n agnostic_mode=False)\n\nplt.imshow(cv2.cvtColor(image_np_with_detections, cv2.COLOR_BGR2RGB))\nplt.show()", "_____no_output_____" ] ], [ [ "# 10. Real Time Detections from your Webcam", "_____no_output_____" ] ], [ [ "!pip uninstall opencv-python-headless -y", "_____no_output_____" ], [ "cap = cv2.VideoCapture(0)\nwidth = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))\nheight = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))\n\nwhile cap.isOpened(): \n ret, frame = cap.read()\n frame = cv2.flip(frame,1,dst=None) #水平镜像\n image_np = np.array(frame)\n \n input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32)\n detections = detect_fn(input_tensor)\n \n num_detections = int(detections.pop('num_detections'))\n detections = {key: value[0, :num_detections].numpy()\n for key, value in detections.items()}\n detections['num_detections'] = num_detections\n\n # detection_classes should be ints.\n detections['detection_classes'] = detections['detection_classes'].astype(np.int64)\n\n label_id_offset = 1\n image_np_with_detections = image_np.copy()\n\n viz_utils.visualize_boxes_and_labels_on_image_array(\n image_np_with_detections,\n detections['detection_boxes'],\n detections['detection_classes']+label_id_offset,\n detections['detection_scores'],\n category_index,\n use_normalized_coordinates=True,\n max_boxes_to_draw=5,\n min_score_thresh=.8,\n agnostic_mode=False)\n\n cv2.imshow('object detection', cv2.resize(image_np_with_detections, (800, 600)))\n \n if cv2.waitKey(10) & 0xFF == ord('q'):\n cap.release()\n cv2.destroyAllWindows()\n break", "_____no_output_____" ] ], [ [ "# 10. Freezing the Graph", "_____no_output_____" ] ], [ [ "FREEZE_SCRIPT = os.path.join(paths['APIMODEL_PATH'], 'research', 'object_detection', 'exporter_main_v2.py ')", "_____no_output_____" ], [ "FREEZE_SCRIPT", "_____no_output_____" ], [ "command = \"python {} --input_type=image_tensor --pipeline_config_path={} --trained_checkpoint_dir={} --output_directory={}\".format(FREEZE_SCRIPT ,files['PIPELINE_CONFIG'], paths['CHECKPOINT_PATH'], paths['OUTPUT_PATH'])", "_____no_output_____" ], [ "print(command)", "_____no_output_____" ], [ "!{command}", "_____no_output_____" ] ], [ [ "# 11. Conversion to TFJS", "_____no_output_____" ] ], [ [ "!pip install tensorflowjs", "_____no_output_____" ], [ "command = \"tensorflowjs_converter --input_format=tf_saved_model --output_node_names='detection_boxes,detection_classes,detection_features,detection_multiclass_scores,detection_scores,num_detections,raw_detection_boxes,raw_detection_scores' --output_format=tfjs_graph_model --signature_name=serving_default {} {}\".format(os.path.join(paths['OUTPUT_PATH'], 'saved_model'), paths['TFJS_PATH'])", "_____no_output_____" ], [ "print(command)", "_____no_output_____" ], [ "!{command}", "_____no_output_____" ], [ "# Test Code: https://github.com/nicknochnack/RealTimeSignLanguageDetectionwithTFJS", "_____no_output_____" ] ], [ [ "# 12. Conversion to TFLite", "_____no_output_____" ] ], [ [ "TFLITE_SCRIPT = os.path.join(paths['APIMODEL_PATH'], 'research', 'object_detection', 'export_tflite_graph_tf2.py ')", "_____no_output_____" ], [ "command = \"python {} --pipeline_config_path={} --trained_checkpoint_dir={} --output_directory={}\".format(TFLITE_SCRIPT ,files['PIPELINE_CONFIG'], paths['CHECKPOINT_PATH'], paths['TFLITE_PATH'])", "_____no_output_____" ], [ "print(command)", "_____no_output_____" ], [ "!{command}", "_____no_output_____" ], [ "FROZEN_TFLITE_PATH = os.path.join(paths['TFLITE_PATH'], 'saved_model')\nTFLITE_MODEL = os.path.join(paths['TFLITE_PATH'], 'saved_model', 'detect.tflite')", "_____no_output_____" ], [ "command = \"tflite_convert \\\n--saved_model_dir={} \\\n--output_file={} \\\n--input_shapes=1,300,300,3 \\\n--input_arrays=normalized_input_image_tensor \\\n--output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \\\n--inference_type=FLOAT \\\n--allow_custom_ops\".format(FROZEN_TFLITE_PATH, TFLITE_MODEL, )", "_____no_output_____" ], [ "print(command)", "_____no_output_____" ], [ "!{command}", "_____no_output_____" ] ], [ [ "# 13. Zip and Export Models ", "_____no_output_____" ] ], [ [ "!tar -czf models.tar.gz {paths['CHECKPOINT_PATH']}", "_____no_output_____" ], [ "from google.colab import drive\ndrive.mount('/content/drive')", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ] ]
e7e39ef8051b83883f86823c1a9e8cf66a2515f7
78,531
ipynb
Jupyter Notebook
notebooks/FlairLMTrain.ipynb
randomunrandom/Emojify
bb6591314fb158617a031f506364315d45dbed4c
[ "MIT" ]
2
2019-04-25T15:38:32.000Z
2019-05-11T19:36:39.000Z
notebooks/FlairLMTrain.ipynb
randomunrandom/Emojify
bb6591314fb158617a031f506364315d45dbed4c
[ "MIT" ]
null
null
null
notebooks/FlairLMTrain.ipynb
randomunrandom/Emojify
bb6591314fb158617a031f506364315d45dbed4c
[ "MIT" ]
null
null
null
96.713054
1,099
0.559512
[ [ [ "from pathlib import Path\n\nfrom flair.data import Dictionary\nfrom flair.models import LanguageModel\nfrom flair.trainers.language_model_trainer import LanguageModelTrainer, TextCorpus", "_____no_output_____" ], [ "is_forward_lm = True\nhidden_dim = 1024\nn_layers = 1\nseq_len = 40\nbatch_size = 64\n\n# load the default character dictionary\ndictionary: Dictionary = Dictionary.load('chars')\n\n# get your corpus, process forward and at the character level\ncorpus = TextCorpus(\n Path('../data/demojized_coprus'),\n dictionary,\n is_forward_lm,\n character_level=True\n)", "2019-05-12 21:25:43,827 https://s3.eu-central-1.amazonaws.com/alan-nlp/resources/models/common_characters not found in cache, downloading to /tmp/tmpzlvqw4ge\n" ], [ "language_model = LanguageModel(\n dictionary,\n is_forward_lm,\n hidden_size=hidden_dim,\n nlayers=n_layers\n)", "_____no_output_____" ], [ "trainer = LanguageModelTrainer(language_model, corpus)", "_____no_output_____" ], [ "trainer.train(\n '../models/flair-lm',\n sequence_length=seq_len,\n mini_batch_size=batch_size,\n max_epochs=150\n)", "2019-05-12 21:41:40,265 read text file with 450235 lines\n2019-05-12 21:41:40,271 read text file with 450476 lines\n2019-05-12 21:41:40,547 shuffled\n2019-05-12 21:41:40,564 shuffled\n2019-05-12 21:44:59,616 read text file with 450002 lines\n2019-05-12 21:44:59,897 shuffled\n2019-05-12 21:45:01,365 Sequence length is 40\n2019-05-12 21:45:01,380 read text file with 449863 lines\n2019-05-12 21:45:01,656 shuffled\n2019-05-12 21:45:01,932 Split 1\t - (21:45:01)\n2019-05-12 21:45:03,956 | split 1 / 30 | 100/11313 batches | ms/batch 20.21 | loss 3.83 | ppl 46.07\n2019-05-12 21:45:05,933 | split 1 / 30 | 200/11313 batches | ms/batch 19.75 | loss 2.99 | ppl 19.82\n2019-05-12 21:45:07,897 | split 1 / 30 | 300/11313 batches | ms/batch 19.63 | loss 2.67 | ppl 14.37\n2019-05-12 21:45:09,870 | split 1 / 30 | 400/11313 batches | ms/batch 19.71 | loss 2.42 | ppl 11.29\n2019-05-12 21:45:11,830 | split 1 / 30 | 500/11313 batches | ms/batch 19.59 | loss 2.26 | ppl 9.60\n2019-05-12 21:45:13,793 | split 1 / 30 | 600/11313 batches | ms/batch 19.61 | loss 2.14 | ppl 8.52\n2019-05-12 21:45:15,758 | split 1 / 30 | 700/11313 batches | ms/batch 19.63 | loss 2.07 | ppl 7.89\n2019-05-12 21:45:17,723 | split 1 / 30 | 800/11313 batches | ms/batch 19.63 | loss 2.02 | ppl 7.51\n2019-05-12 21:45:19,687 | split 1 / 30 | 900/11313 batches | ms/batch 19.62 | loss 1.96 | ppl 7.12\n2019-05-12 21:45:21,657 | split 1 / 30 | 1000/11313 batches | ms/batch 19.68 | loss 1.92 | ppl 6.82\n2019-05-12 21:45:23,622 | split 1 / 30 | 1100/11313 batches | ms/batch 19.63 | loss 1.89 | ppl 6.64\n2019-05-12 21:45:25,588 | split 1 / 30 | 1200/11313 batches | ms/batch 19.64 | loss 1.87 | ppl 6.46\n2019-05-12 21:45:27,553 | split 1 / 30 | 1300/11313 batches | ms/batch 19.63 | loss 1.83 | ppl 6.21\n2019-05-12 21:45:29,524 | split 1 / 30 | 1400/11313 batches | ms/batch 19.69 | loss 1.81 | ppl 6.12\n2019-05-12 21:45:31,487 | split 1 / 30 | 1500/11313 batches | ms/batch 19.62 | loss 1.80 | ppl 6.02\n2019-05-12 21:45:33,451 | split 1 / 30 | 1600/11313 batches | ms/batch 19.62 | loss 1.77 | ppl 5.86\n2019-05-12 21:45:35,414 | split 1 / 30 | 1700/11313 batches | ms/batch 19.62 | loss 1.75 | ppl 5.75\n2019-05-12 21:45:37,380 | split 1 / 30 | 1800/11313 batches | ms/batch 19.65 | loss 1.74 | ppl 5.72\n2019-05-12 21:45:39,342 | split 1 / 30 | 1900/11313 batches | ms/batch 19.61 | loss 1.73 | ppl 5.66\n2019-05-12 21:45:41,308 | split 1 / 30 | 2000/11313 batches | ms/batch 19.64 | loss 1.72 | ppl 5.56\n2019-05-12 21:45:43,272 | split 1 / 30 | 2100/11313 batches | ms/batch 19.63 | loss 1.70 | ppl 5.47\n2019-05-12 21:45:45,234 | split 1 / 30 | 2200/11313 batches | ms/batch 19.60 | loss 1.69 | ppl 5.43\n2019-05-12 21:45:47,198 | split 1 / 30 | 2300/11313 batches | ms/batch 19.62 | loss 1.68 | ppl 5.37\n2019-05-12 21:45:49,159 | split 1 / 30 | 2400/11313 batches | ms/batch 19.60 | loss 1.68 | ppl 5.34\n2019-05-12 21:45:51,123 | split 1 / 30 | 2500/11313 batches | ms/batch 19.62 | loss 1.67 | ppl 5.30\n2019-05-12 21:45:53,092 | split 1 / 30 | 2600/11313 batches | ms/batch 19.67 | loss 1.66 | ppl 5.27\n2019-05-12 21:45:55,057 | split 1 / 30 | 2700/11313 batches | ms/batch 19.63 | loss 1.65 | ppl 5.22\n2019-05-12 21:45:57,026 | split 1 / 30 | 2800/11313 batches | ms/batch 19.68 | loss 1.63 | ppl 5.10\n2019-05-12 21:45:58,988 | split 1 / 30 | 2900/11313 batches | ms/batch 19.61 | loss 1.64 | ppl 5.13\n2019-05-12 21:46:00,951 | split 1 / 30 | 3000/11313 batches | ms/batch 19.62 | loss 1.65 | ppl 5.19\n2019-05-12 21:46:02,917 | split 1 / 30 | 3100/11313 batches | ms/batch 19.63 | loss 1.62 | ppl 5.06\n2019-05-12 21:46:04,872 | split 1 / 30 | 3200/11313 batches | ms/batch 19.54 | loss 1.63 | ppl 5.12\n2019-05-12 21:46:06,831 | split 1 / 30 | 3300/11313 batches | ms/batch 19.57 | loss 1.61 | ppl 5.00\n2019-05-12 21:46:08,799 | split 1 / 30 | 3400/11313 batches | ms/batch 19.67 | loss 1.61 | ppl 4.99\n2019-05-12 21:46:10,764 | split 1 / 30 | 3500/11313 batches | ms/batch 19.63 | loss 1.61 | ppl 5.00\n2019-05-12 21:46:12,727 | split 1 / 30 | 3600/11313 batches | ms/batch 19.61 | loss 1.61 | ppl 4.99\n2019-05-12 21:46:14,693 | split 1 / 30 | 3700/11313 batches | ms/batch 19.64 | loss 1.60 | ppl 4.97\n2019-05-12 21:46:16,664 | split 1 / 30 | 3800/11313 batches | ms/batch 19.69 | loss 1.60 | ppl 4.98\n2019-05-12 21:46:18,628 | split 1 / 30 | 3900/11313 batches | ms/batch 19.63 | loss 1.59 | ppl 4.92\n2019-05-12 21:46:20,599 | split 1 / 30 | 4000/11313 batches | ms/batch 19.70 | loss 1.59 | ppl 4.91\n2019-05-12 21:46:22,559 | split 1 / 30 | 4100/11313 batches | ms/batch 19.58 | loss 1.59 | ppl 4.90\n2019-05-12 21:46:24,527 | split 1 / 30 | 4200/11313 batches | ms/batch 19.66 | loss 1.57 | ppl 4.82\n2019-05-12 21:46:26,491 | split 1 / 30 | 4300/11313 batches | ms/batch 19.63 | loss 1.58 | ppl 4.87\n2019-05-12 21:46:28,459 | split 1 / 30 | 4400/11313 batches | ms/batch 19.67 | loss 1.57 | ppl 4.81\n2019-05-12 21:46:30,420 | split 1 / 30 | 4500/11313 batches | ms/batch 19.59 | loss 1.57 | ppl 4.80\n2019-05-12 21:46:32,404 | split 1 / 30 | 4600/11313 batches | ms/batch 19.83 | loss 1.56 | ppl 4.77\n2019-05-12 21:46:34,372 | split 1 / 30 | 4700/11313 batches | ms/batch 19.66 | loss 1.56 | ppl 4.75\n2019-05-12 21:46:36,338 | split 1 / 30 | 4800/11313 batches | ms/batch 19.64 | loss 1.55 | ppl 4.73\n2019-05-12 21:46:38,303 | split 1 / 30 | 4900/11313 batches | ms/batch 19.64 | loss 1.56 | ppl 4.74\n2019-05-12 21:46:40,272 | split 1 / 30 | 5000/11313 batches | ms/batch 19.67 | loss 1.55 | ppl 4.73\n2019-05-12 21:46:42,241 | split 1 / 30 | 5100/11313 batches | ms/batch 19.67 | loss 1.55 | ppl 4.71\n2019-05-12 21:46:44,206 | split 1 / 30 | 5200/11313 batches | ms/batch 19.63 | loss 1.55 | ppl 4.70\n2019-05-12 21:46:46,173 | split 1 / 30 | 5300/11313 batches | ms/batch 19.65 | loss 1.56 | ppl 4.74\n2019-05-12 21:46:48,144 | split 1 / 30 | 5400/11313 batches | ms/batch 19.70 | loss 1.55 | ppl 4.73\n2019-05-12 21:46:50,111 | split 1 / 30 | 5500/11313 batches | ms/batch 19.66 | loss 1.53 | ppl 4.64\n2019-05-12 21:46:52,080 | split 1 / 30 | 5600/11313 batches | ms/batch 19.67 | loss 1.53 | ppl 4.61\n2019-05-12 21:46:54,049 | split 1 / 30 | 5700/11313 batches | ms/batch 19.67 | loss 1.54 | ppl 4.65\n2019-05-12 21:46:56,015 | split 1 / 30 | 5800/11313 batches | ms/batch 19.65 | loss 1.53 | ppl 4.64\n2019-05-12 21:46:57,982 | split 1 / 30 | 5900/11313 batches | ms/batch 19.65 | loss 1.53 | ppl 4.64\n2019-05-12 21:46:59,948 | split 1 / 30 | 6000/11313 batches | ms/batch 19.65 | loss 1.53 | ppl 4.63\n2019-05-12 21:47:01,918 | split 1 / 30 | 6100/11313 batches | ms/batch 19.68 | loss 1.53 | ppl 4.62\n2019-05-12 21:47:03,885 | split 1 / 30 | 6200/11313 batches | ms/batch 19.65 | loss 1.54 | ppl 4.65\n2019-05-12 21:47:05,859 | split 1 / 30 | 6300/11313 batches | ms/batch 19.73 | loss 1.52 | ppl 4.59\n2019-05-12 21:47:07,826 | split 1 / 30 | 6400/11313 batches | ms/batch 19.65 | loss 1.53 | ppl 4.64\n2019-05-12 21:47:09,804 | split 1 / 30 | 6500/11313 batches | ms/batch 19.77 | loss 1.52 | ppl 4.56\n2019-05-12 21:47:11,774 | split 1 / 30 | 6600/11313 batches | ms/batch 19.69 | loss 1.52 | ppl 4.60\n2019-05-12 21:47:13,740 | split 1 / 30 | 6700/11313 batches | ms/batch 19.63 | loss 1.51 | ppl 4.55\n2019-05-12 21:47:15,704 | split 1 / 30 | 6800/11313 batches | ms/batch 19.63 | loss 1.52 | ppl 4.55\n2019-05-12 21:47:17,667 | split 1 / 30 | 6900/11313 batches | ms/batch 19.61 | loss 1.52 | ppl 4.56\n2019-05-12 21:47:19,633 | split 1 / 30 | 7000/11313 batches | ms/batch 19.64 | loss 1.52 | ppl 4.58\n2019-05-12 21:47:21,600 | split 1 / 30 | 7100/11313 batches | ms/batch 19.65 | loss 1.52 | ppl 4.56\n2019-05-12 21:47:23,565 | split 1 / 30 | 7200/11313 batches | ms/batch 19.63 | loss 1.51 | ppl 4.51\n" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code" ] ]
e7e3a56f720223d5c70b47ec5ad154c15e257454
6,654
ipynb
Jupyter Notebook
Code/day08.ipynb
heibanke/learn_python_in_15days
96658b1b5cd1e532ba57897237cc89f0861e76c2
[ "MIT" ]
null
null
null
Code/day08.ipynb
heibanke/learn_python_in_15days
96658b1b5cd1e532ba57897237cc89f0861e76c2
[ "MIT" ]
null
null
null
Code/day08.ipynb
heibanke/learn_python_in_15days
96658b1b5cd1e532ba57897237cc89f0861e76c2
[ "MIT" ]
null
null
null
20.411043
91
0.444545
[ [ [ "# 15天入门Python3\n\nCopyRight by 黑板客 \n转载请联系heibanke_at_aliyun.com", "_____no_output_____" ], [ "**上节作业**\n\n汉诺塔\n\n如何存储和操作数据?", "_____no_output_____" ] ], [ [ "%load day07/hnt.py\n", "_____no_output_____" ] ], [ [ "## day08:生成器—临阵磨枪\n\n1. <a href=\"#1\">生成器</a>\n2. <a href=\"#2\">itertools</a>\n4. <a href=\"#3\">作业——八皇后</a>\n\n## <a name=\"1\">生成器</a>\n\n生成器函数 \n 1) return关键词被yield取代 \n 2) 当调用这个“函数”的时候,它会立即返回一个迭代器,而不立即执行函数内容,直到调用其返回迭代器的next方法是才开始执行,直到遇到yield语句暂停。 \n 3) 继续调用生成器返回的迭代器的next方法,恢复函数执行,直到再次遇到yield语句 \n 4) 如此反复,一直到遇到StopIteration ", "_____no_output_____" ] ], [ [ "# 最简单的例子,产生0~N个整数\n\ndef irange(N):\n a = 0\n while a<N:\n yield a\n a = a+1\n\nb = irange(10)\n", "_____no_output_____" ], [ "print(b)\nnext(b)", "_____no_output_____" ] ], [ [ "当你要产生的数据只用来遍历。那么这个数据就适合用生成器来实现。不过要注意,生成器只能遍历一次。", "_____no_output_____" ] ], [ [ "# fabonacci序列\n\nfrom __future__ import print_function\n\ndef fib(): \n a, b = 0, 1 \n while True: \n yield b \n a, b = b, a + b\n\nfor i in fib():\n if i > 1000:\n break\n else:\n print(i)", "_____no_output_____" ] ], [ [ "### 生成器表达式", "_____no_output_____" ] ], [ [ "a = (x**2 for x in range(10))\nnext(a)", "_____no_output_____" ], [ "%%timeit -n 1 -r 1\nsum([x**2 for x in range(10000000)])", "_____no_output_____" ], [ "%%timeit -n 1 -r 1\nsum(x**2 for x in range(10000000))", "_____no_output_____" ] ], [ [ "### send\n\n生成器可以修改遍历过程,插入指定的数据", "_____no_output_____" ] ], [ [ "def counter(maximum):\n i = 0\n while i < maximum:\n val = (yield i)\n print(\"i=%s, val=%s\"%(i, val))\n # If value provided, change counter\n if val is not None:\n i = val\n else:\n i += 1", "_____no_output_____" ], [ "it = counter(10)\nprint(\"yield value: %s\"%(next(it)))\n\nprint(\"yield value: %s\"%(next(it)))\n\nprint(it.send(5))\n\n# 想一下下个print(next(it))会输出什么?", "_____no_output_____" ] ], [ [ "## <a name=\"2\">itertools</a>\n\n1. chain # 将多个生成器串起来\n2. repeat # 重复元素\n3. permutations # 排列,从N个数里取m个,考虑顺序。\n4. combinations # 组合,从N个数里取m个,不考虑顺序。\n5. product # 依次从不同集合里任选一个数。笛卡尔乘积\n\n<img src=\"day08/cartesian_product.png\" width=300></img>", "_____no_output_____" ] ], [ [ "import itertools\n\nhorses=[1,2,3,4]\nraces = itertools.permutations(horses,3) \n\na=itertools.product([1,2],[3,4],[5,6])\nb=itertools.repeat([1,2,3],4)\nc=itertools.combinations([1,2,3,4],3)\nd=itertools.chain(races, a, b, c)\n\nprint([i for i in races])\nprint(\"====================\")\nprint([i for i in a])\nprint(\"====================\")\n\nprint([i for i in b])\nprint(\"====================\")\n\nprint([i for i in c])\nprint(\"====================\")\n\nprint([i for i in d])\n", "_____no_output_____" ] ], [ [ "<a name=\"3\">**作业:八皇后问题**</a>\n\n8*8的棋盘上放下8个皇后,彼此吃不到对方。找出所有的位置组合。\n\n1. 棋盘的每一行,每一列,每一个条正斜线,每一条反斜线,都只能有1个皇后\n2. 使用生成器\n3. 支持N皇后\n\n<img src=\"day08/queen.png\"></img>", "_____no_output_____" ] ], [ [ "from day08.eight_queen import gen_n_queen, printsolution\n\nsolves = gen_n_queen(5)", "_____no_output_____" ], [ "s = next(solves)\nprint(s)\nprintsolution(s)", "_____no_output_____" ], [ "def printsolution(solve):\n n = len(solve)\n sep = \"+\" + \"-+\" * n\n print(sep)\n for i in range(n):\n squares = [\" \" for j in range(n)]\n squares[solve[i]] = \"Q\"\n print(\"|\" + \"|\".join(squares) + \"|\")\n print(sep)", "_____no_output_____" ] ], [ [ "提示:\n\n1. 产生所有的可能(先满足不在同一行,同一列)\n2. 判断是否满足对角条件\n3. 所有条件都满足,则yield输出\n4. next则继续检查剩余的可能\n5. 8皇后的解答有92种。", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ] ]
e7e3a7c5073cdef68be74018b6cae31e6fd16254
15,972
ipynb
Jupyter Notebook
savinov-vlad/hw1.ipynb
dingearteom/co-mkn-hw-2021
58e918ee8ef7cfddac48ed8d5c2fd211f599c8a8
[ "MIT" ]
null
null
null
savinov-vlad/hw1.ipynb
dingearteom/co-mkn-hw-2021
58e918ee8ef7cfddac48ed8d5c2fd211f599c8a8
[ "MIT" ]
null
null
null
savinov-vlad/hw1.ipynb
dingearteom/co-mkn-hw-2021
58e918ee8ef7cfddac48ed8d5c2fd211f599c8a8
[ "MIT" ]
null
null
null
26.934233
137
0.457676
[ [ [ "## Вычислить $ \\sqrt[k]{a} $ ", "_____no_output_____" ] ], [ [ "import numpy as np\n\ndef printable_test(a, k, f, prc=1e-4):\n ans = f(a, k)\n print(f'Our result: {a}^(1/{k}) ~ {ans:.10f}')\n print(f'True result: {a**(1/k):.10f}\\n')\n print(f'Approx a ~ {ans**k:.10f}')\n print(f'True a = {a}')\n assert abs(a - ans**k) < prc, f'the answer differs by {abs(a - ans**k):.10f} from the true one'\n \ndef not_printable_test(a, k, f, prc=1e-4):\n ans = f(a, k)\n assert abs(a - ans**k) < prc, f'f({a}, {k}): the answer differs by {abs(a - ans**k):.10f} from the true one'\n \ndef test(func):\n rng = np.random.default_rng(12345)\n test_len = 1000\n vals = rng.integers(low=0, high=1000, size=test_len)\n pws = rng.integers(low=1, high=100, size=test_len)\n\n for a, k in zip(vals, pws):\n not_printable_test(a, k, func)\n \n print(f'All {test_len} tests have passed!')\n", "_____no_output_____" ], [ "def root_bisection(a: float, k: float, iters=1000) -> float:\n def f(x):\n return x**k - a\n\n assert k > 0, 'Negative `k` values are not allowed'\n\n l, r = 0, a\n for _ in range(iters):\n m = l + (r - l) / 2\n if f(m) * f(l) <= 0:\n r = m\n else:\n l = m\n return l + (r - l) / 2\n", "_____no_output_____" ], [ "test(root_bisection)", "All 1000 tests have passed!\n" ], [ "printable_test(1350, 12, root_bisection)\nprint('\\n')\nprintable_test(-1, 1, root_bisection)", "Our result: 1350^(1/12) ~ 1.8233126596\nTrue result: 1.8233126596\n\nApprox a ~ 1350.0000000000\nTrue a = 1350\n\n\nOur result: -1^(1/1) ~ -1.0000000000\nTrue result: -1.0000000000\n\nApprox a ~ -1.0000000000\nTrue a = -1\n" ], [ "def root_newton(a: float, k: float, iters=1000) -> float:\n def f(x):\n return x**k - a\n\n def dx(x):\n return k * x**(k - 1)\n\n assert k > 0, 'Negative `k` values are not allowed'\n \n x = 1\n for _ in range(iters):\n x = x - f(x) / dx(x)\n\n return x\n", "_____no_output_____" ], [ "test(root_newton)", "All 1000 tests have passed!\n" ], [ "printable_test(1350, 12, root_newton)\nprint('\\n')\nprintable_test(-1, 1, root_newton)", "Our result: 1350^(1/12) ~ 1.8233126596\nTrue result: 1.8233126596\n\nApprox a ~ 1350.0000000000\nTrue a = 1350\n\n\nOur result: -1^(1/1) ~ -1.0000000000\nTrue result: -1.0000000000\n\nApprox a ~ -1.0000000000\nTrue a = -1\n" ] ], [ [ "## Дан многочлен P степени не больше 5 и отрезок [L, R]", "_____no_output_____" ], [ "Локализовать корни: $ P(L_i) \\cdot P(R_i) <0 $ \n\nИ найти на каждом таком отрезке корни", "_____no_output_____" ] ], [ [ "from typing import List\nimport numpy as np\n\nclass Polynom:\n def __init__(self, coefs: List[float]):\n # self.coefs = [a0, a1, a2, ...., an]\n self.coefs = coefs\n\n def __str__(self):\n if not self.coefs:\n return ''\n descr = str(self.coefs[0])\n for i, coef in enumerate(self.coefs[1:]):\n sign = '+' if coef > 0 else '-'\n descr += f' {sign} {abs(coef)} * x^{i + 1}'\n return descr\n \n def __repr__(self):\n return self.__str__()\n\n def value_at(self, x: float) -> float:\n res = 0\n for i, coef in enumerate(self.coefs):\n res += x**i * coef\n return res\n \n def dx(self):\n if not self.coefs or len(self.coefs) == 1:\n return Polynom([0])\n return Polynom([(i + 1) * coef for i, coef in enumerate(self.coefs[1:])])\n \n def is_root(self, x: float, prc=1e-4) -> bool:\n return abs(0 - self.value_at(x)) < prc\n \n def root_segments(self, l: float, r: float, min_seg_len=1e-2) -> List[List[float]]:\n segs = []\n prev_end, cur_end = l, l + min_seg_len\n\n while cur_end < r:\n if self.value_at(prev_end) * self.value_at(cur_end) < 0:\n segs.append([prev_end, cur_end])\n prev_end = cur_end\n\n if self.value_at(cur_end) == 0:\n move = min_seg_len / 10\n segs.append([prev_end, cur_end + move])\n prev_end = cur_end + move\n\n cur_end += min_seg_len\n\n return segs\n \n def find_single_root(self, l: float, r: float, iters=1000) -> float:\n for _ in range(iters):\n m = l + (r - l) / 2\n if self.value_at(l) * self.value_at(m) < 0:\n r = m\n else:\n l = m\n return l + (r - l) / 2\n \n def find_roots(self, l: float, r: float) -> List[float]:\n roots = []\n segs = self.root_segments(l, r)\n for seg_l, seg_r in segs:\n roots.append(self.find_single_root(seg_l, seg_r))\n \n return roots\n \n def check_roots(self, roots: List[float]) -> bool:\n return np.all([self.is_root(x) for x in roots])\n \n def find_min(self, l: float, r: float) -> float:\n assert self.coefs, 'Polynom must contain at least one coef'\n\n if len(self.coefs) == 1:\n return self.coefs[0]\n\n pts = [l, *self.dx().find_roots(l, r), r]\n return min(self.value_at(pt) for pt in pts)\n", "_____no_output_____" ], [ "# x^3 + 97.93 x^2 - 229.209 x + 132.304\n# (x - 1.1) * (x - 1.2) * (x + 100.23)\np = Polynom([132.304, -229.209, 97.93, 1])\np.find_roots(-1000, 1000)", "_____no_output_____" ], [ "p.find_min(-10, 10)", "_____no_output_____" ], [ "Polynom([1, 2, 1]).find_roots(-1000, 1000)", "_____no_output_____" ], [ "Polynom([1, -2]).find_roots(-1000, 1000)", "_____no_output_____" ] ], [ [ "## Найти минимум функции $ e^{ax} + e^{-bx} + c(x - d)^2$", "_____no_output_____" ] ], [ [ "from numpy import exp\nfrom typing import Tuple\n\nclass ExpMinFinder:\n def __init__(self, a: float, b: float, c: float, d: float):\n if a <= 0 or b <= 0 or c <= 0:\n raise ValueError(\"Parameters must be non-negative\")\n self.a = a\n self.b = b\n self.c = c\n self.d = d\n \n def f(self, x) -> float:\n return exp(self.a * x) + exp(-self.b * x) + self.c * (x - self.d)**2\n \n def dx(self, x) -> float:\n return self.a * exp(self.a * x) - self.b * exp(-self.b * x) + 2 * self.c * (x - self.d)\n \n def ddx(self, x) -> float:\n return self.a**2 * exp(self.a * x) + self.b**2 * exp(-self.b * x) + 2 * self.c\n \n def min_bisection(self, iters=1000) -> Tuple[float, float]:\n l, r = -100, 100\n for _ in range(iters):\n m = l + (r - l) / 2\n if self.dx(m) * self.dx(l) < 0:\n r = m\n else:\n l = m\n\n min_at = l + (r - l) / 2\n return min_at, self.f(min_at)\n \n def min_newton(self, iters=1000) -> Tuple[float, float]:\n x = 1\n for _ in range(iters):\n x = x - self.dx(x) / self.ddx(x)\n\n return x, self.f(x)\n\n def min_ternary(self, iters=1000) -> Tuple[float, float]:\n l, r = -100, 100\n \n for _ in range(iters):\n m1 = l + (r - l) / 3\n m2 = r - (r - l) / 3\n if self.f(m1) >= self.f(m2):\n l = m1\n else:\n r = m2\n min_at = l + (r - l) / 2\n\n return min_at, self.f(min_at)\n", "_____no_output_____" ], [ "def test_exp():\n rng = np.random.default_rng(12345)\n test_len = 100\n a_ = rng.integers(low=1, high=10, size=test_len)\n b_ = rng.integers(low=1, high=10, size=test_len)\n c_ = rng.integers(low=1, high=10, size=test_len)\n d_ = rng.integers(low=1, high=10, size=test_len)\n \n \n for a, b, c, d in zip(a_, b_, c_, d_):\n m = ExpMinFinder(a, b, c, d)\n \n assert abs(m.min_bisection()[1] - m.min_newton()[1]) < 1e-3, \\\n f'Results: {m.min_bisection():.3f} {m.min_newton():.3f}, values: {a, b, c, d}'\n assert abs(m.min_newton()[1] - m.min_ternary()[1]) < 1e-3, \\\n f'Results: {m.min_newton():.3f} {m.min_ternary():.3f}, values: {a, b, c, d}'\n \n print(f'All {test_len} tests have passed')\n \ntest_exp()", "/var/folders/n7/k2zyw7490b97hfmqkg39c6080000gn/T/ipykernel_79092/1883086689.py:17: RuntimeWarning: overflow encountered in exp\n return self.a * exp(self.a * x) - self.b * exp(-self.b * x) + 2 * self.c * (x - self.d)\n" ], [ "m = ExpMinFinder(1, 2, 3, 4)", "_____no_output_____" ], [ "m.min_bisection()", "_____no_output_____" ], [ "m.min_newton()", "_____no_output_____" ], [ "m.min_ternary()", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ] ]
e7e3abdc05f59875a261798f22b4c691650af603
95,049
ipynb
Jupyter Notebook
NotebookFinalTrainTest.ipynb
Riferji/Cajamar-2019
e1aecc793287ee556ee39c380966cf97627b91b5
[ "MIT" ]
null
null
null
NotebookFinalTrainTest.ipynb
Riferji/Cajamar-2019
e1aecc793287ee556ee39c380966cf97627b91b5
[ "MIT" ]
null
null
null
NotebookFinalTrainTest.ipynb
Riferji/Cajamar-2019
e1aecc793287ee556ee39c380966cf97627b91b5
[ "MIT" ]
null
null
null
75.495631
34,958
0.718598
[ [ [ "En este Nootebock se realiza la limpieza del conjunto train, de tal manera, que al terminar la pipeline ya se puede emplear dicho conjunto para el entrenamiento de modelos.\n\nSe expondrá en un pequeño comentario en la parte superior por la razon que se realiza el cambio\n\nPara una mejor descripción se puede consultar *PreprocesadoTrainRaw.ipynb* donde se comentan un poco mejor los pasos realizados.", "_____no_output_____" ] ], [ [ "import pandas as pd\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom sklearn.decomposition import PCA\n\ndf = pd.read_table('Modelar_UH2019.txt', sep = '|', dtype={'HY_cod_postal':str})", "_____no_output_____" ], [ "df = pd.read_table('Modelar_UH2019.txt', sep = '|', dtype={'HY_cod_postal':str})\n# Tenemos varios Nans en HY_provincias, por lo que creamos la siguiente función que nos ayudará a imputarlos con\n# ayuda del código postal\ndef ArreglarProvincias(df):\n # Diccionario de los códigos postales. 'xxddd' --> xx es el código asociado a la provincia\n diccionario_postal = {'02':'Albacete','03':'Alicante','04':'Almería','01':'Álava','33':'Asturias',\n '05':'Avila','06':'Badajoz','07':'Baleares', '08':'Barcelona','48':'Bizkaia',\n '09':'Burgos','10':'Cáceres','11':'Cádiz','39':'Cantabria','12':'Castellón',\n '13':'Ciudad Real','14':'Córdoba','15':'A Coruña','16':'Cuenca','20':'Gipuzkoa',\n '17':'Gerona','18':'Granada','19':'Guadalajara','21':'Huelva','22':'Huesca',\n '23':'Jaén','24':'León','25':'Lérida','27':'Lugo','28':'Madrid','29':'Málaga',\n '30':'Murcia','31':'Navarra','32':'Ourense','34':'Palencia','35':'Las Palmas',\n '36':'Pontevedra','26':'La Rioja','37':'Salamanca','38':'Tenerife','40':'Segovia',\n '41':'Sevilla','42':'Soria','43':'Tarragona','44':'Teruel','45':'Toledo','46':'Valencia',\n '47':'Valladolid','49':'Zamora','50':'Zaragoza','51':'Ceuta','52':'Melilla'}\n \n # Obtenemos los códigos postales que nos faltan\n codigos_postales = df.loc[df.HY_provincia.isnull()].HY_cod_postal\n \n # Recorremos la pareja index, value\n for idx, cod in zip(codigos_postales.index, codigos_postales):\n # Del cod solo nos interesan los dos primeros valores para la provincia.\n df.loc[idx,'HY_provincia'] = diccionario_postal[cod[:2]]\n \n # Devolvemos el df de las provincias\n return df\n\n# Obtenemos nuestro df con las provincias imputadas\ndf = ArreglarProvincias(df)\n\n\n########## Metros ##############\n# Volvemos Nans los valores de 0m^2 o inferior --> Los 0 provocan errores en una nueva variable de €/m2\ndf.loc[df['HY_metros_utiles'] <= 0,'HY_metros_utiles'] = np.nan\ndf.loc[df['HY_metros_totales'] <= 0,'HY_metros_totales'] = np.nan\n\n# Obtenemos las posiciones de los valores faltantes een los metros útiles\nposiciones_nans = df['HY_metros_totales'].isnull()\n\n# Rellenamos los Nans con los metros totales\ndf.loc[posiciones_nans,'HY_metros_totales'] = df.loc[posiciones_nans,'HY_metros_utiles']\n\n# Obtenemos las posiciones de los valores faltantes een los metros útiles\nposiciones_nans = df['HY_metros_utiles'].isnull()\n\n# Rellenamos los Nans con los metros totales\ndf.loc[posiciones_nans,'HY_metros_utiles'] = df.loc[posiciones_nans,'HY_metros_totales']\n\n# Si continuamos teniendo Nans\nif df[['HY_metros_utiles', 'HY_metros_totales']].isnull().sum().sum()>0: # Hay 2 .sum para sumarlo todo\n # Agrupamos por HY_tipo\n group_tipo = df[['HY_tipo', 'HY_metros_utiles', 'HY_metros_totales']].dropna().groupby('HY_tipo').mean()\n # Cuales son los indices de los registros que tienen nans\n index_nans = df.index[df['HY_metros_utiles'].isnull()]\n for i in index_nans:\n tipo = df.loc[i, 'HY_tipo']\n df.loc[i, ['HY_metros_utiles', 'HY_metros_totales']] = group_tipo.loc[tipo]\n \n# Eliminamos los outliers\n# Definimos la cota a partir de la cual son outliers\ncota = df['HY_metros_utiles'].mean()+3*df['HY_metros_utiles'].std()\n# Y nos quedamos con todos aquellos que no la superan\ndf = df[df['HY_metros_utiles'] <= cota]\n# Idem para metros totales\n# Definimos la cota a partir de la cual son outliers\ncota = df['HY_metros_totales'].mean()+3*df['HY_metros_totales'].std()\n# Y nos quedamos con todos aquellos que no la superan\ndf = df[df['HY_metros_totales'] <= cota]\n\n# Por último, eliminamos los registros que presenten una diferencia excesiva de metros\ndif_metros = np.abs(df.HY_metros_utiles - df.HY_metros_totales)\ndf = df[dif_metros <= 500]\n\n########## Precios ############\n# Creamos una nueva variable que sea ¿Existe precio anterior?--> Si/No\ndf['PV_precio_anterior'] = df['HY_precio_anterior'].isnull()\n# Y modificamos precio anterior para que tenga los valores del precio actual como anterior\ndf.loc[df['HY_precio_anterior'].isnull(),'HY_precio_anterior'] = df.loc[df['HY_precio_anterior'].isnull(),'HY_precio']\n# Eliminamos también los precios irrisorios (Todos aquellos precios inferiores a 100€)\nv = df[['HY_precio', 'HY_precio_anterior']].apply(lambda x: x[0] <= 100 and x[1] <= 100, axis = 1)\ndf = df[v == False]\n\n\n\n######## Descripción y distribución #########\n# Creamos 2 nuevas variables con la longitud del texto expuesto (Nan = 0)\n# Igualamos los NaN a carácteres vacíos\ndf.loc[df['HY_descripcion'].isnull(),'HY_descripcion'] = ''\ndf.loc[df['HY_distribucion'].isnull(),'HY_distribucion'] = ''\n# Calculamos su longitud\ndf['PV_longitud_descripcion'] = df['HY_descripcion'].apply(lambda x: len(x))\ndf['PV_longitud_distribucion'] = df['HY_distribucion'].apply(lambda x: len(x))\n\n####### Cantidad de imágenes #########\n# Añadimos una nueva columna que es la cantidad de imágenes que tiene asociado el piso\n# El df de información de las imágenes tiene 3 columnas: id, posicion_foto, carácteres_aleatorios\ndf_imagenes = pd.read_csv('df_info_imagenes.csv', sep = '|',encoding = 'utf-8')\n# Realizamos un count de los ids de las imagenes (Y nos quedamos con el valor de la \n# variable Posiciones (Al ser un count, nos es indiferente la variable seleccionada))\ndf_count_imagenes = df_imagenes.groupby('HY_id').count()['Posiciones']\n# Definimos la función que asocia a cada id su número de imágenes\ndef AñadirCantidadImagenes(x):\n try:\n return df_count_imagenes.loc[x]\n except:\n return 0\n# Creamos la variable\ndf['PV_cantidad_imagenes'] = df['HY_id'].apply(lambda x: AñadirCantidadImagenes(x))\n\n\n######### Imputación de las variables IDEA #########\n# En el notebook ImputacionNans.ipynb se explica en mayor profundidad las funciones definidas. Por el momento, \n# para imputar los valores Nans de las variables IDEA realizamos lo siguiente:\n# -1. Hacemos la media de las variables que no son Nan por CP\n# -2. Imputamos por la media del CP\n# -3. Repetimos para aquellos codigos postales que son todo Nans con la media por provincias (Sin contar los imputados)\n# -4. Imputamos los Nans que faltan por la media general de todo (Sin contar los imputados)\nvar_list = [\n ['IDEA_pc_1960', 'IDEA_pc_1960_69', 'IDEA_pc_1970_79', 'IDEA_pc_1980_89','IDEA_pc_1990_99', 'IDEA_pc_2000_10'],\n ['IDEA_pc_comercio','IDEA_pc_industria', 'IDEA_pc_oficina', 'IDEA_pc_otros','IDEA_pc_residencial', 'IDEA_pc_trast_parking'],\n ['IDEA_ind_tienda', 'IDEA_ind_turismo', 'IDEA_ind_alimentacion'],\n ['IDEA_ind_riqueza'],\n ['IDEA_rent_alquiler'],\n ['IDEA_ind_elasticidad', 'IDEA_ind_liquidez'],\n ['IDEA_unitprice_sale_residential', 'IDEA_price_sale_residential', 'IDEA_stock_sale_residential'],\n ['IDEA_demand_sale_residential'],\n ['IDEA_unitprice_rent_residential', 'IDEA_price_rent_residential', 'IDEA_stock_rent_residential'],\n ['IDEA_demand_rent_residential'] \n]\n# Función que imputa Nans por la media de CP o Provincias (La versión de ImputacionNans.ipynb imprime el número\n# de valores faltantes después de la imputación)\ndef ImputarNans_cp(df, vars_imput, var): \n '''\n df --> Nuestro dataframe a modificar\n vars_imput --> Variables que queremos imputar.\n var --> Variable por la que queremos realizar la agrupación (HY_cod_postal ó HY_provincia)\n '''\n # Obtenemos nuestros df de grupos\n group_cp = df[[var]+vars_imput].dropna().groupby(var).mean()\n \n # Obtenemos los CP que son Nans\n codigos_nans = df.loc[df[vars_imput[0]].isnull(), var] # Valdría cualquiera de las 6 variables.\n \n # Como sabemos que códigos podremos completar y cuales no, solo utilizaremos los que se pueden completar\n cods = np.intersect1d(codigos_nans.unique(),group_cp.index)\n # Cuales son los índices de los Nans\n index_nan = df.index[df[vars_imput[0]].isnull()]\n for cod in cods:\n # Explicación del indexado: De todos los códigos que coinciden con el nuestro nos quedamos con los que tienen índice\n # nan, y para poder acceder a df, necesitamos los índices de Nan que cumplen lo del código.\n i = index_nan[(df[var] == cod)[index_nan]]\n df.loc[i, vars_imput] = group_cp.loc[cod].values\n \n # Devolvemos los dataframes\n return df, group_cp\n# Bucle que va variable por variable imputando los valores\nfor vars_group in var_list:\n #print('*'*50)\n #print('Variables:', vars_group)\n #print('-'*10+' CP '+'-'*10)\n df, group_cp = ImputarNans_cp(df, vars_group, var = 'HY_cod_postal')\n #print('-'*10+' Provincias '+'-'*10)\n df, group_provincia = ImputarNans_cp(df, vars_group, var = 'HY_provincia')\n \n # Si aún quedan Nans los ponemos a todos con la media de todo\n registros_faltantes = df[vars_group[0]].isnull().sum()\n if registros_faltantes>0:\n #print('-'*30)\n df.loc[df[vars_group[0]].isnull(), vars_group] = group_provincia.mean(axis = 0).values\n #print('Se han imputado {} registros por la media de todo'.format(registros_faltantes))\n # Guardamos los datos en la carpeta DF_grupos ya que tenemos que imputar en test por estos mismos valores.\n df.to_csv('./DF_grupos/df_filled_{}.csv'.format(vars_group[0]), sep = '|', encoding='utf-8', index = False)\n group_cp.to_csv('./DF_grupos/group_cp_{}.csv'.format(vars_group[0]), sep = '|', encoding='utf-8')\n group_provincia.to_csv('./DF_grupos/group_prov_{}.csv'.format(vars_group[0]), sep = '|', encoding='utf-8')\n\n####### Indice elasticidad ##########\n# Creamos una nueva variable que redondea el indice de elasticidad al entero más cercano (La variable toma 1,2,3,4,5)\ndf['PV_ind_elasticidad'] = np.round(df['IDEA_ind_elasticidad'])\n\n###### Antigüedad zona #########\n# Definimos la variable de antigüedad de la zona dependiendo del porcentaje de pisos construidos en la zona\n# Primero tomaremos las variables [IDEA_pc_1960,IDEA_pc_1960_69,IDEA_pc_1970_79,IDEA_pc_1980_89,\n# IDEA_pc_1990_99,IDEA_pc_2000_10] y las transformaremos en solo 3. Y luego nos quedaremos \n# con el máximo de esas tres para determinar el estado de la zona.\ndf['Viejos'] = df[['IDEA_pc_1960', 'IDEA_pc_1960_69']].sum(axis = 1)\ndf['Medios'] = df[['IDEA_pc_1970_79', 'IDEA_pc_1980_89']].sum(axis = 1)\ndf['Nuevos'] = df[['IDEA_pc_1990_99', 'IDEA_pc_2000_10']].sum(axis = 1)\ndf['PV_clase_piso'] = df[['Viejos','Medios','Nuevos']].idxmax(axis = 1)\n\n# Añadimos una nueva variable que es si la longitud de la descripción es nula, va de 0 a 1000 carácteres, ó supera los 1000\ndf['PV_longitud_descripcion2'] = pd.cut(df['PV_longitud_descripcion'], bins = [-1,0,1000, np.inf], labels=['Ninguna', 'Media', 'Larga'], include_lowest=False)\n\n# Precio de euro el metro\ndf['PV_precio_metro'] = df.HY_precio/df.HY_metros_totales\n\n# Cambiamos Provincias por 'Castellón','Murcia','Almería','Valencia','Otros'\ndef estructurar_provincias(x):\n '''\n Funcion que asocia a x (Nombre de provincia) su clase\n '''\n # Lista de clases que nos queremos quedar\n if x in ['Castellón','Murcia','Almería','Valencia']:\n return x\n else:\n return 'Otros'\ndf['PV_provincia'] = df.HY_provincia.apply(lambda x: estructurar_provincias(x))\n\n# Una nueva que es si el inmueble presenta alguna distribución\ndf.loc[df['PV_longitud_distribucion'] > 0,'PV_longitud_distribucion'] = 1\n\n# Cambiamos certificado energetico a Si/No (1/0)\ndf['PV_cert_energ'] = df['HY_cert_energ'].apply(lambda x: np.sum(x != 'No'))\n\n# Cambiamos las categorías de HY_tipo a solo 3: [Piso, Garaje, Otros]\ndef CategorizarHY_tipo(dato):\n if dato in ['Piso', 'Garaje']:\n return dato\n else:\n return 'Otros'\ndf['PV_tipo'] = df['HY_tipo'].apply(CategorizarHY_tipo)\n\n# Cambiamos la variable Garaje a Tiene/No tiene (1/0)\ndf.loc[df['HY_num_garajes']>1,'HY_num_garajes'] = 1\n\n# Cambiamos baños por 0, 1, +1 (No tiene, tiene 1, tiene mas de 1)\ndf['PV_num_banos'] = pd.cut(df['HY_num_banos'], [-1,0,1,np.inf], labels = [0,1,'+1'])\n\n# Cambiamos Num terrazas a Si/No (1/0)\ndf.loc[df['HY_num_terrazas']>1, 'HY_num_terrazas'] = 1\n\n\n# Definimos las variables a eliminar para definir nuestro conjunto X\ndrop_vars = ['HY_id', 'HY_cod_postal', 'HY_provincia', 'HY_descripcion',\n 'HY_distribucion', 'HY_tipo', 'HY_antiguedad','HY_num_banos', 'HY_cert_energ',\n 'HY_num_garajes', 'IDEA_pc_1960', 'IDEA_area', 'IDEA_poblacion', 'IDEA_densidad', 'IDEA_ind_elasticidad',\n 'Viejos', 'Medios','Nuevos']\n# Explicación:\n# + 'HY_id', 'HY_cod_postal' --> Demasiadas categorías\n# + 'HY_provincia' --> Ya tenemos PV_provincia que las agrupa\n# + 'HY_descripcion','HY_distribucion' --> Tenemos sus longitudes\n# + 'HY_tipo' --> Ya hemos creado PV_tipo\n# + 'HY_cert_energ','HY_num_garajes'--> Ya tenemos las PV asociadas (valores con 0 1)\n# + 'IDEA_pc_1960' --> Está duplicada\n# + 'IDEA_area', 'IDEA_poblacion', 'IDEA_densidad' --> Demasiados Nans\n# + 'IDEA_ind_elasticidad' --> Tenemos la variable equivalente en PV\n# + 'Viejos', 'Medios','Nuevos' --> Ya tenemos PV_clase_piso\n# + 'TARGET' --> Por motivos obvios no la queremos en X\nX = df.copy().drop(drop_vars+['TARGET'],axis = 1)\ny = df.TARGET.copy()\n\n# Eliminamos los outliers de las siguientes variables\ncont_vars = ['HY_metros_utiles', 'HY_metros_totales','GA_page_views', 'GA_mean_bounce',\n 'GA_exit_rate', 'GA_quincena_ini', 'GA_quincena_ult','PV_longitud_descripcion',\n 'PV_longitud_distribucion', 'PV_cantidad_imagenes',\n 'PV_ind_elasticidad', 'PV_precio_metro']\nfor var in cont_vars:\n cota = X[var].mean()+3*X[var].std()\n y = y[X[var]<=cota]\n X = X[X[var]<=cota]\n# Y eliminamos los Outliers de nuestra variable respuesta\nX = X[y <= y.mean()+3*y.std()]\ny = y[y <= y.mean()+3*y.std()]\n# Realizamos el logaritmo de nuestra variable respuesta (Nota: Sumamos 1 para evitar log(0))\ny = np.log(y+1)\n\n\n# Creamos las variables Dummy para las categóricas\ndummy_vars = ['PV_provincia','PV_longitud_descripcion2',\n 'PV_clase_piso','PV_tipo','PV_num_banos']\n# Unimos nuestro conjunto con el de dummies\nX = X.join(pd.get_dummies(X[dummy_vars]))\n# Eliminamos las variables que ya son Dummies\nX = X.drop(dummy_vars, axis=1)\n\n\n############# PCA ####################\n# Realizamos una PCA con las variables IDEA (Nota: soolo tomamos 1 componente porque nos explica el 99.95% de la varianza)\nidea_vars_price = [\n 'IDEA_unitprice_sale_residential', 'IDEA_price_sale_residential',\n 'IDEA_stock_sale_residential', 'IDEA_demand_sale_residential',\n 'IDEA_unitprice_rent_residential', 'IDEA_price_rent_residential',\n 'IDEA_stock_rent_residential', 'IDEA_demand_rent_residential']\n\npca_prices = PCA(n_components=1)\nidea_pca_price = pca_prices.fit_transform(X[idea_vars_price])\nX['PV_idea_pca_price'] = (idea_pca_price-idea_pca_price.min())/(idea_pca_price.max()-idea_pca_price.min())\n# Realizamos una PCA con las variables IDEA (Nota: soolo tomamos 1 componente porque nos explica el 78% de la varianza)\nidea_vars_pc = [\n 'IDEA_pc_comercio',\n 'IDEA_pc_industria', 'IDEA_pc_oficina', 'IDEA_pc_otros',\n 'IDEA_pc_residencial', 'IDEA_pc_trast_parking', 'IDEA_ind_tienda',\n 'IDEA_ind_turismo', 'IDEA_ind_alimentacion', 'IDEA_ind_riqueza',\n 'IDEA_rent_alquiler', 'IDEA_ind_liquidez']\n\npca_pc = PCA(n_components=1)\nidea_pca_pc = pca_pc.fit_transform(X[idea_vars_pc])\nX['PV_idea_pca_pc'] = (idea_pca_pc-idea_pca_pc.min())/(idea_pca_pc.max()-idea_pca_pc.min())\n\n# Nos quedamos con la información PCA de nuestras PV \npca_PV = PCA(n_components=3)\nPV_pca = pca_PV.fit_transform(X[['PV_cert_energ',\n 'PV_provincia_Almería', 'PV_provincia_Castellón', 'PV_provincia_Murcia',\n 'PV_provincia_Otros', 'PV_provincia_Valencia',\n 'PV_longitud_descripcion2_Larga', 'PV_longitud_descripcion2_Media',\n 'PV_longitud_descripcion2_Ninguna', 'PV_clase_piso_Medios',\n 'PV_clase_piso_Nuevos', 'PV_clase_piso_Viejos', 'PV_tipo_Garaje',\n 'PV_tipo_Otros', 'PV_tipo_Piso', 'PV_num_banos_0', 'PV_num_banos_1',\n 'PV_num_banos_+1']])\n\nX['PV_pca1'] = PV_pca[:, 0]\nX['PV_pca2'] = PV_pca[:, 1]\nX['PV_pca3'] = PV_pca[:, 2]\n\n# Eliminamos los posibles outliers creados\npca_vars = ['PV_idea_pca_price', 'PV_idea_pca_pc','PV_pca1', 'PV_pca2', 'PV_pca3']\nfor var in pca_vars:\n cota = X[var].mean()+3*X[var].std()\n y = y[X[var]<=cota]\n X = X[X[var]<=cota]\n\nX = X.drop([\n 'IDEA_unitprice_sale_residential', 'IDEA_price_sale_residential',\n 'IDEA_stock_sale_residential', 'IDEA_demand_sale_residential',\n 'IDEA_unitprice_rent_residential', 'IDEA_price_rent_residential',\n 'IDEA_stock_rent_residential', 'IDEA_demand_rent_residential',\n 'IDEA_pc_comercio',\n 'IDEA_pc_industria', 'IDEA_pc_oficina', 'IDEA_pc_otros',\n 'IDEA_pc_residencial', 'IDEA_pc_trast_parking', 'IDEA_ind_tienda',\n 'IDEA_ind_turismo', 'IDEA_ind_alimentacion', 'IDEA_ind_riqueza',\n 'IDEA_rent_alquiler', 'IDEA_ind_liquidez', 'PV_cert_energ',\n 'PV_provincia_Almería', 'PV_provincia_Castellón', 'PV_provincia_Murcia',\n 'PV_provincia_Otros', 'PV_provincia_Valencia',\n 'PV_longitud_descripcion2_Larga', 'PV_longitud_descripcion2_Media',\n 'PV_longitud_descripcion2_Ninguna', 'PV_clase_piso_Medios',\n 'PV_clase_piso_Nuevos', 'PV_clase_piso_Viejos', 'PV_tipo_Garaje',\n 'PV_tipo_Otros', 'PV_tipo_Piso', 'PV_num_banos_0', 'PV_num_banos_1',\n 'PV_num_banos_+1'], axis = 1)", "_____no_output_____" ] ], [ [ "# Entrenamiento de modelos\n\nHemos entrenado una gran cantidad de modelos, incluso podríamos llegar a decir que más de 1000 (a base de bucles y funciones) para ver cual es el que más se ajusta a nuestro dataset. Y para no tenerlos nadando entre los cientos de pruebas que hemos reaalizado en los notebooks *Modelos2\\_TestingsModelos.ipynb*, *Modelos3\\_featureSelection.ipynb*, *Modelos4\\_ForwardAndEnsemble.ipynb*", "_____no_output_____" ] ], [ [ "import pandas as pd\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nfrom sklearn.model_selection import train_test_split\n\nfrom sklearn import linear_model\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn import svm\nfrom sklearn import neighbors\nfrom sklearn import tree\nfrom sklearn.ensemble import RandomForestRegressor\nfrom sklearn.ensemble import ExtraTreesRegressor\nfrom sklearn.ensemble import GradientBoostingRegressor\nfrom sklearn.neural_network import MLPRegressor\n\nimport xgboost as xgb\nfrom xgboost.sklearn import XGBRegressor\n\n# Métrica\nfrom sklearn.metrics import median_absolute_error\n\n\nmodels = {\n 'DecisionTreeRegressor10':tree.DecisionTreeRegressor(max_depth = 10),\n 'RandomForestRegressor20':RandomForestRegressor(max_depth=5, n_estimators = 20, random_state=0),\n 'RandomForestRegressor50':RandomForestRegressor(max_depth=10, n_estimators = 50, random_state=0),\n 'RandomForestRegressor100':RandomForestRegressor(max_depth=10, n_estimators = 100, random_state=0),\n 'ExtraTreesRegressor10':ExtraTreesRegressor(n_estimators=10,random_state=0),\n 'ExtraTreesRegressor100':ExtraTreesRegressor(n_estimators=100, random_state=0),\n 'ExtraTreesRegressor150':ExtraTreesRegressor(n_estimators=150, random_state=0),\n 'GradientBoostingRegressor30_md5':GradientBoostingRegressor(n_estimators=30, learning_rate=0.1, max_depth=5, random_state=0, loss='ls'),\n 'GradientBoostingRegressor50_md5':GradientBoostingRegressor(n_estimators=50, learning_rate=0.1, max_depth=5, random_state=0, loss='ls'),\n 'XGB25':XGBRegressor(max_depth = 10, n_estimators=25, random_state=7),\n 'XGB46':XGBRegressor(max_depth = 10, n_estimators=46, random_state=7),\n 'XGB60':XGBRegressor(max_depth = 10, n_estimators=60, random_state=7),\n 'XGB100':XGBRegressor(max_depth = 10, n_estimators=100, random_state=7)\n }\n\ndef EntrenarModelos(X, y, models, drop_vars):\n '''\n X, y --> Nuestra data\n models --> Diccionario de modelos a entrenar\n drop_vars --> Variables que no queremos en nuestro modelo\n '''\n X_train, X_test, y_train, y_test = train_test_split(X.drop(drop_vars, axis = 1), y, test_size=0.3, random_state=7)\n \n y_test_predict = {}\n errores = {}\n # Definimos el diccionario donde vamos guardando el mejor modelo con su error asociado\n minimo = {'':np.inf}\n for name, model in models.items():\n #try:\n model = model.fit(X_train, y_train)\n y_test_predict[name] = model.predict(X_test)\n errores[name] = median_absolute_error(np.exp(y_test)-1, np.exp(y_test_predict[name])-1)\n \n print(name,': ', errores[name], sep = '')\n \n # Actualizamos el diccionario\n if list(minimo.values())[0] > errores[name]:\n minimo = {name:errores[name]}\n return minimo\n\nEntrenarModelos(X, y, models, [])", "DecisionTreeRegressor10: 21.55431393653663\nRandomForestRegressor20: 18.580995303598044\nRandomForestRegressor50: 19.072373408609195\nRandomForestRegressor100: 18.861664050362826\nExtraTreesRegressor10: 19.80307387148771\nExtraTreesRegressor100: 18.588761921652768\nExtraTreesRegressor150: 18.57115721270116\nGradientBoostingRegressor30_md5: 19.084825961682014\nGradientBoostingRegressor50_md5: 18.973164773235773\nXGB25: 18.734364471435548\nXGB46: 18.948498382568367\nXGB60: 19.172454528808608\nXGB100: 19.46763259887696\n" ] ], [ [ "Para la optimización de los parámetros implementamos un grid search manual con el que vamos variando los parámetros mediante bucles for. Nosotros encontramos el óptimo en *n_estimators= 30, reg_lambda* = 0.9, *subsample = 0.6*, *colsample_bytree = 0.7*", "_____no_output_____" ] ], [ [ "models = {'BestXGBoost' : XGBRegressor(max_depth = 10, \n n_estimators= 30, \n reg_lambda = 0.9,\n subsample = 0.6,\n colsample_bytree = 0.7,\n objective = 'reg:linear',\n random_state=7)\n }", "_____no_output_____" ], [ "EntrenarModelos(X, y, models, [])", "BestXGBoost: 17.369460296630855\n" ], [ "# Variable que indica si queremos iniciar la búsqueda\nQuererBuscar = False\n\nif QuererBuscar == True:\n models = {}\n for i1 in [30, 40, 46, 50, 60]:\n for i2 in [0.7, 0.8, 0.9, 1]:\n for i3 in [0.5, 0.6, 0.7, 0.8, 0.9, 1]:\n for i4 in [0.5, 0.6, 0.7, 0.8, 0.9, 1]:\n models['XGB_{}_{}_{}_{}'.format(i1, i2, i3, i4)] = XGBRegressor(max_depth = 10, \n n_estimators= i1, \n reg_lambda = i2,\n subsample = i3,\n colsample_bytree = i4,\n objective = 'reg:linear',\n random_state=7)\n print(len(models))\n \nelse:\n models = {'BestXGBoost' : XGBRegressor(max_depth = 10, \n n_estimators= 30, \n reg_lambda = 0.9,\n subsample = 0.6,\n colsample_bytree = 0.7,\n objective = 'reg:linear',\n random_state=7)\n }\n \nEntrenarModelos(X, y, models, [])", "BestXGBoost: 17.369460296630855\n" ] ], [ [ "Una vez definido el mejor modelo vamos a realizar una búsqueda de las mejores variables. Y para ello definimos una función forward que nos vaya añadiendo variables según su error.", "_____no_output_____" ] ], [ [ "def Entrenar(X,y,model):\n X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=7)\n \n model = model.fit(X_train, y_train)\n \n y_pred = model.predict(X_test)\n error = median_absolute_error(np.exp(y_test)-1, np.exp(y_pred)-1)\n \n return error\n\ndef EntrenarForward(X, y, model, ini_vars):\n '''\n X,y --> Nuestra data\n model --> un modelo\n ini_vars --> variables con las que comenzamos\n '''\n # Variable que indica si hemos terminado\n fin = False\n \n # Variables con las que estamos trabajando\n current_vars = ini_vars\n all_vars = X.columns\n possible_vars = np.setdiff1d(all_vars, current_vars)\n \n while not fin and len(possible_vars) > 0: # Lo que antes pase\n possible_vars = np.setdiff1d(all_vars, current_vars)\n \n if len(current_vars) == 0:\n # Si no tenemos variables, cuestro error es inf\n best_error = np.inf\n else:\n base_error = Entrenar(X[current_vars], y, model)\n best_error = base_error\n \n best_var = ''\n for var in possible_vars:\n var_error = Entrenar(X[current_vars+[var]],y,model)\n \n if var_error < best_error:\n best_error = var_error\n best_var = var\n \n print('Best var: {} --> {:.4f}'.format(best_var, best_error))\n # Si tenemos una best_var \n if len(best_var) > 0:\n current_vars += [best_var]\n else: \n fin = True\n \n print('Best vars:', current_vars)\n print('Best error:', best_error)\n \n return best_error", "_____no_output_____" ], [ "EntrenarForward(X, y, XGBRegressor(max_depth = 10, \n n_estimators= 30, \n reg_lambda = 0.9,\n subsample = 0.6,\n colsample_bytree = 0.7,\n objective = 'reg:linear',\n random_state=7), \n [])", "Best var: GA_page_views --> 18.9004\nBest var: GA_mean_bounce --> 18.6871\nBest var: IDEA_pc_1970_79 --> 18.4164\nBest var: PV_pca2 --> 18.1765\nBest var: PV_longitud_descripcion --> 18.1751\nBest var: --> 18.1751\nBest vars: ['GA_page_views', 'GA_mean_bounce', 'IDEA_pc_1970_79', 'PV_pca2', 'PV_longitud_descripcion']\nBest error: 18.17510498046875\n" ], [ "EntrenarForward(X, y, XGBRegressor(max_depth = 10, \n n_estimators= 30, \n reg_lambda = 0.9,\n subsample = 0.6,\n colsample_bytree = 0.7,\n objective = 'reg:linear',\n random_state=7), \n ['HY_precio'])", "Best var: GA_page_views --> 18.8182\nBest var: PV_pca2 --> 18.6006\nBest var: IDEA_pc_1960_69 --> 18.4076\nBest var: GA_mean_bounce --> 18.2948\nBest var: GA_exit_rate --> 18.1165\nBest var: PV_longitud_descripcion --> 18.1131\nBest var: IDEA_pc_2000_10 --> 18.0981\nBest var: IDEA_pc_1990_99 --> 17.9477\nBest var: PV_pca3 --> 17.8531\nBest var: --> 17.8531\nBest vars: ['HY_precio', 'GA_page_views', 'PV_pca2', 'IDEA_pc_1960_69', 'GA_mean_bounce', 'GA_exit_rate', 'PV_longitud_descripcion', 'IDEA_pc_2000_10', 'IDEA_pc_1990_99', 'PV_pca3']\nBest error: 17.85312286376954\n" ] ], [ [ "Observemos las feature importances de nuestro mejor árbol ya que no mejoramos con el forward.", "_____no_output_____" ] ], [ [ "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=7)\n \nxgb_model = XGBRegressor(max_depth = 10, \n n_estimators= 30, \n reg_lambda = 0.9,\n subsample = 0.6,\n colsample_bytree = 0.7,\n objective = 'reg:linear',\n random_state=7).fit(X_train, y_train)\ny_test_predict = xgb_model.predict(X_test)\nerror = median_absolute_error(np.exp(y_test)-1, np.exp(y_test_predict)-1)\n \nprint('BestXGBoost: ', error, sep = '')", "BestXGBoost: 17.369460296630855\n" ], [ "v = xgb_model.feature_importances_\nplt.figure(figsize=(8,6))\nplt.bar(range(len(v)), v)\nplt.title('Feature Importances')\nplt.xticks(range(len(X_train.columns)), list(X_train.columns), rotation = 90)\nplt.show()", "_____no_output_____" ], [ "# Ordenamos las variables de menor a mayor\nfeatures_ordered, colnames_ordered = zip(*sorted(zip(xgb_model.feature_importances_, X_train.columns)))\n# No tenemos en cuenta las 10 peores variables\nEntrenarModelos(X, y, models, list(colnames_ordered[10:]))", "BestXGBoost: 20.791393280029297\n" ] ], [ [ "Por lo que el mejor modelo es el primer XGBoost entrenado", "_____no_output_____" ], [ "# Conjunto de Test\n\nRealizamos las mismas transforaciones para test", "_____no_output_____" ] ], [ [ "df = pd.read_table('Estimar_UH2019.txt', sep = '|', dtype={'HY_cod_postal':str})\n# Tenemos varios Nans en HY_provincias, por lo que creamos la siguiente función que nos ayudará a imputarlos con\n# ayuda del código postal\ndef ArreglarProvincias(df):\n # Diccionario de los códigos postales. 'xxddd' --> xx es el código asociado a la provincia\n diccionario_postal = {'02':'Albacete','03':'Alicante','04':'Almería','01':'Álava','33':'Asturias',\n '05':'Avila','06':'Badajoz','07':'Baleares', '08':'Barcelona','48':'Bizkaia',\n '09':'Burgos','10':'Cáceres','11':'Cádiz','39':'Cantabria','12':'Castellón',\n '13':'Ciudad Real','14':'Córdoba','15':'A Coruña','16':'Cuenca','20':'Gipuzkoa',\n '17':'Gerona','18':'Granada','19':'Guadalajara','21':'Huelva','22':'Huesca',\n '23':'Jaén','24':'León','25':'Lérida','27':'Lugo','28':'Madrid','29':'Málaga',\n '30':'Murcia','31':'Navarra','32':'Ourense','34':'Palencia','35':'Las Palmas',\n '36':'Pontevedra','26':'La Rioja','37':'Salamanca','38':'Tenerife','40':'Segovia',\n '41':'Sevilla','42':'Soria','43':'Tarragona','44':'Teruel','45':'Toledo','46':'Valencia',\n '47':'Valladolid','49':'Zamora','50':'Zaragoza','51':'Ceuta','52':'Melilla'}\n \n # Obtenemos los códigos postales que nos faltan\n codigos_postales = df.loc[df.HY_provincia.isnull()].HY_cod_postal\n \n # Recorremos la pareja index, value\n for idx, cod in zip(codigos_postales.index, codigos_postales):\n # Del cod solo nos interesan los dos primeros valores para la provincia.\n df.loc[idx,'HY_provincia'] = diccionario_postal[cod[:2]]\n \n # Devolvemos el df de las provincias\n return df\n\n# Obtenemos nuestro df con las provincias imputadas\ndf = ArreglarProvincias(df)\n\n\n########## Metros ##############\n# Volvemos Nans los valores de 0m^2 o inferior --> Los 0 provocan errores en una nueva variable de €/m2\ndf.loc[df['HY_metros_utiles'] <= 0,'HY_metros_utiles'] = np.nan\ndf.loc[df['HY_metros_totales'] <= 0,'HY_metros_totales'] = np.nan\n\n# Obtenemos las posiciones de los valores faltantes en los metros útiles\nposiciones_nans = df['HY_metros_totales'].isnull()\n# Rellenamos los Nans con los metros totales\ndf.loc[posiciones_nans,'HY_metros_totales'] = df.loc[posiciones_nans,'HY_metros_utiles']\n\n# Obtenemos las posiciones de los valores faltantes een los metros útiles\nposiciones_nans = df['HY_metros_utiles'].isnull()\n# Rellenamos los Nans con los metros totales\ndf.loc[posiciones_nans,'HY_metros_utiles'] = df.loc[posiciones_nans,'HY_metros_totales']\n\n# Si continuamos teniendo Nans\nif df[['HY_metros_utiles', 'HY_metros_totales']].isnull().sum().sum()>0: # Hay 2 .sum para sumarlo todo\n # Cuales son los indices de los registros que tienen nans\n index_nans = df.index[df['HY_metros_utiles'].isnull()]\n for i in index_nans:\n tipo = df.loc[i, 'HY_tipo']\n df.loc[i, ['HY_metros_utiles', 'HY_metros_totales']] = group_tipo.loc[tipo] # Recuperamos group_tipo\n \n\n########## Precios ############\n# Creamos una nueva variable que sea ¿Existe precio anterior?--> Si/No\ndf['PV_precio_anterior'] = df['HY_precio_anterior'].isnull()\n# Y modificamos precio anterior para que tenga los valores del precio actual como anterior\ndf.loc[df['HY_precio_anterior'].isnull(),'HY_precio_anterior'] = df.loc[df['HY_precio_anterior'].isnull(),'HY_precio']\n\n\n######## Descripción y distribución #########\n# Creamos 2 nuevas variables con la longitud del texto expuesto (Nan = 0)\n# Igualamos los NaN a carácteres vacíos\ndf.loc[df['HY_descripcion'].isnull(),'HY_descripcion'] = ''\ndf.loc[df['HY_distribucion'].isnull(),'HY_distribucion'] = ''\n# Calculamos su longitud\ndf['PV_longitud_descripcion'] = df['HY_descripcion'].apply(lambda x: len(x))\ndf['PV_longitud_distribucion'] = df['HY_distribucion'].apply(lambda x: len(x))\n\n####### Cantidad de imágenes #########\n# Añadimos una nueva columna que es la cantidad de imágenes que tiene asociado el piso\n# El df de información de las imágenes tiene 3 columnas: id, posicion_foto, carácteres_aleatorios\ndf_imagenes = pd.read_csv('df_info_imagenes.csv', sep = '|',encoding = 'utf-8')\n# Realizamos un count de los ids de las imagenes (Y nos quedamos con el valor de la \n# variable Posiciones (Al ser un count, nos es indiferente la variable seleccionada))\ndf_count_imagenes = df_imagenes.groupby('HY_id').count()['Posiciones']\n# Definimos la función que asocia a cada id su número de imágenes\ndef AñadirCantidadImagenes(x):\n try:\n return df_count_imagenes.loc[x]\n except:\n return 0\n# Creamos la variable\ndf['PV_cantidad_imagenes'] = df['HY_id'].apply(lambda x: AñadirCantidadImagenes(x))\n\n\n######### Imputación de las variables IDEA #########\n# En el notebook ImputacionNans.ipynb se explica en mayor profundidad las funciones definidas. Por el momento, \n# para imputar los valores Nans de las variables IDEA realizamos lo siguiente:\n# -1. Hacemos la media de las variables que no son Nan por CP\n# -2. Imputamos por la media del CP\n# -3. Repetimos para aquellos codigos postales que son todo Nans con la media por provincias (Sin contar los imputados)\n# -4. Imputamos los Nans que faltan por la media general de todo (Sin contar los imputados)\nvar_list = [\n ['IDEA_pc_1960', 'IDEA_pc_1960_69', 'IDEA_pc_1970_79', 'IDEA_pc_1980_89','IDEA_pc_1990_99', 'IDEA_pc_2000_10'],\n ['IDEA_pc_comercio','IDEA_pc_industria', 'IDEA_pc_oficina', 'IDEA_pc_otros','IDEA_pc_residencial', 'IDEA_pc_trast_parking'],\n ['IDEA_ind_tienda', 'IDEA_ind_turismo', 'IDEA_ind_alimentacion'],\n ['IDEA_ind_riqueza'],\n ['IDEA_rent_alquiler'],\n ['IDEA_ind_elasticidad', 'IDEA_ind_liquidez'],\n ['IDEA_unitprice_sale_residential', 'IDEA_price_sale_residential', 'IDEA_stock_sale_residential'],\n ['IDEA_demand_sale_residential'],\n ['IDEA_unitprice_rent_residential', 'IDEA_price_rent_residential', 'IDEA_stock_rent_residential'],\n ['IDEA_demand_rent_residential'] \n]\n\n# Función para arregla los codigos postales mal leidos (Son leidos como enteros).\ndef ArreglarCP(cp):\n if len(cp)==4:\n return '0'+cp\n else:\n return cp\n \ndef ImputarNans_test(df, vars_imput, var):\n '''\n df --> Nuestro dataframe a modificar\n vars_imput --> Variables que queremos imputar.\n var --> Variable por la que queremos realizar la agrupación (HY_cod_postal ó HY_provincia)\n '''\n # Obtenemos nuestros df definidos durante el Train\n if var == 'HY_cod_postal':\n # Hay un error en la escritura del CP, ya que se guardó como int\n group_cp = pd.read_csv('./DF_grupos/group_cp_{}.csv'.format(vars_imput[0]), sep = '|', encoding='utf-8', dtype={'HY_cod_postal': str})\n group_cp['HY_cod_postal'] = group_cp['HY_cod_postal'].apply(lambda x: ArreglarCP(x))\n group_cp.index = group_cp['HY_cod_postal']\n group_cp = group_cp.drop('HY_cod_postal',axis = 1)\n elif var == 'HY_provincia':\n group_cp = pd.read_csv('./DF_grupos/group_prov_{}.csv'.format(vars_imput[0]), sep = '|', encoding='utf-8', index_col='HY_provincia')\n else:\n print('Solo se acepta HY_cod_postal ó HY_provincia como valor de \"var\"')\n \n # Obtenemos los CP que son Nans\n codigos_nans = df.loc[df[vars_imput[0]].isnull(), var] # Valdría cualquiera de las variables.\n \n # Como sabemos que códigos podremos completar y cuales no, solo utilizaremos los que se pueden completar\n cods = np.intersect1d(codigos_nans.unique(),group_cp.index)\n # Cuales son los índices de los Nans\n index_nan = df.index[df[vars_imput[0]].isnull()]\n for cod in cods:\n # Explicación del indexado: De todos los códigos que coinciden con el nuestro nos quedamos con los que tienen índice\n # nan, y para poder acceder a df, necesitamos los índices de Nan que cumplen lo del código.\n i = index_nan[(df[var] == cod)[index_nan]]\n df.loc[i, vars_imput] = group_cp.loc[cod].values\n \n # Si ya hemos terminado de imputar y aún nos quedan Nans imputamos por la media de todo\n if var == 'HY_provincia' and df[vars_imput[0]].isnull().sum()>0:\n df.loc[df[vars_imput[0]].isnull(), vars_imput] = group_cp.mean(axis = 0).values\n \n # Devolvemos el dataframe imputado\n return df\n\n# Como en el caso anterior, vamos conjunto por conjunto\nfor vars_group in var_list:\n df = ImputarNans_test(df, vars_group, var = 'HY_cod_postal')\n df = ImputarNans_test(df, vars_group, var = 'HY_provincia')\n\n####### Indice elasticidad ##########\n# Creamos una nueva variable que redondea el indice de elasticidad al entero más cercano (La variable toma 1,2,3,4,5)\ndf['PV_ind_elasticidad'] = np.round(df['IDEA_ind_elasticidad'])\n\n###### Antigüedad zona #########\n# Definimos la variable de antigüedad de la zona dependiendo del porcentaje de pisos construidos en la zona\n# Primero tomaremos las variables [IDEA_pc_1960,IDEA_pc_1960_69,IDEA_pc_1970_79,IDEA_pc_1980_89,\n# IDEA_pc_1990_99,IDEA_pc_2000_10] y las transformaremos en solo 3. Y luego nos quedaremos \n# con el máximo de esas tres para determinar el estado de la zona.\ndf['Viejos'] = df[['IDEA_pc_1960', 'IDEA_pc_1960_69']].sum(axis = 1)\ndf['Medios'] = df[['IDEA_pc_1970_79', 'IDEA_pc_1980_89']].sum(axis = 1)\ndf['Nuevos'] = df[['IDEA_pc_1990_99', 'IDEA_pc_2000_10']].sum(axis = 1)\ndf['PV_clase_piso'] = df[['Viejos','Medios','Nuevos']].idxmax(axis = 1)\n\n# Añadimos una nueva variable que es si la longitud de la descripción es nula, va de 0 a 1000 carácteres, ó supera los 1000\ndf['PV_longitud_descripcion2'] = pd.cut(df['PV_longitud_descripcion'], bins = [-1,0,1000, np.inf], labels=['Ninguna', 'Media', 'Larga'], include_lowest=False)\n\n# Precio de euro el metro\ndf['PV_precio_metro'] = df.HY_precio/df.HY_metros_totales\n\n# Cambiamos Provincias por 'Castellón','Murcia','Almería','Valencia','Otros'\ndef estructurar_provincias(x):\n '''\n Funcion que asocia a x (Nombre de provincia) su clase\n '''\n # Lista de clases que nos queremos quedar\n if x in ['Castellón','Murcia','Almería','Valencia']:\n return x\n else:\n return 'Otros'\ndf['PV_provincia'] = df.HY_provincia.apply(lambda x: estructurar_provincias(x))\n\n# Una nueva que es si el inmueble presenta alguna distribución\ndf.loc[df['PV_longitud_distribucion'] > 0,'PV_longitud_distribucion'] = 1\n\n# Cambiamos certificado energetico a Si/No (1/0)\ndf['PV_cert_energ'] = df['HY_cert_energ'].apply(lambda x: np.sum(x != 'No'))\n\n# Cambiamos las categorías de HY_tipo a solo 3: [Piso, Garaje, Otros]\ndef CategorizarHY_tipo(dato):\n if dato in ['Piso', 'Garaje']:\n return dato\n else:\n return 'Otros'\ndf['PV_tipo'] = df['HY_tipo'].apply(CategorizarHY_tipo)\n\n# Cambiamos la variable Garaje a Tiene/No tiene (1/0)\ndf.loc[df['HY_num_garajes']>1,'HY_num_garajes'] = 1\n\n# Cambiamos baños por 0, 1, +1 (No tiene, tiene 1, tiene mas de 1)\ndf['PV_num_banos'] = pd.cut(df['HY_num_banos'], [-1,0,1,np.inf], labels = [0,1,'+1'])\n\n# Cambiamos Num terrazas a Si/No (1/0)\ndf.loc[df['HY_num_terrazas']>1, 'HY_num_terrazas'] = 1\n\n\n# Definimos las variables a eliminar para definir nuestro conjunto X\ndrop_vars = ['HY_id', 'HY_cod_postal', 'HY_provincia', 'HY_descripcion',\n 'HY_distribucion', 'HY_tipo', 'HY_antiguedad','HY_num_banos', 'HY_cert_energ',\n 'HY_num_garajes', 'IDEA_pc_1960', 'IDEA_area', 'IDEA_poblacion', 'IDEA_densidad', 'IDEA_ind_elasticidad',\n 'Viejos', 'Medios','Nuevos']\n# Explicación:\n# + 'HY_id', 'HY_cod_postal' --> Demasiadas categorías\n# + 'HY_provincia' --> Ya tenemos PV_provincia que las agrupa\n# + 'HY_descripcion','HY_distribucion' --> Tenemos sus longitudes\n# + 'HY_tipo' --> Ya hemos creado PV_tipo\n# + 'HY_cert_energ','HY_num_garajes'--> Ya tenemos las PV asociadas (valores con 0 1)\n# + 'IDEA_pc_1960' --> Está duplicada\n# + 'IDEA_area', 'IDEA_poblacion', 'IDEA_densidad' --> Demasiados Nans\n# + 'IDEA_ind_elasticidad' --> Tenemos la variable equivalente en PV\n# + 'Viejos', 'Medios','Nuevos' --> Ya tenemos PV_clase_piso\n\nX_real_test = df.copy().drop(drop_vars, axis = 1)\n\n# Definimos las variables como en Train\ncont_vars = ['HY_metros_utiles', 'HY_metros_totales','GA_page_views', 'GA_mean_bounce',\n 'GA_exit_rate', 'GA_quincena_ini', 'GA_quincena_ult','PV_longitud_descripcion',\n 'PV_longitud_distribucion', 'PV_cantidad_imagenes',\n 'PV_ind_elasticidad', 'PV_precio_metro']\n\n# Creamos las variables Dummy para las categóricas\ndummy_vars = ['PV_provincia','PV_longitud_descripcion2',\n 'PV_clase_piso','PV_tipo','PV_num_banos']\n# Unimos nuestro conjunto con el de dummies\nX_real_test = X_real_test.join(pd.get_dummies(X_real_test[dummy_vars]))\n# Eliminamos las variables que ya son Dummies\nX_real_test = X_real_test.drop(dummy_vars, axis=1)\n\n\n############# PCA ####################\n# Realizamos una PCA con las variables IDEA\nidea_vars_price = [\n 'IDEA_unitprice_sale_residential', 'IDEA_price_sale_residential',\n 'IDEA_stock_sale_residential', 'IDEA_demand_sale_residential',\n 'IDEA_unitprice_rent_residential', 'IDEA_price_rent_residential',\n 'IDEA_stock_rent_residential', 'IDEA_demand_rent_residential']\nidea_pca_price = pca_prices.transform(X_real_test[idea_vars_price])\nX_real_test['PV_idea_pca_price'] = (idea_pca_price-idea_pca_price.min())/(idea_pca_price.max()-idea_pca_price.min())\n# Realizamos una PCA con las variables IDEA \nidea_vars_pc = [\n 'IDEA_pc_comercio',\n 'IDEA_pc_industria', 'IDEA_pc_oficina', 'IDEA_pc_otros',\n 'IDEA_pc_residencial', 'IDEA_pc_trast_parking', 'IDEA_ind_tienda',\n 'IDEA_ind_turismo', 'IDEA_ind_alimentacion', 'IDEA_ind_riqueza',\n 'IDEA_rent_alquiler', 'IDEA_ind_liquidez']\n\nidea_pca_pc = pca_pc.transform(X_real_test[idea_vars_pc])\nX_real_test['PV_idea_pca_pc'] = (idea_pca_pc-idea_pca_pc.min())/(idea_pca_pc.max()-idea_pca_pc.min())\n# Nos quedamos con la información PCA de nuestras PV \nPV_pca = pca_PV.transform(X_real_test[['PV_cert_energ',\n 'PV_provincia_Almería', 'PV_provincia_Castellón', 'PV_provincia_Murcia',\n 'PV_provincia_Otros', 'PV_provincia_Valencia',\n 'PV_longitud_descripcion2_Larga', 'PV_longitud_descripcion2_Media',\n 'PV_longitud_descripcion2_Ninguna', 'PV_clase_piso_Medios',\n 'PV_clase_piso_Nuevos', 'PV_clase_piso_Viejos', 'PV_tipo_Garaje',\n 'PV_tipo_Otros', 'PV_tipo_Piso', 'PV_num_banos_0', 'PV_num_banos_1',\n 'PV_num_banos_+1']])\n\nX_real_test['PV_pca1'] = PV_pca[:, 0]\nX_real_test['PV_pca2'] = PV_pca[:, 1]\nX_real_test['PV_pca3'] = PV_pca[:, 2]\n\n# Eliminamos las variables que ya no queremos\nX_real_test = X_real_test.drop([\n 'IDEA_unitprice_sale_residential', 'IDEA_price_sale_residential',\n 'IDEA_stock_sale_residential', 'IDEA_demand_sale_residential',\n 'IDEA_unitprice_rent_residential', 'IDEA_price_rent_residential',\n 'IDEA_stock_rent_residential', 'IDEA_demand_rent_residential',\n 'IDEA_pc_comercio',\n 'IDEA_pc_industria', 'IDEA_pc_oficina', 'IDEA_pc_otros',\n 'IDEA_pc_residencial', 'IDEA_pc_trast_parking', 'IDEA_ind_tienda',\n 'IDEA_ind_turismo', 'IDEA_ind_alimentacion', 'IDEA_ind_riqueza',\n 'IDEA_rent_alquiler', 'IDEA_ind_liquidez', 'PV_cert_energ',\n 'PV_provincia_Almería', 'PV_provincia_Castellón', 'PV_provincia_Murcia',\n 'PV_provincia_Otros', 'PV_provincia_Valencia',\n 'PV_longitud_descripcion2_Larga', 'PV_longitud_descripcion2_Media',\n 'PV_longitud_descripcion2_Ninguna', 'PV_clase_piso_Medios',\n 'PV_clase_piso_Nuevos', 'PV_clase_piso_Viejos', 'PV_tipo_Garaje',\n 'PV_tipo_Otros', 'PV_tipo_Piso', 'PV_num_banos_0', 'PV_num_banos_1',\n 'PV_num_banos_+1'], axis = 1)", "_____no_output_____" ], [ "X_real_test.columns", "_____no_output_____" ], [ "# Realizamos la predicción\ny_final_pred = xgb_model.predict(X_real_test)\n# Deshacemos el cambio\nultra_final_pred = np.exp(y_final_pred)-1\n# Guardamos el resultado\n\n# Definimos el df de solución aprovechando que tenemos el HY_id almacenado en df\ndf_solucion = pd.DataFrame({'HY_id':df['HY_id'], 'TM_Est':ultra_final_pred})\ndf_solucion.head(7)\n# Guardamos la solución\ndf_solucion.to_csv('machine predictor_UH2019.txt', \n header=True, index=False, sep='|', encoding='utf-8')", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ] ]
e7e3b001cfa528bbbf9e43e4edc79cfc94c19d8a
4,053
ipynb
Jupyter Notebook
1_BlackScholes_naive.ipynb
IntelPython/workshop
4d17792515f383ceab4fd80a2d6f79834d32fa50
[ "MIT" ]
13
2017-11-16T12:54:57.000Z
2021-11-21T21:54:22.000Z
1_BlackScholes_naive.ipynb
IntelPython/workshop
4d17792515f383ceab4fd80a2d6f79834d32fa50
[ "MIT" ]
null
null
null
1_BlackScholes_naive.ipynb
IntelPython/workshop
4d17792515f383ceab4fd80a2d6f79834d32fa50
[ "MIT" ]
2
2017-11-28T13:29:47.000Z
2018-07-23T08:06:31.000Z
21.790323
87
0.444856
[ [ [ "# Black Scholes Exercise 1: Naive implementation\n\n- Use cProfile and Line Profiler to look for bottlenecks and hotspots in the code", "_____no_output_____" ] ], [ [ "# Boilerplate for the example\n\nimport cProfile\nimport pstats\n\ntry:\n import numpy.random_intel as rnd\nexcept:\n import numpy.random as rnd\n\n# make xrange available in python 3\ntry:\n xrange\nexcept NameError:\n xrange = range\n\nSEED = 7777777\nS0L = 10.0\nS0H = 50.0\nXL = 10.0\nXH = 50.0\nTL = 1.0\nTH = 2.0\nRISK_FREE = 0.1\nVOLATILITY = 0.2\nTEST_ARRAY_LENGTH = 1024\n\n###############################################\n\ndef gen_data(nopt):\n return (\n rnd.uniform(S0L, S0H, nopt),\n rnd.uniform(XL, XH, nopt),\n rnd.uniform(TL, TH, nopt),\n )\n\nnopt=100000\nprice, strike, t = gen_data(nopt)\ncall = [0.0 for i in range(nopt)]\nput = [-1.0 for i in range(nopt)]\nprice=list(price)\nstrike=list(strike)\nt=list(t)", "_____no_output_____" ] ], [ [ "# The Naive Black Scholes algorithm (looped)", "_____no_output_____" ] ], [ [ "from math import log, sqrt, exp, erf\ninvsqrt = lambda x: 1.0/sqrt(x)\n\ndef black_scholes(nopt, price, strike, t, rate, vol, call, put):\n mr = -rate\n sig_sig_two = vol * vol * 2\n \n for i in range(nopt):\n P = float( price [i] )\n S = strike [i]\n T = t [i]\n \n a = log(P / S)\n b = T * mr\n \n z = T * sig_sig_two\n c = 0.25 * z\n y = invsqrt(z)\n \n w1 = (a - b + c) * y\n w2 = (a - b - c) * y\n \n d1 = 0.5 + 0.5 * erf(w1)\n d2 = 0.5 + 0.5 * erf(w2)\n \n Se = exp(b) * S\n \n call [i] = P * d1 - Se * d2\n put [i] = call [i] - P + Se", "_____no_output_____" ] ], [ [ "# Timeit and CProfile Tests\n\nWhat do you notice about the times?\n\n%timeit function(args)\n\n%prun function(args)", "_____no_output_____" ], [ "# Line_Profiler tests\n\nHow many times does the function items get called (hits)?", "_____no_output_____" ] ], [ [ "%load_ext line_profiler", "_____no_output_____" ] ], [ [ "%lprun -f function function(args)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ] ]
e7e3c21af0d75cff286235dfcc4573ae3400dd2c
232,097
ipynb
Jupyter Notebook
Visualizations/AvarageDailyErrors.ipynb
SGBC/weatherdata
c04ade1b104ef2d94b471bdd1baebdef4c9e9ce0
[ "MIT" ]
null
null
null
Visualizations/AvarageDailyErrors.ipynb
SGBC/weatherdata
c04ade1b104ef2d94b471bdd1baebdef4c9e9ce0
[ "MIT" ]
1
2020-12-11T18:31:05.000Z
2021-01-11T15:04:51.000Z
Visualizations/AvarageDailyErrors.ipynb
SGBC/weatherdata
c04ade1b104ef2d94b471bdd1baebdef4c9e9ce0
[ "MIT" ]
null
null
null
1,126.684466
225,396
0.951753
[ [ [ "# Load data.\nfrom METCOMP_utils import *\nstation_ids = ['40013','40010','25754','40003','24768','40005','23470','25786','24856','23658','40004','23659','25652','20949','40145','40007','40143','22234']\n\n# param_dict: Dictionary translating SMHI parameter names to corresponding parameters in reference.\n# Example: param_dict = {'t': 'ref_temperature', 'prec1h': 'ref_precipitation', ...}\nparam_dict = {'t': 'TM', 'prec1h': 'RR', 'r': 'UM', 'ws': 'FM2'}\n\nstart_date = datetime.date(2017, 3, 1)\nend_date = datetime.date(2020, 2, 29)\nMESAN_data = {}\nLANTMET_data = {}\nfor station in station_ids:\n print('Loading ' + station + '...')\n MESAN_data[station] = read_CSV(station, 'MESAN', start_date, end_date)\n LANTMET_data[station] = read_CSV(station, 'LANTMET', start_date, end_date)\n\n# Unit conversion if needed.\nfor station in station_ids:\n LANTMET_data[station][param_dict['r']] = LANTMET_data[station][param_dict['r']]/100", "Loading 40013...\nLoading 40010...\nLoading 25754...\nLoading 40003...\nLoading 24768...\nLoading 40005...\nLoading 23470...\nLoading 25786...\nLoading 24856...\nLoading 23658...\nLoading 40004...\nLoading 23659...\nLoading 25652...\nLoading 20949...\nLoading 40145...\nLoading 40007...\nLoading 40143...\nLoading 22234...\n" ], [ "import matplotlib.pyplot as plt\nimport numpy as np\n\nparam = 't'\n# param_dict: Dictionary translating SMHI parameter names to corresponding parameters in reference.\n# Example: param_dict = {'t': 'ref_temperature', 'prec1h': 'ref_precipitation', ...}\nparam_dict = {'t': 'TM', 'prec1h': 'RR', 'r': 'UM', 'ws': 'FM2'}\nseasons = {'spring': [3, 4, 5], 'summer': [6, 7, 8], 'fall': [9, 10, 11], 'winter': [12, 1, 2]}\nstations = ['40013','40010','25754','40003','24768','40005','23470','25786','24856','23658','40004','23659','25652','20949','40145','40007','40143','22234']\n\n\nylims = []\nfig, axs = plt.subplots(1, 4, figsize = (16, 16))\nfor station in stations:\n \n print('Working on ' + station + '...')\n \n df_MESAN = MESAN_data[station]\n df_LANTMET = LANTMET_data[station]\n \n MESAN_months = divide_months(df_MESAN)\n LANTMET_months = divide_months(df_LANTMET)\n \n index = 0\n for season in seasons:\n \n # Get season dataframe.\n MESAN_season = None\n LANTMET_season = None\n for month in seasons[season]:\n MESAN_season = pd.concat([MESAN_season, MESAN_months[month]], axis=0, ignore_index=True)\n LANTMET_season = pd.concat([LANTMET_season, LANTMET_months[month]], axis=0, ignore_index=True)\n \n MESAN_hours = divide_hours(MESAN_season)\n LANTMET_hours = divide_hours(LANTMET_season)\n \n hours = [h for h in range(0, 24)]\n avg_day_error = []\n for hour in hours:\n tmp_MESAN = MESAN_hours[hour][param].mean(skipna=True)\n tmp_LANTMET = LANTMET_hours[hour][param_dict[param]].mean(skipna=True)\n avg_day_error.append(abs(tmp_MESAN - tmp_LANTMET))\n \n \n #print(avg_day_error)\n \n if param == 'r':\n avg_day_error = np.array(avg_day_error)*100\n ylims.append(max(avg_day_error))\n axs[index].plot(hours, avg_day_error)\n \n index = index + 1\n\nindex = 0\nfor season in seasons:\n \n axs[index].set_xlabel('Hours', fontsize=16)\n axs[index].set_title(season, fontsize=16)\n axs[index].set_xlim([0, 23])\n axs[index].set_ylim([0, max(ylims)])\n x0,x1 = axs[index].get_xlim()\n y0,y1 = axs[index].get_ylim()\n axs[index].set_aspect(abs(x1-x0)/abs(y1-y0))\n \n index = index + 1\n \nif param == 't':\n axs[0].set_ylabel('Temperature (°C)', fontsize=16)\nif param == 'r':\n axs[0].set_ylabel('Relative humidity (%)', fontsize=16)\nif param == 'prec1h':\n axs[0].set_ylabel('Precipitation (mm)', fontsize=16)\nif param == 'ws':\n axs[0].set_ylabel('Wind speed (m/s)', fontsize=16)\n ", "Working on 40013...\nWorking on 40010...\nWorking on 25754...\nWorking on 40003...\nWorking on 24768...\nWorking on 40005...\nWorking on 23470...\nWorking on 25786...\nWorking on 24856...\nWorking on 23658...\nWorking on 40004...\nWorking on 23659...\nWorking on 25652...\nWorking on 20949...\nWorking on 40145...\nWorking on 40007...\nWorking on 40143...\nWorking on 22234...\n" ] ] ]
[ "code" ]
[ [ "code", "code" ] ]
e7e40050746d4860af586c6a472d6d372606b35e
309,718
ipynb
Jupyter Notebook
time_series_analysis.ipynb
EAC49/timeseries_homework
923292db1d49aaff796da205b56ed18dad7a04ad
[ "ADSL" ]
null
null
null
time_series_analysis.ipynb
EAC49/timeseries_homework
923292db1d49aaff796da205b56ed18dad7a04ad
[ "ADSL" ]
null
null
null
time_series_analysis.ipynb
EAC49/timeseries_homework
923292db1d49aaff796da205b56ed18dad7a04ad
[ "ADSL" ]
null
null
null
195.52904
90,432
0.867702
[ [ [ "import numpy as np\nimport pandas as pd\nfrom pathlib import Path\n%matplotlib inline", "_____no_output_____" ] ], [ [ "# Return Forecasting: Read Historical Daily Yen Futures Data\nIn this notebook, you will load historical Dollar-Yen exchange rate futures data and apply time series analysis and modeling to determine whether there is any predictable behavior.", "_____no_output_____" ] ], [ [ "# Futures contract on the Yen-dollar exchange rate:\n# This is the continuous chain of the futures contracts that are 1 month to expiration\nyen_futures = pd.read_csv(\n Path(\"yen.csv\"), index_col=\"Date\", infer_datetime_format=True, parse_dates=True\n)\nyen_futures.head()", "_____no_output_____" ], [ "# Trim the dataset to begin on January 1st, 1990\nyen_futures = yen_futures.loc[\"1990-01-01\":, :]\nyen_futures.head()", "_____no_output_____" ] ], [ [ " # Return Forecasting: Initial Time-Series Plotting", "_____no_output_____" ], [ " Start by plotting the \"Settle\" price. Do you see any patterns, long-term and/or short?", "_____no_output_____" ] ], [ [ "# Plot just the \"Settle\" column from the dataframe:\nyen_futures.Settle.plot(figsize=[15,10],title='Yen Future Settle Prices',legend=True)", "_____no_output_____" ] ], [ [ "---", "_____no_output_____" ], [ "# Decomposition Using a Hodrick-Prescott Filter", "_____no_output_____" ], [ " Using a Hodrick-Prescott Filter, decompose the Settle price into a trend and noise.", "_____no_output_____" ] ], [ [ "import statsmodels.api as sm\n\n# Apply the Hodrick-Prescott Filter by decomposing the \"Settle\" price into two separate series:\nnoise, trend = sm.tsa.filters.hpfilter(yen_futures['Settle'])", "_____no_output_____" ], [ "# Create a dataframe of just the settle price, and add columns for \"noise\" and \"trend\" series from above:\ndf = yen_futures['Settle'].to_frame()\ndf['noise'] = noise\ndf['trend'] = trend\ndf.tail()", "_____no_output_____" ], [ "# Plot the Settle Price vs. the Trend for 2015 to the present\ndf.loc['2015':].plot(y=['Settle', 'trend'], figsize= (15, 10), title = 'Settle vs. Trend')", "_____no_output_____" ], [ "# Plot the Settle Noise\ndf.noise.plot(figsize= (10, 5), title = 'Noise')", "_____no_output_____" ] ], [ [ "---", "_____no_output_____" ], [ "# Forecasting Returns using an ARMA Model", "_____no_output_____" ], [ "Using futures Settle *Returns*, estimate an ARMA model\n\n1. ARMA: Create an ARMA model and fit it to the returns data. Note: Set the AR and MA (\"p\" and \"q\") parameters to p=2 and q=1: order=(2, 1).\n2. Output the ARMA summary table and take note of the p-values of the lags. Based on the p-values, is the model a good fit (p < 0.05)?\n3. Plot the 5-day forecast of the forecasted returns (the results forecast from ARMA model)", "_____no_output_____" ] ], [ [ "# Create a series using \"Settle\" price percentage returns, drop any nan\"s, and check the results:\n# (Make sure to multiply the pct_change() results by 100)\n# In this case, you may have to replace inf, -inf values with np.nan\"s\nreturns = (yen_futures[[\"Settle\"]].pct_change() * 100)\nreturns = returns.replace(-np.inf, np.nan).dropna()\nreturns.tail()", "_____no_output_____" ], [ "import statsmodels.api as sm\n\n# Estimate and ARMA model using statsmodels (use order=(2, 1))\nfrom statsmodels.tsa.arima_model import ARMA\narma_model = ARMA(returns['Settle'], order=(2,1))\n\n# Fit the model and assign it to a variable called results\nresults = arma_model.fit()", "/Users/emilioacubero/opt/anaconda3/envs/dev/lib/python3.7/site-packages/statsmodels/tsa/arima_model.py:472: FutureWarning: \nstatsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have\nbeen deprecated in favor of statsmodels.tsa.arima.model.ARIMA (note the .\nbetween arima and model) and\nstatsmodels.tsa.SARIMAX. These will be removed after the 0.12 release.\n\nstatsmodels.tsa.arima.model.ARIMA makes use of the statespace framework and\nis both well tested and maintained.\n\nTo silence this warning and continue using ARMA and ARIMA until they are\nremoved, use:\n\nimport warnings\nwarnings.filterwarnings('ignore', 'statsmodels.tsa.arima_model.ARMA',\n FutureWarning)\nwarnings.filterwarnings('ignore', 'statsmodels.tsa.arima_model.ARIMA',\n FutureWarning)\n\n warnings.warn(ARIMA_DEPRECATION_WARN, FutureWarning)\n/Users/emilioacubero/opt/anaconda3/envs/dev/lib/python3.7/site-packages/statsmodels/tsa/base/tsa_model.py:583: ValueWarning: A date index has been provided, but it has no associated frequency information and so will be ignored when e.g. forecasting.\n ' ignored when e.g. forecasting.', ValueWarning)\n This problem is unconstrained.\n" ], [ "# Output model summary results:\nresults.summary()", "_____no_output_____" ], [ "# Plot the 5 Day Returns Forecast\npd.DataFrame(results.forecast(steps=5)[0]).plot(figsize= (10, 5), title='5 Day Returns Forcast')\n", "_____no_output_____" ] ], [ [ "---", "_____no_output_____" ], [ "# Forecasting the Settle Price using an ARIMA Model", "_____no_output_____" ], [ " 1. Using the *raw* Yen **Settle Price**, estimate an ARIMA model.\n 1. Set P=5, D=1, and Q=1 in the model (e.g., ARIMA(df, order=(5,1,1))\n 2. P= # of Auto-Regressive Lags, D= # of Differences (this is usually =1), Q= # of Moving Average Lags\n 2. Output the ARIMA summary table and take note of the p-values of the lags. Based on the p-values, is the model a good fit (p < 0.05)?\n 3. Construct a 5 day forecast for the Settle Price. What does the model forecast will happen to the Japanese Yen in the near term?", "_____no_output_____" ] ], [ [ "from statsmodels.tsa.arima_model import ARIMA\n\n# Estimate and ARIMA Model:\n# Hint: ARIMA(df, order=(p, d, q))\narima_model = ARIMA(yen_futures['Settle'], order=(5,1,1))\n\n# Fit the model\narima_results = arima_model.fit()", "/Users/emilioacubero/opt/anaconda3/envs/dev/lib/python3.7/site-packages/statsmodels/tsa/arima_model.py:472: FutureWarning: \nstatsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have\nbeen deprecated in favor of statsmodels.tsa.arima.model.ARIMA (note the .\nbetween arima and model) and\nstatsmodels.tsa.SARIMAX. These will be removed after the 0.12 release.\n\nstatsmodels.tsa.arima.model.ARIMA makes use of the statespace framework and\nis both well tested and maintained.\n\nTo silence this warning and continue using ARMA and ARIMA until they are\nremoved, use:\n\nimport warnings\nwarnings.filterwarnings('ignore', 'statsmodels.tsa.arima_model.ARMA',\n FutureWarning)\nwarnings.filterwarnings('ignore', 'statsmodels.tsa.arima_model.ARIMA',\n FutureWarning)\n\n warnings.warn(ARIMA_DEPRECATION_WARN, FutureWarning)\n/Users/emilioacubero/opt/anaconda3/envs/dev/lib/python3.7/site-packages/statsmodels/tsa/base/tsa_model.py:583: ValueWarning: A date index has been provided, but it has no associated frequency information and so will be ignored when e.g. forecasting.\n ' ignored when e.g. forecasting.', ValueWarning)\n/Users/emilioacubero/opt/anaconda3/envs/dev/lib/python3.7/site-packages/statsmodels/tsa/base/tsa_model.py:583: ValueWarning: A date index has been provided, but it has no associated frequency information and so will be ignored when e.g. forecasting.\n ' ignored when e.g. forecasting.', ValueWarning)\n This problem is unconstrained.\n" ], [ "# Output model summary results:\narima_results.summary()", "_____no_output_____" ], [ "# Plot the 5 Day Price Forecast\npd.DataFrame(arima_results.forecast(steps=5)[0]).plot(figsize= (10, 5), title='5 Day Futures Price Forcast')", "_____no_output_____" ] ], [ [ "---", "_____no_output_____" ], [ "# Volatility Forecasting with GARCH\n\nRather than predicting returns, let's forecast near-term **volatility** of Japanese Yen futures returns. Being able to accurately predict volatility will be extremely useful if we want to trade in derivatives or quantify our maximum loss.\n \nUsing futures Settle *Returns*, estimate an GARCH model\n\n1. GARCH: Create an GARCH model and fit it to the returns data. Note: Set the parameters to p=2 and q=1: order=(2, 1).\n2. Output the GARCH summary table and take note of the p-values of the lags. Based on the p-values, is the model a good fit (p < 0.05)?\n3. Plot the 5-day forecast of the volatility.", "_____no_output_____" ] ], [ [ "from arch import arch_model", "_____no_output_____" ], [ "# Estimate a GARCH model:\ngarch_model = arch_model(returns, mean=\"Zero\", vol=\"GARCH\", p=2, q=1)\n\n# Fit the model\ngarch_results = garch_model.fit(disp=\"off\")", "_____no_output_____" ], [ "# Summarize the model results\ngarch_results.summary()", "_____no_output_____" ], [ "# Find the last day of the dataset\nlast_day = returns.index.max().strftime('%Y-%m-%d')\nlast_day", "_____no_output_____" ], [ "# Create a 5 day forecast of volatility\nforecast_horizon = 5\n# Start the forecast using the last_day calculated above\nforecasts = garch_results.forecast(start=last_day, horizon=forecast_horizon)", "/Users/emilioacubero/opt/anaconda3/envs/dev/lib/python3.7/site-packages/arch/__future__/_utility.py:21: FutureWarning: \nThe default for reindex is True. After September 2021 this will change to\nFalse. Set reindex to True or False to silence this message. Alternatively,\nyou can use the import comment\n\nfrom arch.__future__ import reindexing\n\nto globally set reindex to True and silence this warning.\n\n FutureWarning,\n" ], [ "# Annualize the forecast\nintermediate = np.sqrt(forecasts.variance.dropna() * 252)\nintermediate.head()", "_____no_output_____" ], [ "# Transpose the forecast so that it is easier to plot\nfinal = intermediate.dropna().T\nfinal.head()", "_____no_output_____" ], [ "# Plot the final forecast\nfinal.plot(figsize= (10, 5), title='5 Day Forecast of Volatility')", "_____no_output_____" ] ], [ [ "---", "_____no_output_____" ], [ "# Conclusions", "_____no_output_____" ], [ "Based on your time series analysis, would you buy the yen now?\n\nIs the risk of the yen expected to increase or decrease?\n\nBased on the model evaluation, would you feel confident in using these models for trading?", "_____no_output_____" ], [ "With the return forceast predicting decreasing returns and the volatility forecast predicting increased volatility, I do not believe it is appropiate to invest in the yen after anaylzing these forecasts.", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ] ]
e7e4102616503478306baf8084c3fff7bcb0dace
314,350
ipynb
Jupyter Notebook
lab1/Part2_Music_Generation.ipynb
mukesh5237/introtodeeplearning
c847305ea5d50a0efb921b6c75438673d2cbc319
[ "MIT" ]
null
null
null
lab1/Part2_Music_Generation.ipynb
mukesh5237/introtodeeplearning
c847305ea5d50a0efb921b6c75438673d2cbc319
[ "MIT" ]
null
null
null
lab1/Part2_Music_Generation.ipynb
mukesh5237/introtodeeplearning
c847305ea5d50a0efb921b6c75438673d2cbc319
[ "MIT" ]
null
null
null
184.803057
220,176
0.679892
[ [ [ "<table align=\"center\">\n <td align=\"center\"><a target=\"_blank\" href=\"http://introtodeeplearning.com\">\n <img src=\"https://i.ibb.co/Jr88sn2/mit.png\" style=\"padding-bottom:5px;\" />\n Visit MIT Deep Learning</a></td>\n <td align=\"center\"><a target=\"_blank\" href=\"https://colab.research.google.com/github/aamini/introtodeeplearning/blob/master/lab1/Part2_Music_Generation.ipynb\">\n <img src=\"https://i.ibb.co/2P3SLwK/colab.png\" style=\"padding-bottom:5px;\" />Run in Google Colab</a></td>\n <td align=\"center\"><a target=\"_blank\" href=\"https://github.com/aamini/introtodeeplearning/blob/master/lab1/Part2_Music_Generation.ipynb\">\n <img src=\"https://i.ibb.co/xfJbPmL/github.png\" height=\"70px\" style=\"padding-bottom:5px;\" />View Source on GitHub</a></td>\n</table>\n\n# Copyright Information", "_____no_output_____" ] ], [ [ "# Copyright 2021 MIT 6.S191 Introduction to Deep Learning. All Rights Reserved.\n# \n# Licensed under the MIT License. You may not use this file except in compliance\n# with the License. Use and/or modification of this code outside of 6.S191 must\n# reference:\n#\n# © MIT 6.S191: Introduction to Deep Learning\n# http://introtodeeplearning.com\n#", "_____no_output_____" ] ], [ [ "# Lab 1: Intro to TensorFlow and Music Generation with RNNs\n\n# Part 2: Music Generation with RNNs\n\nIn this portion of the lab, we will explore building a Recurrent Neural Network (RNN) for music generation. We will train a model to learn the patterns in raw sheet music in [ABC notation](https://en.wikipedia.org/wiki/ABC_notation) and then use this model to generate new music. ", "_____no_output_____" ], [ "## 2.1 Dependencies \nFirst, let's download the course repository, install dependencies, and import the relevant packages we'll need for this lab.", "_____no_output_____" ] ], [ [ "# Import Tensorflow 2.0\n#%tensorflow_version 2.x\nimport tensorflow as tf \n\n# Download and import the MIT 6.S191 package\n#!pip install mitdeeplearning\nimport mitdeeplearning as mdl\n\n# Import all remaining packages\nimport numpy as np\nimport os\nimport time\nimport functools\nfrom IPython import display as ipythondisplay\nfrom tqdm import tqdm\n#!apt-get install abcmidi timidity > /dev/null 2>&1\n\n# Check that we are using a GPU, if not switch runtimes using Runtime > Change Runtime Type > GPU\n#assert len(tf.config.list_physical_devices('GPU')) > 0", "_____no_output_____" ], [ "print(\"Num GPUs Available: \", len(tf.config.list_physical_devices('GPU')))", "Num GPUs Available: 0\n" ] ], [ [ "## 2.2 Dataset\n\n![Let's Dance!](http://33.media.tumblr.com/3d223954ad0a77f4e98a7b87136aa395/tumblr_nlct5lFVbF1qhu7oio1_500.gif)\n\nWe've gathered a dataset of thousands of Irish folk songs, represented in the ABC notation. Let's download the dataset and inspect it: \n", "_____no_output_____" ] ], [ [ "mdl.__file__", "_____no_output_____" ], [ "# Download the dataset\nsongs = mdl.lab1.load_training_data()\n\n# Print one of the songs to inspect it in greater detail!\nexample_song = songs[0]\nprint(\"\\nExample song: \")\nprint(example_song)", "Found 817 songs in text\n\nExample song: \nX:1\nT:Alexander's\nZ: id:dc-hornpipe-1\nM:C|\nL:1/8\nK:D Major\n(3ABc|dAFA DFAd|fdcd FAdf|gfge fefd|(3efe (3dcB A2 (3ABc|!\ndAFA DFAd|fdcd FAdf|gfge fefd|(3efe dc d2:|!\nAG|FAdA FAdA|GBdB GBdB|Acec Acec|dfaf gecA|!\nFAdA FAdA|GBdB GBdB|Aceg fefd|(3efe dc d2:|!\n" ], [ "songs[0]", "_____no_output_____" ], [ "len(songs)", "_____no_output_____" ] ], [ [ "We can easily convert a song in ABC notation to an audio waveform and play it back. Be patient for this conversion to run, it can take some time.", "_____no_output_____" ] ], [ [ "# Convert the ABC notation to audio file and listen to it\nmdl.lab1.play_song(example_song)", "_____no_output_____" ] ], [ [ "One important thing to think about is that this notation of music does not simply contain information on the notes being played, but additionally there is meta information such as the song title, key, and tempo. How does the number of different characters that are present in the text file impact the complexity of the learning problem? This will become important soon, when we generate a numerical representation for the text data.", "_____no_output_____" ] ], [ [ "# Join our list of song strings into a single string containing all songs\nsongs_joined = \"\\n\\n\".join(songs) \n\n# Find all unique characters in the joined string\nvocab = sorted(set(songs_joined))\nprint(\"There are\", len(vocab), \"unique characters in the dataset\")", "There are 83 unique characters in the dataset\n" ], [ "songs_joined", "_____no_output_____" ], [ "print(vocab)", "['\\n', ' ', '!', '\"', '#', \"'\", '(', ')', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', '<', '=', '>', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', ']', '^', '_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '|']\n" ] ], [ [ "## 2.3 Process the dataset for the learning task\n\nLet's take a step back and consider our prediction task. We're trying to train a RNN model to learn patterns in ABC music, and then use this model to generate (i.e., predict) a new piece of music based on this learned information. \n\nBreaking this down, what we're really asking the model is: given a character, or a sequence of characters, what is the most probable next character? We'll train the model to perform this task. \n\nTo achieve this, we will input a sequence of characters to the model, and train the model to predict the output, that is, the following character at each time step. RNNs maintain an internal state that depends on previously seen elements, so information about all characters seen up until a given moment will be taken into account in generating the prediction.", "_____no_output_____" ], [ "### Vectorize the text\n\nBefore we begin training our RNN model, we'll need to create a numerical representation of our text-based dataset. To do this, we'll generate two lookup tables: one that maps characters to numbers, and a second that maps numbers back to characters. Recall that we just identified the unique characters present in the text.", "_____no_output_____" ] ], [ [ "### Define numerical representation of text ###\n\n# Create a mapping from character to unique index.\n# For example, to get the index of the character \"d\", \n# we can evaluate `char2idx[\"d\"]`. \nchar2idx = {u:i for i, u in enumerate(vocab)}\n\n# Create a mapping from indices to characters. This is\n# the inverse of char2idx and allows us to convert back\n# from unique index to the character in our vocabulary.\nidx2char = np.array(vocab)", "_____no_output_____" ], [ "print(char2idx)", "{'\\n': 0, ' ': 1, '!': 2, '\"': 3, '#': 4, \"'\": 5, '(': 6, ')': 7, ',': 8, '-': 9, '.': 10, '/': 11, '0': 12, '1': 13, '2': 14, '3': 15, '4': 16, '5': 17, '6': 18, '7': 19, '8': 20, '9': 21, ':': 22, '<': 23, '=': 24, '>': 25, 'A': 26, 'B': 27, 'C': 28, 'D': 29, 'E': 30, 'F': 31, 'G': 32, 'H': 33, 'I': 34, 'J': 35, 'K': 36, 'L': 37, 'M': 38, 'N': 39, 'O': 40, 'P': 41, 'Q': 42, 'R': 43, 'S': 44, 'T': 45, 'U': 46, 'V': 47, 'W': 48, 'X': 49, 'Y': 50, 'Z': 51, '[': 52, ']': 53, '^': 54, '_': 55, 'a': 56, 'b': 57, 'c': 58, 'd': 59, 'e': 60, 'f': 61, 'g': 62, 'h': 63, 'i': 64, 'j': 65, 'k': 66, 'l': 67, 'm': 68, 'n': 69, 'o': 70, 'p': 71, 'q': 72, 'r': 73, 's': 74, 't': 75, 'u': 76, 'v': 77, 'w': 78, 'x': 79, 'y': 80, 'z': 81, '|': 82}\n" ], [ "idx2char", "_____no_output_____" ] ], [ [ "This gives us an integer representation for each character. Observe that the unique characters (i.e., our vocabulary) in the text are mapped as indices from 0 to `len(unique)`. Let's take a peek at this numerical representation of our dataset:", "_____no_output_____" ] ], [ [ "print('{')\nfor char,_ in zip(char2idx, range(5)):\n print(' {:4s}: {:3d},'.format(repr(char), char2idx[char]))\nprint(' ...\\n}')", "{\n '\\n': 0,\n ' ' : 1,\n '!' : 2,\n '\"' : 3,\n '#' : 4,\n ...\n}\n" ], [ "char2idx['A']", "_____no_output_____" ], [ "### Vectorize the songs string ###\n\n'''TODO: Write a function to convert the all songs string to a vectorized\n (i.e., numeric) representation. Use the appropriate mapping\n above to convert from vocab characters to the corresponding indices.\n\n NOTE: the output of the `vectorize_string` function \n should be a np.array with `N` elements, where `N` is\n the number of characters in the input string\n'''\n\ndef vectorize_string(string):\n return np.array([char2idx[string[i]] for i in range(len(string))])\n\nvectorized_songs = vectorize_string(songs_joined)", "_____no_output_____" ], [ "vectorized_songs", "_____no_output_____" ] ], [ [ "We can also look at how the first part of the text is mapped to an integer representation:", "_____no_output_____" ] ], [ [ "print ('{} ---- characters mapped to int ----> {}'.format(repr(songs_joined[:10]), vectorized_songs[:10]))\n# check that vectorized_songs is a numpy array\nassert isinstance(vectorized_songs, np.ndarray), \"returned result should be a numpy array\"", "'X:1\\nT:Alex' ---- characters mapped to int ----> [49 22 13 0 45 22 26 67 60 79]\n" ] ], [ [ "### Create training examples and targets\n\nOur next step is to actually divide the text into example sequences that we'll use during training. Each input sequence that we feed into our RNN will contain `seq_length` characters from the text. We'll also need to define a target sequence for each input sequence, which will be used in training the RNN to predict the next character. For each input, the corresponding target will contain the same length of text, except shifted one character to the right.\n\nTo do this, we'll break the text into chunks of `seq_length+1`. Suppose `seq_length` is 4 and our text is \"Hello\". Then, our input sequence is \"Hell\" and the target sequence is \"ello\".\n\nThe batch method will then let us convert this stream of character indices to sequences of the desired size.", "_____no_output_____" ] ], [ [ "### Batch definition to create training examples ###\n\ndef get_batch(vectorized_songs, seq_length, batch_size):\n # the length of the vectorized songs string\n n = vectorized_songs.shape[0] - 1\n # randomly choose the starting indices for the examples in the training batch\n idx = np.random.choice(n-seq_length, batch_size)\n\n '''TODO: construct a list of input sequences for the training batch'''\n input_batch = [vectorized_songs[idx[i]:idx[i]+seq_length] for i in range(batch_size)]\n '''TODO: construct a list of output sequences for the training batch'''\n output_batch = [vectorized_songs[idx[i]+1:idx[i]+seq_length+1] for i in range(batch_size)]\n\n # x_batch, y_batch provide the true inputs and targets for network training\n x_batch = np.reshape(input_batch, [batch_size, seq_length])\n y_batch = np.reshape(output_batch, [batch_size, seq_length])\n return x_batch, y_batch\n\n# Perform some simple tests to make sure your batch function is working properly! \ntest_args = (vectorized_songs, 10, 2)\nif not mdl.lab1.test_batch_func_types(get_batch, test_args) or \\\n not mdl.lab1.test_batch_func_shapes(get_batch, test_args) or \\\n not mdl.lab1.test_batch_func_next_step(get_batch, test_args): \n print(\"======\\n[FAIL] could not pass tests\")\nelse: \n print(\"======\\n[PASS] passed all tests!\")", "[PASS] test_batch_func_types\n[PASS] test_batch_func_shapes\n[PASS] test_batch_func_next_step\n======\n[PASS] passed all tests!\n" ] ], [ [ "For each of these vectors, each index is processed at a single time step. So, for the input at time step 0, the model receives the index for the first character in the sequence, and tries to predict the index of the next character. At the next timestep, it does the same thing, but the RNN considers the information from the previous step, i.e., its updated state, in addition to the current input.\n\nWe can make this concrete by taking a look at how this works over the first several characters in our text:", "_____no_output_____" ] ], [ [ "x_batch, y_batch = get_batch(vectorized_songs, seq_length=5, batch_size=1)\n\nfor i, (input_idx, target_idx) in enumerate(zip(np.squeeze(x_batch), np.squeeze(y_batch))):\n print(\"Step {:3d}\".format(i))\n print(\" input: {} ({:s})\".format(input_idx, repr(idx2char[input_idx])))\n print(\" expected output: {} ({:s})\".format(target_idx, repr(idx2char[target_idx])))", "Step 0\n input: 10 ('.')\n expected output: 1 (' ')\nStep 1\n input: 1 (' ')\n expected output: 13 ('1')\nStep 2\n input: 13 ('1')\n expected output: 0 ('\\n')\nStep 3\n input: 0 ('\\n')\n expected output: 51 ('Z')\nStep 4\n input: 51 ('Z')\n expected output: 22 (':')\n" ] ], [ [ "## 2.4 The Recurrent Neural Network (RNN) model", "_____no_output_____" ], [ "Now we're ready to define and train a RNN model on our ABC music dataset, and then use that trained model to generate a new song. We'll train our RNN using batches of song snippets from our dataset, which we generated in the previous section.\n\nThe model is based off the LSTM architecture, where we use a state vector to maintain information about the temporal relationships between consecutive characters. The final output of the LSTM is then fed into a fully connected [`Dense`](https://www.tensorflow.org/api_docs/python/tf/keras/layers/Dense) layer where we'll output a softmax over each character in the vocabulary, and then sample from this distribution to predict the next character. \n\nAs we introduced in the first portion of this lab, we'll be using the Keras API, specifically, [`tf.keras.Sequential`](https://www.tensorflow.org/api_docs/python/tf/keras/models/Sequential), to define the model. Three layers are used to define the model:\n\n* [`tf.keras.layers.Embedding`](https://www.tensorflow.org/api_docs/python/tf/keras/layers/Embedding): This is the input layer, consisting of a trainable lookup table that maps the numbers of each character to a vector with `embedding_dim` dimensions.\n* [`tf.keras.layers.LSTM`](https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM): Our LSTM network, with size `units=rnn_units`. \n* [`tf.keras.layers.Dense`](https://www.tensorflow.org/api_docs/python/tf/keras/layers/Dense): The output layer, with `vocab_size` outputs.\n\n\n<img src=\"https://raw.githubusercontent.com/aamini/introtodeeplearning/2019/lab1/img/lstm_unrolled-01-01.png\" alt=\"Drawing\"/>", "_____no_output_____" ], [ "Embedding vs one-hot encoding\n\nEmbedding - creates continuous representation of vocab, similar words stay close to each other, this representation is learnt, needs less dimenstionality than one-hot encoding to represent vocab\none hot encoding - leads to curse of dimensionality for a large vocab", "_____no_output_____" ], [ "### Define the RNN model\n\nNow, we will define a function that we will use to actually build the model.", "_____no_output_____" ] ], [ [ "def LSTM(rnn_units): \n return tf.keras.layers.LSTM(\n rnn_units, \n return_sequences=True, \n recurrent_initializer='glorot_uniform',\n recurrent_activation='sigmoid',\n stateful=True,\n )", "_____no_output_____" ] ], [ [ "The time has come! Fill in the `TODOs` to define the RNN model within the `build_model` function, and then call the function you just defined to instantiate the model!", "_____no_output_____" ] ], [ [ "len(vocab)", "_____no_output_____" ], [ "### Defining the RNN Model ###\n\n'''TODO: Add LSTM and Dense layers to define the RNN model using the Sequential API.'''\ndef build_model(vocab_size, embedding_dim, rnn_units, batch_size):\n model = tf.keras.Sequential([\n # Layer 1: Embedding layer to transform indices into dense vectors of a fixed embedding size\n # None is the sequence length, just a place holder\n tf.keras.layers.Embedding(vocab_size, embedding_dim, batch_input_shape=[batch_size, None]),\n\n # Layer 2: LSTM with `rnn_units` number of units. \n # TODO: Call the LSTM function defined above to add this layer.\n LSTM(rnn_units),\n\n # Layer 3: Dense (fully-connected) layer that transforms the LSTM output into the vocabulary size. \n # TODO: Add the Dense layer.\n # '''TODO: DENSE LAYER HERE'''\n tf.keras.layers.Dense(units=vocab_size)\n ])\n\n return model\n\n# Build a simple model with default hyperparameters. You will get the chance to change these later.\nmodel = build_model(len(vocab), embedding_dim=256, rnn_units=1024, batch_size=32)", "_____no_output_____" ] ], [ [ "### Test out the RNN model\n\nIt's always a good idea to run a few simple checks on our model to see that it behaves as expected. \n\nFirst, we can use the `Model.summary` function to print out a summary of our model's internal workings. Here we can check the layers in the model, the shape of the output of each of the layers, the batch size, etc.", "_____no_output_____" ] ], [ [ "model.summary()", "Model: \"sequential_1\"\n_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nembedding_1 (Embedding) (32, None, 256) 21248 \n_________________________________________________________________\nlstm_1 (LSTM) (32, None, 1024) 5246976 \n_________________________________________________________________\ndense_1 (Dense) (32, None, 83) 85075 \n=================================================================\nTotal params: 5,353,299\nTrainable params: 5,353,299\nNon-trainable params: 0\n_________________________________________________________________\n" ] ], [ [ "We can also quickly check the dimensionality of our output, using a sequence length of 100. Note that the model can be run on inputs of any length.", "_____no_output_____" ] ], [ [ "x, y = get_batch(vectorized_songs, seq_length=100, batch_size=32)\npred = model(x)\nprint(\"Input shape: \", x.shape, \" # (batch_size, sequence_length)\")\nprint(\"Prediction shape: \", pred.shape, \"# (batch_size, sequence_length, vocab_size)\")", "Input shape: (32, 100) # (batch_size, sequence_length)\nPrediction shape: (32, 100, 83) # (batch_size, sequence_length, vocab_size)\n" ], [ "x", "_____no_output_____" ], [ "y", "_____no_output_____" ], [ "pred", "_____no_output_____" ] ], [ [ "### Predictions from the untrained model\n\nLet's take a look at what our untrained model is predicting.\n\nTo get actual predictions from the model, we sample from the output distribution, which is defined by a `softmax` over our character vocabulary. This will give us actual character indices. This means we are using a [categorical distribution](https://en.wikipedia.org/wiki/Categorical_distribution) to sample over the example prediction. This gives a prediction of the next character (specifically its index) at each timestep.\n\nNote here that we sample from this probability distribution, as opposed to simply taking the `argmax`, which can cause the model to get stuck in a loop.\n\nLet's try this sampling out for the first example in the batch.", "_____no_output_____" ] ], [ [ "# for batch 0, input sequence size: 100, so output sequence size: 100\nsampled_indices = tf.random.categorical(pred[0], num_samples=1)\nsampled_indices = tf.squeeze(sampled_indices,axis=-1).numpy()\nsampled_indices", "_____no_output_____" ], [ "x[0]", "_____no_output_____" ] ], [ [ "We can now decode these to see the text predicted by the untrained model:", "_____no_output_____" ] ], [ [ "print(\"Input: \\n\", repr(\"\".join(idx2char[x[0]])))\nprint()\nprint(\"Next Char Predictions: \\n\", repr(\"\".join(idx2char[sampled_indices])))", "Input: \n 'AG|F2D DED|FEF GFG|!\\nA3 cAG|AGA cde|fed cAG|Ad^c d2:|!\\ne|f2d d^cd|f2a agf|e2c cBc|e2f gfe|!\\nf2g agf|'\n\nNext Char Predictions: \n '^VIQXjybPEk-^_G/>#T9ZLYJ\"CkYXBE\\nUUDBU<AwqWFDa(]X09T)0GpF(5Q\"k|\\nKHU1fhFeuSM)s\"i9F8hjYcj[Dl5\\'KQzecQkKs'\n" ] ], [ [ "As you can see, the text predicted by the untrained model is pretty nonsensical! How can we do better? We can train the network!", "_____no_output_____" ], [ "## 2.5 Training the model: loss and training operations\n\nNow it's time to train the model!\n\nAt this point, we can think of our next character prediction problem as a standard classification problem. Given the previous state of the RNN, as well as the input at a given time step, we want to predict the class of the next character -- that is, to actually predict the next character. \n\nTo train our model on this classification task, we can use a form of the `crossentropy` loss (negative log likelihood loss). Specifically, we will use the [`sparse_categorical_crossentropy`](https://www.tensorflow.org/api_docs/python/tf/keras/losses/sparse_categorical_crossentropy) loss, as it utilizes integer targets for categorical classification tasks. We will want to compute the loss using the true targets -- the `labels` -- and the predicted targets -- the `logits`.\n\nLet's first compute the loss using our example predictions from the untrained model: ", "_____no_output_____" ] ], [ [ "### Defining the loss function ###\n\n'''TODO: define the loss function to compute and return the loss between\n the true labels and predictions (logits). Set the argument from_logits=True.'''\ndef compute_loss(labels, logits):\n loss = tf.keras.losses.sparse_categorical_crossentropy(labels, logits, from_logits=True) # TODO\n return loss\n\n'''TODO: compute the loss using the true next characters from the example batch \n and the predictions from the untrained model several cells above'''\nexample_batch_loss = compute_loss(y, pred) # TODO\n\nprint(\"Prediction shape: \", pred.shape, \" # (batch_size, sequence_length, vocab_size)\") \nprint(\"scalar_loss: \", example_batch_loss.numpy().mean())", "Prediction shape: (32, 100, 83) # (batch_size, sequence_length, vocab_size)\nscalar_loss: 4.418804\n" ], [ "y.shape", "_____no_output_____" ], [ "pred.shape", "_____no_output_____" ], [ "example_batch_loss.shape", "_____no_output_____" ] ], [ [ "Let's start by defining some hyperparameters for training the model. To start, we have provided some reasonable values for some of the parameters. It is up to you to use what we've learned in class to help optimize the parameter selection here!", "_____no_output_____" ] ], [ [ "### Hyperparameter setting and optimization ###\n\n# Optimization parameters:\nnum_training_iterations = 2000 # Increase this to train longer\nbatch_size = 4 # Experiment between 1 and 64\nseq_length = 100 # Experiment between 50 and 500\nlearning_rate = 5e-3 # Experiment between 1e-5 and 1e-1\n\n# Model parameters: \nvocab_size = len(vocab)\nembedding_dim = 256 \nrnn_units = 1024 # Experiment between 1 and 2048\n\n# Checkpoint location: \ncheckpoint_dir = './training_checkpoints'\ncheckpoint_prefix = os.path.join(checkpoint_dir, \"my_ckpt\")", "_____no_output_____" ] ], [ [ "Now, we are ready to define our training operation -- the optimizer and duration of training -- and use this function to train the model. You will experiment with the choice of optimizer and the duration for which you train your models, and see how these changes affect the network's output. Some optimizers you may like to try are [`Adam`](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/Adam?version=stable) and [`Adagrad`](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/Adagrad?version=stable).\n\nFirst, we will instantiate a new model and an optimizer. Then, we will use the [`tf.GradientTape`](https://www.tensorflow.org/api_docs/python/tf/GradientTape) method to perform the backpropagation operations. \n\nWe will also generate a print-out of the model's progress through training, which will help us easily visualize whether or not we are minimizing the loss.", "_____no_output_____" ] ], [ [ "### Define optimizer and training operation ###\n\n'''TODO: instantiate a new model for training using the `build_model`\n function and the hyperparameters created above.'''\n#model = build_model('''TODO: arguments''')\nmodel = build_model(vocab_size, embedding_dim=embedding_dim, rnn_units=rnn_units, batch_size=batch_size)\n\n'''TODO: instantiate an optimizer with its learning rate.\n Checkout the tensorflow website for a list of supported optimizers.\n https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/\n Try using the Adam optimizer to start.'''\noptimizer = tf.keras.optimizers.Adam(learning_rate=learning_rate)\n\[email protected]\ndef train_step(x, y): \n # Use tf.GradientTape()\n with tf.GradientTape() as tape:\n \n '''TODO: feed the current input into the model and generate predictions'''\n y_hat = model(x)\n \n '''TODO: compute the loss!'''\n loss = compute_loss(y, y_hat)\n\n # Now, compute the gradients \n '''TODO: complete the function call for gradient computation. \n Remember that we want the gradient of the loss with respect all \n of the model parameters. \n HINT: use `model.trainable_variables` to get a list of all model\n parameters.'''\n grads = tape.gradient(loss, model.trainable_variables)\n \n # Apply the gradients to the optimizer so it can update the model accordingly\n optimizer.apply_gradients(zip(grads, model.trainable_variables))\n return loss\n\n##################\n# Begin training!#\n##################\n\nhistory = []\nplotter = mdl.util.PeriodicPlotter(sec=2, xlabel='Iterations', ylabel='Loss')\nif hasattr(tqdm, '_instances'): tqdm._instances.clear() # clear if it exists\n\nfor iter in tqdm(range(num_training_iterations)):\n\n # Grab a batch and propagate it through the network\n x_batch, y_batch = get_batch(vectorized_songs, seq_length, batch_size)\n loss = train_step(x_batch, y_batch)\n\n # Update the progress bar\n history.append(loss.numpy().mean())\n plotter.plot(history)\n\n # Update the model with the changed weights!\n if iter % 100 == 0: \n model.save_weights(checkpoint_prefix)\n \n# Save the trained model and the weights\nmodel.save_weights(checkpoint_prefix)\n", "_____no_output_____" ] ], [ [ "## 2.6 Generate music using the RNN model\n\nNow, we can use our trained RNN model to generate some music! When generating music, we'll have to feed the model some sort of seed to get it started (because it can't predict anything without something to start with!).\n\nOnce we have a generated seed, we can then iteratively predict each successive character (remember, we are using the ABC representation for our music) using our trained RNN. More specifically, recall that our RNN outputs a `softmax` over possible successive characters. For inference, we iteratively sample from these distributions, and then use our samples to encode a generated song in the ABC format.\n\nThen, all we have to do is write it to a file and listen!", "_____no_output_____" ], [ "### Restore the latest checkpoint\n\nTo keep this inference step simple, we will use a batch size of 1. Because of how the RNN state is passed from timestep to timestep, the model will only be able to accept a fixed batch size once it is built. \n\nTo run the model with a different `batch_size`, we'll need to rebuild the model and restore the weights from the latest checkpoint, i.e., the weights after the last checkpoint during training:", "_____no_output_____" ] ], [ [ "'''TODO: Rebuild the model using a batch_size=1'''\nmodel = build_model(vocab_size, embedding_dim=embedding_dim, rnn_units=rnn_units, batch_size=1)\n\n# Restore the model weights for the last checkpoint after training\nmodel.load_weights(tf.train.latest_checkpoint(checkpoint_dir))\nmodel.build(tf.TensorShape([1, None]))\n\nmodel.summary()", "Model: \"sequential_3\"\n_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nembedding_3 (Embedding) (1, None, 256) 21248 \n_________________________________________________________________\nlstm_3 (LSTM) (1, None, 1024) 5246976 \n_________________________________________________________________\ndense_3 (Dense) (1, None, 83) 85075 \n=================================================================\nTotal params: 5,353,299\nTrainable params: 5,353,299\nNon-trainable params: 0\n_________________________________________________________________\n" ] ], [ [ "Notice that we have fed in a fixed `batch_size` of 1 for inference.", "_____no_output_____" ], [ "### The prediction procedure\n\nNow, we're ready to write the code to generate text in the ABC music format:\n\n* Initialize a \"seed\" start string and the RNN state, and set the number of characters we want to generate.\n\n* Use the start string and the RNN state to obtain the probability distribution over the next predicted character.\n\n* Sample from multinomial distribution to calculate the index of the predicted character. This predicted character is then used as the next input to the model.\n\n* At each time step, the updated RNN state is fed back into the model, so that it now has more context in making the next prediction. After predicting the next character, the updated RNN states are again fed back into the model, which is how it learns sequence dependencies in the data, as it gets more information from the previous predictions.\n\n![LSTM inference](https://raw.githubusercontent.com/aamini/introtodeeplearning/2019/lab1/img/lstm_inference.png)\n\nComplete and experiment with this code block (as well as some of the aspects of network definition and training!), and see how the model performs. How do songs generated after training with a small number of epochs compare to those generated after a longer duration of training?", "_____no_output_____" ] ], [ [ "### Prediction of a generated song ###\n\ndef generate_text(model, start_string, generation_length=1000):\n # Evaluation step (generating ABC text using the learned RNN model)\n\n '''TODO: convert the start string to numbers (vectorize)'''\n input_eval = [char2idx[s] for s in start_string] # TODO\n # input_eval = ['''TODO''']\n input_eval = tf.expand_dims(input_eval, 0)\n\n # Empty string to store our results\n text_generated = []\n\n # Here batch size == 1\n model.reset_states()\n tqdm._instances.clear()\n\n for i in tqdm(range(generation_length)):\n '''TODO: evaluate the inputs and generate the next character predictions'''\n predictions = model(input_eval)\n # predictions = model('''TODO''')\n \n # Remove the batch dimension\n predictions = tf.squeeze(predictions, 0)\n \n '''TODO: use a multinomial distribution to sample'''\n predicted_id = tf.random.categorical(predictions, num_samples=1)[-1,0].numpy()\n # predicted_id = tf.random.categorical('''TODO''', num_samples=1)[-1,0].numpy()\n \n # Pass the prediction along with the previous hidden state\n # as the next inputs to the model\n input_eval = tf.expand_dims([predicted_id], 0)\n \n '''TODO: add the predicted character to the generated text!'''\n # Hint: consider what format the prediction is in vs. the output\n text_generated.append(idx2char[predicted_id]) # TODO \n # text_generated.append('''TODO''')\n \n return (start_string + ''.join(text_generated))", "_____no_output_____" ], [ "'''TODO: Use the model and the function defined above to generate ABC format text of length 1000!\n As you may notice, ABC files start with \"X\" - this may be a good start string.'''\ngenerated_text = generate_text(model, start_string=\"A\", generation_length=1000) # TODO\n# generated_text = generate_text('''TODO''', start_string=\"X\", generation_length=1000)", "100%|█████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:07<00:00, 128.46it/s]\n" ], [ "generated_text", "_____no_output_____" ] ], [ [ "### Play back the generated music!\n\nWe can now call a function to convert the ABC format text to an audio file, and then play that back to check out our generated music! Try training longer if the resulting song is not long enough, or re-generating the song!", "_____no_output_____" ] ], [ [ "### Play back generated songs ###\n\ngenerated_songs = mdl.lab1.extract_song_snippet(generated_text)\n\nfor i, song in enumerate(generated_songs): \n # Synthesize the waveform from a song\n waveform = mdl.lab1.play_song(song)\n\n # If its a valid song (correct syntax), lets play it! \n if waveform:\n print(\"Generated song\", i)\n ipythondisplay.display(waveform)", "Found 6 songs in text\n" ], [ "generated_songs", "_____no_output_____" ] ], [ [ "## 2.7 Experiment and **get awarded for the best songs**!\n\nCongrats on making your first sequence model in TensorFlow! It's a pretty big accomplishment, and hopefully you have some sweet tunes to show for it.\n\nConsider how you may improve your model and what seems to be most important in terms of performance. Here are some ideas to get you started:\n\n* How does the number of training epochs affect the performance?\n* What if you alter or augment the dataset? \n* Does the choice of start string significantly affect the result? \n\nTry to optimize your model and submit your best song! **MIT students and affiliates will be eligible for prizes during the IAP offering**. To enter the competition, MIT students and affiliates should upload the following to the course Canvas:\n\n* a recording of your song;\n* iPython notebook with the code you used to generate the song;\n* a description and/or diagram of the architecture and hyperparameters you used -- if there are any additional or interesting modifications you made to the template code, please include these in your description.\n\nYou can also tweet us at [@MITDeepLearning](https://twitter.com/MITDeepLearning) a copy of the song! See this example song generated by a previous 6.S191 student (credit Ana Heart): <a href=\"https://twitter.com/AnaWhatever16/status/1263092914680410112?s=20\">song from May 20, 2020.</a>\n<script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n\nHave fun and happy listening!\n\n![Let's Dance!](http://33.media.tumblr.com/3d223954ad0a77f4e98a7b87136aa395/tumblr_nlct5lFVbF1qhu7oio1_500.gif)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ] ]
e7e41534feb44e158fec1ce8fce2f1400506e0a4
504,663
ipynb
Jupyter Notebook
introduction_to_ml_with_python-master/07-working-with-text-data.ipynb
nosy0411/Programming_for_Data_Science
95a5f16f4f6c786290bfc5b8fd1cdd05da00d1db
[ "MIT" ]
null
null
null
introduction_to_ml_with_python-master/07-working-with-text-data.ipynb
nosy0411/Programming_for_Data_Science
95a5f16f4f6c786290bfc5b8fd1cdd05da00d1db
[ "MIT" ]
null
null
null
introduction_to_ml_with_python-master/07-working-with-text-data.ipynb
nosy0411/Programming_for_Data_Science
95a5f16f4f6c786290bfc5b8fd1cdd05da00d1db
[ "MIT" ]
null
null
null
352.172366
108,094
0.915855
[ [ [ "%matplotlib inline\nfrom preamble import *", "_____no_output_____" ] ], [ [ "## Working with Text Data", "_____no_output_____" ], [ "### Types of data represented as strings\n#### Example application: Sentiment analysis of movie reviews", "_____no_output_____" ] ], [ [ "! wget -nc http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz -P data\n! tar xzf data/aclImdb_v1.tar.gz --skip-old-files -C data", "File ‘data/aclImdb_v1.tar.gz’ already there; not retrieving.\n\n" ], [ "!tree -dL 2 data/aclImdb", "\u001b[01;34mdata/aclImdb\u001b[00m\n├── \u001b[01;34mtest\u001b[00m\n│   ├── \u001b[01;34mneg\u001b[00m\n│   └── \u001b[01;34mpos\u001b[00m\n└── \u001b[01;34mtrain\u001b[00m\n ├── \u001b[01;34mneg\u001b[00m\n ├── \u001b[01;34mpos\u001b[00m\n └── \u001b[01;34munsup\u001b[00m\n\n7 directories\n" ], [ "!rm -r data/aclImdb/train/unsup", "_____no_output_____" ], [ "from sklearn.datasets import load_files\n\nreviews_train = load_files(\"data/aclImdb/train/\")\n# load_files returns a bunch, containing training texts and training labels\ntext_train, y_train = reviews_train.data, reviews_train.target\nprint(\"type of text_train: {}\".format(type(text_train)))\nprint(\"length of text_train: {}\".format(len(text_train)))\nprint(\"text_train[6]:\\n{}\".format(text_train[6]))", "type of text_train: <class 'list'>\nlength of text_train: 25000\ntext_train[6]:\nb\"This movie has a special way of telling the story, at first i found it rather odd as it jumped through time and I had no idea whats happening.<br /><br />Anyway the story line was although simple, but still very real and touching. You met someone the first time, you fell in love completely, but broke up at last and promoted a deadly agony. Who hasn't go through this? but we will never forget this kind of pain in our life. <br /><br />I would say i am rather touched as two actor has shown great performance in showing the love between the characters. I just wish that the story could be a happy ending.\"\n" ], [ "text_train = [doc.replace(b\"<br />\", b\" \") for doc in text_train]", "_____no_output_____" ], [ "np.unique(y_train)", "_____no_output_____" ], [ "print(\"Samples per class (training): {}\".format(np.bincount(y_train)))", "Samples per class (training): [12500 12500]\n" ], [ "reviews_test = load_files(\"data/aclImdb/test/\")\ntext_test, y_test = reviews_test.data, reviews_test.target\nprint(\"Number of documents in test data: {}\".format(len(text_test)))\nprint(\"Samples per class (test): {}\".format(np.bincount(y_test)))\ntext_test = [doc.replace(b\"<br />\", b\" \") for doc in text_test]", "Number of documents in test data: 25000\nSamples per class (test): [12500 12500]\n" ] ], [ [ "### Representing text data as Bag of Words", "_____no_output_____" ], [ "![bag_of_words](images/bag_of_words.png)", "_____no_output_____" ], [ "#### Applying bag-of-words to a toy dataset", "_____no_output_____" ] ], [ [ "bards_words =[\"The fool doth think he is wise,\",\n \"but the wise man knows himself to be a fool\"]", "_____no_output_____" ], [ "from sklearn.feature_extraction.text import CountVectorizer\nvect = CountVectorizer()\nvect.fit(bards_words)", "_____no_output_____" ], [ "print(\"Vocabulary size: {}\".format(len(vect.vocabulary_)))\nprint(\"Vocabulary content:\\n {}\".format(vect.vocabulary_))", "Vocabulary size: 13\nVocabulary content:\n {'the': 9, 'fool': 3, 'doth': 2, 'think': 10, 'he': 4, 'is': 6, 'wise': 12, 'but': 1, 'man': 8, 'knows': 7, 'himself': 5, 'to': 11, 'be': 0}\n" ], [ "bag_of_words = vect.transform(bards_words)\nprint(\"bag_of_words: {}\".format(repr(bag_of_words)))", "bag_of_words: <2x13 sparse matrix of type '<class 'numpy.int64'>'\n\twith 16 stored elements in Compressed Sparse Row format>\n" ], [ "print(\"Dense representation of bag_of_words:\\n{}\".format(\n bag_of_words.toarray()))", "Dense representation of bag_of_words:\n[[0 0 1 1 1 0 1 0 0 1 1 0 1]\n [1 1 0 1 0 1 0 1 1 1 0 1 1]]\n" ] ], [ [ "### Bag-of-word for movie reviews", "_____no_output_____" ] ], [ [ "vect = CountVectorizer().fit(text_train)\nX_train = vect.transform(text_train)\nprint(\"X_train:\\n{}\".format(repr(X_train)))", "X_train:\n<25000x74849 sparse matrix of type '<class 'numpy.int64'>'\n\twith 3431196 stored elements in Compressed Sparse Row format>\n" ], [ "feature_names = vect.get_feature_names()\nprint(\"Number of features: {}\".format(len(feature_names)))\nprint(\"First 20 features:\\n{}\".format(feature_names[:20]))\nprint(\"Features 20010 to 20030:\\n{}\".format(feature_names[20010:20030]))\nprint(\"Every 2000th feature:\\n{}\".format(feature_names[::2000]))", "Number of features: 74849\nFirst 20 features:\n['00', '000', '0000000000001', '00001', '00015', '000s', '001', '003830', '006', '007', '0079', '0080', '0083', '0093638', '00am', '00pm', '00s', '01', '01pm', '02']\nFeatures 20010 to 20030:\n['dratted', 'draub', 'draught', 'draughts', 'draughtswoman', 'draw', 'drawback', 'drawbacks', 'drawer', 'drawers', 'drawing', 'drawings', 'drawl', 'drawled', 'drawling', 'drawn', 'draws', 'draza', 'dre', 'drea']\nEvery 2000th feature:\n['00', 'aesir', 'aquarian', 'barking', 'blustering', 'bête', 'chicanery', 'condensing', 'cunning', 'detox', 'draper', 'enshrined', 'favorit', 'freezer', 'goldman', 'hasan', 'huitieme', 'intelligible', 'kantrowitz', 'lawful', 'maars', 'megalunged', 'mostey', 'norrland', 'padilla', 'pincher', 'promisingly', 'receptionist', 'rivals', 'schnaas', 'shunning', 'sparse', 'subset', 'temptations', 'treatises', 'unproven', 'walkman', 'xylophonist']\n" ], [ "from sklearn.model_selection import cross_val_score\nfrom sklearn.linear_model import LogisticRegression\nscores = cross_val_score(LogisticRegression(), X_train, y_train, cv=5)\nprint(\"Mean cross-validation accuracy: {:.2f}\".format(np.mean(scores)))", "Mean cross-validation accuracy: 0.88\n" ], [ "from sklearn.model_selection import GridSearchCV\nparam_grid = {'C': [0.001, 0.01, 0.1, 1, 10]}\ngrid = GridSearchCV(LogisticRegression(), param_grid, cv=5)\ngrid.fit(X_train, y_train)\nprint(\"Best cross-validation score: {:.2f}\".format(grid.best_score_))\nprint(\"Best parameters: \", grid.best_params_)", "Best cross-validation score: 0.89\nBest parameters: {'C': 0.1}\n" ], [ "X_test = vect.transform(text_test)\nprint(\"Test score: {:.2f}\".format(grid.score(X_test, y_test)))", "Test score: 0.88\n" ], [ "vect = CountVectorizer(min_df=5).fit(text_train)\nX_train = vect.transform(text_train)\nprint(\"X_train with min_df: {}\".format(repr(X_train)))", "X_train with min_df: <25000x27271 sparse matrix of type '<class 'numpy.int64'>'\n\twith 3354014 stored elements in Compressed Sparse Row format>\n" ], [ "feature_names = vect.get_feature_names()\n\nprint(\"First 50 features:\\n{}\".format(feature_names[:50]))\nprint(\"Features 20010 to 20030:\\n{}\".format(feature_names[20010:20030]))\nprint(\"Every 700th feature:\\n{}\".format(feature_names[::700]))", "First 50 features:\n['00', '000', '007', '00s', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '100', '1000', '100th', '101', '102', '103', '104', '105', '107', '108', '10s', '10th', '11', '110', '112', '116', '117', '11th', '12', '120', '12th', '13', '135', '13th', '14', '140', '14th', '15', '150', '15th', '16', '160', '1600', '16mm', '16s', '16th']\nFeatures 20010 to 20030:\n['repentance', 'repercussions', 'repertoire', 'repetition', 'repetitions', 'repetitious', 'repetitive', 'rephrase', 'replace', 'replaced', 'replacement', 'replaces', 'replacing', 'replay', 'replayable', 'replayed', 'replaying', 'replays', 'replete', 'replica']\nEvery 700th feature:\n['00', 'affections', 'appropriately', 'barbra', 'blurbs', 'butchered', 'cheese', 'commitment', 'courts', 'deconstructed', 'disgraceful', 'dvds', 'eschews', 'fell', 'freezer', 'goriest', 'hauser', 'hungary', 'insinuate', 'juggle', 'leering', 'maelstrom', 'messiah', 'music', 'occasional', 'parking', 'pleasantville', 'pronunciation', 'recipient', 'reviews', 'sas', 'shea', 'sneers', 'steiger', 'swastika', 'thrusting', 'tvs', 'vampyre', 'westerns']\n" ], [ "grid = GridSearchCV(LogisticRegression(), param_grid, cv=5)\ngrid.fit(X_train, y_train)\nprint(\"Best cross-validation score: {:.2f}\".format(grid.best_score_))", "Best cross-validation score: 0.89\n" ] ], [ [ "### Stop-words", "_____no_output_____" ] ], [ [ "from sklearn.feature_extraction.text import ENGLISH_STOP_WORDS\nprint(\"Number of stop words: {}\".format(len(ENGLISH_STOP_WORDS)))\nprint(\"Every 10th stopword:\\n{}\".format(list(ENGLISH_STOP_WORDS)[::10]))", "Number of stop words: 318\nEvery 10th stopword:\n['they', 'of', 'who', 'found', 'none', 'co', 'full', 'otherwise', 'never', 'have', 'she', 'neither', 'whereby', 'one', 'any', 'de', 'hence', 'wherever', 'whose', 'him', 'which', 'nine', 'still', 'from', 'here', 'what', 'everything', 'us', 'etc', 'mine', 'find', 'most']\n" ], [ "# Specifying stop_words=\"english\" uses the built-in list.\n# We could also augment it and pass our own.\nvect = CountVectorizer(min_df=5, stop_words=\"english\").fit(text_train)\nX_train = vect.transform(text_train)\nprint(\"X_train with stop words:\\n{}\".format(repr(X_train)))", "X_train with stop words:\n<25000x26966 sparse matrix of type '<class 'numpy.int64'>'\n\twith 2149958 stored elements in Compressed Sparse Row format>\n" ], [ "grid = GridSearchCV(LogisticRegression(), param_grid, cv=5)\ngrid.fit(X_train, y_train)\nprint(\"Best cross-validation score: {:.2f}\".format(grid.best_score_))", "Best cross-validation score: 0.88\n" ] ], [ [ "### Rescaling the Data with tf-idf\n\\begin{equation*}\n\\text{tfidf}(w, d) = \\text{tf} \\log\\big(\\frac{N + 1}{N_w + 1}\\big) + 1\n\\end{equation*}", "_____no_output_____" ] ], [ [ "from sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.pipeline import make_pipeline\npipe = make_pipeline(TfidfVectorizer(min_df=5, norm=None),\n LogisticRegression())\nparam_grid = {'logisticregression__C': [0.001, 0.01, 0.1, 1, 10]}\n\ngrid = GridSearchCV(pipe, param_grid, cv=5)\ngrid.fit(text_train, y_train)\nprint(\"Best cross-validation score: {:.2f}\".format(grid.best_score_))", "Best cross-validation score: 0.89\n" ], [ "vectorizer = grid.best_estimator_.named_steps[\"tfidfvectorizer\"]\n# transform the training dataset:\nX_train = vectorizer.transform(text_train)\n# find maximum value for each of the features over dataset:\nmax_value = X_train.max(axis=0).toarray().ravel()\nsorted_by_tfidf = max_value.argsort()\n# get feature names\nfeature_names = np.array(vectorizer.get_feature_names())\n\nprint(\"Features with lowest tfidf:\\n{}\".format(\n feature_names[sorted_by_tfidf[:20]]))\n\nprint(\"Features with highest tfidf: \\n{}\".format(\n feature_names[sorted_by_tfidf[-20:]]))", "Features with lowest tfidf:\n['poignant' 'disagree' 'instantly' 'importantly' 'lacked' 'occurred'\n 'currently' 'altogether' 'nearby' 'undoubtedly' 'directs' 'fond' 'stinker'\n 'avoided' 'emphasis' 'commented' 'disappoint' 'realizing' 'downhill'\n 'inane']\nFeatures with highest tfidf: \n['coop' 'homer' 'dillinger' 'hackenstein' 'gadget' 'taker' 'macarthur'\n 'vargas' 'jesse' 'basket' 'dominick' 'the' 'victor' 'bridget' 'victoria'\n 'khouri' 'zizek' 'rob' 'timon' 'titanic']\n" ], [ "sorted_by_idf = np.argsort(vectorizer.idf_)\nprint(\"Features with lowest idf:\\n{}\".format(\n feature_names[sorted_by_idf[:100]]))", "Features with lowest idf:\n['the' 'and' 'of' 'to' 'this' 'is' 'it' 'in' 'that' 'but' 'for' 'with'\n 'was' 'as' 'on' 'movie' 'not' 'have' 'one' 'be' 'film' 'are' 'you' 'all'\n 'at' 'an' 'by' 'so' 'from' 'like' 'who' 'they' 'there' 'if' 'his' 'out'\n 'just' 'about' 'he' 'or' 'has' 'what' 'some' 'good' 'can' 'more' 'when'\n 'time' 'up' 'very' 'even' 'only' 'no' 'would' 'my' 'see' 'really' 'story'\n 'which' 'well' 'had' 'me' 'than' 'much' 'their' 'get' 'were' 'other'\n 'been' 'do' 'most' 'don' 'her' 'also' 'into' 'first' 'made' 'how' 'great'\n 'because' 'will' 'people' 'make' 'way' 'could' 'we' 'bad' 'after' 'any'\n 'too' 'then' 'them' 'she' 'watch' 'think' 'acting' 'movies' 'seen' 'its'\n 'him']\n" ] ], [ [ "#### Investigating model coefficients", "_____no_output_____" ] ], [ [ "mglearn.tools.visualize_coefficients(\n grid.best_estimator_.named_steps[\"logisticregression\"].coef_,\n feature_names, n_top_features=40)", "_____no_output_____" ] ], [ [ "#### Bag of words with more than one word (n-grams)", "_____no_output_____" ] ], [ [ "print(\"bards_words:\\n{}\".format(bards_words))", "bards_words:\n['The fool doth think he is wise,', 'but the wise man knows himself to be a fool']\n" ], [ "cv = CountVectorizer(ngram_range=(1, 1)).fit(bards_words)\nprint(\"Vocabulary size: {}\".format(len(cv.vocabulary_)))\nprint(\"Vocabulary:\\n{}\".format(cv.get_feature_names()))", "Vocabulary size: 13\nVocabulary:\n['be', 'but', 'doth', 'fool', 'he', 'himself', 'is', 'knows', 'man', 'the', 'think', 'to', 'wise']\n" ], [ "cv = CountVectorizer(ngram_range=(2, 2)).fit(bards_words)\nprint(\"Vocabulary size: {}\".format(len(cv.vocabulary_)))\nprint(\"Vocabulary:\\n{}\".format(cv.get_feature_names()))", "Vocabulary size: 14\nVocabulary:\n['be fool', 'but the', 'doth think', 'fool doth', 'he is', 'himself to', 'is wise', 'knows himself', 'man knows', 'the fool', 'the wise', 'think he', 'to be', 'wise man']\n" ], [ "print(\"Transformed data (dense):\\n{}\".format(cv.transform(bards_words).toarray()))", "Transformed data (dense):\n[[0 0 1 1 1 0 1 0 0 1 0 1 0 0]\n [1 1 0 0 0 1 0 1 1 0 1 0 1 1]]\n" ], [ "cv = CountVectorizer(ngram_range=(1, 3)).fit(bards_words)\nprint(\"Vocabulary size: {}\".format(len(cv.vocabulary_)))\nprint(\"Vocabulary:\\n{}\".format(cv.get_feature_names()))", "Vocabulary size: 39\nVocabulary:['be', 'be fool', 'but', 'but the', 'but the wise', 'doth', 'doth think', 'doth think he', 'fool', 'fool doth', 'fool doth think', 'he', 'he is', 'he is wise', 'himself', 'himself to', 'himself to be', 'is', 'is wise', 'knows', 'knows himself', 'knows himself to', 'man', 'man knows', 'man knows himself', 'the', 'the fool', 'the fool doth', 'the wise', 'the wise man', 'think', 'think he', 'think he is', 'to', 'to be', 'to be fool', 'wise', 'wise man', 'wise man knows']\n\n" ], [ "pipe = make_pipeline(TfidfVectorizer(min_df=5), LogisticRegression())\n# running the grid-search takes a long time because of the\n# relatively large grid and the inclusion of trigrams\nparam_grid = {'logisticregression__C': [0.001, 0.01, 0.1, 1, 10, 100],\n \"tfidfvectorizer__ngram_range\": [(1, 1), (1, 2), (1, 3)]}\n\ngrid = GridSearchCV(pipe, param_grid, cv=5)\ngrid.fit(text_train, y_train)\nprint(\"Best cross-validation score: {:.2f}\".format(grid.best_score_))\nprint(\"Best parameters:\\n{}\".format(grid.best_params_))", "Best cross-validation score: 0.91\nBest parameters:\n{'logisticregression__C': 100, 'tfidfvectorizer__ngram_range': (1, 3)}\n" ], [ "# extract scores from grid_search\nscores = grid.cv_results_['mean_test_score'].reshape(-1, 3).T\n# visualize heat map\nheatmap = mglearn.tools.heatmap(\n scores, xlabel=\"C\", ylabel=\"ngram_range\", cmap=\"viridis\", fmt=\"%.3f\",\n xticklabels=param_grid['logisticregression__C'],\n yticklabels=param_grid['tfidfvectorizer__ngram_range'])\nplt.colorbar(heatmap)", "_____no_output_____" ], [ "# extract feature names and coefficients\nvect = grid.best_estimator_.named_steps['tfidfvectorizer']\nfeature_names = np.array(vect.get_feature_names())\ncoef = grid.best_estimator_.named_steps['logisticregression'].coef_\nmglearn.tools.visualize_coefficients(coef, feature_names, n_top_features=40)\nplt.ylim(-22, 22)", "_____no_output_____" ], [ "# find 3-gram features\nmask = np.array([len(feature.split(\" \")) for feature in feature_names]) == 3\n# visualize only 3-gram features\nmglearn.tools.visualize_coefficients(coef.ravel()[mask],\n feature_names[mask], n_top_features=40)\nplt.ylim(-22, 22)", "_____no_output_____" ] ], [ [ "#### Advanced tokenization, stemming and lemmatization", "_____no_output_____" ] ], [ [ "import spacy\nimport nltk\n\n# load spacy's English-language models\nen_nlp = spacy.load('en')\n# instantiate nltk's Porter stemmer\nstemmer = nltk.stem.PorterStemmer()\n\n# define function to compare lemmatization in spacy with stemming in nltk\ndef compare_normalization(doc):\n # tokenize document in spacy\n doc_spacy = en_nlp(doc)\n # print lemmas found by spacy\n print(\"Lemmatization:\")\n print([token.lemma_ for token in doc_spacy])\n # print tokens found by Porter stemmer\n print(\"Stemming:\")\n print([stemmer.stem(token.norm_.lower()) for token in doc_spacy])", "_____no_output_____" ], [ "compare_normalization(u\"Our meeting today was worse than yesterday, \"\n \"I'm scared of meeting the clients tomorrow.\")", "Lemmatization:\n['our', 'meeting', 'today', 'be', 'bad', 'than', 'yesterday', ',', 'i', 'be', 'scar', 'of', 'meet', 'the', 'client', 'tomorrow', '.']\nStemming:\n['our', 'meet', 'today', 'wa', 'wors', 'than', 'yesterday', ',', 'i', \"'m\", 'scare', 'of', 'meet', 'the', 'client', 'tomorrow', '.']\n" ], [ "# Technicallity: we want to use the regexp based tokenizer\n# that is used by CountVectorizer and only use the lemmatization\n# from SpaCy. To this end, we replace en_nlp.tokenizer (the SpaCy tokenizer)\n# with the regexp based tokenization\nimport re\n# regexp used in CountVectorizer:\nregexp = re.compile('(?u)\\\\b\\\\w\\\\w+\\\\b')\n# load spacy language model\nen_nlp = spacy.load('en', disable=['parser', 'ner'])\nold_tokenizer = en_nlp.tokenizer\n# replace the tokenizer with the preceding regexp\nen_nlp.tokenizer = lambda string: old_tokenizer.tokens_from_list(\n regexp.findall(string))\n\n# create a custom tokenizer using the SpaCy document processing pipeline\n# (now using our own tokenizer)\ndef custom_tokenizer(document):\n doc_spacy = en_nlp(document)\n return [token.lemma_ for token in doc_spacy]\n\n# define a count vectorizer with the custom tokenizer\nlemma_vect = CountVectorizer(tokenizer=custom_tokenizer, min_df=5)", "_____no_output_____" ], [ "# transform text_train using CountVectorizer with lemmatization\nX_train_lemma = lemma_vect.fit_transform(text_train)\nprint(\"X_train_lemma.shape: {}\".format(X_train_lemma.shape))\n\n# standard CountVectorizer for reference\nvect = CountVectorizer(min_df=5).fit(text_train)\nX_train = vect.transform(text_train)\nprint(\"X_train.shape: {}\".format(X_train.shape))", "X_train_lemma.shape: (25000, 21637)\nX_train.shape: (25000, 27271)\n" ], [ "# build a grid-search using only 1% of the data as training set:\nfrom sklearn.model_selection import StratifiedShuffleSplit\n\nparam_grid = {'C': [0.001, 0.01, 0.1, 1, 10]}\ncv = StratifiedShuffleSplit(n_splits=5, test_size=0.99,\n train_size=0.01, random_state=0)\ngrid = GridSearchCV(LogisticRegression(), param_grid, cv=cv)\n# perform grid search with standard CountVectorizer\ngrid.fit(X_train, y_train)\nprint(\"Best cross-validation score \"\n \"(standard CountVectorizer): {:.3f}\".format(grid.best_score_))\n# perform grid search with Lemmatization\ngrid.fit(X_train_lemma, y_train)\nprint(\"Best cross-validation score \"\n \"(lemmatization): {:.3f}\".format(grid.best_score_))", "Best cross-validation score (standard CountVectorizer): 0.721\nBest cross-validation score (lemmatization): 0.731\n" ] ], [ [ "### Topic Modeling and Document Clustering\n#### Latent Dirichlet Allocation", "_____no_output_____" ] ], [ [ "vect = CountVectorizer(max_features=10000, max_df=.15)\nX = vect.fit_transform(text_train)", "_____no_output_____" ], [ "from sklearn.decomposition import LatentDirichletAllocation\nlda = LatentDirichletAllocation(n_topics=10, learning_method=\"batch\",\n max_iter=25, random_state=0)\n# We build the model and transform the data in one step\n# Computing transform takes some time,\n# and we can save time by doing both at once\ndocument_topics = lda.fit_transform(X)", "_____no_output_____" ], [ "print(\"lda.components_.shape: {}\".format(lda.components_.shape))", "lda.components_.shape: (10, 10000)\n" ], [ "# for each topic (a row in the components_), sort the features (ascending).\n# Invert rows with [:, ::-1] to make sorting descending\nsorting = np.argsort(lda.components_, axis=1)[:, ::-1]\n# get the feature names from the vectorizer:\nfeature_names = np.array(vect.get_feature_names())", "_____no_output_____" ], [ "# Print out the 10 topics:\nmglearn.tools.print_topics(topics=range(10), feature_names=feature_names,\n sorting=sorting, topics_per_chunk=5, n_words=10)", "topic 0 topic 1 topic 2 topic 3 topic 4 \n-------- -------- -------- -------- -------- \nbetween war funny show didn \nfamily world comedy series saw \nyoung us guy episode thought \nreal american laugh tv am \nus our jokes episodes thing \ndirector documentary fun shows got \nwork history humor season 10 \nboth years re new want \nbeautiful new hilarious years going \neach human doesn television watched \n\n\ntopic 5 topic 6 topic 7 topic 8 topic 9 \n-------- -------- -------- -------- -------- \naction kids role performance horror \neffects action cast role house \nnothing animation john john killer \nbudget children version actor gets \nscript game novel cast woman \nminutes disney director plays dead \noriginal fun both jack girl \ndirector old played michael around \nleast 10 mr oscar goes \ndoesn kid young father wife \n\n\n" ], [ "lda100 = LatentDirichletAllocation(n_topics=100, learning_method=\"batch\",\n max_iter=25, random_state=0)\ndocument_topics100 = lda100.fit_transform(X)", "_____no_output_____" ], [ "topics = np.array([7, 16, 24, 25, 28, 36, 37, 41, 45, 51, 53, 54, 63, 89, 97])", "_____no_output_____" ], [ "sorting = np.argsort(lda100.components_, axis=1)[:, ::-1]\nfeature_names = np.array(vect.get_feature_names())\nmglearn.tools.print_topics(topics=topics, feature_names=feature_names,\n sorting=sorting, topics_per_chunk=5, n_words=20)", "topic 7 topic 16 topic 24 topic 25 topic 28 \n-------- -------- -------- -------- -------- \nthriller worst german car beautiful \nsuspense awful hitler gets young \nhorror boring nazi guy old \natmosphere horrible midnight around romantic \nmystery stupid joe down between \nhouse thing germany kill romance \ndirector terrible years goes wonderful \nquite script history killed heart \nbit nothing new going feel \nde worse modesty house year \nperformances waste cowboy away each \ndark pretty jewish head french \ntwist minutes past take sweet \nhitchcock didn kirk another boy \ntension actors young getting loved \ninteresting actually spanish doesn girl \nmysterious re enterprise now relationship \nmurder supposed von night saw \nending mean nazis right both \ncreepy want spock woman simple \n\n\ntopic 36 topic 37 topic 41 topic 45 topic 51 \n-------- -------- -------- -------- -------- \nperformance excellent war music earth \nrole highly american song space \nactor amazing world songs planet \ncast wonderful soldiers rock superman \nplay truly military band alien \nactors superb army soundtrack world \nperformances actors tarzan singing evil \nplayed brilliant soldier voice humans \nsupporting recommend america singer aliens \ndirector quite country sing human \noscar performance americans musical creatures \nroles performances during roll miike \nactress perfect men fan monsters \nexcellent drama us metal apes \nscreen without government concert clark \nplays beautiful jungle playing burton \naward human vietnam hear tim \nwork moving ii fans outer \nplaying world political prince men \ngives recommended against especially moon \n\n\ntopic 53 topic 54 topic 63 topic 89 topic 97 \n-------- -------- -------- -------- -------- \nscott money funny dead didn \ngary budget comedy zombie thought \nstreisand actors laugh gore wasn \nstar low jokes zombies ending \nhart worst humor blood minutes \nlundgren waste hilarious horror got \ndolph 10 laughs flesh felt \ncareer give fun minutes part \nsabrina want re body going \nrole nothing funniest living seemed \ntemple terrible laughing eating bit \nphantom crap joke flick found \njudy must few budget though \nmelissa reviews moments head nothing \nzorro imdb guy gory lot \ngets director unfunny evil saw \nbarbra thing times shot long \ncast believe laughed low interesting \nshort am comedies fulci few \nserial actually isn re half \n\n\n" ], [ "# sort by weight of \"music\" topic 45\nmusic = np.argsort(document_topics100[:, 45])[::-1]\n# print the five documents where the topic is most important\nfor i in music[:10]:\n # show first two sentences\n print(b\".\".join(text_train[i].split(b\".\")[:2]) + b\".\\n\")", "b'I love this movie and never get tired of watching. The music in it is great.\\n'\nb\"I enjoyed Still Crazy more than any film I have seen in years. A successful band from the 70's decide to give it another try.\\n\"\nb'Hollywood Hotel was the last movie musical that Busby Berkeley directed for Warner Bros. His directing style had changed or evolved to the point that this film does not contain his signature overhead shots or huge production numbers with thousands of extras.\\n'\nb\"What happens to washed up rock-n-roll stars in the late 1990's? They launch a comeback / reunion tour. At least, that's what the members of Strange Fruit, a (fictional) 70's stadium rock group do.\\n\"\nb'As a big-time Prince fan of the last three to four years, I really can\\'t believe I\\'ve only just got round to watching \"Purple Rain\". The brand new 2-disc anniversary Special Edition led me to buy it.\\n'\nb\"This film is worth seeing alone for Jared Harris' outstanding portrayal of John Lennon. It doesn't matter that Harris doesn't exactly resemble Lennon; his mannerisms, expressions, posture, accent and attitude are pure Lennon.\\n\"\nb\"The funky, yet strictly second-tier British glam-rock band Strange Fruit breaks up at the end of the wild'n'wacky excess-ridden 70's. The individual band members go their separate ways and uncomfortably settle into lackluster middle age in the dull and uneventful 90's: morose keyboardist Stephen Rea winds up penniless and down on his luck, vain, neurotic, pretentious lead singer Bill Nighy tries (and fails) to pursue a floundering solo career, paranoid drummer Timothy Spall resides in obscurity on a remote farm so he can avoid paying a hefty back taxes debt, and surly bass player Jimmy Nail installs roofs for a living.\\n\"\nb\"I just finished reading a book on Anita Loos' work and the photo in TCM Magazine of MacDonald in her angel costume looked great (impressive wings), so I thought I'd watch this movie. I'd never heard of the film before, so I had no preconceived notions about it whatsoever.\\n\"\nb'I love this movie!!! Purple Rain came out the year I was born and it has had my heart since I can remember. Prince is so tight in this movie.\\n'\nb\"This movie is sort of a Carrie meets Heavy Metal. It's about a highschool guy who gets picked on alot and he totally gets revenge with the help of a Heavy Metal ghost.\\n\"\n" ], [ "fig, ax = plt.subplots(1, 2, figsize=(10, 10))\ntopic_names = [\"{:>2} \".format(i) + \" \".join(words)\n for i, words in enumerate(feature_names[sorting[:, :2]])]\n# two column bar chart:\nfor col in [0, 1]:\n start = col * 50\n end = (col + 1) * 50\n ax[col].barh(np.arange(50), np.sum(document_topics100, axis=0)[start:end])\n ax[col].set_yticks(np.arange(50))\n ax[col].set_yticklabels(topic_names[start:end], ha=\"left\", va=\"top\")\n ax[col].invert_yaxis()\n ax[col].set_xlim(0, 2000)\n yax = ax[col].get_yaxis()\n yax.set_tick_params(pad=130)\nplt.tight_layout()", "_____no_output_____" ] ], [ [ "### Summary and Outlook", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ] ]
e7e42897ce02b6e931a4955b7f9e5519109c95fb
2,635
ipynb
Jupyter Notebook
notebooks/Day 5 - Classification Metrics.ipynb
pjaswanthreddy/100daysofNLP
e68eeabef58307a6bac81d50144608b08d2147b8
[ "FTL" ]
null
null
null
notebooks/Day 5 - Classification Metrics.ipynb
pjaswanthreddy/100daysofNLP
e68eeabef58307a6bac81d50144608b08d2147b8
[ "FTL" ]
null
null
null
notebooks/Day 5 - Classification Metrics.ipynb
pjaswanthreddy/100daysofNLP
e68eeabef58307a6bac81d50144608b08d2147b8
[ "FTL" ]
null
null
null
26.616162
101
0.521822
[ [ [ "#### Common Metrics to analyze the model performance\n - Confusion Matrix\n - Accuracy\n - Recall (sensitivity or true positive rate)\n - Precision\n - Precision - Recall Tradeoff\n - F1 Score\n - ROC/AUC Curve", "_____no_output_____" ], [ "### Confusion Matrix \n<img src=\"../docs/confusion_matrix.jpg\" width=400 height=400 />", "_____no_output_____" ], [ " - Type 1 Error (False Positive Rate) \n \n - Type 2 Error (False Negative Rate) \n\n - False Positive Rate = FP/ (FP + TN)\n\n - False Negative Rate = FN / (FN + TP)\n \n - True Positive Rate = TP / (TP + FN)\n\n - Accuracy = (TP + TN) / (TP + TN + FN + FP)\n\n - Recall = TP / (TP + FN) => True Positive Rate or Sensitivity\n - out of actual total positive classes, how many did we predict correctly positively\n\n - Precision = TP / (TP + FP) => Positive Prediction Value\n - out of total predicted positive classes, how many were actually positive\n \n - F(beta) Score: When you want to consider both precision and recall equally important \n - When FP and FN are equally important then beta = 1\n - When FP has more impact then 0.5 <= beta <= 1\n - When FN has more impact then beta > 1\n\n", "_____no_output_____" ], [ "### ROC Curve - Receiving Optimistic Characteristic\n", "_____no_output_____" ], [ "[YouTube Video -> ritvikmath](https://www.youtube.com/watch?v=SHM_GgNI4fY)\n - TPR vs FPR Graph\n - Never go below the random line\n - AUC decides which ROC Curve is better, but it loses information ", "_____no_output_____" ] ] ]
[ "markdown" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown" ] ]
e7e43bc2023363ae437c29a3db9e4043e132e18c
31,317
ipynb
Jupyter Notebook
Big-Data-Clusters/CU3/Public/content/cert-management/cer100-create-root-ca-install-certs.ipynb
gantz-at-incomm/tigertoolbox
9ea80d39a3c5e0c77553fc851c5ee787fbf9291d
[ "MIT" ]
541
2019-05-07T11:41:25.000Z
2022-03-29T17:33:19.000Z
Big-Data-Clusters/CU3/Public/content/cert-management/cer100-create-root-ca-install-certs.ipynb
gantz-at-incomm/tigertoolbox
9ea80d39a3c5e0c77553fc851c5ee787fbf9291d
[ "MIT" ]
89
2019-05-09T14:23:52.000Z
2022-01-13T20:21:04.000Z
Big-Data-Clusters/CU3/Public/content/cert-management/cer100-create-root-ca-install-certs.ipynb
gantz-at-incomm/tigertoolbox
9ea80d39a3c5e0c77553fc851c5ee787fbf9291d
[ "MIT" ]
338
2019-05-08T05:45:16.000Z
2022-03-28T15:35:03.000Z
57.14781
1,878
0.443178
[ [ [ "CER100 - Configure Cluster with Self Signed Certificates\n========================================================\n\nThis notebook will:\n\n1. Generate a new Root CA in the Big Data Cluster\n2. Create new certificates for each endpoint (Management, Gateway,\n App-Proxy and Controller)\n3. Sign each new certificate with the new generated Root CA, except the\n Controller cert (which is signed with the existing cluster Root CA)\n4. Install each certificate into the Big Data Cluster\n5. Download the new generated Root CA into this machine’s Trusted Root\n Cerification Authorities certificate store.\n\nAll generated self-signed certificates will be stored in the controller\npod (at the `test_cert_store_root` location).\n\n**NOTE: When CER010 runs (the 3rd notebook), look for the ‘Security\nWarning’ dialog to pop up, and press ‘Yes’ to accept the installation of\nthe new Root CA into this machine’s certificate store.**\n\nUpon completion of this notebook, all https:// access to the Big Data\nCluster from this machine (and any machine that installs the new Root\nCA) will show as being secure.\n\nThe Notebook Runner chapter, will ensure CronJobs created (RUN003) to\nrun App-Deploy will install the cluster Root CA to allow securely\ngetting JWT tokens and the swagger.json.\n\nDescription\n-----------\n\n### Parameters\n\nThe parameters set here will override the default parameters set in each\nindividual notebook (`azdata notebook run` injects a `Parameters` cell\nat runtime with the values passed in from the `-a` arguement)", "_____no_output_____" ] ], [ [ "import getpass\n\ncommon_name = \"SQL Server Big Data Clusters Test CA\"\n\ncountry_name = \"US\"\nstate_or_province_name = \"Illinois\"\nlocality_name = \"Chicago\"\norganization_name = \"Contoso\"\norganizational_unit_name = \"Finance\"\nemail_address = f\"{getpass.getuser()}@contoso.com\"\n\ndays = \"825\" # the number of days to certify the certificates for\n\ntest_cert_store_root = \"/var/opt/secrets/test-certificates\"", "_____no_output_____" ] ], [ [ "### Define notebooks and their arguments", "_____no_output_____" ] ], [ [ "import os\nimport copy\n\ncer00_args = { \"country_name\": country_name, \"state_or_province_name\": state_or_province_name, \"locality_name\": locality_name, \"organization_name\": organization_name, \"organizational_unit_name\": organizational_unit_name, \"common_name\": common_name, \"email_address\": email_address, \"days\": days, \"test_cert_store_root\": test_cert_store_root }\n\ncer02_args = copy.deepcopy(cer00_args)\ncer02_args.pop(\"common_name\") # no common_name (as this is the service name set per endpoint)\n\ncer04_args = { \"test_cert_store_root\": test_cert_store_root }\n\nnotebooks = [\n [ os.path.join(\"..\", \"common\", \"sop028-azdata-login.ipynb\"), {} ],\n [ os.path.join(\"..\", \"cert-management\", \"cer001-create-root-ca.ipynb\"), cer00_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer010-install-generated-root-ca-locally.ipynb\"), cer04_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer020-create-management-service-proxy-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer021-create-knox-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer022-create-app-proxy-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer023-create-controller-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer030-sign-service-proxy-generated-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer031-sign-knox-generated-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer032-sign-app-proxy-generated-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer033-sign-controller-generated-cert.ipynb\"), cer02_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer040-install-service-proxy-cert.ipynb\"), cer04_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer041-install-knox-cert.ipynb\"), cer04_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer042-install-app-proxy-cert.ipynb\"), cer04_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer043-install-controller-cert.ipynb\"), cer04_args ],\n [ os.path.join(\"..\", \"cert-management\", \"cer050-wait-cluster-healthly.ipynb\"), {} ]\n]", "_____no_output_____" ] ], [ [ "### Common functions\n\nDefine helper functions used in this notebook.", "_____no_output_____" ] ], [ [ "# Define `run` function for transient fault handling, hyperlinked suggestions, and scrolling updates on Windows\nimport sys\nimport os\nimport re\nimport json\nimport platform\nimport shlex\nimport shutil\nimport datetime\n\nfrom subprocess import Popen, PIPE\nfrom IPython.display import Markdown\n\nretry_hints = {}\nerror_hints = {}\ninstall_hint = {}\n\nfirst_run = True\nrules = None\n\ndef run(cmd, return_output=False, no_output=False, retry_count=0):\n \"\"\"\n Run shell command, stream stdout, print stderr and optionally return output\n \"\"\"\n MAX_RETRIES = 5\n output = \"\"\n retry = False\n\n global first_run\n global rules\n\n if first_run:\n first_run = False\n rules = load_rules()\n\n # shlex.split is required on bash and for Windows paths with spaces\n #\n cmd_actual = shlex.split(cmd)\n\n # Store this (i.e. kubectl, python etc.) to support binary context aware error_hints and retries\n #\n user_provided_exe_name = cmd_actual[0].lower()\n\n # When running python, use the python in the ADS sandbox ({sys.executable})\n #\n if cmd.startswith(\"python \"):\n cmd_actual[0] = cmd_actual[0].replace(\"python\", sys.executable)\n\n # On Mac, when ADS is not launched from terminal, LC_ALL may not be set, which causes pip installs to fail\n # with:\n #\n # UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 4969: ordinal not in range(128)\n #\n # Setting it to a default value of \"en_US.UTF-8\" enables pip install to complete\n #\n if platform.system() == \"Darwin\" and \"LC_ALL\" not in os.environ:\n os.environ[\"LC_ALL\"] = \"en_US.UTF-8\"\n\n # To aid supportabilty, determine which binary file will actually be executed on the machine\n #\n which_binary = None\n\n # Special case for CURL on Windows. The version of CURL in Windows System32 does not work to\n # get JWT tokens, it returns \"(56) Failure when receiving data from the peer\". If another instance\n # of CURL exists on the machine use that one. (Unfortunately the curl.exe in System32 is almost\n # always the first curl.exe in the path, and it can't be uninstalled from System32, so here we\n # look for the 2nd installation of CURL in the path)\n if platform.system() == \"Windows\" and cmd.startswith(\"curl \"):\n path = os.getenv('PATH')\n for p in path.split(os.path.pathsep):\n p = os.path.join(p, \"curl.exe\")\n if os.path.exists(p) and os.access(p, os.X_OK):\n if p.lower().find(\"system32\") == -1:\n cmd_actual[0] = p\n which_binary = p\n break\n\n # Find the path based location (shutil.which) of the executable that will be run (and display it to aid supportability), this\n # seems to be required for .msi installs of azdata.cmd/az.cmd. (otherwise Popen returns FileNotFound) \n #\n # NOTE: Bash needs cmd to be the list of the space separated values hence shlex.split.\n #\n if which_binary == None:\n which_binary = shutil.which(cmd_actual[0])\n\n if which_binary == None:\n if user_provided_exe_name in install_hint and install_hint[user_provided_exe_name] is not None:\n display(Markdown(f'HINT: Use [{install_hint[user_provided_exe_name][0]}]({install_hint[user_provided_exe_name][1]}) to resolve this issue.'))\n\n raise FileNotFoundError(f\"Executable '{cmd_actual[0]}' not found in path (where/which)\")\n else: \n cmd_actual[0] = which_binary\n\n start_time = datetime.datetime.now().replace(microsecond=0)\n\n print(f\"START: {cmd} @ {start_time} ({datetime.datetime.utcnow().replace(microsecond=0)} UTC)\")\n print(f\" using: {which_binary} ({platform.system()} {platform.release()} on {platform.machine()})\")\n print(f\" cwd: {os.getcwd()}\")\n\n # Command-line tools such as CURL and AZDATA HDFS commands output\n # scrolling progress bars, which causes Jupyter to hang forever, to\n # workaround this, use no_output=True\n #\n\n # Work around a infinite hang when a notebook generates a non-zero return code, break out, and do not wait\n #\n wait = True \n\n try:\n if no_output:\n p = Popen(cmd_actual)\n else:\n p = Popen(cmd_actual, stdout=PIPE, stderr=PIPE, bufsize=1)\n with p.stdout:\n for line in iter(p.stdout.readline, b''):\n line = line.decode()\n if return_output:\n output = output + line\n else:\n if cmd.startswith(\"azdata notebook run\"): # Hyperlink the .ipynb file\n regex = re.compile(' \"(.*)\"\\: \"(.*)\"') \n match = regex.match(line)\n if match:\n if match.group(1).find(\"HTML\") != -1:\n display(Markdown(f' - \"{match.group(1)}\": \"{match.group(2)}\"'))\n else:\n display(Markdown(f' - \"{match.group(1)}\": \"[{match.group(2)}]({match.group(2)})\"'))\n\n wait = False\n break # otherwise infinite hang, have not worked out why yet.\n else:\n print(line, end='')\n if rules is not None:\n apply_expert_rules(line)\n\n if wait:\n p.wait()\n except FileNotFoundError as e:\n if install_hint is not None:\n display(Markdown(f'HINT: Use {install_hint} to resolve this issue.'))\n\n raise FileNotFoundError(f\"Executable '{cmd_actual[0]}' not found in path (where/which)\") from e\n\n exit_code_workaround = 0 # WORKAROUND: azdata hangs on exception from notebook on p.wait()\n\n if not no_output:\n for line in iter(p.stderr.readline, b''):\n line_decoded = line.decode()\n\n # azdata emits a single empty line to stderr when doing an hdfs cp, don't\n # print this empty \"ERR:\" as it confuses.\n #\n if line_decoded == \"\":\n continue\n \n print(f\"STDERR: {line_decoded}\", end='')\n\n if line_decoded.startswith(\"An exception has occurred\") or line_decoded.startswith(\"ERROR: An error occurred while executing the following cell\"):\n exit_code_workaround = 1\n\n if user_provided_exe_name in error_hints:\n for error_hint in error_hints[user_provided_exe_name]:\n if line_decoded.find(error_hint[0]) != -1:\n display(Markdown(f'HINT: Use [{error_hint[1]}]({error_hint[2]}) to resolve this issue.'))\n\n if rules is not None:\n apply_expert_rules(line_decoded)\n\n if user_provided_exe_name in retry_hints:\n for retry_hint in retry_hints[user_provided_exe_name]:\n if line_decoded.find(retry_hint) != -1:\n if retry_count < MAX_RETRIES:\n print(f\"RETRY: {retry_count} (due to: {retry_hint})\")\n retry_count = retry_count + 1\n output = run(cmd, return_output=return_output, retry_count=retry_count)\n\n if return_output:\n return output\n else:\n return\n\n elapsed = datetime.datetime.now().replace(microsecond=0) - start_time\n\n # WORKAROUND: We avoid infinite hang above in the `azdata notebook run` failure case, by inferring success (from stdout output), so\n # don't wait here, if success known above\n #\n if wait: \n if p.returncode != 0:\n raise SystemExit(f'Shell command:\\n\\n\\t{cmd} ({elapsed}s elapsed)\\n\\nreturned non-zero exit code: {str(p.returncode)}.\\n')\n else:\n if exit_code_workaround !=0 :\n raise SystemExit(f'Shell command:\\n\\n\\t{cmd} ({elapsed}s elapsed)\\n\\nreturned non-zero exit code: {str(exit_code_workaround)}.\\n')\n\n\n print(f'\\nSUCCESS: {elapsed}s elapsed.\\n')\n\n if return_output:\n return output\n\ndef load_json(filename):\n with open(filename, encoding=\"utf8\") as json_file:\n return json.load(json_file)\n\ndef load_rules():\n\n try:\n\n # Load this notebook as json to get access to the expert rules in the notebook metadata.\n #\n j = load_json(\"cer100-create-root-ca-install-certs.ipynb\")\n\n except:\n pass # If the user has renamed the book, we can't load ourself. NOTE: Is there a way in Jupyter, to know your own filename?\n\n else:\n if \"metadata\" in j and \\\n \"azdata\" in j[\"metadata\"] and \\\n \"expert\" in j[\"metadata\"][\"azdata\"] and \\\n \"rules\" in j[\"metadata\"][\"azdata\"][\"expert\"]:\n\n rules = j[\"metadata\"][\"azdata\"][\"expert\"][\"rules\"]\n\n rules.sort() # Sort rules, so they run in priority order (the [0] element). Lowest value first.\n\n # print (f\"EXPERT: There are {len(rules)} rules to evaluate.\")\n\n return rules\n\ndef apply_expert_rules(line):\n\n global rules\n\n for rule in rules:\n\n # rules that have 9 elements are the injected (output) rules (the ones we want). Rules\n # with only 8 elements are the source (input) rules, which are not expanded (i.e. TSG029,\n # not ../repair/tsg029-nb-name.ipynb)\n if len(rule) == 9:\n notebook = rule[1]\n cell_type = rule[2]\n output_type = rule[3] # i.e. stream or error\n output_type_name = rule[4] # i.e. ename or name \n output_type_value = rule[5] # i.e. SystemExit or stdout\n details_name = rule[6] # i.e. evalue or text \n expression = rule[7].replace(\"\\\\*\", \"*\") # Something escaped *, and put a \\ in front of it!\n\n # print(f\"EXPERT: If rule '{expression}' satisfied', run '{notebook}'.\")\n\n if re.match(expression, line, re.DOTALL):\n\n # print(\"EXPERT: MATCH: name = value: '{0}' = '{1}' matched expression '{2}', therefore HINT '{4}'\".format(output_type_name, output_type_value, expression, notebook))\n\n match_found = True\n\n display(Markdown(f'HINT: Use [{notebook}]({notebook}) to resolve this issue.'))\n\n\n\nprint('Common functions defined successfully.')\n\n# Hints for binary (transient fault) retry, (known) error and install guide\n#\nretry_hints = {'azdata': ['Endpoint sql-server-master does not exist', 'Endpoint livy does not exist', 'Failed to get state for cluster', 'Endpoint webhdfs does not exist', 'Adaptive Server is unavailable or does not exist', 'Error: Address already in use']}\nerror_hints = {'azdata': [['azdata login', 'SOP028 - azdata login', '../common/sop028-azdata-login.ipynb'], ['The token is expired', 'SOP028 - azdata login', '../common/sop028-azdata-login.ipynb'], ['Reason: Unauthorized', 'SOP028 - azdata login', '../common/sop028-azdata-login.ipynb'], ['Max retries exceeded with url: /api/v1/bdc/endpoints', 'SOP028 - azdata login', '../common/sop028-azdata-login.ipynb'], ['Look at the controller logs for more details', 'TSG027 - Observe cluster deployment', '../diagnose/tsg027-observe-bdc-create.ipynb'], ['provided port is already allocated', 'TSG062 - Get tail of all previous container logs for pods in BDC namespace', '../log-files/tsg062-tail-bdc-previous-container-logs.ipynb'], ['Create cluster failed since the existing namespace', 'SOP061 - Delete a big data cluster', '../install/sop061-delete-bdc.ipynb'], ['Failed to complete kube config setup', 'TSG067 - Failed to complete kube config setup', '../repair/tsg067-failed-to-complete-kube-config-setup.ipynb'], ['Error processing command: \"ApiError', 'TSG110 - Azdata returns ApiError', '../repair/tsg110-azdata-returns-apierror.ipynb'], ['Error processing command: \"ControllerError', 'TSG036 - Controller logs', '../log-analyzers/tsg036-get-controller-logs.ipynb'], ['ERROR: 500', 'TSG046 - Knox gateway logs', '../log-analyzers/tsg046-get-knox-logs.ipynb'], ['Data source name not found and no default driver specified', 'SOP069 - Install ODBC for SQL Server', '../install/sop069-install-odbc-driver-for-sql-server.ipynb'], [\"Can't open lib 'ODBC Driver 17 for SQL Server\", 'SOP069 - Install ODBC for SQL Server', '../install/sop069-install-odbc-driver-for-sql-server.ipynb'], ['Control plane upgrade failed. Failed to upgrade controller.', 'TSG108 - View the controller upgrade config map', '../diagnose/tsg108-controller-failed-to-upgrade.ipynb']]}\ninstall_hint = {'azdata': ['SOP055 - Install azdata command line interface', '../install/sop055-install-azdata.ipynb']}", "_____no_output_____" ] ], [ [ "### Create a temporary directory to stage files", "_____no_output_____" ] ], [ [ "# Create a temporary directory to hold configuration files\n\nimport tempfile\n\ntemp_dir = tempfile.mkdtemp()\n\nprint(f\"Temporary directory created: {temp_dir}\")", "_____no_output_____" ] ], [ [ "### Helper function for running notebooks with `azdata notebook run`\n\nTo pass ‘list’ types to `azdata notebook run --arguments`, flatten to\nstring", "_____no_output_____" ] ], [ [ "# Define helper function 'run_notebook'\n\ndef run_notebook(name, arguments):\n for key, value in arguments.items():\n if isinstance(value, list):\n arguments[key] = str(value).replace(\"'\", \"\")\n\n # --arguments have to be passed as \\\" \\\" quoted strings on Windows cmd line\n #\n # `app create` and `app run` can take a long time, so pass in a 30 minute cell timeout\n #\n arguments = str(arguments).replace(\"'\", '\\\\\"') \n run(f'azdata notebook run -p \"{os.path.join(\"..\", \"notebook-runner\", name)}\" --arguments \"{arguments}\" --output-path \"{os.getcwd()}\" --output-html --timeout 1800')\n\nprint(\"Function 'run_notebook' defined\")", "_____no_output_____" ] ], [ [ "### Run the notebooks", "_____no_output_____" ] ], [ [ "for notebook in notebooks:\n run_notebook(notebook[0], notebook[1])\n\nprint(\"Notebooks ran successfully.\")", "_____no_output_____" ], [ "print('Notebook execution complete.')", "_____no_output_____" ] ], [ [ "Related\n-------\n\n- [CAN100 - Deploy all\n Canaries](../canary/can100-deploy-all-canaries.ipynb)\n\n- [CER001 - Generate a Root CA\n certificate](../cert-management/cer001-create-root-ca.ipynb)\n\n- [CER020 - Create Management Proxy\n certificate](../cert-management/cer020-create-management-service-proxy-cert.ipynb)\n\n- [CER021 - Create Knox\n certificate](../cert-management/cer021-create-knox-cert.ipynb)\n\n- [CER022 - Create App Proxy\n certificate](../cert-management/cer022-create-app-proxy-cert.ipynb)\n\n- [CER030 - Sign Management Proxy certificate with generated\n CA](../cert-management/cer030-sign-service-proxy-generated-cert.ipynb)\n\n- [CER031 - Sign Knox certificate with generated\n CA](../cert-management/cer031-sign-knox-generated-cert.ipynb)\n\n- [CER032 - Sign App-Proxy certificate with generated\n CA](../cert-management/cer032-sign-app-proxy-generated-cert.ipynb)\n\n- [CER040 - Install signed Management Proxy\n certificate](../cert-management/cer040-install-service-proxy-cert.ipynb)\n\n- [CER041 - Install signed Knox\n certificate](../cert-management/cer041-install-knox-cert.ipynb)\n\n- [CER042 - Install signed App-Proxy\n certificate](../cert-management/cer042-install-app-proxy-cert.ipynb)\n\n- [CER010 - Install generated Root CA\n locally](../cert-management/cer010-install-generated-root-ca-locally.ipynb)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ] ]
e7e44ccc04746bffe5680f75a7dc496891f9bff5
58,390
ipynb
Jupyter Notebook
Classification/Naive Bayes/BernoulliNB_Normalize.ipynb
shreepad-nade/ds-seed
93ddd3b73541f436b6832b94ca09f50872dfaf10
[ "Apache-2.0" ]
53
2021-08-28T07:41:49.000Z
2022-03-09T02:20:17.000Z
Classification/Naive Bayes/BernoulliNB_Normalize.ipynb
shreepad-nade/ds-seed
93ddd3b73541f436b6832b94ca09f50872dfaf10
[ "Apache-2.0" ]
142
2021-07-27T07:23:10.000Z
2021-08-25T14:57:24.000Z
Classification/Naive Bayes/BernoulliNB_Normalize.ipynb
shreepad-nade/ds-seed
93ddd3b73541f436b6832b94ca09f50872dfaf10
[ "Apache-2.0" ]
38
2021-07-27T04:54:08.000Z
2021-08-23T02:27:20.000Z
84.992722
24,102
0.817948
[ [ [ "# Bernoulli Naive Bayes Classifier with Normalize", "_____no_output_____" ], [ "This code template is facilitates to solve the problem of classification problem using Bernoulli Naive Bayes Algorithm using Normalize technique.", "_____no_output_____" ], [ "### Required Packages", "_____no_output_____" ] ], [ [ "!pip install imblearn", "_____no_output_____" ], [ "import warnings \r\nimport numpy as np \r\nimport pandas as pd \r\nimport matplotlib.pyplot as plt \r\nimport seaborn as se \r\nfrom imblearn.over_sampling import RandomOverSampler\r\nfrom sklearn.pipeline import make_pipeline\r\nfrom sklearn.naive_bayes import BernoulliNB \r\nfrom sklearn.preprocessing import LabelEncoder,Normalizer\r\nfrom sklearn.model_selection import train_test_split \r\nfrom sklearn.metrics import classification_report,plot_confusion_matrix\r\nwarnings.filterwarnings('ignore')", "_____no_output_____" ] ], [ [ "### Initialization\n\nFilepath of CSV file", "_____no_output_____" ] ], [ [ "#filepath\r\nfile_path= \"\"", "_____no_output_____" ] ], [ [ "List of features which are required for model training .", "_____no_output_____" ] ], [ [ "#x_values\r\nfeatures=[]", "_____no_output_____" ] ], [ [ "Target feature for prediction.", "_____no_output_____" ] ], [ [ "#y_value\ntarget=''", "_____no_output_____" ] ], [ [ "### Data Fetching\n\nPandas is an open-source, BSD-licensed library providing high-performance, easy-to-use data manipulation and data analysis tools.\n\nWe will use panda's library to read the CSV file using its storage path.And we use the head function to display the initial row or entry.", "_____no_output_____" ] ], [ [ "df=pd.read_csv(file_path)\ndf.head()", "_____no_output_____" ] ], [ [ "### Feature Selections\n\nIt is the process of reducing the number of input variables when developing a predictive model. Used to reduce the number of input variables to both reduce the computational cost of modelling and, in some cases, to improve the performance of the model.\n\nWe will assign all the required input features to X and target/outcome to Y.", "_____no_output_____" ] ], [ [ "X = df[features]\nY = df[target]", "_____no_output_____" ] ], [ [ "### Data Preprocessing\n\nSince the majority of the machine learning models in the Sklearn library doesn't handle string category data and Null value, we have to explicitly remove or replace null values. The below snippet have functions, which removes the null value if any exists. And convert the string classes data in the datasets by encoding them to integer classes.\n", "_____no_output_____" ] ], [ [ "def NullClearner(df):\n if(isinstance(df, pd.Series) and (df.dtype in [\"float64\",\"int64\"])):\n df.fillna(df.mean(),inplace=True)\n return df\n elif(isinstance(df, pd.Series)):\n df.fillna(df.mode()[0],inplace=True)\n return df\n else:return df\ndef EncodeX(df):\n return pd.get_dummies(df)\ndef EncodeY(df):\n if len(df.unique())<=2:\n return df\n else:\n un_EncodedT=np.sort(pd.unique(df), axis=-1, kind='mergesort')\n df=LabelEncoder().fit_transform(df)\n EncodedT=[xi for xi in range(len(un_EncodedT))]\n print(\"Encoded Target: {} to {}\".format(un_EncodedT,EncodedT))\n return df", "_____no_output_____" ], [ "x=X.columns.to_list()\nfor i in x:\n X[i]=NullClearner(X[i]) \nX=EncodeX(X)\nY=EncodeY(NullClearner(Y))\nX.head()", "_____no_output_____" ] ], [ [ "#### Correlation Map\n\nIn order to check the correlation between the features, we will plot a correlation matrix. It is effective in summarizing a large amount of data where the goal is to see patterns.", "_____no_output_____" ] ], [ [ "f,ax = plt.subplots(figsize=(18, 18))\nmatrix = np.triu(X.corr())\nse.heatmap(X.corr(), annot=True, linewidths=.5, fmt= '.1f',ax=ax, mask=matrix)\nplt.show()", "_____no_output_____" ] ], [ [ "#### Distribution of Target Variable", "_____no_output_____" ] ], [ [ "plt.figure(figsize = (10,6))\nse.countplot(Y)", "_____no_output_____" ] ], [ [ "### Data Splitting\n\nThe train-test split is a procedure for evaluating the performance of an algorithm. The procedure involves taking a dataset and dividing it into two subsets. The first subset is utilized to fit/train the model. The second subset is used for prediction. The main motive is to estimate the performance of the model on new data.", "_____no_output_____" ] ], [ [ "x_train,x_test,y_train,y_test=train_test_split(X,Y,test_size=0.2,random_state=123)", "_____no_output_____" ] ], [ [ "#### Handling Target Imbalance\n\nThe challenge of working with imbalanced datasets is that most machine learning techniques will ignore, and in turn have poor performance on, the minority class, although typically it is performance on the minority class that is most important.\n\nOne approach to addressing imbalanced datasets is to oversample the minority class. The simplest approach involves duplicating examples in the minority class.We will perform overspampling using imblearn library. ", "_____no_output_____" ] ], [ [ "x_train,y_train = RandomOverSampler(random_state=123).fit_resample(x_train, y_train)", "_____no_output_____" ] ], [ [ "#### Data Rescaling\n\nsklearn.preprocessing.Normalizer()\n\nNormalize samples individually to unit norm.\n\nmore details at [scikit-learn.org](https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.Normalizer.html#sklearn.preprocessing.Normalizer)", "_____no_output_____" ] ], [ [ "Scaler=Normalizer() \nx_train=Scaler.fit_transform(x_train) \nx_test=Scaler.transform(x_test)", "_____no_output_____" ] ], [ [ "### Model\n\n<code>Bernoulli Naive Bayes Classifier</code> is used for discrete data and it works on Bernoulli distribution. The main feature of Bernoulli Naive Bayes is that it accepts features only as binary values like true or false, yes or no, success or failure, 0 or 1 and so on. So when the feature values are **<code>binary</code>** we know that we have to use Bernoulli Naive Bayes classifier.\n\n#### Model Tuning Parameters\n\n 1. alpha : float, default=1.0\n> Additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing).\n\n 2. binarize : float or None, default=0.0\n> Threshold for binarizing (mapping to booleans) of sample features. If None, input is presumed to already consist of binary vectors.\n\n 3. fit_prior : bool, default=True\n> Whether to learn class prior probabilities or not. If false, a uniform prior will be used.\n\n 4. class_prior : array-like of shape (n_classes,), default=None\n> Prior probabilities of the classes. If specified the priors are not adjusted according to the data.", "_____no_output_____" ] ], [ [ "# BernoulliNB.\nmodel = BernoulliNB()\nmodel.fit(x_train, y_train)", "_____no_output_____" ] ], [ [ "#### Model Accuracy\nscore() method return the mean accuracy on the given test data and labels.\n\nIn multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.", "_____no_output_____" ] ], [ [ "print(\"Accuracy score {:.2f} %\\n\".format(model.score(x_test,y_test)*100))", "Accuracy score 41.25 %\n\n" ] ], [ [ "#### Confusion Matrix\n\nA confusion matrix is utilized to understand the performance of the classification model or algorithm in machine learning for a given test set where results are known.", "_____no_output_____" ] ], [ [ "plot_confusion_matrix(model,x_test,y_test,cmap=plt.cm.Blues)", "_____no_output_____" ] ], [ [ "#### Classification Report\nA Classification report is used to measure the quality of predictions from a classification algorithm. How many predictions are True, how many are False.\n\n* **where**:\n - Precision:- Accuracy of positive predictions.\n - Recall:- Fraction of positives that were correctly identified.\n - f1-score:- percent of positive predictions were correct\n - support:- Support is the number of actual occurrences of the class in the specified dataset.", "_____no_output_____" ] ], [ [ "print(classification_report(y_test,model.predict(x_test)))", " precision recall f1-score support\n\n 0 0.54 0.44 0.48 50\n 1 0.28 0.37 0.32 30\n\n accuracy 0.41 80\n macro avg 0.41 0.40 0.40 80\nweighted avg 0.44 0.41 0.42 80\n\n" ] ], [ [ "#### Creator: Snehaan Bhawal , Github: [Profile](https://github.com/Sbhawal)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ] ]
e7e44ea71c54bd5d452df5ee06b94da0c700c75c
6,597
ipynb
Jupyter Notebook
Tutorials/Collocate_cloud_data_with_cvs_file.ipynb
caitlinkroeger/cloud_science
06ed74adf936e25c70ec6b2330ab06419a6e02de
[ "Apache-2.0" ]
null
null
null
Tutorials/Collocate_cloud_data_with_cvs_file.ipynb
caitlinkroeger/cloud_science
06ed74adf936e25c70ec6b2330ab06419a6e02de
[ "Apache-2.0" ]
null
null
null
Tutorials/Collocate_cloud_data_with_cvs_file.ipynb
caitlinkroeger/cloud_science
06ed74adf936e25c70ec6b2330ab06419a6e02de
[ "Apache-2.0" ]
null
null
null
29.190265
153
0.56647
[ [ [ "# Tutorial on collocating a datafile with lagged data", "_____no_output_____" ] ], [ [ "import matplotlib.pyplot as plt\nimport numpy as np\nimport xarray as xr\nimport pandas as pd\nimport warnings\nimport timeit\n# filter some warning messages\nwarnings.filterwarnings(\"ignore\") \n#from geopy.distance import geodesic \n\n####################you will need to change some paths here!#####################\n#list of input files\nfilename_bird='~/Desktop/zoo_selgroups_HadSST_relabundance_5aug2019_plumchrusV_4regions_final.csv'\n#output files\nfilename_bird_out='~/Desktop/zoo_selgroups_HadSST_relabundance_5aug2019_plumchrusV_4regions_final_satsst.csv'\nfilename_bird_out_netcdf='~/Desktop/zoo_selgroups_HadSST_relabundance_5aug2019_plumchrusV_4regions_final_satsst.nc'\n#################################################################################\n", "_____no_output_____" ] ], [ [ "## Reading CSV datasets", "_____no_output_____" ] ], [ [ "#read in csv file in to panda dataframe & into xarray\ndf_bird = pd.read_csv(filename_bird)\n\n# calculate time, it needs a datetime64[ns] format\ndf_bird.insert(3,'Year',df_bird['year'])\ndf_bird.insert(4,'Month',df_bird['month'])\ndf_bird.insert(5,'Day',df_bird['day'])\ndf_bird=df_bird.drop(columns={'day','month','year'})\ndf_bird['time'] = df_bird['time'].apply(lambda x: x.zfill(8))\ndf_bird.insert(6,'Hour',df_bird['time'].apply(lambda x: x[:2]))\ndf_bird.insert(7,'Min',df_bird['time'].apply(lambda x: x[3:5]))\ndf_bird.insert(3,'time64',pd.to_datetime(df_bird[list(df_bird)[3:7]]))\ndf_bird=df_bird.drop(columns={'Day','Month','Year','Hour','Min','time','Date'})\n\n# transform to x array\nds_bird = df_bird.to_xarray()", "_____no_output_____" ], [ "#just check lat/lon & see looks okay\nminlat,maxlat=ds_bird.lat.min(),ds_bird.lat.max()\nminlon,maxlon=ds_bird.lon.min(),ds_bird.lon.max()\nplt.scatter(ds_bird.lon,ds_bird.lat)\nprint(minlat,maxlat,minlon,maxlon)", "_____no_output_____" ], [ "#open cmc sst\nds = xr.open_zarr('F:/data/sat_data/sst/cmc/zarr').drop({'analysis_error','mask','sea_ice_fraction'})\nds", "_____no_output_____" ], [ "#average 0.6 deg in each direction to create mean \nds = ds.rolling(lat=3,center=True,keep_attrs=True).mean(keep_attrs=True)\nds = ds.rolling(lon=3,center=True,keep_attrs=True).mean(keep_attrs=True)\nds", "_____no_output_____" ], [ "ds_mon = ds.rolling(time=30, center=False,keep_attrs=True).mean(keep_attrs=True)\nds_15 = ds.rolling(time=15, center=False,keep_attrs=True).mean(keep_attrs=True)\nds['analysed_sst_1mon']=ds_mon['analysed_sst']\nds['analysed_sst_15dy']=ds_15['analysed_sst']\nds", "_____no_output_____" ] ], [ [ "# Collocate all data with bird data", "_____no_output_____" ] ], [ [ "len(ds_bird.lat)\n", "_____no_output_____" ], [ "ds_data = ds\nfor var in ds_data:\n var_tem=var\n ds_bird[var_tem]=xr.DataArray(np.empty(ilen_bird, dtype=str(ds_data[var].dtype)), coords={'index': ds_bird.index}, dims=('index'))\n ds_bird[var_tem].attrs=ds_data[var].attrs\nprint('var',var_tem)\nfor i in range(len(ds_bird.lat)):\n# for i in range(len(ds_bird.lat)):\n# if ds_bird.time[i]<ds_data.time.min():\n# continue\n# if ds_bird.time[i]>ds_data.time.max():\n# continue\n t1,t2 = ds_bird.time64[i]-np.timedelta64(24,'h'), ds_bird.time64[i]+np.timedelta64(24,'h')\n lat1,lat2=ds_bird.lat[i]-.5,ds_bird.lat[i]+.5\n lon1,lon2=ds_bird.lon[i]-.5,ds_bird.lon[i]+.5\n tem = ds_data.sel(time=slice(t1,t2),lat=slice(lat1,lat2),lon=slice(lon1,lon2)).load()\n tem = tem.interp(time=ds_bird.time64[i],lat=ds_bird.lat[i],lon=ds_bird.lon[i])\n #tem = tem.load()\n for var in ds_data:\n var_tem=var\n ds_bird[var_tem][i]=tem[var].data\n if int(i/100)*100==i:\n print(i,len(ds_bird.lat))\n\n#output data\ndf_bird = ds_bird.to_dataframe()\ndf_bird.to_csv(filename_bird_out)\n#ds_bird.to_netcdf(filename_bird_out_netcdf)", "_____no_output_____" ], [ "var2\n", "_____no_output_____" ], [ "#test rolling to check\nprint(da.data)\nda = xr.DataArray(np.linspace(0, 11, num=12),coords=[pd.date_range( \"15/12/1999\", periods=12, freq=pd.DateOffset(months=1), )],dims=\"time\",)\ndar = da.rolling(time=3,center=False).mean() #before and up too\nprint(dar.data)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ] ]
e7e45dc6dfc3f884a39860956d437b9097e08a3e
42,992
ipynb
Jupyter Notebook
src/test2 copy.ipynb
B06901052/deep-stabilization
b6030b463cf1f1128660e900669f43e742aa2651
[ "Apache-2.0" ]
null
null
null
src/test2 copy.ipynb
B06901052/deep-stabilization
b6030b463cf1f1128660e900669f43e742aa2651
[ "Apache-2.0" ]
null
null
null
src/test2 copy.ipynb
B06901052/deep-stabilization
b6030b463cf1f1128660e900669f43e742aa2651
[ "Apache-2.0" ]
null
null
null
38.24911
189
0.550358
[ [ [ "import cv2\nimport numpy as np\nfrom importlib import reload\nimport matplotlib.pyplot as plt\nfrom IPython.display import Video\n\nimport torch\nfrom torchvision import transforms\nfrom torchvision.io import read_video, read_video_timestamps\n\nimport kornia as K\nimport kornia.feature as KF\nfrom kornia_moons.feature import *\nfrom kornia.contrib import ImageStitcher\nfrom kornia.geometry.transform import warp_perspective, get_perspective_transform\n\nimport utils\ndef load_torch_image(fname):\n img = K.image_to_tensor(cv2.imread(fname), False).float() /255.\n img = K.color.bgr_to_rgb(img)\n return img", "_____no_output_____" ], [ "fname = \"../deep-stabilization/dvs/video/s_114_outdoor_running_trail_daytime/ControlCam_20200930_104820.mp4\"", "_____no_output_____" ], [ "video_frames, audio_frames, meta = read_video(fname, end_pts=100, pts_unit=\"sec\")\nprint(meta)\nprint(\"video size: \", video_frames.shape)\nprint(\"audio size: \", audio_frames.shape)", "_____no_output_____" ], [ "Video(fname, width=960, height=540)", "_____no_output_____" ], [ "Video(\"../test.mp4\", width=960, height=540)", "_____no_output_____" ], [ "Video(\"../video_out.avi\", width=960, height=540)", "_____no_output_____" ], [ "# utils.show_frames(video_frames[:100:10], 2, 5, (30,16))", "_____no_output_____" ], [ "img1 = video_frames[0:1].permute(0,3,1,2).float() / 255\nimg2 = video_frames[100:101].permute(0,3,1,2).float() / 255\n\nprint(img1.shape)\n\nfeature1 = transforms.CenterCrop((270*3,480*3))(img1)\nfeature2 = transforms.CenterCrop((270*3,480*3))(img2)\n\nfeature1 = torch.cat(transforms.FiveCrop(256)(feature1))\nfeature2 = torch.cat(transforms.FiveCrop(256)(feature2))\n\nprint(feature1.shape)\n\n# K.color.rgb_to_grayscale(img1).shape\nutils.show_frame(feature1[3].permute(1,2,0))", "_____no_output_____" ], [ "matcher2 = KF.LocalFeatureMatcher(\n KF.SIFTFeature(2000, device=\"cuda\"),\n KF.DescriptorMatcher('smnn', 0.9)\n )\n\ninput_dict = {\"image0\": K.color.rgb_to_grayscale(feature1).cuda(), # LofTR works on grayscale images only \n \"image1\": K.color.rgb_to_grayscale(feature2).cuda()}\n\nwith torch.no_grad():\n correspondences = matcher2(input_dict)\n del input_dict[\"image0\"], input_dict[\"image1\"]\n \nfor k,v in correspondences.items():\n print (k)\n\nprint(len(correspondences[\"keypoints0\"]))", "_____no_output_____" ], [ "# for x in range(5):\n# idx = torch.topk(correspondences[\"confidence\"][correspondences[\"batch_indexes\"]==x], 100).indices\n# print((correspondences[\"keypoints0\"][correspondences[\"batch_indexes\"]==x][idx] - correspondences[\"keypoints1\"][correspondences[\"batch_indexes\"]==x][idx]).mean(dim=0))\n# print(\"\\n\\n\\n\")\n# for x in range(5):\n# idx = torch.topk(correspondences[\"confidence\"][correspondences[\"batch_indexes\"]==x], 150).indices\n# print((correspondences[\"keypoints0\"][correspondences[\"batch_indexes\"]==x][idx] - correspondences[\"keypoints1\"][correspondences[\"batch_indexes\"]==x][idx]).mean(dim=0))\n# print(\"\\n\\n\\n\")\ntmp = []\nfor x in range(5):\n tmp.append((correspondences[\"keypoints0\"][correspondences[\"batch_indexes\"]==x] - correspondences[\"keypoints1\"][correspondences[\"batch_indexes\"]==x]).median(dim=0)[0])\n print(tmp[-1])", "_____no_output_____" ], [ "src = torch.Tensor([\n [135*1+128, 240*1+128],# 左上\n [135*1+128, 240*7-128],# 右上\n [135*7-128, 240*1+128],# 左下\n [135*7-128, 240*7-128] # 右下\n]).cuda()\n\ndst = torch.vstack(tmp[:4]) + src", "_____no_output_____" ], [ "img1[0].permute(1,2,0).shape", "_____no_output_____" ], [ "res = cv2.warpAffine(img1[0].permute(1,2,0).numpy(), H[:2], (1080, 1920))", "_____no_output_____" ], [ "utils.show_frame(torch.from_numpy(res))", "_____no_output_____" ], [ "H, inliers = cv2.findFundamentalMat(mkpts0, mkpts1, cv2.USAC_MAGSAC, 0.5, 0.999, 100000)", "_____no_output_____" ], [ "b", "_____no_output_____" ], [ "print(src)\nprint(dst)\nb = get_perspective_transform(src.unsqueeze(0), dst.unsqueeze(0))\n\nout = warp_perspective(img1.cuda(), b, (1080,1920)).cpu()\noutt = torch.where(out == 0.0, img2, out)\nutils.show_frame(outt[0].permute(1,2,0))", "_____no_output_____" ], [ "utils.show_frame(img1[0].permute(1,2,0))", "_____no_output_____" ], [ "utils.show_frame(img2[0].permute(1,2,0))", "_____no_output_____" ], [ "out = warp_perspective(img1.cuda(), torch.from_numpy(H).cuda().unsqueeze(0).float(), (1080,1920)).cpu()\nouttt = torch.where(out == 0.0, img2, out)\nutils.show_frame(outtt[0].permute(1,2,0))", "_____no_output_____" ], [ "for k,v in correspondences.items():\n print (k)", "_____no_output_____" ], [ "th = torch.quantile(correspondences[\"confidence\"], 0.0)\nidx = correspondences[\"confidence\"] > th\nprint(idx.sum())", "_____no_output_____" ], [ "mkpts0 = correspondences['keypoints0'][idx].cpu().numpy()\nmkpts1 = correspondences['keypoints1'][idx].cpu().numpy()\nH, inliers = cv2.findFundamentalMat(mkpts0, mkpts1, cv2.USAC_MAGSAC, 0.5, 0.999, 100000)\ninliers = inliers > 0", "_____no_output_____" ], [ "H", "_____no_output_____" ], [ "draw_LAF_matches(\n KF.laf_from_center_scale_ori(torch.from_numpy(mkpts0).view(1,-1, 2),\n torch.ones(mkpts0.shape[0]).view(1,-1, 1, 1),\n torch.ones(mkpts0.shape[0]).view(1,-1, 1)),\n\n KF.laf_from_center_scale_ori(torch.from_numpy(mkpts1).view(1,-1, 2),\n torch.ones(mkpts1.shape[0]).view(1,-1, 1, 1),\n torch.ones(mkpts1.shape[0]).view(1,-1, 1)),\n torch.arange(mkpts0.shape[0]).view(-1,1).repeat(1,2),\n K.tensor_to_image(img1),\n K.tensor_to_image(img2),\n inliers,\n draw_dict={'inlier_color': (0.2, 1, 0.2),\n 'tentative_color': None, \n 'feature_color': (0.2, 0.5, 1), 'vertical': False})", "_____no_output_____" ], [ "from kornia.geometry.transform import get_perspective_transform, warp_perspective\nidx = torch.topk(correspondences[\"confidence\"], 12).indices\n# idx = torch.randperm(20)\nsrc = correspondences[\"keypoints0\"][idx[:4]].unsqueeze(0)\ndst = correspondences[\"keypoints1\"][idx[:4]].unsqueeze(0)\na = get_perspective_transform(src, dst)\nsrc = correspondences[\"keypoints0\"][idx[2:6]].unsqueeze(0)\ndst = correspondences[\"keypoints1\"][idx[2:6]].unsqueeze(0)\nb = get_perspective_transform(src, dst)\n\nout = warp_perspective(img1.cuda(), (a+b)/2, (1080//4,1920//4)).cpu()\noutt = torch.where(out < 0.0, img2, out)\nutils.show_frame(outt[0].permute(1,2,0))", "_____no_output_____" ], [ "# Import numpy and OpenCV\nimport numpy as np\nimport cv2# Read input video\n\nfname = \"../deep-stabilization/dvs/video/s_114_outdoor_running_trail_daytime/ControlCam_20200930_104820.mp4\"\ncap = cv2.VideoCapture(fname)\n \n# Get frame count\nn_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\n \n# Get width and height of video stream\nw = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))\nh = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))\n \n# Define the codec for output video\n \n# Set up output video\nfps = 30\nprint(w, h)\n\n# Read first frame\n_, prev = cap.read()\n \n# Convert frame to grayscale\nprev_gray = cv2.cvtColor(prev, cv2.COLOR_BGR2GRAY)\n# prev_gray = (prev_gray&192)|((prev_gray&32)<<1)\n\n# Pre-define transformation-store array\ntransforms = np.zeros((n_frames-1, 3), np.float32)\n \nfor i in range(n_frames-2):\n # Detect feature points in previous frame\n prev_pts = cv2.goodFeaturesToTrack(prev_gray,\n maxCorners=400,\n qualityLevel=0.3,\n minDistance=20,\n blockSize=9)\n \n # Read next frame\n success, curr = cap.read()\n if not success:\n break\n \n # Convert to grayscale\n curr_gray = cv2.cvtColor(curr, cv2.COLOR_BGR2GRAY)\n # curr_gray = (curr_gray&192)|((curr_gray&32)<<1)\n \n # Calculate optical flow (i.e. track feature points)\n curr_pts, status, err = cv2.calcOpticalFlowPyrLK(prev_gray, curr_gray, prev_pts, None)\n \n # Sanity check\n assert prev_pts.shape == curr_pts.shape\n \n # Filter only valid points\n idx = np.where(status==1)[0]\n prev_pts = prev_pts[idx]\n curr_pts = curr_pts[idx]\n \n #Find transformation matrix\n retval, inliers = cv2.estimateAffine2D(prev_pts, curr_pts)\n \n # Extract traslation\n dx = retval[0][2]\n dy = retval[1][2]\n \n # Extract rotation angle\n da = np.arctan2(retval[1,0], retval[0,0])\n \n # Store transformation\n transforms[i] = [dx,dy,da]\n \n # Move to next frame\n prev_gray = curr_gray\n \n print(\"Frame: \" + str(i) + \"/\" + str(n_frames) + \" - Tracked points : \" + str(len(prev_pts)))\n \n# Compute trajectory using cumulative sum of transformations\nprint(\"transforms: \", len(transforms))\ntrajectory = np.cumsum(transforms, axis=0)", "1920 1080\nFrame: 0/486 - Tracked points : 311\nFrame: 1/486 - Tracked points : 258\nFrame: 2/486 - Tracked points : 284\nFrame: 3/486 - Tracked points : 222\nFrame: 4/486 - Tracked points : 289\nFrame: 5/486 - Tracked points : 214\nFrame: 6/486 - Tracked points : 247\nFrame: 7/486 - Tracked points : 293\nFrame: 8/486 - Tracked points : 328\nFrame: 9/486 - Tracked points : 246\nFrame: 10/486 - Tracked points : 303\nFrame: 11/486 - Tracked points : 333\nFrame: 12/486 - Tracked points : 308\nFrame: 13/486 - Tracked points : 288\nFrame: 14/486 - Tracked points : 304\nFrame: 15/486 - Tracked points : 285\nFrame: 16/486 - Tracked points : 288\nFrame: 17/486 - Tracked points : 283\nFrame: 18/486 - Tracked points : 284\nFrame: 19/486 - Tracked points : 140\nFrame: 20/486 - Tracked points : 181\nFrame: 21/486 - Tracked points : 197\nFrame: 22/486 - Tracked points : 162\nFrame: 23/486 - Tracked points : 303\nFrame: 24/486 - Tracked points : 319\nFrame: 25/486 - Tracked points : 233\nFrame: 26/486 - Tracked points : 204\nFrame: 27/486 - Tracked points : 268\nFrame: 28/486 - Tracked points : 275\nFrame: 29/486 - Tracked points : 299\nFrame: 30/486 - Tracked points : 203\nFrame: 31/486 - Tracked points : 258\nFrame: 32/486 - Tracked points : 241\nFrame: 33/486 - Tracked points : 255\nFrame: 34/486 - Tracked points : 236\nFrame: 35/486 - Tracked points : 265\nFrame: 36/486 - Tracked points : 162\nFrame: 37/486 - Tracked points : 71\nFrame: 38/486 - Tracked points : 69\nFrame: 39/486 - Tracked points : 78\nFrame: 40/486 - Tracked points : 71\nFrame: 41/486 - Tracked points : 77\nFrame: 42/486 - Tracked points : 68\nFrame: 43/486 - Tracked points : 78\nFrame: 44/486 - Tracked points : 57\nFrame: 45/486 - Tracked points : 74\nFrame: 46/486 - Tracked points : 63\nFrame: 47/486 - Tracked points : 73\nFrame: 48/486 - Tracked points : 75\nFrame: 49/486 - Tracked points : 81\nFrame: 50/486 - Tracked points : 84\nFrame: 51/486 - Tracked points : 82\nFrame: 52/486 - Tracked points : 82\nFrame: 53/486 - Tracked points : 372\nFrame: 54/486 - Tracked points : 276\nFrame: 55/486 - Tracked points : 216\nFrame: 56/486 - Tracked points : 136\nFrame: 57/486 - Tracked points : 336\nFrame: 58/486 - Tracked points : 338\nFrame: 59/486 - Tracked points : 381\nFrame: 60/486 - Tracked points : 339\nFrame: 61/486 - Tracked points : 323\nFrame: 62/486 - Tracked points : 299\nFrame: 63/486 - Tracked points : 319\nFrame: 64/486 - Tracked points : 360\nFrame: 65/486 - Tracked points : 278\nFrame: 66/486 - Tracked points : 223\nFrame: 67/486 - Tracked points : 206\nFrame: 68/486 - Tracked points : 198\nFrame: 69/486 - Tracked points : 168\nFrame: 70/486 - Tracked points : 175\nFrame: 71/486 - Tracked points : 161\nFrame: 72/486 - Tracked points : 155\nFrame: 73/486 - Tracked points : 151\nFrame: 74/486 - Tracked points : 178\nFrame: 75/486 - Tracked points : 178\nFrame: 76/486 - Tracked points : 173\nFrame: 77/486 - Tracked points : 193\nFrame: 78/486 - Tracked points : 151\nFrame: 79/486 - Tracked points : 136\nFrame: 80/486 - Tracked points : 190\nFrame: 81/486 - Tracked points : 211\nFrame: 82/486 - Tracked points : 247\nFrame: 83/486 - Tracked points : 211\nFrame: 84/486 - Tracked points : 191\nFrame: 85/486 - Tracked points : 116\nFrame: 86/486 - Tracked points : 153\nFrame: 87/486 - Tracked points : 132\nFrame: 88/486 - Tracked points : 133\nFrame: 89/486 - Tracked points : 135\nFrame: 90/486 - Tracked points : 140\nFrame: 91/486 - Tracked points : 107\nFrame: 92/486 - Tracked points : 164\nFrame: 93/486 - Tracked points : 151\nFrame: 94/486 - Tracked points : 170\nFrame: 95/486 - Tracked points : 181\nFrame: 96/486 - Tracked points : 183\nFrame: 97/486 - Tracked points : 154\nFrame: 98/486 - Tracked points : 132\nFrame: 99/486 - Tracked points : 142\nFrame: 100/486 - Tracked points : 119\nFrame: 101/486 - Tracked points : 158\nFrame: 102/486 - Tracked points : 149\nFrame: 103/486 - Tracked points : 145\nFrame: 104/486 - Tracked points : 177\nFrame: 105/486 - Tracked points : 128\nFrame: 106/486 - Tracked points : 139\nFrame: 107/486 - Tracked points : 109\nFrame: 108/486 - Tracked points : 109\nFrame: 109/486 - Tracked points : 117\nFrame: 110/486 - Tracked points : 105\nFrame: 111/486 - Tracked points : 169\nFrame: 112/486 - Tracked points : 102\nFrame: 113/486 - Tracked points : 104\nFrame: 114/486 - Tracked points : 112\nFrame: 115/486 - Tracked points : 121\nFrame: 116/486 - Tracked points : 118\nFrame: 117/486 - Tracked points : 124\nFrame: 118/486 - Tracked points : 103\nFrame: 119/486 - Tracked points : 105\nFrame: 120/486 - Tracked points : 121\nFrame: 121/486 - Tracked points : 75\nFrame: 122/486 - Tracked points : 47\nFrame: 123/486 - Tracked points : 55\nFrame: 124/486 - Tracked points : 51\nFrame: 125/486 - Tracked points : 76\nFrame: 126/486 - Tracked points : 78\nFrame: 127/486 - Tracked points : 62\nFrame: 128/486 - Tracked points : 64\nFrame: 129/486 - Tracked points : 81\nFrame: 130/486 - Tracked points : 86\nFrame: 131/486 - Tracked points : 83\nFrame: 132/486 - Tracked points : 81\nFrame: 133/486 - Tracked points : 82\nFrame: 134/486 - Tracked points : 100\nFrame: 135/486 - Tracked points : 123\nFrame: 136/486 - Tracked points : 144\nFrame: 137/486 - Tracked points : 118\nFrame: 138/486 - Tracked points : 119\nFrame: 139/486 - Tracked points : 119\nFrame: 140/486 - Tracked points : 138\nFrame: 141/486 - Tracked points : 110\nFrame: 142/486 - Tracked points : 146\nFrame: 143/486 - Tracked points : 113\nFrame: 144/486 - Tracked points : 128\nFrame: 145/486 - Tracked points : 106\nFrame: 146/486 - Tracked points : 120\nFrame: 147/486 - Tracked points : 77\nFrame: 148/486 - Tracked points : 130\nFrame: 149/486 - Tracked points : 144\nFrame: 150/486 - Tracked points : 233\nFrame: 151/486 - Tracked points : 186\nFrame: 152/486 - Tracked points : 45\nFrame: 153/486 - Tracked points : 43\nFrame: 154/486 - Tracked points : 42\nFrame: 155/486 - Tracked points : 80\nFrame: 156/486 - Tracked points : 86\nFrame: 157/486 - Tracked points : 115\nFrame: 158/486 - Tracked points : 117\nFrame: 159/486 - Tracked points : 121\nFrame: 160/486 - Tracked points : 123\nFrame: 161/486 - Tracked points : 151\nFrame: 162/486 - Tracked points : 126\nFrame: 163/486 - Tracked points : 148\nFrame: 164/486 - Tracked points : 111\nFrame: 165/486 - Tracked points : 110\nFrame: 166/486 - Tracked points : 116\nFrame: 167/486 - Tracked points : 100\nFrame: 168/486 - Tracked points : 113\nFrame: 169/486 - Tracked points : 110\nFrame: 170/486 - Tracked points : 112\nFrame: 171/486 - Tracked points : 85\nFrame: 172/486 - Tracked points : 93\nFrame: 173/486 - Tracked points : 75\nFrame: 174/486 - Tracked points : 68\nFrame: 175/486 - Tracked points : 83\nFrame: 176/486 - Tracked points : 83\nFrame: 177/486 - Tracked points : 68\nFrame: 178/486 - Tracked points : 103\nFrame: 179/486 - Tracked points : 88\nFrame: 180/486 - Tracked points : 97\nFrame: 181/486 - Tracked points : 91\nFrame: 182/486 - Tracked points : 100\nFrame: 183/486 - Tracked points : 111\nFrame: 184/486 - Tracked points : 72\nFrame: 185/486 - Tracked points : 56\nFrame: 186/486 - Tracked points : 90\nFrame: 187/486 - Tracked points : 76\nFrame: 188/486 - Tracked points : 90\nFrame: 189/486 - Tracked points : 181\nFrame: 190/486 - Tracked points : 106\nFrame: 191/486 - Tracked points : 92\nFrame: 192/486 - Tracked points : 388\nFrame: 193/486 - Tracked points : 382\nFrame: 194/486 - Tracked points : 387\nFrame: 195/486 - Tracked points : 390\nFrame: 196/486 - Tracked points : 384\nFrame: 197/486 - Tracked points : 389\nFrame: 198/486 - Tracked points : 385\nFrame: 199/486 - Tracked points : 390\nFrame: 200/486 - Tracked points : 127\nFrame: 201/486 - Tracked points : 190\nFrame: 202/486 - Tracked points : 107\nFrame: 203/486 - Tracked points : 145\nFrame: 204/486 - Tracked points : 137\nFrame: 205/486 - Tracked points : 205\nFrame: 206/486 - Tracked points : 146\nFrame: 207/486 - Tracked points : 170\nFrame: 208/486 - Tracked points : 205\nFrame: 209/486 - Tracked points : 133\nFrame: 210/486 - Tracked points : 74\nFrame: 211/486 - Tracked points : 168\nFrame: 212/486 - Tracked points : 127\nFrame: 213/486 - Tracked points : 384\nFrame: 214/486 - Tracked points : 378\nFrame: 215/486 - Tracked points : 376\nFrame: 216/486 - Tracked points : 385\nFrame: 217/486 - Tracked points : 386\nFrame: 218/486 - Tracked points : 396\nFrame: 219/486 - Tracked points : 389\nFrame: 220/486 - Tracked points : 378\nFrame: 221/486 - Tracked points : 379\nFrame: 222/486 - Tracked points : 382\nFrame: 223/486 - Tracked points : 384\nFrame: 224/486 - Tracked points : 387\nFrame: 225/486 - Tracked points : 385\nFrame: 226/486 - Tracked points : 384\nFrame: 227/486 - Tracked points : 392\nFrame: 228/486 - Tracked points : 392\nFrame: 229/486 - Tracked points : 393\nFrame: 230/486 - Tracked points : 394\nFrame: 231/486 - Tracked points : 347\nFrame: 232/486 - Tracked points : 291\nFrame: 233/486 - Tracked points : 389\nFrame: 234/486 - Tracked points : 378\nFrame: 235/486 - Tracked points : 390\nFrame: 236/486 - Tracked points : 369\nFrame: 237/486 - Tracked points : 384\nFrame: 238/486 - Tracked points : 384\nFrame: 239/486 - Tracked points : 386\nFrame: 240/486 - Tracked points : 206\nFrame: 241/486 - Tracked points : 303\nFrame: 242/486 - Tracked points : 291\nFrame: 243/486 - Tracked points : 387\nFrame: 244/486 - Tracked points : 384\nFrame: 245/486 - Tracked points : 378\nFrame: 246/486 - Tracked points : 380\nFrame: 247/486 - Tracked points : 381\nFrame: 248/486 - Tracked points : 383\nFrame: 249/486 - Tracked points : 389\nFrame: 250/486 - Tracked points : 390\nFrame: 251/486 - Tracked points : 392\nFrame: 252/486 - Tracked points : 387\nFrame: 253/486 - Tracked points : 243\nFrame: 254/486 - Tracked points : 392\nFrame: 255/486 - Tracked points : 379\nFrame: 256/486 - Tracked points : 384\nFrame: 257/486 - Tracked points : 366\nFrame: 258/486 - Tracked points : 389\nFrame: 259/486 - Tracked points : 373\nFrame: 260/486 - Tracked points : 373\nFrame: 261/486 - Tracked points : 383\nFrame: 262/486 - Tracked points : 376\nFrame: 263/486 - Tracked points : 378\nFrame: 264/486 - Tracked points : 379\nFrame: 265/486 - Tracked points : 393\nFrame: 266/486 - Tracked points : 394\nFrame: 267/486 - Tracked points : 390\nFrame: 268/486 - Tracked points : 383\nFrame: 269/486 - Tracked points : 386\nFrame: 270/486 - Tracked points : 394\nFrame: 271/486 - Tracked points : 391\nFrame: 272/486 - Tracked points : 362\nFrame: 273/486 - Tracked points : 303\nFrame: 274/486 - Tracked points : 236\nFrame: 275/486 - Tracked points : 336\nFrame: 276/486 - Tracked points : 295\nFrame: 277/486 - Tracked points : 388\nFrame: 278/486 - Tracked points : 371\nFrame: 279/486 - Tracked points : 381\nFrame: 280/486 - Tracked points : 386\nFrame: 281/486 - Tracked points : 384\nFrame: 282/486 - Tracked points : 375\nFrame: 283/486 - Tracked points : 367\nFrame: 284/486 - Tracked points : 391\nFrame: 285/486 - Tracked points : 392\nFrame: 286/486 - Tracked points : 389\nFrame: 287/486 - Tracked points : 387\nFrame: 288/486 - Tracked points : 392\nFrame: 289/486 - Tracked points : 389\nFrame: 290/486 - Tracked points : 385\nFrame: 291/486 - Tracked points : 394\nFrame: 292/486 - Tracked points : 392\nFrame: 293/486 - Tracked points : 387\nFrame: 294/486 - Tracked points : 389\nFrame: 295/486 - Tracked points : 391\nFrame: 296/486 - Tracked points : 369\nFrame: 297/486 - Tracked points : 376\nFrame: 298/486 - Tracked points : 387\nFrame: 299/486 - Tracked points : 375\nFrame: 300/486 - Tracked points : 365\nFrame: 301/486 - Tracked points : 323\nFrame: 302/486 - Tracked points : 291\nFrame: 303/486 - Tracked points : 313\nFrame: 304/486 - Tracked points : 324\nFrame: 305/486 - Tracked points : 380\nFrame: 306/486 - Tracked points : 393\nFrame: 307/486 - Tracked points : 316\nFrame: 308/486 - Tracked points : 391\nFrame: 309/486 - Tracked points : 394\nFrame: 310/486 - Tracked points : 294\nFrame: 311/486 - Tracked points : 352\nFrame: 312/486 - Tracked points : 390\nFrame: 313/486 - Tracked points : 365\nFrame: 314/486 - Tracked points : 390\nFrame: 315/486 - Tracked points : 299\nFrame: 316/486 - Tracked points : 255\nFrame: 317/486 - Tracked points : 360\nFrame: 318/486 - Tracked points : 389\nFrame: 319/486 - Tracked points : 377\nFrame: 320/486 - Tracked points : 379\nFrame: 321/486 - Tracked points : 360\nFrame: 322/486 - Tracked points : 381\nFrame: 323/486 - Tracked points : 392\nFrame: 324/486 - Tracked points : 381\nFrame: 325/486 - Tracked points : 383\nFrame: 326/486 - Tracked points : 381\nFrame: 327/486 - Tracked points : 378\nFrame: 328/486 - Tracked points : 388\nFrame: 329/486 - Tracked points : 379\nFrame: 330/486 - Tracked points : 389\nFrame: 331/486 - Tracked points : 398\nFrame: 332/486 - Tracked points : 393\nFrame: 333/486 - Tracked points : 387\nFrame: 334/486 - Tracked points : 391\nFrame: 335/486 - Tracked points : 392\nFrame: 336/486 - Tracked points : 391\nFrame: 337/486 - Tracked points : 392\nFrame: 338/486 - Tracked points : 391\nFrame: 339/486 - Tracked points : 383\nFrame: 340/486 - Tracked points : 385\nFrame: 341/486 - Tracked points : 386\nFrame: 342/486 - Tracked points : 394\nFrame: 343/486 - Tracked points : 392\nFrame: 344/486 - Tracked points : 383\nFrame: 345/486 - Tracked points : 393\nFrame: 346/486 - Tracked points : 310\nFrame: 347/486 - Tracked points : 270\nFrame: 348/486 - Tracked points : 199\nFrame: 349/486 - Tracked points : 173\nFrame: 350/486 - Tracked points : 231\nFrame: 351/486 - Tracked points : 271\nFrame: 352/486 - Tracked points : 369\nFrame: 353/486 - Tracked points : 374\nFrame: 354/486 - Tracked points : 316\nFrame: 355/486 - Tracked points : 349\nFrame: 356/486 - Tracked points : 290\nFrame: 357/486 - Tracked points : 390\nFrame: 358/486 - Tracked points : 382\nFrame: 359/486 - Tracked points : 292\nFrame: 360/486 - Tracked points : 252\nFrame: 361/486 - Tracked points : 393\nFrame: 362/486 - Tracked points : 382\nFrame: 363/486 - Tracked points : 353\nFrame: 364/486 - Tracked points : 383\nFrame: 365/486 - Tracked points : 373\nFrame: 366/486 - Tracked points : 387\nFrame: 367/486 - Tracked points : 391\nFrame: 368/486 - Tracked points : 385\nFrame: 369/486 - Tracked points : 380\nFrame: 370/486 - Tracked points : 394\nFrame: 371/486 - Tracked points : 397\nFrame: 372/486 - Tracked points : 149\nFrame: 373/486 - Tracked points : 152\nFrame: 374/486 - Tracked points : 108\nFrame: 375/486 - Tracked points : 119\nFrame: 376/486 - Tracked points : 151\nFrame: 377/486 - Tracked points : 163\nFrame: 378/486 - Tracked points : 147\nFrame: 379/486 - Tracked points : 146\nFrame: 380/486 - Tracked points : 130\nFrame: 381/486 - Tracked points : 155\nFrame: 382/486 - Tracked points : 119\nFrame: 383/486 - Tracked points : 140\nFrame: 384/486 - Tracked points : 106\nFrame: 385/486 - Tracked points : 157\nFrame: 386/486 - Tracked points : 152\nFrame: 387/486 - Tracked points : 390\nFrame: 388/486 - Tracked points : 174\nFrame: 389/486 - Tracked points : 110\nFrame: 390/486 - Tracked points : 120\nFrame: 391/486 - Tracked points : 127\nFrame: 392/486 - Tracked points : 147\nFrame: 393/486 - Tracked points : 97\nFrame: 394/486 - Tracked points : 100\nFrame: 395/486 - Tracked points : 128\nFrame: 396/486 - Tracked points : 95\nFrame: 397/486 - Tracked points : 201\nFrame: 398/486 - Tracked points : 188\nFrame: 399/486 - Tracked points : 173\nFrame: 400/486 - Tracked points : 174\nFrame: 401/486 - Tracked points : 205\nFrame: 402/486 - Tracked points : 245\nFrame: 403/486 - Tracked points : 241\nFrame: 404/486 - Tracked points : 180\nFrame: 405/486 - Tracked points : 240\nFrame: 406/486 - Tracked points : 231\nFrame: 407/486 - Tracked points : 188\nFrame: 408/486 - Tracked points : 148\nFrame: 409/486 - Tracked points : 137\nFrame: 410/486 - Tracked points : 179\nFrame: 411/486 - Tracked points : 229\nFrame: 412/486 - Tracked points : 162\nFrame: 413/486 - Tracked points : 139\nFrame: 414/486 - Tracked points : 188\nFrame: 415/486 - Tracked points : 217\nFrame: 416/486 - Tracked points : 197\nFrame: 417/486 - Tracked points : 200\nFrame: 418/486 - Tracked points : 197\nFrame: 419/486 - Tracked points : 233\nFrame: 420/486 - Tracked points : 150\nFrame: 421/486 - Tracked points : 139\nFrame: 422/486 - Tracked points : 135\nFrame: 423/486 - Tracked points : 185\nFrame: 424/486 - Tracked points : 165\nFrame: 425/486 - Tracked points : 133\nFrame: 426/486 - Tracked points : 140\nFrame: 427/486 - Tracked points : 157\nFrame: 428/486 - Tracked points : 220\nFrame: 429/486 - Tracked points : 175\nFrame: 430/486 - Tracked points : 152\nFrame: 431/486 - Tracked points : 163\nFrame: 432/486 - Tracked points : 167\nFrame: 433/486 - Tracked points : 186\nFrame: 434/486 - Tracked points : 198\nFrame: 435/486 - Tracked points : 197\nFrame: 436/486 - Tracked points : 194\nFrame: 437/486 - Tracked points : 163\nFrame: 438/486 - Tracked points : 133\nFrame: 439/486 - Tracked points : 161\nFrame: 440/486 - Tracked points : 175\nFrame: 441/486 - Tracked points : 178\nFrame: 442/486 - Tracked points : 184\nFrame: 443/486 - Tracked points : 184\nFrame: 444/486 - Tracked points : 180\nFrame: 445/486 - Tracked points : 201\nFrame: 446/486 - Tracked points : 162\nFrame: 447/486 - Tracked points : 173\nFrame: 448/486 - Tracked points : 199\nFrame: 449/486 - Tracked points : 189\nFrame: 450/486 - Tracked points : 156\nFrame: 451/486 - Tracked points : 137\nFrame: 452/486 - Tracked points : 150\nFrame: 453/486 - Tracked points : 135\nFrame: 454/486 - Tracked points : 154\nFrame: 455/486 - Tracked points : 179\nFrame: 456/486 - Tracked points : 148\nFrame: 457/486 - Tracked points : 155\nFrame: 458/486 - Tracked points : 183\nFrame: 459/486 - Tracked points : 144\nFrame: 460/486 - Tracked points : 134\nFrame: 461/486 - Tracked points : 140\nFrame: 462/486 - Tracked points : 205\nFrame: 463/486 - Tracked points : 176\nFrame: 464/486 - Tracked points : 163\nFrame: 465/486 - Tracked points : 175\nFrame: 466/486 - Tracked points : 183\nFrame: 467/486 - Tracked points : 131\nFrame: 468/486 - Tracked points : 142\nFrame: 469/486 - Tracked points : 158\nFrame: 470/486 - Tracked points : 131\nFrame: 471/486 - Tracked points : 141\nFrame: 472/486 - Tracked points : 138\nFrame: 473/486 - Tracked points : 143\nFrame: 474/486 - Tracked points : 128\nFrame: 475/486 - Tracked points : 118\nFrame: 476/486 - Tracked points : 108\nFrame: 477/486 - Tracked points : 106\nFrame: 478/486 - Tracked points : 114\nFrame: 479/486 - Tracked points : 138\nFrame: 480/486 - Tracked points : 144\nFrame: 481/486 - Tracked points : 130\nFrame: 482/486 - Tracked points : 131\nFrame: 483/486 - Tracked points : 128\ntransforms: 485\n" ], [ "from scipy.signal import savgol_filter\ndef movingAverage(curve, radius):\n window_size = 2 * radius + 1\n # Define the filter\n f = np.ones(window_size)/window_size\n # Add padding to the boundaries\n curve_pad = np.lib.pad(curve, (radius, radius), 'edge')\n # Apply convolution\n curve_smoothed = np.convolve(curve_pad, f, mode='same')\n # Remove padding\n curve_smoothed = curve_smoothed[radius:-radius]\n # return smoothed curve\n return savgol_filter(curve, window_size, 3)\n # return curve_smoothed\n\ndef fixBorder(frame):\n s = frame.shape\n # Scale the image 4% without moving the center\n T = cv2.getRotationMatrix2D((s[1]/2, s[0]/2), 0, 1.04)\n frame = cv2.warpAffine(frame, T, (s[1], s[0]))\n return frame\n\ndef smooth(trajectory, SMOOTHING_RADIUS=60):\n smoothed_trajectory = np.copy(trajectory)\n # Filter the x, y and angle curves\n for i in range(3):\n smoothed_trajectory[:,i] = movingAverage(trajectory[:,i], radius=SMOOTHING_RADIUS)\n \n return smoothed_trajectory", "_____no_output_____" ], [ "# Calculate difference in smoothed_trajectory and trajectory\nsmoothed_trajectory = smooth(trajectory)\ndifference = smoothed_trajectory - trajectory\n# median = np.median(np.abs(difference))\n# new_trajectory = trajectory.copy()\n# for i, d in enumerate(difference):\n# if d[0]>median:\n# new_trajectory[i] = smoothed_trajectory[i]\n \n# smoothed_trajectory = smooth(new_trajectory)\n# difference = smoothed_trajectory - trajectory\n# # Calculate newer transformation array\ntransforms_smooth = transforms + difference\n\n\n# Reset stream to first frame\ncap.set(cv2.CAP_PROP_POS_FRAMES, 0)\n\nframes=[]\n# Write n_frames-1 transformed frames\nfourcc = cv2.VideoWriter_fourcc(*'mp4v')\nout = cv2.VideoWriter('../video_out.mp4', fourcc, fps, (w, h))\nfor i in range(n_frames-2):\n # Read next frame\n success, frame = cap.read()\n if not success:\n break\n\n # Extract transformations from the new transformation array\n dx = transforms_smooth[i,0]\n dy = transforms_smooth[i,1]\n da = transforms_smooth[i,2]\n \n # Reconstruct transformation matrix accordingly to new values\n m = np.zeros((2,3), np.float32)\n m[0,0] = np.cos(da)\n m[0,1] = -np.sin(da)\n m[1,0] = np.sin(da)\n m[1,1] = np.cos(da)\n m[0,2] = dx\n m[1,2] = dy\n \n # Apply affine wrapping to the given frame\n frame_stabilized = cv2.warpAffine(frame.astype(np.float64)/255, m, (w,h))\n\n # Fix border artifacts\n # frame_stabilized = fixBorder(frame_stabilized)\n\n # Write the frame to the file\n frame_out = cv2.hconcat([frame.astype(np.float64)/255, frame_stabilized])\n\n # If the image is too big, resize it.\n if frame_out.shape[1] > 1920:\n frame_out = cv2.resize(frame_out, (frame_out.shape[1]//2, frame_out.shape[0]));\n \n frames.append(frame_out)\n out.write((frame_out*255).astype(np.uint8))\n\nout.release()", "_____no_output_____" ], [ "import torch\nframes = [torch.from_numpy(frame) for frame in frames]", "_____no_output_____" ], [ "len(frames)", "_____no_output_____" ], [ "vid = torch.stack(frames)\nvid.shape\nfrom torchvision.io import read_video, read_video_timestamps, write_video\nwrite_video(\"../video_out.avi\", vid.flip(3), fps=30)", "_____no_output_____" ], [ "Video(\"../video_out.mp4\", width=960, height=540)", "_____no_output_____" ], [ "from IPython.display import Video\nVideo(\"../video_out.mp4\", width=960, height=540)", "_____no_output_____" ], [ "Video(\"../stable_video.avi\", width=960, height=540)", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e461d41da28b4ea8ddb3028905bc8bf84dcf87
97,067
ipynb
Jupyter Notebook
Project_Plagiarism_Detection/2_Plagiarism_Feature_Engineering.ipynb
brunokiyoshi/ML_SageMaker_Studies
d2418ba0d750b71bfb1d36ee897a6369c6173045
[ "MIT" ]
null
null
null
Project_Plagiarism_Detection/2_Plagiarism_Feature_Engineering.ipynb
brunokiyoshi/ML_SageMaker_Studies
d2418ba0d750b71bfb1d36ee897a6369c6173045
[ "MIT" ]
null
null
null
Project_Plagiarism_Detection/2_Plagiarism_Feature_Engineering.ipynb
brunokiyoshi/ML_SageMaker_Studies
d2418ba0d750b71bfb1d36ee897a6369c6173045
[ "MIT" ]
null
null
null
41.043129
1,493
0.532581
[ [ [ "# Plagiarism Detection, Feature Engineering\n\nIn this project, you will be tasked with building a plagiarism detector that examines an answer text file and performs binary classification; labeling that file as either plagiarized or not, depending on how similar that text file is to a provided, source text. \n\nYour first task will be to create some features that can then be used to train a classification model. This task will be broken down into a few discrete steps:\n\n* Clean and pre-process the data.\n* Define features for comparing the similarity of an answer text and a source text, and extract similarity features.\n* Select \"good\" features, by analyzing the correlations between different features.\n* Create train/test `.csv` files that hold the relevant features and class labels for train/test data points.\n\nIn the _next_ notebook, Notebook 3, you'll use the features and `.csv` files you create in _this_ notebook to train a binary classification model in a SageMaker notebook instance.\n\nYou'll be defining a few different similarity features, as outlined in [this paper](https://s3.amazonaws.com/video.udacity-data.com/topher/2019/January/5c412841_developing-a-corpus-of-plagiarised-short-answers/developing-a-corpus-of-plagiarised-short-answers.pdf), which should help you build a robust plagiarism detector!\n\nTo complete this notebook, you'll have to complete all given exercises and answer all the questions in this notebook.\n> All your tasks will be clearly labeled **EXERCISE** and questions as **QUESTION**.\n\nIt will be up to you to decide on the features to include in your final training and test data.\n\n---", "_____no_output_____" ], [ "## Read in the Data\n\nThe cell below will download the necessary, project data and extract the files into the folder `data/`.\n\nThis data is a slightly modified version of a dataset created by Paul Clough (Information Studies) and Mark Stevenson (Computer Science), at the University of Sheffield. You can read all about the data collection and corpus, at [their university webpage](https://ir.shef.ac.uk/cloughie/resources/plagiarism_corpus.html). \n\n> **Citation for data**: Clough, P. and Stevenson, M. Developing A Corpus of Plagiarised Short Answers, Language Resources and Evaluation: Special Issue on Plagiarism and Authorship Analysis, In Press. [Download]", "_____no_output_____" ] ], [ [ "# NOTE:\n# you only need to run this cell if you have not yet downloaded the data\n# otherwise you may skip this cell or comment it out\n\n!wget https://s3.amazonaws.com/video.udacity-data.com/topher/2019/January/5c4147f9_data/data.zip\n!unzip data", "--2020-09-27 00:00:47-- https://s3.amazonaws.com/video.udacity-data.com/topher/2019/January/5c4147f9_data/data.zip\nResolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.21.125\nConnecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.21.125|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 113826 (111K) [application/zip]\nSaving to: ‘data.zip.3’\n\ndata.zip.3 100%[===================>] 111.16K --.-KB/s in 0.02s \n\n2020-09-27 00:00:47 (4.89 MB/s) - ‘data.zip.3’ saved [113826/113826]\n\nArchive: data.zip\nreplace data/.DS_Store? [y]es, [n]o, [A]ll, [N]one, [r]ename: ^C\n" ], [ "# import libraries\nimport pandas as pd\nimport numpy as np\nimport os", "_____no_output_____" ] ], [ [ "This plagiarism dataset is made of multiple text files; each of these files has characteristics that are is summarized in a `.csv` file named `file_information.csv`, which we can read in using `pandas`.", "_____no_output_____" ] ], [ [ "csv_file = 'data/file_information.csv'\nplagiarism_df = pd.read_csv(csv_file)\n\n# print out the first few rows of data info\nplagiarism_df.head()", "_____no_output_____" ] ], [ [ "## Types of Plagiarism\n\nEach text file is associated with one **Task** (task A-E) and one **Category** of plagiarism, which you can see in the above DataFrame.\n\n### Tasks, A-E\n\nEach text file contains an answer to one short question; these questions are labeled as tasks A-E. For example, Task A asks the question: \"What is inheritance in object oriented programming?\"\n\n### Categories of plagiarism \n\nEach text file has an associated plagiarism label/category:\n\n**1. Plagiarized categories: `cut`, `light`, and `heavy`.**\n* These categories represent different levels of plagiarized answer texts. `cut` answers copy directly from a source text, `light` answers are based on the source text but include some light rephrasing, and `heavy` answers are based on the source text, but *heavily* rephrased (and will likely be the most challenging kind of plagiarism to detect).\n \n**2. Non-plagiarized category: `non`.** \n* `non` indicates that an answer is not plagiarized; the Wikipedia source text is not used to create this answer.\n \n**3. Special, source text category: `orig`.**\n* This is a specific category for the original, Wikipedia source text. We will use these files only for comparison purposes.", "_____no_output_____" ], [ "---\n## Pre-Process the Data\n\nIn the next few cells, you'll be tasked with creating a new DataFrame of desired information about all of the files in the `data/` directory. This will prepare the data for feature extraction and for training a binary, plagiarism classifier.", "_____no_output_____" ], [ "### EXERCISE: Convert categorical to numerical data\n\nYou'll notice that the `Category` column in the data, contains string or categorical values, and to prepare these for feature extraction, we'll want to convert these into numerical values. Additionally, our goal is to create a binary classifier and so we'll need a binary class label that indicates whether an answer text is plagiarized (1) or not (0). Complete the below function `numerical_dataframe` that reads in a `file_information.csv` file by name, and returns a *new* DataFrame with a numerical `Category` column and a new `Class` column that labels each answer as plagiarized or not. \n\nYour function should return a new DataFrame with the following properties:\n\n* 4 columns: `File`, `Task`, `Category`, `Class`. The `File` and `Task` columns can remain unchanged from the original `.csv` file.\n* Convert all `Category` labels to numerical labels according to the following rules (a higher value indicates a higher degree of plagiarism):\n * 0 = `non`\n * 1 = `heavy`\n * 2 = `light`\n * 3 = `cut`\n * -1 = `orig`, this is a special value that indicates an original file.\n* For the new `Class` column\n * Any answer text that is not plagiarized (`non`) should have the class label `0`. \n * Any plagiarized answer texts should have the class label `1`. \n * And any `orig` texts will have a special label `-1`. \n\n### Expected output\n\nAfter running your function, you should get a DataFrame with rows that looks like the following: \n```\n\n File\t Task Category Class\n0\tg0pA_taska.txt\ta\t 0 \t0\n1\tg0pA_taskb.txt\tb\t 3 \t1\n2\tg0pA_taskc.txt\tc\t 2 \t1\n3\tg0pA_taskd.txt\td\t 1 \t1\n4\tg0pA_taske.txt\te\t 0\t 0\n...\n...\n99 orig_taske.txt e -1 -1\n\n```", "_____no_output_____" ] ], [ [ "# Read in a csv file and return a transformed dataframe\ndef numerical_dataframe(csv_file='data/file_information.csv'):\n '''Reads in a csv file which is assumed to have `File`, `Category` and `Task` columns.\n This function does two things: \n 1) converts `Category` column values to numerical values \n 2) Adds a new, numerical `Class` label column.\n The `Class` column will label plagiarized answers as 1 and non-plagiarized as 0.\n Source texts have a special label, -1.\n :param csv_file: The directory for the file_information.csv file\n :return: A dataframe with numerical categories and a new `Class` label column'''\n \n # your code here\n df = pd.read_csv(csv_file) #read csv file and create a Dataframe\n mapping_dict = {'Category':{'non': 0, 'heavy': 1, 'light': 2, 'cut': 3, 'orig': -1}} # Define numbers for each category\n df.replace(mapping_dict, inplace=True) # replace string categories by the respective numbers\n class_list = [(x if x < 1 else 1) for x in df['Category']] # this will be 0 and -1 for negatives and 1 for all toher categories\n df['Class'] = class_list\n \n return df\n", "_____no_output_____" ] ], [ [ "### Test cells\n\nBelow are a couple of test cells. The first is an informal test where you can check that your code is working as expected by calling your function and printing out the returned result.\n\nThe **second** cell below is a more rigorous test cell. The goal of a cell like this is to ensure that your code is working as expected, and to form any variables that might be used in _later_ tests/code, in this case, the data frame, `transformed_df`.\n\n> The cells in this notebook should be run in chronological order (the order they appear in the notebook). This is especially important for test cells.\n\nOften, later cells rely on the functions, imports, or variables defined in earlier cells. For example, some tests rely on previous tests to work.\n\nThese tests do not test all cases, but they are a great way to check that you are on the right track!", "_____no_output_____" ] ], [ [ "# informal testing, print out the results of a called function\n# create new `transformed_df`\ntransformed_df = numerical_dataframe(csv_file ='data/file_information.csv')\n\n# check work\n# check that all categories of plagiarism have a class label = 1\ntransformed_df.head(10)", "_____no_output_____" ], [ "# test cell that creates `transformed_df`, if tests are passed\n\n\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n\n# importing tests\nimport problem_unittests as tests\n\n# test numerical_dataframe function\ntests.test_numerical_df(numerical_dataframe)\n\n# if above test is passed, create NEW `transformed_df`\ntransformed_df = numerical_dataframe(csv_file ='data/file_information.csv')\n\n# check work\nprint('\\nExample data: ')\ntransformed_df.head()", "Tests Passed!\n\nExample data: \n" ] ], [ [ "## Text Processing & Splitting Data\n\nRecall that the goal of this project is to build a plagiarism classifier. At it's heart, this task is a comparison text; one that looks at a given answer and a source text, compares them and predicts whether an answer has plagiarized from the source. To effectively do this comparison, and train a classifier we'll need to do a few more things: pre-process all of our text data and prepare the text files (in this case, the 95 answer files and 5 original source files) to be easily compared, and split our data into a `train` and `test` set that can be used to train a classifier and evaluate it, respectively. \n\nTo this end, you've been provided code that adds additional information to your `transformed_df` from above. The next two cells need not be changed; they add two additional columns to the `transformed_df`:\n\n1. A `Text` column; this holds all the lowercase text for a `File`, with extraneous punctuation removed.\n2. A `Datatype` column; this is a string value `train`, `test`, or `orig` that labels a data point as part of our train or test set\n\nThe details of how these additional columns are created can be found in the `helpers.py` file in the project directory. You're encouraged to read through that file to see exactly how text is processed and how data is split.\n\nRun the cells below to get a `complete_df` that has all the information you need to proceed with plagiarism detection and feature engineering.", "_____no_output_____" ] ], [ [ "\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\nimport helpers \n\n# create a text column \ntext_df = helpers.create_text_column(transformed_df)\ntext_df.head()", "_____no_output_____" ], [ "# after running the cell above\n# check out the processed text for a single file, by row index\nrow_idx = 9 # feel free to change this index\n\nsample_text = text_df.iloc[row_idx]['Text']\n\nprint('Sample processed text:\\n\\n', sample_text)", "Sample processed text:\n\n dynamic programming is a method for solving mathematical programming problems that exhibit the properties of overlapping subproblems and optimal substructure this is a much quicker method than other more naive methods the word programming in dynamic programming relates optimization which is commonly referred to as mathematical programming richard bellman originally coined the term in the 1940s to describe a method for solving problems where one needs to find the best decisions one after another and by 1953 he refined his method to the current modern meaning optimal substructure means that by splitting the programming into optimal solutions of subproblems these can then be used to find the optimal solutions of the overall problem one example is the computing of the shortest path to a goal from a vertex in a graph first compute the shortest path to the goal from all adjacent vertices then using this the best overall path can be found thereby demonstrating the dynamic programming principle this general three step process can be used to solve a problem 1 break up the problem different smaller subproblems 2 recursively use this three step process to compute the optimal path in the subproblem 3 construct an optimal solution using the computed optimal subproblems for the original problem this process continues recursively working over the subproblems by dividing them into sub subproblems and so forth until a simple case is reached one that is easily solvable \n" ] ], [ [ "## Split data into training and test sets\n\nThe next cell will add a `Datatype` column to a given DataFrame to indicate if the record is: \n* `train` - Training data, for model training.\n* `test` - Testing data, for model evaluation.\n* `orig` - The task's original answer from wikipedia.\n\n### Stratified sampling\n\nThe given code uses a helper function which you can view in the `helpers.py` file in the main project directory. This implements [stratified random sampling](https://en.wikipedia.org/wiki/Stratified_sampling) to randomly split data by task & plagiarism amount. Stratified sampling ensures that we get training and test data that is fairly evenly distributed across task & plagiarism combinations. Approximately 26% of the data is held out for testing and 74% of the data is used for training.\n\nThe function **train_test_dataframe** takes in a DataFrame that it assumes has `Task` and `Category` columns, and, returns a modified frame that indicates which `Datatype` (train, test, or orig) a file falls into. This sampling will change slightly based on a passed in *random_seed*. Due to a small sample size, this stratified random sampling will provide more stable results for a binary plagiarism classifier. Stability here is smaller *variance* in the accuracy of classifier, given a random seed.", "_____no_output_____" ] ], [ [ "random_seed = 1 # can change; set for reproducibility\n\n\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\nimport helpers\n\n# create new df with Datatype (train, test, orig) column\n# pass in `text_df` from above to create a complete dataframe, with all the information you need\ncomplete_df = helpers.train_test_dataframe(text_df, random_seed=random_seed)\n\n# check results\ncomplete_df", "_____no_output_____" ] ], [ [ "# Determining Plagiarism\n\nNow that you've prepared this data and created a `complete_df` of information, including the text and class associated with each file, you can move on to the task of extracting similarity features that will be useful for plagiarism classification. \n\n> Note: The following code exercises, assume that the `complete_df` as it exists now, will **not** have its existing columns modified. \n\nThe `complete_df` should always include the columns: `['File', 'Task', 'Category', 'Class', 'Text', 'Datatype']`. You can add additional columns, and you can create any new DataFrames you need by copying the parts of the `complete_df` as long as you do not modify the existing values, directly.\n\n---", "_____no_output_____" ], [ "\n# Similarity Features \n\nOne of the ways we might go about detecting plagiarism, is by computing **similarity features** that measure how similar a given answer text is as compared to the original wikipedia source text (for a specific task, a-e). The similarity features you will use are informed by [this paper on plagiarism detection](https://s3.amazonaws.com/video.udacity-data.com/topher/2019/January/5c412841_developing-a-corpus-of-plagiarised-short-answers/developing-a-corpus-of-plagiarised-short-answers.pdf). \n> In this paper, researchers created features called **containment** and **longest common subsequence**. \n\nUsing these features as input, you will train a model to distinguish between plagiarized and not-plagiarized text files.\n\n## Feature Engineering\n\nLet's talk a bit more about the features we want to include in a plagiarism detection model and how to calculate such features. In the following explanations, I'll refer to a submitted text file as a **Student Answer Text (A)** and the original, wikipedia source file (that we want to compare that answer to) as the **Wikipedia Source Text (S)**.\n\n### Containment\n\nYour first task will be to create **containment features**. To understand containment, let's first revisit a definition of [n-grams](https://en.wikipedia.org/wiki/N-gram). An *n-gram* is a sequential word grouping. For example, in a line like \"bayes rule gives us a way to combine prior knowledge with new information,\" a 1-gram is just one word, like \"bayes.\" A 2-gram might be \"bayes rule\" and a 3-gram might be \"combine prior knowledge.\"\n\n> Containment is defined as the **intersection** of the n-gram word count of the Wikipedia Source Text (S) with the n-gram word count of the Student Answer Text (S) *divided* by the n-gram word count of the Student Answer Text.\n\n$$ \\frac{\\sum{count(\\text{ngram}_{A}) \\cap count(\\text{ngram}_{S})}}{\\sum{count(\\text{ngram}_{A})}} $$\n\nIf the two texts have no n-grams in common, the containment will be 0, but if _all_ their n-grams intersect then the containment will be 1. Intuitively, you can see how having longer n-gram's in common, might be an indication of cut-and-paste plagiarism. In this project, it will be up to you to decide on the appropriate `n` or several `n`'s to use in your final model.\n\n### EXERCISE: Create containment features\n\nGiven the `complete_df` that you've created, you should have all the information you need to compare any Student Answer Text (A) with its appropriate Wikipedia Source Text (S). An answer for task A should be compared to the source text for task A, just as answers to tasks B, C, D, and E should be compared to the corresponding original source text.\n\nIn this exercise, you'll complete the function, `calculate_containment` which calculates containment based upon the following parameters:\n* A given DataFrame, `df` (which is assumed to be the `complete_df` from above)\n* An `answer_filename`, such as 'g0pB_taskd.txt' \n* An n-gram length, `n`\n\n### Containment calculation\n\nThe general steps to complete this function are as follows:\n1. From *all* of the text files in a given `df`, create an array of n-gram counts; it is suggested that you use a [CountVectorizer](https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.CountVectorizer.html) for this purpose.\n2. Get the processed answer and source texts for the given `answer_filename`.\n3. Calculate the containment between an answer and source text according to the following equation.\n\n >$$ \\frac{\\sum{count(\\text{ngram}_{A}) \\cap count(\\text{ngram}_{S})}}{\\sum{count(\\text{ngram}_{A})}} $$\n \n4. Return that containment value.\n\nYou are encouraged to write any helper functions that you need to complete the function below.", "_____no_output_____" ] ], [ [ "# Calculate the ngram containment for one answer file/source file pair in a df\nfrom sklearn.feature_extraction.text import CountVectorizer\ndef calculate_containment(df, n, answer_filename):\n '''Calculates the containment between a given answer text and its associated source text.\n This function creates a count of ngrams (of a size, n) for each text file in our data.\n Then calculates the containment by finding the ngram count for a given answer text, \n and its associated source text, and calculating the normalized intersection of those counts.\n :param df: A dataframe with columns,\n 'File', 'Task', 'Category', 'Class', 'Text', and 'Datatype'\n :param n: An integer that defines the ngram size\n :param answer_filename: A filename for an answer text in the df, ex. 'g0pB_taskd.txt'\n :return: A single containment value that represents the similarity\n between an answer text and its source text.\n '''\n \n # your code here\n # print(f'calculate_containment(df=df, n={n}, answer_filename={answer_filename})')\n # get the text from filename\n answer_row = df.loc[df['File'] == answer_filename]\n # print(f'answer_row =')\n # print(answer_row)\n # get the task, assuming no two files have the same name\n # print(answer_row['Task'])\n task = answer_row['Task'].tolist()[0]\n #find appropriate original text \n original_text_row = df.loc[(df['Task'] == task) & (df['Class'] == -1)]\n \n original_text = original_text_row['Text']\n \n # get answer text\n answer_text = answer_row['Text']\n \n # get one-hot-encoded matrix for our answer and get transformed strings\n vectorizer = CountVectorizer(ngram_range=(n, n))\n transformed_answer = vectorizer.fit_transform(answer_text).toarray()[0]\n \n transformed_original = vectorizer.transform(original_text).toarray()[0]\n \n # get the intersections between the two matrices\n intersection = []\n for i, element in enumerate(transformed_answer):\n intersection.append(transformed_answer[i] if (transformed_answer[i] < transformed_original[i]) else transformed_original[i])\n \n containment = sum(intersection) / sum(transformed_answer)\n # print(f'containment = {containment}')\n # print('------------------------------')\n return containment", "_____no_output_____" ] ], [ [ "### Test cells\n\nAfter you've implemented the containment function, you can test out its behavior. \n\nThe cell below iterates through the first few files, and calculates the original category _and_ containment values for a specified n and file.\n\n>If you've implemented this correctly, you should see that the non-plagiarized have low or close to 0 containment values and that plagiarized examples have higher containment values, closer to 1.\n\nNote what happens when you change the value of n. I recommend applying your code to multiple files and comparing the resultant containment values. You should see that the highest containment values correspond to files with the highest category (`cut`) of plagiarism level.", "_____no_output_____" ] ], [ [ "# select a value for n\nn = 1\n\n# indices for first few files\ntest_indices = range(5)\n\n# iterate through files and calculate containment\ncategory_vals = []\ncontainment_vals = []\nfor i in test_indices:\n # get level of plagiarism for a given file index\n category_vals.append(complete_df.loc[i, 'Category'])\n # calculate containment for given file and n\n filename = complete_df.loc[i, 'File']\n c = calculate_containment(complete_df, n, filename)\n containment_vals.append(c)\n\n# print out result, does it make sense?\nprint('Original category values: \\n', category_vals)\nprint()\nprint(str(n)+'-gram containment values: \\n', containment_vals)", "Original category values: \n [0, 3, 2, 1, 0]\n\n1-gram containment values: \n [0.39814814814814814, 1.0, 0.8693693693693694, 0.5935828877005348, 0.5445026178010471]\n" ], [ "# run this test cell\n\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n# test containment calculation\n# params: complete_df from before, and containment function\ntests.test_containment(complete_df, calculate_containment)", "Tests Passed!\n" ] ], [ [ "### QUESTION 1: Why can we calculate containment features across *all* data (training & test), prior to splitting the DataFrame for modeling? That is, what about the containment calculation means that the test and training data do not influence each other?", "_____no_output_____" ], [ "**Answer:**\nIt's a property of a single entry (a feature) and not a property of the dataset or of a group of entries.", "_____no_output_____" ], [ "---\n## Longest Common Subsequence\n\nContainment a good way to find overlap in word usage between two documents; it may help identify cases of cut-and-paste as well as paraphrased levels of plagiarism. Since plagiarism is a fairly complex task with varying levels, it's often useful to include other measures of similarity. The paper also discusses a feature called **longest common subsequence**.\n\n> The longest common subsequence is the longest string of words (or letters) that are *the same* between the Wikipedia Source Text (S) and the Student Answer Text (A). This value is also normalized by dividing by the total number of words (or letters) in the Student Answer Text. \n\nIn this exercise, we'll ask you to calculate the longest common subsequence of words between two texts.\n\n### EXERCISE: Calculate the longest common subsequence\n\nComplete the function `lcs_norm_word`; this should calculate the *longest common subsequence* of words between a Student Answer Text and corresponding Wikipedia Source Text. \n\nIt may be helpful to think of this in a concrete example. A Longest Common Subsequence (LCS) problem may look as follows:\n* Given two texts: text A (answer text) of length n, and string S (original source text) of length m. Our goal is to produce their longest common subsequence of words: the longest sequence of words that appear left-to-right in both texts (though the words don't have to be in continuous order).\n* Consider:\n * A = \"i think pagerank is a link analysis algorithm used by google that uses a system of weights attached to each element of a hyperlinked set of documents\"\n * S = \"pagerank is a link analysis algorithm used by the google internet search engine that assigns a numerical weighting to each element of a hyperlinked set of documents\"\n\n* In this case, we can see that the start of each sentence of fairly similar, having overlap in the sequence of words, \"pagerank is a link analysis algorithm used by\" before diverging slightly. Then we **continue moving left -to-right along both texts** until we see the next common sequence; in this case it is only one word, \"google\". Next we find \"that\" and \"a\" and finally the same ending \"to each element of a hyperlinked set of documents\".\n* Below, is a clear visual of how these sequences were found, sequentially, in each text.\n\n<img src='notebook_ims/common_subseq_words.png' width=40% />\n\n* Now, those words appear in left-to-right order in each document, sequentially, and even though there are some words in between, we count this as the longest common subsequence between the two texts. \n* If I count up each word that I found in common I get the value 20. **So, LCS has length 20**. \n* Next, to normalize this value, divide by the total length of the student answer; in this example that length is only 27. **So, the function `lcs_norm_word` should return the value `20/27` or about `0.7408`.**\n\nIn this way, LCS is a great indicator of cut-and-paste plagiarism or if someone has referenced the same source text multiple times in an answer.", "_____no_output_____" ], [ "### LCS, dynamic programming\n\nIf you read through the scenario above, you can see that this algorithm depends on looking at two texts and comparing them word by word. You can solve this problem in multiple ways. First, it may be useful to `.split()` each text into lists of comma separated words to compare. Then, you can iterate through each word in the texts and compare them, adding to your value for LCS as you go. \n\nThe method I recommend for implementing an efficient LCS algorithm is: using a matrix and dynamic programming. **Dynamic programming** is all about breaking a larger problem into a smaller set of subproblems, and building up a complete result without having to repeat any subproblems. \n\nThis approach assumes that you can split up a large LCS task into a combination of smaller LCS tasks. Let's look at a simple example that compares letters:\n\n* A = \"ABCD\"\n* S = \"BD\"\n\nWe can see right away that the longest subsequence of _letters_ here is 2 (B and D are in sequence in both strings). And we can calculate this by looking at relationships between each letter in the two strings, A and S.\n\nHere, I have a matrix with the letters of A on top and the letters of S on the left side:\n\n<img src='notebook_ims/matrix_1.png' width=40% />\n\nThis starts out as a matrix that has as many columns and rows as letters in the strings S and O **+1** additional row and column, filled with zeros on the top and left sides. So, in this case, instead of a 2x4 matrix it is a 3x5.\n\nNow, we can fill this matrix up by breaking it into smaller LCS problems. For example, let's first look at the shortest substrings: the starting letter of A and S. We'll first ask, what is the Longest Common Subsequence between these two letters \"A\" and \"B\"? \n\n**Here, the answer is zero and we fill in the corresponding grid cell with that value.**\n\n<img src='notebook_ims/matrix_2.png' width=30% />\n\nThen, we ask the next question, what is the LCS between \"AB\" and \"B\"?\n\n**Here, we have a match, and can fill in the appropriate value 1**.\n\n<img src='notebook_ims/matrix_3_match.png' width=25% />\n\nIf we continue, we get to a final matrix that looks as follows, with a **2** in the bottom right corner.\n\n<img src='notebook_ims/matrix_6_complete.png' width=25% />\n\nThe final LCS will be that value **2** *normalized* by the number of n-grams in A. So, our normalized value is 2/4 = **0.5**.\n\n### The matrix rules\n\nOne thing to notice here is that, you can efficiently fill up this matrix one cell at a time. Each grid cell only depends on the values in the grid cells that are directly on top and to the left of it, or on the diagonal/top-left. The rules are as follows:\n* Start with a matrix that has one extra row and column of zeros.\n* As you traverse your string:\n * If there is a match, fill that grid cell with the value to the top-left of that cell *plus* one. So, in our case, when we found a matching B-B, we added +1 to the value in the top-left of the matching cell, 0.\n * If there is not a match, take the *maximum* value from either directly to the left or the top cell, and carry that value over to the non-match cell.\n\n<img src='notebook_ims/matrix_rules.png' width=50% />\n\nAfter completely filling the matrix, **the bottom-right cell will hold the non-normalized LCS value**.\n\nThis matrix treatment can be applied to a set of words instead of letters. Your function should apply this to the words in two texts and return the normalized LCS value.", "_____no_output_____" ] ], [ [ "# Compute the normalized LCS given an answer text and a source text\ndef lcs_norm_word(answer_text, source_text):\n '''Computes the longest common subsequence of words in two texts; returns a normalized value.\n :param answer_text: The pre-processed text for an answer text\n :param source_text: The pre-processed text for an answer's associated source text\n :return: A normalized LCS value'''\n \n # your code here\n # split strings into words\n answer = answer_text.lower().split()\n source = source_text.lower().split()\n # create a mtrix o zeros, with one additional row and one additional column\n matrix = np.zeros((len(answer) + 1, len(source) + 1))\n # iterate over all the word combinations\n for row_idx, answer_word in enumerate(answer):\n for col_idx, source_word in enumerate(source):\n # define coordinates where I'll write a new value\n # x and y are the column and row, respectively, where we'll write a new value\n # col_idx and row_idx refer to the elements we are comparing \n y = row_idx + 1\n x = col_idx + 1\n \n if answer_word == source_word:\n # diagonal addition, as stated above\n new_value = matrix[row_idx, col_idx] + 1\n else:\n # max of top/left values\n value_north = matrix[row_idx, x]\n value_west = matrix[y, col_idx]\n new_value = max((value_north, value_west))\n matrix[y, x] = new_value\n return matrix[-1][-1] / len(answer)", "_____no_output_____" ] ], [ [ "### Test cells\n\nLet's start by testing out your code on the example given in the initial description.\n\nIn the below cell, we have specified strings A (answer text) and S (original source text). We know that these texts have 20 words in common and the submitted answer is 27 words long, so the normalized, longest common subsequence should be 20/27.\n", "_____no_output_____" ] ], [ [ "# Run the test scenario from above\n# does your function return the expected value?\n\nA = \"i think pagerank is a link analysis algorithm used by google that uses a system of weights attached to each element of a hyperlinked set of documents\"\nS = \"pagerank is a link analysis algorithm used by the google internet search engine that assigns a numerical weighting to each element of a hyperlinked set of documents\"\n\n# calculate LCS\nlcs = lcs_norm_word(A, S)\nprint('LCS = ', lcs)\n\n\n# expected value test\nassert lcs==20/27., \"Incorrect LCS value, expected about 0.7408, got \"+str(lcs)\n\nprint('Test passed!')", "LCS = 0.7407407407407407\nTest passed!\n" ] ], [ [ "This next cell runs a more rigorous test.", "_____no_output_____" ] ], [ [ "# run test cell\n\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n# test lcs implementation\n# params: complete_df from before, and lcs_norm_word function\ntests.test_lcs(complete_df, lcs_norm_word)", "Tests Passed!\n" ] ], [ [ "Finally, take a look at a few resultant values for `lcs_norm_word`. Just like before, you should see that higher values correspond to higher levels of plagiarism.", "_____no_output_____" ] ], [ [ "# test on your own\ntest_indices = range(5) # look at first few files\n\ncategory_vals = []\nlcs_norm_vals = []\n# iterate through first few docs and calculate LCS\nfor i in test_indices:\n category_vals.append(complete_df.loc[i, 'Category'])\n # get texts to compare\n answer_text = complete_df.loc[i, 'Text'] \n task = complete_df.loc[i, 'Task']\n # we know that source texts have Class = -1\n orig_rows = complete_df[(complete_df['Class'] == -1)]\n orig_row = orig_rows[(orig_rows['Task'] == task)]\n source_text = orig_row['Text'].values[0]\n \n # calculate lcs\n lcs_val = lcs_norm_word(answer_text, source_text)\n lcs_norm_vals.append(lcs_val)\n\n# print out result, does it make sense?\nprint('Original category values: \\n', category_vals)\nprint()\nprint('Normalized LCS values: \\n', lcs_norm_vals)", "Original category values: \n [0, 3, 2, 1, 0]\n\nNormalized LCS values: \n [0.1917808219178082, 0.8207547169811321, 0.8464912280701754, 0.3160621761658031, 0.24257425742574257]\n" ] ], [ [ "---\n# Create All Features\n\nNow that you've completed the feature calculation functions, it's time to actually create multiple features and decide on which ones to use in your final model! In the below cells, you're provided two helper functions to help you create multiple features and store those in a DataFrame, `features_df`.\n\n### Creating multiple containment features\n\nYour completed `calculate_containment` function will be called in the next cell, which defines the helper function `create_containment_features`. \n\n> This function returns a list of containment features, calculated for a given `n` and for *all* files in a df (assumed to the the `complete_df`).\n\nFor our original files, the containment value is set to a special value, -1.\n\nThis function gives you the ability to easily create several containment features, of different n-gram lengths, for each of our text files.", "_____no_output_____" ] ], [ [ "\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n# Function returns a list of containment features, calculated for a given n \n# Should return a list of length 100 for all files in a complete_df\ndef create_containment_features(df, n, column_name=None):\n \n containment_values = []\n \n if(column_name==None):\n column_name = 'c_'+str(n) # c_1, c_2, .. c_n\n \n # iterates through dataframe rows\n for i in df.index:\n file = df.loc[i, 'File']\n # Computes features using calculate_containment function\n if df.loc[i,'Category'] > -1:\n c = calculate_containment(df, n, file)\n containment_values.append(c)\n # Sets value to -1 for original tasks \n else:\n containment_values.append(-1)\n \n print(str(n)+'-gram containment features created!')\n return containment_values\n", "_____no_output_____" ] ], [ [ "### Creating LCS features\n\nBelow, your complete `lcs_norm_word` function is used to create a list of LCS features for all the answer files in a given DataFrame (again, this assumes you are passing in the `complete_df`. It assigns a special value for our original, source files, -1.\n", "_____no_output_____" ] ], [ [ "\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n# Function creates lcs feature and add it to the dataframe\ndef create_lcs_features(df, column_name='lcs_word'):\n \n lcs_values = []\n \n # iterate through files in dataframe\n for i in df.index:\n # Computes LCS_norm words feature using function above for answer tasks\n if df.loc[i,'Category'] > -1:\n # get texts to compare\n answer_text = df.loc[i, 'Text'] \n task = df.loc[i, 'Task']\n # we know that source texts have Class = -1\n orig_rows = df[(df['Class'] == -1)]\n orig_row = orig_rows[(orig_rows['Task'] == task)]\n source_text = orig_row['Text'].values[0]\n\n # calculate lcs\n lcs = lcs_norm_word(answer_text, source_text)\n lcs_values.append(lcs)\n # Sets to -1 for original tasks \n else:\n lcs_values.append(-1)\n\n print('LCS features created!')\n return lcs_values\n ", "_____no_output_____" ] ], [ [ "## EXERCISE: Create a features DataFrame by selecting an `ngram_range`\n\nThe paper suggests calculating the following features: containment *1-gram to 5-gram* and *longest common subsequence*. \n> In this exercise, you can choose to create even more features, for example from *1-gram to 7-gram* containment features and *longest common subsequence*. \n\nYou'll want to create at least 6 features to choose from as you think about which to give to your final, classification model. Defining and comparing at least 6 different features allows you to discard any features that seem redundant, and choose to use the best features for your final model!\n\nIn the below cell **define an n-gram range**; these will be the n's you use to create n-gram containment features. The rest of the feature creation code is provided.", "_____no_output_____" ] ], [ [ "# Define an ngram range\nngram_range = range(1,10)\n\n\n# The following code may take a minute to run, depending on your ngram_range\n\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\nfeatures_list = []\n\n# Create features in a features_df\nall_features = np.zeros((len(ngram_range)+1, len(complete_df)))\n\n# Calculate features for containment for ngrams in range\ni=0\nfor n in ngram_range:\n column_name = 'c_'+str(n)\n features_list.append(column_name)\n # create containment features\n all_features[i]=np.squeeze(create_containment_features(complete_df, n))\n i+=1\n\n# Calculate features for LCS_Norm Words \nfeatures_list.append('lcs_word')\nall_features[i]= np.squeeze(create_lcs_features(complete_df))\n\n# create a features dataframe\nfeatures_df = pd.DataFrame(np.transpose(all_features), columns=features_list)\n\n# Print all features/columns\nprint()\nprint('Features: ', features_list)\nprint()", "1-gram containment features created!\n2-gram containment features created!\n3-gram containment features created!\n4-gram containment features created!\n5-gram containment features created!\n6-gram containment features created!\n7-gram containment features created!\n8-gram containment features created!\n9-gram containment features created!\nLCS features created!\n\nFeatures: ['c_1', 'c_2', 'c_3', 'c_4', 'c_5', 'c_6', 'c_7', 'c_8', 'c_9', 'lcs_word']\n\n" ], [ "# print some results \nfeatures_df.head(10)", "_____no_output_____" ] ], [ [ "## Correlated Features\n\nYou should use feature correlation across the *entire* dataset to determine which features are ***too*** **highly-correlated** with each other to include both features in a single model. For this analysis, you can use the *entire* dataset due to the small sample size we have. \n\nAll of our features try to measure the similarity between two texts. Since our features are designed to measure similarity, it is expected that these features will be highly-correlated. Many classification models, for example a Naive Bayes classifier, rely on the assumption that features are *not* highly correlated; highly-correlated features may over-inflate the importance of a single feature. \n\nSo, you'll want to choose your features based on which pairings have the lowest correlation. These correlation values range between 0 and 1; from low to high correlation, and are displayed in a [correlation matrix](https://www.displayr.com/what-is-a-correlation-matrix/), below.", "_____no_output_____" ] ], [ [ "\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n# Create correlation matrix for just Features to determine different models to test\ncorr_matrix = features_df.corr().abs().round(2)\n\n# display shows all of a dataframe\ndisplay(corr_matrix)", "_____no_output_____" ] ], [ [ "## EXERCISE: Create selected train/test data\n\nComplete the `train_test_data` function below. This function should take in the following parameters:\n* `complete_df`: A DataFrame that contains all of our processed text data, file info, datatypes, and class labels\n* `features_df`: A DataFrame of all calculated features, such as containment for ngrams, n= 1-5, and lcs values for each text file listed in the `complete_df` (this was created in the above cells)\n* `selected_features`: A list of feature column names, ex. `['c_1', 'lcs_word']`, which will be used to select the final features in creating train/test sets of data.\n\nIt should return two tuples:\n* `(train_x, train_y)`, selected training features and their corresponding class labels (0/1)\n* `(test_x, test_y)`, selected training features and their corresponding class labels (0/1)\n\n** Note: x and y should be arrays of feature values and numerical class labels, respectively; not DataFrames.**\n\nLooking at the above correlation matrix, you should decide on a **cutoff** correlation value, less than 1.0, to determine which sets of features are *too* highly-correlated to be included in the final training and test data. If you cannot find features that are less correlated than some cutoff value, it is suggested that you increase the number of features (longer n-grams) to choose from or use *only one or two* features in your final model to avoid introducing highly-correlated features.\n\nRecall that the `complete_df` has a `Datatype` column that indicates whether data should be `train` or `test` data; this should help you split the data appropriately.", "_____no_output_____" ] ], [ [ "# Takes in dataframes and a list of selected features (column names) \n# and returns (train_x, train_y), (test_x, test_y)\ndef train_test_data(complete_df, features_df, selected_features):\n '''Gets selected training and test features from given dataframes, and \n returns tuples for training and test features and their corresponding class labels.\n :param complete_df: A dataframe with all of our processed text data, datatypes, and labels\n :param features_df: A dataframe of all computed, similarity features\n :param selected_features: An array of selected features that correspond to certain columns in `features_df`\n :return: training and test features and labels: (train_x, train_y), (test_x, test_y)'''\n # assume all dataframes are in exactly the same order\n # get indexes of training and testing features\n train_df = complete_df.loc[(complete_df['Datatype'] == \"train\")]\n test_df = complete_df.loc[(complete_df['Datatype'] == \"test\")]\n \n train_indexes = train_df.index.tolist()\n test_indexes = test_df.index.tolist()\n \n # get the training features\n train_x = features_df[selected_features].iloc[train_indexes].to_numpy()\n # And training class labels (0 or 1)\n train_y = complete_df.iloc[train_indexes]['Class'].to_numpy()\n \n # get the test features and labels\n test_x = features_df[selected_features].iloc[test_indexes].to_numpy()\n test_y = complete_df.iloc[test_indexes]['Class'].to_numpy()\n \n return (train_x, train_y), (test_x, test_y)\n ", "_____no_output_____" ] ], [ [ "### Test cells\n\nBelow, test out your implementation and create the final train/test data.", "_____no_output_____" ] ], [ [ "\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\ntest_selection = list(features_df)[:2] # first couple columns as a test\n# test that the correct train/test data is created\n(train_x, train_y), (test_x, test_y) = train_test_data(complete_df, features_df, test_selection)\n\n# params: generated train/test data\ntests.test_data_split(train_x, train_y, test_x, test_y)", "Tests Passed!\n" ] ], [ [ "## EXERCISE: Select \"good\" features\n\nIf you passed the test above, you can create your own train/test data, below. \n\nDefine a list of features you'd like to include in your final mode, `selected_features`; this is a list of the features names you want to include.", "_____no_output_____" ] ], [ [ "# Select your list of features, this should be column names from features_df\n# ex. ['c_1', 'lcs_word']\nselected_features = ['c_1', 'c_9', 'lcs_word']\n\n\n\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n\n(train_x, train_y), (test_x, test_y) = train_test_data(complete_df, features_df, selected_features)\n\n# check that division of samples seems correct\n# these should add up to 95 (100 - 5 original files)\nprint('Training size: ', len(train_x))\nprint('Test size: ', len(test_x))\nprint()\nprint('Training df sample: \\n', train_x[:10])", "Training size: 70\nTest size: 25\n\nTraining df sample: \n [[0.39814815 0. 0.19178082]\n [0.86936937 0.21962617 0.84649123]\n [0.59358289 0.01117318 0.31606218]\n [0.54450262 0. 0.24257426]\n [0.32950192 0. 0.16117216]\n [0.59030837 0. 0.30165289]\n [0.75977654 0.07017544 0.48430493]\n [0.51612903 0. 0.27083333]\n [0.44086022 0. 0.22395833]\n [0.97945205 0.60869565 0.9 ]]\n" ] ], [ [ "### Question 2: How did you decide on which features to include in your final model? ", "_____no_output_____" ], [ "**Answer:**\nBy checking the correlation matrix we created, I selected two variables that are not strongly correlated (0.86), plus the wordLCS.", "_____no_output_____" ], [ "---\n## Creating Final Data Files\n\nNow, you are almost ready to move on to training a model in SageMaker!\n\nYou'll want to access your train and test data in SageMaker and upload it to S3. In this project, SageMaker will expect the following format for your train/test data:\n* Training and test data should be saved in one `.csv` file each, ex `train.csv` and `test.csv`\n* These files should have class labels in the first column and features in the rest of the columns\n\nThis format follows the practice, outlined in the [SageMaker documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-training.html), which reads: \"Amazon SageMaker requires that a CSV file doesn't have a header record and that the target variable [class label] is in the first column.\"\n\n## EXERCISE: Create csv files\n\nDefine a function that takes in x (features) and y (labels) and saves them to one `.csv` file at the path `data_dir/filename`.\n\nIt may be useful to use pandas to merge your features and labels into one DataFrame and then convert that into a csv file. You can make sure to get rid of any incomplete rows, in a DataFrame, by using `dropna`.", "_____no_output_____" ] ], [ [ "def make_csv(x, y, filename, data_dir):\n '''Merges features and labels and converts them into one csv file with labels in the first column.\n :param x: Data features\n :param y: Data labels\n :param file_name: Name of csv file, ex. 'train.csv'\n :param data_dir: The directory where files will be saved\n '''\n # make data dir, if it does not exist\n if not os.path.exists(data_dir):\n os.makedirs(data_dir)\n \n complete_path = os.path.join(data_dir, filename)\n # your code here\n df = pd.concat((pd.DataFrame(y),pd.DataFrame(x)), axis=1).dropna()\n df.to_csv(path_or_buf=complete_path,\n index=False,\n header=False)\n print(df)\n # nothing is returned, but a print statement indicates that the function has run\n print('Path created: '+str(data_dir)+'/'+str(filename))", "_____no_output_____" ] ], [ [ "### Test cells\n\nTest that your code produces the correct format for a `.csv` file, given some text features and labels.", "_____no_output_____" ] ], [ [ "\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\nfake_x = [ [0.39814815, 0.0001, 0.19178082], \n [0.86936937, 0.44954128, 0.84649123], \n [0.44086022, 0., 0.22395833] ]\n\nfake_y = [0, 1, 1]\n\nmake_csv(fake_x, fake_y, filename='to_delete.csv', data_dir='test_csv')\n\n# read in and test dimensions\nfake_df = pd.read_csv('test_csv/to_delete.csv', header=None)\n\n# check shape\nassert fake_df.shape==(3, 4), \\\n 'The file should have as many rows as data_points and as many columns as features+1 (for indices).'\n# check that first column = labels\nassert np.all(fake_df.iloc[:,0].values==fake_y), 'First column is not equal to the labels, fake_y.'\nprint('Tests passed!')", " 0 0 1 2\n0 0 0.398148 0.000100 0.191781\n1 1 0.869369 0.449541 0.846491\n2 1 0.440860 0.000000 0.223958\nPath created: test_csv/to_delete.csv\nTests passed!\n" ], [ "# delete the test csv file, generated above\n! rm -rf test_csv", "_____no_output_____" ] ], [ [ "If you've passed the tests above, run the following cell to create `train.csv` and `test.csv` files in a directory that you specify! This will save the data in a local directory. Remember the name of this directory because you will reference it again when uploading this data to S3.", "_____no_output_____" ] ], [ [ "# can change directory, if you want\ndata_dir = 'plagiarism_data'\n\n\"\"\"\nDON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE\n\"\"\"\n\nmake_csv(train_x, train_y, filename='train.csv', data_dir=data_dir)\nmake_csv(test_x, test_y, filename='test.csv', data_dir=data_dir)", " 0 0 1 2\n0 0 0.398148 0.000000 0.191781\n1 1 0.869369 0.219626 0.846491\n2 1 0.593583 0.011173 0.316062\n3 0 0.544503 0.000000 0.242574\n4 0 0.329502 0.000000 0.161172\n.. .. ... ... ...\n65 1 0.845188 0.225108 0.643725\n66 1 0.485000 0.000000 0.242718\n67 1 0.950673 0.702326 0.839506\n68 1 0.551220 0.187817 0.283019\n69 0 0.361257 0.000000 0.161765\n\n[70 rows x 4 columns]\nPath created: plagiarism_data/train.csv\n 0 0 1 2\n0 1 1.000000 0.835979 0.820755\n1 1 0.765306 0.454545 0.621711\n2 1 0.884444 0.064516 0.597458\n3 1 0.619048 0.000000 0.427835\n4 1 0.920000 0.179104 0.775000\n5 1 0.992674 0.958491 0.993056\n6 0 0.412698 0.000000 0.346667\n7 0 0.462687 0.000000 0.189320\n8 0 0.581152 0.000000 0.247423\n9 0 0.584211 0.000000 0.294416\n10 0 0.566372 0.000000 0.258333\n11 0 0.481481 0.000000 0.278912\n12 1 0.619792 0.005435 0.341584\n13 1 0.921739 0.463964 0.929412\n14 1 1.000000 0.842520 1.000000\n15 1 0.861538 0.000000 0.504717\n16 1 0.626168 0.067093 0.558559\n17 1 1.000000 0.936759 0.996700\n18 0 0.383838 0.000000 0.178744\n19 1 1.000000 0.883895 0.854671\n20 0 0.613924 0.000000 0.298343\n21 1 0.972763 0.694779 0.927083\n22 1 0.962810 0.495726 0.909804\n23 0 0.415254 0.000000 0.177419\n24 0 0.532189 0.000000 0.245833\nPath created: plagiarism_data/test.csv\n" ] ], [ [ "## Up Next\n\nNow that you've done some feature engineering and created some training and test data, you are ready to train and deploy a plagiarism classification model. The next notebook will utilize SageMaker resources to train and test a model that you design.", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ] ]
e7e4780a0a4d431e23d91bef812de0cdfbc7d316
40,139
ipynb
Jupyter Notebook
Bloque 1 - Ramp-Up/06_Estadística/01_Probabilidad y Estadística descriptiva/06_Ejercicios.ipynb
franciscocanon-thebridge/bootcamp_thebridge_PTSep20
e81cbdcb9254fa46a3925f41c583748e25b459c0
[ "MIT" ]
null
null
null
Bloque 1 - Ramp-Up/06_Estadística/01_Probabilidad y Estadística descriptiva/06_Ejercicios.ipynb
franciscocanon-thebridge/bootcamp_thebridge_PTSep20
e81cbdcb9254fa46a3925f41c583748e25b459c0
[ "MIT" ]
null
null
null
Bloque 1 - Ramp-Up/06_Estadística/01_Probabilidad y Estadística descriptiva/06_Ejercicios.ipynb
franciscocanon-thebridge/bootcamp_thebridge_PTSep20
e81cbdcb9254fa46a3925f41c583748e25b459c0
[ "MIT" ]
1
2021-01-23T10:37:15.000Z
2021-01-23T10:37:15.000Z
34.994769
914
0.47328
[ [ [ "## Jugando con Probabilidades y Python\n\n\n### La coincidencia de cumpleaños\n\nAquí vemos la solución de la paradija del cumpleaños que vimos en el apartado de proabilidad.\n\nLa [paradoja del cumpleaños](https://es.wikipedia.org/wiki/Paradoja_del_cumplea%C3%B1os) es un problema muy conocido en el campo de la probabilidad. Plantea las siguientes interesantes preguntas: ¿Cuál es la probabilidad de que, en un grupo de personas elegidas al azar, al menos dos de ellas habrán nacido el mismo día del año? ¿Cuántas personas son necesarias para asegurar una probabilidad mayor al 50%?. \n\nCalcular esa probabilidad es complicado, así que vamos a calcular la probabilidad de que no coincidad, suponinedo que con eventos independietes (es decir las podemos multiplicar), y luego calcularemos la probabilidad de que coincidan como 1 menos esa probabilidad. \n\nExcluyendo el 29 de febrero de nuestros cálculos y asumiendo que los restantes 365 días de posibles cumpleaños son igualmente probables, vamos a calcular esas dós cuestiones.", "_____no_output_____" ] ], [ [ "# Ejemplo situación 2 La coincidencia de cumpleaños\n\nprob = 1.0\nasistentes = 50\n\n# Calculamos el número de asistentes necesarios para asegurar \n# que la probabilidad de coincidencia sea mayor del 50%\n# asistentes = 50\nasistentes = 1\n \nprob = 1\n\nwhile 1 - prob <= 0.5:\n asistentes += 1\n prob = prob * (365 - (asistentes - 1))/365\n probabilidad_coincidir = 1 - prob\nprint(probabilidad_coincidir)\n\nprint(\"Para asegurar que la probabilidad es mayor del 50% necesitamos {0} asistentes\".format(asistentes))", "0.5072972343239855\nPara asegurar que la probabilidad es mayor del 50% necesitamos 23 asistentes\n" ] ], [ [ "## Variables aleatorias. Vamos a tirar un dado\n\nVamos a trabajar con variables discretas, y en este caso vamos a vamos a reproducir un dado con la librería `random` que forma parte de la librería estandar de Python:", "_____no_output_____" ] ], [ [ "# importa la libreria random. puedes utilizar dir() para entender lo que ofrece\n", "_____no_output_____" ], [ "# utiliza help para obtener ayuda sobre el metodo randint\n", "_____no_output_____" ], [ "# utiliza randint() para simular un dado y haz una tirada\n", "_____no_output_____" ], [ "# ahora haz 20 tiradas, y crea una lista con las tiradas\n", "_____no_output_____" ], [ "# Vamos a calcular la media de las tiradas\n", "_____no_output_____" ], [ "# Calcula ahora la mediana\n", "_____no_output_____" ], [ "# Calcula la moda de las tiradas \n", "_____no_output_____" ], [ "# se te ocurre otra forma de calcularla?\na = [2, -9, -9, 2]\nfrom scipy import stats\nstats.mode(a).mode", "_____no_output_____" ] ], [ [ "## Viendo como evoluciona el número de 6 cuando sacamos más jugadas\n\nVamos a ver ahora como evoluciona el número de seises que obtenemos al lanzar el dado 10000 veces. Vamos a crear una lista en la que cada elemento sea el número de ocurrencias del número 6 dividido entre el número de lanzamientos. \n\ncrea una lista llamadada ``frecuencia_seis[]`` que almacene estos valores \n", "_____no_output_____" ] ], [ [ "\n", "_____no_output_____" ] ], [ [ "### Vamos a tratar de hacerlo gráficamente\n¿Hacia que valor debería converger los números que forman la lista frecuencia_seis? \nRevisa la ley de los grandes números para la moneda, y aplica un poco de lógica para este caso.\n", "_____no_output_____" ] ], [ [ "", "_____no_output_____" ] ], [ [ "# Resolviendo el problema de Monty Hall\n\nEste problema, más conocido con el nombre de [Monty Hall](https://es.wikipedia.org/wiki/Problema_de_Monty_Hall).\nEn primer lugar trata de simular el problema de Monty Hall con Python, para ver cuantas veces gana el concursante y cuantas pierde. Realiza por ejemplo 10000 simulaciones del problema, en las que el usuario cambia siempre de puerta. Después puedes comparar con 10000 simulaciones en las que el usuario no cambie de puertas.\nCuales son los resultados?\n", "_____no_output_____" ], [ "### Monty Hall sin Bayes - Simulación", "_____no_output_____" ] ], [ [ "", "_____no_output_____" ], [ "", "_____no_output_____" ] ], [ [ "## Monthy Hall - una aproximación bayesiana\n\nTrata de resolver ahora el problema de Monthy Hall utilizando el teorema de Bayes.\nPuedes escribir la solución, o programar el código. Lo que prefieras.", "_____no_output_____" ] ], [ [ "", "_____no_output_____" ] ], [ [ "# El problema de las Cookies\n\nImagina que tienes 2 botes con galletas. El primero contiene 30 cookies de vainilla y 10 cookies de chocolate. El segundo bote tiene 20 cookies de chocolate y 20 cookies de vainilla.\n\nAhora vamos a suponer que sacamos un cookie sin ver de que bote lo sacamos. El cookie es de vainilla. ¿Cuál es la probabilidad de que el cookie venga del primer bote?\n", "_____no_output_____" ] ], [ [ "", "_____no_output_____" ] ], [ [ "## El problema de los M&Ms \n\nEn 1995 M&Ms lanzó los M&M’s azules. \n\n- Antes de ese año la distibución de una bolsa era: 30% Marrones, 20% Amarillos, 20% Rojos, 10% Verdes, 10% Naranjas, 10% Marron Claros. \n- Después de 1995 la distribución en una bolsa era la siguiente: 24% Azul , 20% Verde, 16% Naranjas, 14% Amarillos, 13% Rojos, 13% Marrones\n\nSin saber qué bolsa es cúal, sacas un M&Ms al azar de cada bolsa. Una es amarilla y otra es verde. ¿Cuál es la probabilidad de que la bolsa de la que salió el caramelo amarillo sea una bolsa de 1994?\n\nPista: Para calcular la probabilidad a posteriori (likelihoods), tienes que multiplicar las probabilidades de sacar un amarillo de una bolsa y un verde de la otra, y viceversa.\n\n\n¿Cuál es la probabilidad de que el caramelo amarillo viniera de una bolsa de 1996?\n", "_____no_output_____" ] ], [ [ "", "_____no_output_____" ] ], [ [ "# Creando un clasificador basado en el teorema de Bayes", "_____no_output_____" ], [ "Este es un problema extraido de la página web de Chris Albon, que ha replicado un ejemplo que puedes ver en la wikipedia. Trata de reproducirlo y entenderlo. \n\nNaive bayes is simple classifier known for doing well when only a small number of observations is available. In this tutorial we will create a gaussian naive bayes classifier from scratch and use it to predict the class of a previously unseen data point. This tutorial is based on an example on Wikipedia's [naive bayes classifier page](https://en.wikipedia.org/wiki/Naive_Bayes_classifier), I have implemented it in Python and tweaked some notation to improve explanation. ", "_____no_output_____" ], [ "## Preliminaries", "_____no_output_____" ] ], [ [ "import pandas as pd\nimport numpy as np", "_____no_output_____" ] ], [ [ "## Create Data\n\nOur dataset is contains data on eight individuals. We will use the dataset to construct a classifier that takes in the height, weight, and foot size of an individual and outputs a prediction for their gender.", "_____no_output_____" ] ], [ [ "# Create an empty dataframe\ndata = pd.DataFrame()\n\n# Create our target variable\ndata['Gender'] = ['male','male','male','male','female','female','female','female']\n\n# Create our feature variables\ndata['Height'] = [6,5.92,5.58,5.92,5,5.5,5.42,5.75]\ndata['Weight'] = [180,190,170,165,100,150,130,150]\ndata['Foot_Size'] = [12,11,12,10,6,8,7,9]\n\n# View the data\ndata", "_____no_output_____" ] ], [ [ "The dataset above is used to construct our classifier. Below we will create a new person for whom we know their feature values but not their gender. Our goal is to predict their gender.", "_____no_output_____" ] ], [ [ "# Create an empty dataframe\nperson = pd.DataFrame()\n\n# Create some feature values for this single row\nperson['Height'] = [6]\nperson['Weight'] = [130]\nperson['Foot_Size'] = [8]\n\n# View the data \nperson", "_____no_output_____" ] ], [ [ "## Bayes Theorem", "_____no_output_____" ], [ "Bayes theorem is a famous equation that allows us to make predictions based on data. Here is the classic version of the Bayes theorem:\n\n$$\\displaystyle P(A\\mid B)={\\frac {P(B\\mid A)\\,P(A)}{P(B)}}$$\n\nThis might be too abstract, so let us replace some of the variables to make it more concrete. In a bayes classifier, we are interested in finding out the class (e.g. male or female, spam or ham) of an observation _given_ the data:\n\n$$p(\\text{class} \\mid \\mathbf {\\text{data}} )={\\frac {p(\\mathbf {\\text{data}} \\mid \\text{class}) * p(\\text{class})}{p(\\mathbf {\\text{data}} )}}$$\n\nwhere: \n\n- $\\text{class}$ is a particular class (e.g. male)\n- $\\mathbf {\\text{data}}$ is an observation's data\n- $p(\\text{class} \\mid \\mathbf {\\text{data}} )$ is called the posterior\n- $p(\\text{data|class})$ is called the likelihood\n- $p(\\text{class})$ is called the prior\n- $p(\\mathbf {\\text{data}} )$ is called the marginal probability\n\nIn a bayes classifier, we calculate the posterior (technically we only calculate the numerator of the posterior, but ignore that for now) for every class for each observation. Then, classify the observation based on the class with the largest posterior value. In our example, we have one observation to predict and two possible classes (e.g. male and female), therefore we will calculate two posteriors: one for male and one for female.\n\n$$p(\\text{person is male} \\mid \\mathbf {\\text{person's data}} )={\\frac {p(\\mathbf {\\text{person's data}} \\mid \\text{person is male}) * p(\\text{person is male})}{p(\\mathbf {\\text{person's data}} )}}$$\n\n$$p(\\text{person is female} \\mid \\mathbf {\\text{person's data}} )={\\frac {p(\\mathbf {\\text{person's data}} \\mid \\text{person is female}) * p(\\text{person is female})}{p(\\mathbf {\\text{person's data}} )}}$$", "_____no_output_____" ], [ "## Gaussian Naive Bayes Classifier", "_____no_output_____" ], [ "A gaussian naive bayes is probably the most popular type of bayes classifier. To explain what the name means, let us look at what the bayes equations looks like when we apply our two classes (male and female) and three feature variables (height, weight, and footsize):\n\n$${\\displaystyle {\\text{posterior (male)}}={\\frac {P({\\text{male}})\\,p({\\text{height}}\\mid{\\text{male}})\\,p({\\text{weight}}\\mid{\\text{male}})\\,p({\\text{foot size}}\\mid{\\text{male}})}{\\text{marginal probability}}}}$$\n\n$${\\displaystyle {\\text{posterior (female)}}={\\frac {P({\\text{female}})\\,p({\\text{height}}\\mid{\\text{female}})\\,p({\\text{weight}}\\mid{\\text{female}})\\,p({\\text{foot size}}\\mid{\\text{female}})}{\\text{marginal probability}}}}$$\n\nNow let us unpack the top equation a bit:\n\n- $P({\\text{male}})$ is the prior probabilities. It is, as you can see, simply the probability an observation is male. This is just the number of males in the dataset divided by the total number of people in the dataset.\n- $p({\\text{height}}\\mid{\\text{female}})\\,p({\\text{weight}}\\mid{\\text{female}})\\,p({\\text{foot size}}\\mid{\\text{female}})$ is the likelihood. Notice that we have unpacked $\\mathbf {\\text{person's data}}$ so it is now every feature in the dataset. The \"gaussian\" and \"naive\" come from two assumptions present in this likelihood:\n 1. If you look each term in the likelihood you will notice that we assume each feature is uncorrelated from each other. That is, foot size is independent of weight or height etc.. This is obviously not true, and is a \"naive\" assumption - hence the name \"naive bayes.\"\n 2. Second, we assume have that the value of the features (e.g. the height of women, the weight of women) are normally (gaussian) distributed. This means that $p(\\text{height}\\mid\\text{female})$ is calculated by inputing the required parameters into the probability density function of the normal distribution: \n\n$$ \np(\\text{height}\\mid\\text{female})=\\frac{1}{\\sqrt{2\\pi\\text{variance of female height in the data}}}\\,e^{ -\\frac{(\\text{observation's height}-\\text{average height of females in the data})^2}{2\\text{variance of female height in the data}} }\n$$\n\n- $\\text{marginal probability}$ is probably one of the most confusing parts of bayesian approaches. In toy examples (including ours) it is completely possible to calculate the marginal probability. However, in many real-world cases, it is either extremely difficult or impossible to find the value of the marginal probability (explaining why is beyond the scope of this tutorial). This is not as much of a problem for our classifier as you might think. Why? Because we don't care what the true posterior value is, we only care which class has a the highest posterior value. And because the marginal probability is the same for all classes 1) we can ignore the denominator, 2) calculate only the posterior's numerator for each class, and 3) pick the largest numerator. That is, we can ignore the posterior's denominator and make a prediction solely on the relative values of the posterior's numerator.\n\nOkay! Theory over. Now let us start calculating all the different parts of the bayes equations.", "_____no_output_____" ], [ "## Calculate Priors", "_____no_output_____" ], [ "Priors can be either constants or probability distributions. In our example, this is simply the probability of being a gender. Calculating this is simple:", "_____no_output_____" ] ], [ [ "# Number of males\nn_male = data['Gender'][data['Gender'] == 'male'].count()\n\n# Number of males\nn_female = data['Gender'][data['Gender'] == 'female'].count()\n\n# Total rows\ntotal_ppl = data['Gender'].count()", "_____no_output_____" ], [ "# Number of males divided by the total rows\nP_male = n_male/total_ppl\n\n# Number of females divided by the total rows\nP_female = n_female/total_ppl", "_____no_output_____" ] ], [ [ "## Calculate Likelihood", "_____no_output_____" ], [ "Remember that each term (e.g. $p(\\text{height}\\mid\\text{female})$) in our likelihood is assumed to be a normal pdf. For example:\n\n$$ \np(\\text{height}\\mid\\text{female})=\\frac{1}{\\sqrt{2\\pi\\text{variance of female height in the data}}}\\,e^{ -\\frac{(\\text{observation's height}-\\text{average height of females in the data})^2}{2\\text{variance of female height in the data}} }\n$$\n\nThis means that for each class (e.g. female) and feature (e.g. height) combination we need to calculate the variance and mean value from the data. Pandas makes this easy:", "_____no_output_____" ] ], [ [ "# Group the data by gender and calculate the means of each feature\ndata_means = data.groupby('Gender').mean()\n\n# View the values\ndata_means", "_____no_output_____" ], [ "# Group the data by gender and calculate the variance of each feature\ndata_variance = data.groupby('Gender').var()\n\n# View the values\ndata_variance", "_____no_output_____" ] ], [ [ "Now we can create all the variables we need. The code below might look complex but all we are doing is creating a variable out of each cell in both of the tables above.", "_____no_output_____" ] ], [ [ "# Means for male\nmale_height_mean = data_means['Height'][data_variance.index == 'male'].values[0]\nprint(male_height_mean)\nmale_weight_mean = data_means['Weight'][data_variance.index == 'male'].values[0]\nmale_footsize_mean = data_means['Foot_Size'][data_variance.index == 'male'].values[0]\n\n# Variance for male\nmale_height_variance = data_variance['Height'][data_variance.index == 'male'].values[0]\nmale_weight_variance = data_variance['Weight'][data_variance.index == 'male'].values[0]\nmale_footsize_variance = data_variance['Foot_Size'][data_variance.index == 'male'].values[0]\n\n# Means for female\nfemale_height_mean = data_means['Height'][data_variance.index == 'female'].values[0]\nfemale_weight_mean = data_means['Weight'][data_variance.index == 'female'].values[0]\nfemale_footsize_mean = data_means['Foot_Size'][data_variance.index == 'female'].values[0]\n\n# Variance for female\nfemale_height_variance = data_variance['Height'][data_variance.index == 'female'].values[0]\nfemale_weight_variance = data_variance['Weight'][data_variance.index == 'female'].values[0]\nfemale_footsize_variance = data_variance['Foot_Size'][data_variance.index == 'female'].values[0]", "5.855\n" ] ], [ [ "Finally, we need to create a function to calculate the probability density of each of the terms of the likelihood (e.g. $p(\\text{height}\\mid\\text{female})$).", "_____no_output_____" ] ], [ [ "# Create a function that calculates p(x | y):\ndef p_x_given_y(x, mean_y, variance_y):\n\n # Input the arguments into a probability density function\n p = 1/(np.sqrt(2*np.pi*variance_y)) * np.exp((-(x-mean_y)**2)/(2*variance_y))\n \n # return p\n return p", "_____no_output_____" ] ], [ [ "## Apply Bayes Classifier To New Data Point", "_____no_output_____" ], [ "Alright! Our bayes classifier is ready. Remember that since we can ignore the marginal probability (the demoninator), what we are actually calculating is this:\n\n$${\\displaystyle {\\text{numerator of the posterior}}={P({\\text{female}})\\,p({\\text{height}}\\mid{\\text{female}})\\,p({\\text{weight}}\\mid{\\text{female}})\\,p({\\text{foot size}}\\mid{\\text{female}})}{}}$$\n\nTo do this, we just need to plug in the values of the unclassified person (height = 6), the variables of the dataset (e.g. mean of female height), and the function (`p_x_given_y`) we made above:", "_____no_output_____" ] ], [ [ "# Numerator of the posterior if the unclassified observation is a male\nP_male * \\\np_x_given_y(person['Height'][0], male_height_mean, male_height_variance) * \\\np_x_given_y(person['Weight'][0], male_weight_mean, male_weight_variance) * \\\np_x_given_y(person['Foot_Size'][0], male_footsize_mean, male_footsize_variance)", "_____no_output_____" ], [ "# Numerator of the posterior if the unclassified observation is a female\nP_female * \\\np_x_given_y(person['Height'][0], female_height_mean, female_height_variance) * \\\np_x_given_y(person['Weight'][0], female_weight_mean, female_weight_variance) * \\\np_x_given_y(person['Foot_Size'][0], female_footsize_mean, female_footsize_variance)", "_____no_output_____" ] ], [ [ "Because the numerator of the posterior for female is greater than male, then we predict that the person is female.", "_____no_output_____" ], [ "Crea un nuevo punto con tus datos y predice su resultado (fíjate en las unidades)", "_____no_output_____" ] ], [ [ "", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ] ]
e7e48ef46cd8aeb5c7fc8aee41c5ea126a1d2eea
538,515
ipynb
Jupyter Notebook
ANN_moreFeatures.ipynb
F3rdixX/Basketball_BBL
cfec47a6efb66e309cc47343e36e3517136314f2
[ "MIT" ]
null
null
null
ANN_moreFeatures.ipynb
F3rdixX/Basketball_BBL
cfec47a6efb66e309cc47343e36e3517136314f2
[ "MIT" ]
null
null
null
ANN_moreFeatures.ipynb
F3rdixX/Basketball_BBL
cfec47a6efb66e309cc47343e36e3517136314f2
[ "MIT" ]
null
null
null
62.019463
26,356
0.367212
[ [ [ "import keras\n", "Using TensorFlow backend.\n" ] ], [ [ "# Data Set Preprocessing\n", "_____no_output_____" ] ], [ [ "import urllib.request, json \nwith urllib.request.urlopen(\"http://statistik.easycredit-bbl.de/XML/exchange/540/Schedule.php?type=json&saison=2017&fixedGamesOnly=0\") as url:\n games = json.loads(url.read().decode())\n print(json.dumps(games, indent=4, sort_keys=True))\n ", "{\n \"competition\": [\n {\n \"@attributes\": {\n \"ID\": \"1\",\n \"title\": \"easyCredit BBL Hauptrunde\"\n },\n \"spiel\": [\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20826\",\n \"datum\": \"2017-09-29\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"73\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"76\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20826.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20826.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20827\",\n \"datum\": \"2017-09-29\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"68\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20827.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20827.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2316\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20828\",\n \"datum\": \"2017-09-29\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"82\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20828.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20828.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2071\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20829\",\n \"datum\": \"2017-09-30\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"72\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"68\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20829.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20829.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20830\",\n \"datum\": \"2017-09-30\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"93\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20830.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20830.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"2703\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20831\",\n \"datum\": \"2017-09-30\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"87\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"53\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20831.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20831.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3618\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20832\",\n \"datum\": \"2017-09-30\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"87\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"77\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20832.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20832.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2850\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20833\",\n \"datum\": \"2017-09-30\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"69\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20833.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20833.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2500\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20915\",\n \"datum\": \"2017-10-02\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"66\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"64\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20915.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20915.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"8877\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20837\",\n \"datum\": \"2017-10-03\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"84\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20837.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20837.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20838\",\n \"datum\": \"2017-10-03\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"80\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20838.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20838.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"4640\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20839\",\n \"datum\": \"2017-10-03\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"81\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20839.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20839.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2292\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20840\",\n \"datum\": \"2017-10-03\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"74\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20840.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20840.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3211\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20841\",\n \"datum\": \"2017-10-03\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"53\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"111\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20841.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20841.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6123\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20836\",\n \"datum\": \"2017-10-03\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"94\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20836.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20836.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2465\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20842\",\n \"datum\": \"2017-10-04\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"74\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"86\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20842.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20842.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"4670\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20843\",\n \"datum\": \"2017-10-05\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"98\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"77\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20843.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20843.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2480\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20835\",\n \"datum\": \"2017-10-06\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"63\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"99\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20835.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20835.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"7543\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20862\",\n \"datum\": \"2017-10-06\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"92\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"64\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20862.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20862.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2391\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20845\",\n \"datum\": \"2017-10-07\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"78\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20845.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20845.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"16:00:00\",\n \"zuschauer\": \"3125\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20844\",\n \"datum\": \"2017-10-07\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"84\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20844.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20844.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20846\",\n \"datum\": \"2017-10-08\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"89\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20846.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20846.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2650\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20848\",\n \"datum\": \"2017-10-08\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"69\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20848.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20848.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5018\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20849\",\n \"datum\": \"2017-10-08\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"64\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20849.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20849.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3021\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20847\",\n \"datum\": \"2017-10-08\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"81\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"73\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20847.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20847.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2400\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20850\",\n \"datum\": \"2017-10-08\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"76\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"73\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20850.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20850.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2431\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20851\",\n \"datum\": \"2017-10-08\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"96\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"71\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20851.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20851.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3189\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20852\",\n \"datum\": \"2017-10-08\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"62\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20852.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20852.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"19:15:00\",\n \"zuschauer\": \"2700\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20860\",\n \"datum\": \"2017-10-11\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"71\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20860.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20860.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3340\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20853\",\n \"datum\": \"2017-10-13\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"89\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20853.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20853.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"5007\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20854\",\n \"datum\": \"2017-10-13\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"88\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"69\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20854.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20854.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2912\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20855\",\n \"datum\": \"2017-10-13\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"84\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"76\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20855.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20855.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:30:00\",\n \"zuschauer\": \"5912\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20856\",\n \"datum\": \"2017-10-13\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"87\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"92\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20856.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20856.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2024\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20857\",\n \"datum\": \"2017-10-13\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"83\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20857.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20857.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2627\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20858\",\n \"datum\": \"2017-10-13\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"100\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"99\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20858.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20858.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2650\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20859\",\n \"datum\": \"2017-10-13\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"73\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20859.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20859.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"4350\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20863\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"88\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20863.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20863.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3018\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20864\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"65\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"89\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20864.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20864.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20866\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"69\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20866.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20866.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"8111\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20867\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"74\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"67\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20867.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20867.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"1699\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20868\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"96\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"93\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20868.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20868.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"1950\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20865\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"74\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20865.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20865.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"19:15:00\",\n \"zuschauer\": \"5256\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20869\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"73\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"89\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20869.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20869.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"20:00:00\",\n \"zuschauer\": \"2985\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20870\",\n \"datum\": \"2017-10-15\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"69\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20870.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20870.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"20:00:00\",\n \"zuschauer\": \"3012\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20871\",\n \"datum\": \"2017-10-20\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"98\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"110\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20871.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20871.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2928\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20872\",\n \"datum\": \"2017-10-21\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"61\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20872.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20872.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"7991\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20873\",\n \"datum\": \"2017-10-21\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"71\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"73\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20873.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20873.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"1901\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20874\",\n \"datum\": \"2017-10-21\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"60\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"86\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20874.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20874.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3024\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20875\",\n \"datum\": \"2017-10-21\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"91\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20875.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20875.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"4510\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20876\",\n \"datum\": \"2017-10-21\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"74\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"91\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20876.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20876.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3806\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20877\",\n \"datum\": \"2017-10-22\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"83\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"94\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20877.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20877.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5384\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20878\",\n \"datum\": \"2017-10-22\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"85\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20878.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20878.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"7100\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20879\",\n \"datum\": \"2017-10-22\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"68\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20879.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20879.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"6\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"4600\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20880\",\n \"datum\": \"2017-10-28\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"77\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20880.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20880.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20881\",\n \"datum\": \"2017-10-28\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"86\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20881.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20881.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20882\",\n \"datum\": \"2017-10-28\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"60\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20882.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20882.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5831\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20883\",\n \"datum\": \"2017-10-28\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"89\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20883.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20883.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2400\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20884\",\n \"datum\": \"2017-10-29\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"78\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"64\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20884.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20884.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2608\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20887\",\n \"datum\": \"2017-10-29\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"77\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20887.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20887.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20885\",\n \"datum\": \"2017-10-29\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"75\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"96\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20885.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20885.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3199\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20886\",\n \"datum\": \"2017-10-29\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"84\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20886.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20886.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3000\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20888\",\n \"datum\": \"2017-11-02\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"92\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20888.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20888.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"7\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2230\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20889\",\n \"datum\": \"2017-11-04\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"74\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20889.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20889.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3254\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20890\",\n \"datum\": \"2017-11-04\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"94\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"68\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20890.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20890.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3025\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20891\",\n \"datum\": \"2017-11-04\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"99\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"107\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20891.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20891.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3325\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20892\",\n \"datum\": \"2017-11-04\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"81\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20892.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20892.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3132\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20896\",\n \"datum\": \"2017-11-04\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"69\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"73\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20896.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20896.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2150\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20893\",\n \"datum\": \"2017-11-05\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"103\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"99\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20893.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20893.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2085\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20894\",\n \"datum\": \"2017-11-05\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"80\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20894.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20894.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"13566\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20895\",\n \"datum\": \"2017-11-05\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"82\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"93\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20895.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20895.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"4820\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20897\",\n \"datum\": \"2017-11-05\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"54\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"94\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20897.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20897.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"8\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3629\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20951\",\n \"datum\": \"2017-11-06\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"61\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"100\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20951.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20951.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20901\",\n \"datum\": \"2017-11-10\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"92\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20901.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20901.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2050\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20899\",\n \"datum\": \"2017-11-11\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"77\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20899.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20899.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20898\",\n \"datum\": \"2017-11-11\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"82\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"98\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20898.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20898.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5079\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20900\",\n \"datum\": \"2017-11-11\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"76\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20900.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20900.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3300\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20903\",\n \"datum\": \"2017-11-12\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"77\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20903.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20903.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2567\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20902\",\n \"datum\": \"2017-11-12\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"75\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20902.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20902.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5320\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20904\",\n \"datum\": \"2017-11-12\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"72\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20904.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20904.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5743\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20906\",\n \"datum\": \"2017-11-12\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"101\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"97\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20906.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20906.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3635\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20905\",\n \"datum\": \"2017-11-12\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"67\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20905.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20905.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"9\",\n \"uhrzeit\": \"19:15:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20908\",\n \"datum\": \"2017-11-18\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"79\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20908.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20908.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3447\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20909\",\n \"datum\": \"2017-11-18\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"89\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20909.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20909.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"4900\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20960\",\n \"datum\": \"2017-11-18\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"88\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20960.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20960.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20907\",\n \"datum\": \"2017-11-18\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"90\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20907.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20907.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3050\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20910\",\n \"datum\": \"2017-11-18\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"60\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20910.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20910.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3314\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20911\",\n \"datum\": \"2017-11-18\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"61\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"71\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20911.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20911.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3112\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20913\",\n \"datum\": \"2017-11-19\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"82\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20913.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20913.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5500\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20914\",\n \"datum\": \"2017-11-19\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"68\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"77\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20914.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20914.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6700\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20916\",\n \"datum\": \"2017-12-01\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"73\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20916.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20916.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2327\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20917\",\n \"datum\": \"2017-12-01\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"66\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20917.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20917.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"9154\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20952\",\n \"datum\": \"2017-12-01\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"50\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20952.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20952.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6167\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20918\",\n \"datum\": \"2017-12-02\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"88\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"99\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20918.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20918.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"2589\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20919\",\n \"datum\": \"2017-12-02\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"80\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"86\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20919.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20919.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3300\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20921\",\n \"datum\": \"2017-12-03\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"76\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"93\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20921.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20921.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20920\",\n \"datum\": \"2017-12-03\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"61\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"93\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20920.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20920.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3499\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20922\",\n \"datum\": \"2017-12-03\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"85\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20922.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20922.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3076\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20924\",\n \"datum\": \"2017-12-03\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"77\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"56\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20924.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20924.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2287\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20923\",\n \"datum\": \"2017-12-03\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"65\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20923.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20923.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"11\",\n \"uhrzeit\": \"18:30:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20925\",\n \"datum\": \"2017-12-08\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"78\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20925.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20925.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2100\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20926\",\n \"datum\": \"2017-12-09\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"69\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20926.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20926.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"4540\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20927\",\n \"datum\": \"2017-12-09\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"90\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"76\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20927.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20927.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20928\",\n \"datum\": \"2017-12-09\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"71\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"91\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20928.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20928.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6700\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20929\",\n \"datum\": \"2017-12-09\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"67\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20929.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20929.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2850\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20933\",\n \"datum\": \"2017-12-09\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"71\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20933.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20933.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20930\",\n \"datum\": \"2017-12-10\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"84\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20930.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20930.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3226\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20931\",\n \"datum\": \"2017-12-10\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"68\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20931.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20931.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5080\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20932\",\n \"datum\": \"2017-12-10\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"72\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"93\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20932.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20932.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"12\",\n \"uhrzeit\": \"18:30:00\",\n \"zuschauer\": \"2905\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20861\",\n \"datum\": \"2017-12-11\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"74\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20861.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20861.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20934\",\n \"datum\": \"2017-12-15\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"82\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20934.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20934.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2175\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20935\",\n \"datum\": \"2017-12-16\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"96\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20935.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20935.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"2786\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20936\",\n \"datum\": \"2017-12-16\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"69\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20936.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20936.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20938\",\n \"datum\": \"2017-12-16\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"91\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"65\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20938.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20938.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3447\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20937\",\n \"datum\": \"2017-12-16\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"47\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20937.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20937.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3744\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20939\",\n \"datum\": \"2017-12-17\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"98\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"59\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20939.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20939.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3443\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20940\",\n \"datum\": \"2017-12-17\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"74\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20940.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20940.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20941\",\n \"datum\": \"2017-12-17\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"84\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20941.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20941.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"4860\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20942\",\n \"datum\": \"2017-12-17\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"69\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20942.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20942.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"13\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2340\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20943\",\n \"datum\": \"2017-12-22\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"59\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20943.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20943.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3752\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20944\",\n \"datum\": \"2017-12-22\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"62\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20944.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20944.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20945\",\n \"datum\": \"2017-12-22\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"86\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"77\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20945.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20945.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3300\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20947\",\n \"datum\": \"2017-12-22\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"72\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"71\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20947.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20947.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2300\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20948\",\n \"datum\": \"2017-12-23\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"67\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"100\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20948.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20948.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"8959\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20949\",\n \"datum\": \"2017-12-23\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"87\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"94\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20949.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20949.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20950\",\n \"datum\": \"2017-12-23\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"77\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"69\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20950.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20950.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3132\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20955\",\n \"datum\": \"2017-12-26\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"100\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20955.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20955.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2719\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20957\",\n \"datum\": \"2017-12-26\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"63\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20957.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20957.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3920\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20953\",\n \"datum\": \"2017-12-26\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"77\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20953.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20953.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2217\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20954\",\n \"datum\": \"2017-12-26\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"94\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20954.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20954.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3447\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20956\",\n \"datum\": \"2017-12-26\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"66\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"103\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20956.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20956.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20834\",\n \"datum\": \"2017-12-27\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"78\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20834.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20834.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"4200\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20958\",\n \"datum\": \"2017-12-27\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"68\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/20958.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/20958.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3076\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20961\",\n \"datum\": \"2017-12-29\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"81\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20961.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20961.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"10251\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20962\",\n \"datum\": \"2017-12-29\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"64\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20962.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20962.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20963\",\n \"datum\": \"2017-12-29\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"78\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20963.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20963.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5920\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20966\",\n \"datum\": \"2017-12-30\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"89\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20966.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20966.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20964\",\n \"datum\": \"2017-12-30\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"63\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20964.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20964.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"2811\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20965\",\n \"datum\": \"2017-12-30\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"90\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20965.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20965.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"4050\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20967\",\n \"datum\": \"2017-12-30\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"93\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20967.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20967.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3132\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20968\",\n \"datum\": \"2017-12-30\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"100\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"94\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20968.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20968.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3000\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20912\",\n \"datum\": \"2018-01-02\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"87\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20912.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20912.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"10\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"5633\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20969\",\n \"datum\": \"2018-01-02\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"75\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20969.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20969.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"16\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3300\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20970\",\n \"datum\": \"2018-01-05\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"68\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"69\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20970.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20970.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3191\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20971\",\n \"datum\": \"2018-01-05\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"93\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20971.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20971.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2938\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20972\",\n \"datum\": \"2018-01-06\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"74\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20972.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20972.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"5683\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20973\",\n \"datum\": \"2018-01-06\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"86\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20973.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20973.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3529\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20974\",\n \"datum\": \"2018-01-07\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"86\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"67\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20974.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20974.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"4200\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20975\",\n \"datum\": \"2018-01-07\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"75\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20975.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20975.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5347\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20976\",\n \"datum\": \"2018-01-07\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"81\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"76\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20976.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20976.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5002\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20978\",\n \"datum\": \"2018-01-07\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"95\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"77\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20978.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20978.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5180\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20977\",\n \"datum\": \"2018-01-07\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"77\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20977.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20977.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"17\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"21019\",\n \"datum\": \"2018-01-10\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"79\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/21019.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/21019.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3172\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20946\",\n \"datum\": \"2018-01-11\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"86\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20946.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20946.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"14\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"4530\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"20982\",\n \"datum\": \"2018-01-20\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"84\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"86\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/20982.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/20982.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5237\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20983\",\n \"datum\": \"2018-01-21\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"86\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20983.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20983.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2100\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20985\",\n \"datum\": \"2018-01-21\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"80\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20985.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20985.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2525\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20986\",\n \"datum\": \"2018-01-21\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"80\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"89\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20986.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20986.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5100\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21031\",\n \"datum\": \"2018-01-21\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"81\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21031.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21031.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2712\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"20988\",\n \"datum\": \"2018-01-26\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"80\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/20988.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/20988.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"20989\",\n \"datum\": \"2018-01-27\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"71\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"91\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/20989.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/20989.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"9235\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"20990\",\n \"datum\": \"2018-01-27\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"72\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/20990.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/20990.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"20991\",\n \"datum\": \"2018-01-27\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"99\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/20991.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/20991.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3447\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20992\",\n \"datum\": \"2018-01-27\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"69\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"92\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20992.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20992.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3379\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"20993\",\n \"datum\": \"2018-01-27\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"65\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"57\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/20993.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/20993.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2900\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"20996\",\n \"datum\": \"2018-01-28\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"83\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"86\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/20996.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/20996.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3104\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"20994\",\n \"datum\": \"2018-01-28\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"69\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"106\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/20994.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/20994.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5750\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"20995\",\n \"datum\": \"2018-01-28\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"68\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/20995.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/20995.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"19\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2862\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"20997\",\n \"datum\": \"2018-02-02\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"88\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"93\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/20997.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/20997.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2200\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"20998\",\n \"datum\": \"2018-02-02\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"72\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/20998.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/20998.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2270\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20999\",\n \"datum\": \"2018-02-03\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"94\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20999.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20999.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3321\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21000\",\n \"datum\": \"2018-02-03\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"88\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"96\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21000.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21000.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6500\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21001\",\n \"datum\": \"2018-02-03\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"86\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21001.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21001.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21002\",\n \"datum\": \"2018-02-04\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"75\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21002.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21002.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"11431\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21004\",\n \"datum\": \"2018-02-04\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"85\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21004.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21004.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2468\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21003\",\n \"datum\": \"2018-02-04\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"88\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21003.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21003.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"4860\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21005\",\n \"datum\": \"2018-02-06\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"90\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21005.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21005.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"20\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2882\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"21006\",\n \"datum\": \"2018-02-08\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"74\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"77\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/21006.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/21006.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2055\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21007\",\n \"datum\": \"2018-02-09\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"82\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21007.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21007.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3007\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21008\",\n \"datum\": \"2018-02-10\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"95\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21008.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21008.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21011\",\n \"datum\": \"2018-02-10\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"68\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21011.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21011.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"5118\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21009\",\n \"datum\": \"2018-02-10\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"99\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"89\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21009.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21009.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3076\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21010\",\n \"datum\": \"2018-02-10\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"71\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21010.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21010.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3079\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"21012\",\n \"datum\": \"2018-02-10\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"109\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"105\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/21012.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/21012.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"21013\",\n \"datum\": \"2018-02-11\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"90\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"98\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/21013.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/21013.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2300\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"21014\",\n \"datum\": \"2018-02-11\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"71\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"63\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/21014.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/21014.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"21\",\n \"uhrzeit\": \"20:15:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21018\",\n \"datum\": \"2018-02-14\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"83\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"91\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21018.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21018.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"18:45:00\",\n \"zuschauer\": \"7512\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21015\",\n \"datum\": \"2018-02-14\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"78\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"77\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21015.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21015.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21023\",\n \"datum\": \"2018-02-14\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"85\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"97\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21023.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21023.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3033\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"21017\",\n \"datum\": \"2018-02-14\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"87\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/21017.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/21017.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2450\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"21020\",\n \"datum\": \"2018-02-14\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"77\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"99\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/21020.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/21020.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3251\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21021\",\n \"datum\": \"2018-02-14\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"77\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"91\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21021.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21021.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"4856\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21016\",\n \"datum\": \"2018-02-16\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"68\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21016.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21016.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2386\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21022\",\n \"datum\": \"2018-02-16\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"69\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"79\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21022.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21022.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"22\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3051\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"21032\",\n \"datum\": \"2018-02-18\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"63\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"71\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/21032.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/21032.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3373\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"20959\",\n \"datum\": \"2018-02-28\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"54\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"89\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/20959.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/20959.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"15\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3908\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"21024\",\n \"datum\": \"2018-03-02\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"89\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"73\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/21024.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/21024.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2040\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21025\",\n \"datum\": \"2018-03-03\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"75\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/21025.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/21025.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3363\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21026\",\n \"datum\": \"2018-03-03\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"68\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"100\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21026.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21026.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"11697\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"21027\",\n \"datum\": \"2018-03-03\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"90\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"73\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/21027.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/21027.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"4200\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21028\",\n \"datum\": \"2018-03-04\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"72\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21028.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21028.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5002\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21029\",\n \"datum\": \"2018-03-04\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"83\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21029.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21029.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2508\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"21030\",\n \"datum\": \"2018-03-04\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"105\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"96\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/21030.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/21030.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"23\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3752\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21033\",\n \"datum\": \"2018-03-09\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"62\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21033.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21033.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3079\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21034\",\n \"datum\": \"2018-03-10\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"92\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/21034.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/21034.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"2961\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"21035\",\n \"datum\": \"2018-03-10\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"92\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"61\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/21035.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/21035.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2400\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"21037\",\n \"datum\": \"2018-03-11\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"99\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/21037.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/21037.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3430\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21041\",\n \"datum\": \"2018-03-11\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"89\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21041.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21041.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2421\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21036\",\n \"datum\": \"2018-03-11\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"90\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"67\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21036.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21036.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21038\",\n \"datum\": \"2018-03-11\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"91\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"111\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21038.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21038.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5346\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"21040\",\n \"datum\": \"2018-03-11\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"80\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"102\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/21040.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/21040.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5010\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21039\",\n \"datum\": \"2018-03-12\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"79\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"96\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21039.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21039.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"24\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3009\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21043\",\n \"datum\": \"2018-03-16\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"90\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"107\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21043.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21043.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2234\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21044\",\n \"datum\": \"2018-03-17\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"71\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"98\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21044.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21044.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"10458\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21045\",\n \"datum\": \"2018-03-17\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"82\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21045.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21045.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"21047\",\n \"datum\": \"2018-03-17\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"91\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/21047.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/21047.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"4011\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"21048\",\n \"datum\": \"2018-03-17\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"118\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"98\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/21048.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/21048.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3426\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"21049\",\n \"datum\": \"2018-03-17\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"67\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/21049.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/21049.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"21042\",\n \"datum\": \"2018-03-18\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"87\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"61\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/21042.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/21042.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"15:30:00\",\n \"zuschauer\": \"2800\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21046\",\n \"datum\": \"2018-03-18\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"73\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21046.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21046.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21050\",\n \"datum\": \"2018-03-18\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"82\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21050.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21050.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"25\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3830\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"20979\",\n \"datum\": \"2018-03-21\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"88\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"62\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/20979.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/20979.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2712\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"21051\",\n \"datum\": \"2018-03-23\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"106\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/21051.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/21051.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2300\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21052\",\n \"datum\": \"2018-03-24\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"91\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21052.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21052.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21054\",\n \"datum\": \"2018-03-24\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"102\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"98\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21054.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21054.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3204\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"21053\",\n \"datum\": \"2018-03-24\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"62\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"91\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/21053.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/21053.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3350\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21056\",\n \"datum\": \"2018-03-24\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"74\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21056.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21056.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2682\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"21057\",\n \"datum\": \"2018-03-25\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"65\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/21057.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/21057.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2720\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21055\",\n \"datum\": \"2018-03-25\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"91\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21055.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21055.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6500\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"21058\",\n \"datum\": \"2018-03-25\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"79\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/21058.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/21058.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"5810\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21059\",\n \"datum\": \"2018-03-25\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"98\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"105\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/21059.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/21059.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"26\",\n \"uhrzeit\": \"19:30:00\",\n \"zuschauer\": \"3268\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"20980\",\n \"datum\": \"2018-03-29\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"86\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/20980.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/20980.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"4520\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"20984\",\n \"datum\": \"2018-03-29\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"98\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"68\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/20984.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/20984.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2773\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"21060\",\n \"datum\": \"2018-03-31\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"96\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"107\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/21060.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/21060.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3468\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21061\",\n \"datum\": \"2018-03-31\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"77\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"100\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21061.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21061.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21065\",\n \"datum\": \"2018-03-31\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"92\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"103\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21065.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21065.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2128\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21062\",\n \"datum\": \"2018-04-01\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"90\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"98\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21062.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21062.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2071\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21063\",\n \"datum\": \"2018-04-01\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"76\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21063.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21063.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"8267\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21066\",\n \"datum\": \"2018-04-01\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"94\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21066.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21066.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"21064\",\n \"datum\": \"2018-04-01\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"73\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/21064.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/21064.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"20:45:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"21068\",\n \"datum\": \"2018-04-02\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"77\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"94\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/21068.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/21068.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2914\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21067\",\n \"datum\": \"2018-04-02\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"67\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21067.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21067.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"27\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"4220\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"20981\",\n \"datum\": \"2018-04-04\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"95\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"100\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/20981.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/20981.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6014\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21070\",\n \"datum\": \"2018-04-06\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"62\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"69\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21070.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21070.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3004\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21071\",\n \"datum\": \"2018-04-07\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"88\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"75\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/21071.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/21071.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3447\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21074\",\n \"datum\": \"2018-04-07\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"83\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"107\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21074.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21074.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"4939\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21072\",\n \"datum\": \"2018-04-07\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"45\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21072.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21072.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3017\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"21073\",\n \"datum\": \"2018-04-07\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"86\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"90\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/21073.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/21073.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3542\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"21075\",\n \"datum\": \"2018-04-07\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"91\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"64\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/21075.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/21075.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2000\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"21069\",\n \"datum\": \"2018-04-08\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"69\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/21069.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/21069.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2100\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"21076\",\n \"datum\": \"2018-04-08\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"83\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"76\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/21076.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/21076.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"7380\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"21077\",\n \"datum\": \"2018-04-08\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"84\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"76\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/21077.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/21077.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"28\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"20987\",\n \"datum\": \"2018-04-11\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"73\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/20987.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/20987.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"18\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21080\",\n \"datum\": \"2018-04-14\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"78\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/21080.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/21080.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3447\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21081\",\n \"datum\": \"2018-04-14\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"86\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"96\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21081.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21081.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"11115\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"21082\",\n \"datum\": \"2018-04-14\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"86\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/21082.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/21082.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"3437\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21078\",\n \"datum\": \"2018-04-14\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"75\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"61\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21078.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21078.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2978\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"21079\",\n \"datum\": \"2018-04-14\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"63\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"97\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/21079.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/21079.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21083\",\n \"datum\": \"2018-04-14\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"93\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21083.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21083.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21084\",\n \"datum\": \"2018-04-15\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"87\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21084.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21084.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5002\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"21085\",\n \"datum\": \"2018-04-15\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"73\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/21085.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/21085.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"2507\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21086\",\n \"datum\": \"2018-04-15\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"82\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"65\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21086.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21086.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"29\",\n \"uhrzeit\": \"20:15:00\",\n \"zuschauer\": \"2077\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21088\",\n \"datum\": \"2018-04-19\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"72\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21088.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21088.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2968\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"21090\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"81\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"69\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/21090.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/21090.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2150\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"21091\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"82\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"95\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/21091.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/21091.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21094\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"75\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21094.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21094.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"3025\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"21095\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"102\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"97\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/21095.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/21095.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2100\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"21087\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"70\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/21087.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/21087.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5060\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"21089\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"59\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/21089.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/21089.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"4096\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21092\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"80\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"102\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21092.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21092.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5291\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"21093\",\n \"datum\": \"2018-04-20\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"125\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/21093.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/21093.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"30\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2500\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21096\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"78\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"101\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21096.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21096.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5345\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21101\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"77\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21101.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21101.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21103\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"84\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"86\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21103.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21103.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5073\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"21097\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"111\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"102\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/21097.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/21097.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3236\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21098\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"72\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"83\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21098.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21098.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"4650\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"21100\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"72\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"62\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/21100.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/21100.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3201\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21099\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"78\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21099.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21099.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"20:15:00\",\n \"zuschauer\": \"3012\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21102\",\n \"datum\": \"2018-04-22\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"74\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21102.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21102.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"20:15:00\",\n \"zuschauer\": \"2719\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21104\",\n \"datum\": \"2018-04-24\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"82\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"100\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21104.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21104.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"31\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2519\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"21105\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"89\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/21105.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/21105.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2510\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"21106\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"80\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/21106.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/21106.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21107\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"69\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"106\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21107.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21107.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"8739\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21110\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"65\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"86\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21110.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21110.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"2376\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"21113\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"93\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/21113.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/21113.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"1900\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"21108\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"77\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/21108.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/21108.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3030\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"21109\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"56\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/21109.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/21109.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5090\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"21111\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"87\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/21111.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/21111.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"2600\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21112\",\n \"datum\": \"2018-04-27\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"75\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"97\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21112.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21112.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"32\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5604\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21115\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"Eisb\\u00e4ren Bremerhaven\",\n \"gastCity\": \"Bremerhaven\",\n \"gast_id\": \"439\",\n \"gast_result\": \"95\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"98\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21115.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21115.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"4848\"\n },\n {\n \"arenaLat\": \"50.57770\",\n \"arenaLon\": \"8.691257\",\n \"arenaName\": \"Sporthalle Gie\\u00dfen-Ost\",\n \"bbl_spielID\": \"21116\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"87\",\n \"home\": \"GIESSEN 46ers\",\n \"homeCity\": \"Gie\\u00dfen\",\n \"home_id\": \"421\",\n \"home_result\": \"102\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/421/21116.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/421/21116.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3418\"\n },\n {\n \"arenaLat\": \"50.95877\",\n \"arenaLon\": \"10.98980\",\n \"arenaName\": \"Messehalle Erfurt\",\n \"bbl_spielID\": \"21122\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"93\",\n \"home\": \"Rockets\",\n \"homeCity\": \"Rockets\",\n \"home_id\": \"517\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/517/21122.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/517/21122.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3080\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21117\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"Science City Jena\",\n \"gastCity\": \"Jena\",\n \"gast_id\": \"483\",\n \"gast_result\": \"65\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"67\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21117.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21117.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"4540\"\n },\n {\n \"arenaLat\": \"51.54179\",\n \"arenaLon\": \"9.920995\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21118\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"Mitteldeutscher BC\",\n \"gastCity\": \"MBC\",\n \"gast_id\": \"428\",\n \"gast_result\": \"90\",\n \"home\": \"BG G\\u00f6ttingen\",\n \"homeCity\": \"G\\u00f6ttingen\",\n \"home_id\": \"477\",\n \"home_result\": \"96\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/477/21118.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/477/21118.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"3447\"\n },\n {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21120\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"87\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21120.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21120.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"21114\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"Basketball L\\u00f6wen Braunschweig\",\n \"gastCity\": \"Braunschweig\",\n \"gast_id\": \"422\",\n \"gast_result\": \"55\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/21114.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/21114.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"20:15:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"48.51035\",\n \"arenaLon\": \"9.041096\",\n \"arenaName\": \"Paul-Horn-Arena\",\n \"bbl_spielID\": \"21119\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"s.Oliver W\\u00fcrzburg\",\n \"gastCity\": \"W\\u00fcrzburg\",\n \"gast_id\": \"540\",\n \"gast_result\": \"73\",\n \"home\": \"WALTER Tigers T\\u00fcbingen\",\n \"homeCity\": \"WALTER Tigers\",\n \"home_id\": \"432\",\n \"home_result\": \"57\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/432/21119.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/432/21119.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"20:15:00\",\n \"zuschauer\": \"2400\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21121\",\n \"datum\": \"2018-04-29\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"73\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"70\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21121.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21121.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"33\",\n \"uhrzeit\": \"20:15:00\",\n \"zuschauer\": \"2910\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"21123\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"WALTER Tigers T\\u00fcbingen\",\n \"gastCity\": \"WALTER Tigers\",\n \"gast_id\": \"432\",\n \"gast_result\": \"79\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"88\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/21123.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/21123.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2863\"\n },\n {\n \"arenaLat\": \"53.55514\",\n \"arenaLon\": \"8.58895\",\n \"arenaName\": \"Stadthalle Bremerhaven\",\n \"bbl_spielID\": \"21124\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"GIESSEN 46ers\",\n \"gastCity\": \"Gie\\u00dfen\",\n \"gast_id\": \"421\",\n \"gast_result\": \"74\",\n \"home\": \"Eisb\\u00e4ren Bremerhaven\",\n \"homeCity\": \"Bremerhaven\",\n \"home_id\": \"439\",\n \"home_result\": \"87\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/439/21124.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/439/21124.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3420\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"21125\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"83\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"72\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/21125.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/21125.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"50.89985\",\n \"arenaLon\": \"11.58844\",\n \"arenaName\": \"Sparkassen Arena\",\n \"bbl_spielID\": \"21126\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"Rockets\",\n \"gastCity\": \"Rockets\",\n \"gast_id\": \"517\",\n \"gast_result\": \"81\",\n \"home\": \"Science City Jena\",\n \"homeCity\": \"Jena\",\n \"home_id\": \"483\",\n \"home_result\": \"85\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/483/21126.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/483/21126.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3076\"\n },\n {\n \"arenaLat\": \"52.25708\",\n \"arenaLon\": \"10.51687\",\n \"arenaName\": \"Volkswagen Halle\",\n \"bbl_spielID\": \"21127\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"BG G\\u00f6ttingen\",\n \"gastCity\": \"G\\u00f6ttingen\",\n \"gast_id\": \"477\",\n \"gast_result\": \"86\",\n \"home\": \"Basketball L\\u00f6wen Braunschweig\",\n \"homeCity\": \"Braunschweig\",\n \"home_id\": \"422\",\n \"home_result\": \"91\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/422/21127.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/422/21127.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3603\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21128\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"73\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"102\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21128.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21128.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"8899\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"21129\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"90\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/21129.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/21129.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"5675\"\n },\n {\n \"arenaLat\": \"49.77337\",\n \"arenaLon\": \"9.93923\",\n \"arenaName\": \"S.Oliver-Arena\",\n \"bbl_spielID\": \"21130\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"68\",\n \"home\": \"s.Oliver W\\u00fcrzburg\",\n \"homeCity\": \"W\\u00fcrzburg\",\n \"home_id\": \"540\",\n \"home_result\": \"82\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/540/21130.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/540/21130.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"3140\"\n },\n {\n \"arenaLat\": \"51.20179\",\n \"arenaLon\": \"11.95719\",\n \"arenaName\": \"Stadthalle\",\n \"bbl_spielID\": \"21131\",\n \"datum\": \"2018-05-01\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"76\",\n \"home\": \"Mitteldeutscher BC\",\n \"homeCity\": \"MBC\",\n \"home_id\": \"428\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/428/21131.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/428/21131.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"34\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"2350\"\n }\n ]\n },\n {\n \"@attributes\": {\n \"ID\": \"2\",\n \"title\": \"Playoffs Viertelfinale\"\n },\n \"spiel\": [\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21972\",\n \"datum\": \"2018-05-05\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"88\",\n \"gast_score\": \"0\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"114\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21972.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21972.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"18:15:00\",\n \"zuschauer\": \"8772\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22001\",\n \"datum\": \"2018-05-05\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"72\",\n \"gast_score\": \"0\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"85\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22001.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22001.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6324\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"22002\",\n \"datum\": \"2018-05-06\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"74\",\n \"gast_score\": \"0\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"87\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/22002.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/22002.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"17:30:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"22004\",\n \"datum\": \"2018-05-08\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"100\",\n \"gast_score\": \"1\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"105\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/22004.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/22004.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"18:15:00\",\n \"zuschauer\": \"5531\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"22005\",\n \"datum\": \"2018-05-09\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"69\",\n \"gast_score\": \"1\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"75\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/22005.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/22005.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"18:15:00\",\n \"zuschauer\": \"4640\"\n },\n {\n \"arenaLat\": \"50.70522\",\n \"arenaLon\": \"7.059180\",\n \"arenaName\": \"Telekom Dome\",\n \"bbl_spielID\": \"22006\",\n \"datum\": \"2018-05-09\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"90\",\n \"gast_score\": \"2\",\n \"home\": \"Telekom Baskets Bonn\",\n \"homeCity\": \"Telekom Baskets\",\n \"home_id\": \"415\",\n \"home_result\": \"82\",\n \"home_score\": \"0\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/415/22006.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/415/22006.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"22003\",\n \"datum\": \"2018-05-10\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"85\",\n \"gast_score\": \"0\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"104\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/22003.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/22003.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"18:15:00\",\n \"zuschauer\": \"3244\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"22008\",\n \"datum\": \"2018-05-12\",\n \"gast\": \"Telekom Baskets Bonn\",\n \"gastCity\": \"Telekom Baskets\",\n \"gast_id\": \"415\",\n \"gast_result\": \"70\",\n \"gast_score\": \"0\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"75\",\n \"home_score\": \"3\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/22008.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/22008.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"14:15:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"22009\",\n \"datum\": \"2018-05-12\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"79\",\n \"gast_score\": \"1\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"96\",\n \"home_score\": \"2\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/22009.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/22009.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"8891\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"22007\",\n \"datum\": \"2018-05-12\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"79\",\n \"gast_score\": \"0\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"74\",\n \"home_score\": \"0\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/22007.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/22007.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"18:15:00\",\n \"zuschauer\": \"3034\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22010\",\n \"datum\": \"2018-05-12\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"86\",\n \"gast_score\": \"1\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"83\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22010.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22010.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6018\"\n },\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"22012\",\n \"datum\": \"2018-05-15\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"85\",\n \"gast_score\": \"2\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"50\",\n \"home_score\": \"2\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/22012.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/22012.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"5002\"\n },\n {\n \"arenaLat\": \"53.14610\",\n \"arenaLon\": \"8.227446\",\n \"arenaName\": \"EWE Arena \",\n \"bbl_spielID\": \"22013\",\n \"datum\": \"2018-05-15\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"85\",\n \"gast_score\": \"2\",\n \"home\": \"EWE Baskets Oldenburg\",\n \"homeCity\": \"EWE Baskets\",\n \"home_id\": \"430\",\n \"home_result\": \"97\",\n \"home_score\": \"2\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/430/22013.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/430/22013.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6000\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"22011\",\n \"datum\": \"2018-05-15\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"70\",\n \"gast_score\": \"0\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"95\",\n \"home_score\": \"3\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/22011.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/22011.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"3253\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"22017\",\n \"datum\": \"2018-05-17\",\n \"gast\": \"EWE Baskets Oldenburg\",\n \"gastCity\": \"EWE Baskets\",\n \"gast_id\": \"430\",\n \"gast_result\": \"68\",\n \"gast_score\": \"2\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"85\",\n \"home_score\": \"3\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/22017.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/22017.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"8115\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22018\",\n \"datum\": \"2018-05-17\",\n \"gast\": \"FRAPORT SKYLINERS\",\n \"gastCity\": \"FRAPORT SKYLINERS\",\n \"gast_id\": \"426\",\n \"gast_result\": \"70\",\n \"gast_score\": \"2\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"90\",\n \"home_score\": \"3\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22018.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22018.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"5534\"\n }\n ]\n },\n {\n \"@attributes\": {\n \"ID\": \"3\",\n \"title\": \"Playoffs Halbfinale\"\n },\n \"spiel\": [\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22035\",\n \"datum\": \"2018-05-20\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"72\",\n \"gast_score\": \"0\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"95\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22035.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22035.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6083\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"22030\",\n \"datum\": \"2018-05-21\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"87\",\n \"gast_score\": \"0\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"102\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/22030.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/22030.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"8210\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"22036\",\n \"datum\": \"2018-05-23\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"65\",\n \"gast_score\": \"1\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"78\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/22036.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/22036.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"20:00:00\",\n \"zuschauer\": \"6150\"\n },\n {\n \"arenaLat\": \"48.89104\",\n \"arenaLon\": \"9.180009\",\n \"arenaName\": \"MHP Arena\",\n \"bbl_spielID\": \"22031\",\n \"datum\": \"2018-05-24\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"100\",\n \"gast_score\": \"2\",\n \"home\": \"MHP RIESEN Ludwigsburg\",\n \"homeCity\": \"Ludwigsburg\",\n \"home_id\": \"433\",\n \"home_result\": \"74\",\n \"home_score\": \"0\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/433/22031.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/433/22031.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"20:00:00\",\n \"zuschauer\": \"4023\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22037\",\n \"datum\": \"2018-05-26\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"67\",\n \"gast_score\": \"1\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"99\",\n \"home_score\": \"2\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22037.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22037.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"6271\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"22032\",\n \"datum\": \"2018-05-27\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"88\",\n \"gast_score\": \"0\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"91\",\n \"home_score\": \"3\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/22032.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/22032.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"10387\"\n },\n {\n \"arenaLat\": \"49.87945\",\n \"arenaLon\": \"10.92006\",\n \"arenaName\": \"Brose Arena\",\n \"bbl_spielID\": \"22038\",\n \"datum\": \"2018-05-29\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"83\",\n \"gast_score\": \"3\",\n \"home\": \"Brose Bamberg\",\n \"homeCity\": \"Brose Bamberg\",\n \"home_id\": \"420\",\n \"home_result\": \"79\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/420/22038.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/420/22038.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6150\"\n }\n ]\n },\n {\n \"@attributes\": {\n \"ID\": \"4\",\n \"title\": \"Playoffs Finale\"\n },\n \"spiel\": [\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22040\",\n \"datum\": \"2018-06-03\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"106\",\n \"gast_score\": \"1\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"95\",\n \"home_score\": \"0\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22040.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22040.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6054\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"22041\",\n \"datum\": \"2018-06-07\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"96\",\n \"gast_score\": \"1\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"69\",\n \"home_score\": \"1\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/22041.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/22041.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"2\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"13251\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22042\",\n \"datum\": \"2018-06-10\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"66\",\n \"gast_score\": \"1\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"72\",\n \"home_score\": \"2\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22042.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22042.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"3\",\n \"uhrzeit\": \"18:30:00\",\n \"zuschauer\": \"6500\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"22043\",\n \"datum\": \"2018-06-13\",\n \"gast\": \"FC Bayern M\\u00fcnchen\",\n \"gastCity\": \"M\\u00fcnchen\",\n \"gast_id\": \"486\",\n \"gast_result\": \"68\",\n \"gast_score\": \"2\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"72\",\n \"home_score\": \"2\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/22043.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/22043.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"4\",\n \"uhrzeit\": \"20:00:00\",\n \"zuschauer\": \"11722\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"22044\",\n \"datum\": \"2018-06-16\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"85\",\n \"gast_score\": \"2\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"106\",\n \"home_score\": \"3\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/22044.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/22044.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"5\",\n \"uhrzeit\": \"20:30:00\",\n \"zuschauer\": \"6500\"\n }\n ]\n },\n {\n \"@attributes\": {\n \"ID\": \"107\",\n \"title\": \"BBL-Pokal Qualifikation\"\n },\n \"spiel\": [\n {\n \"arenaLat\": \"50.10133\",\n \"arenaLon\": \"8.525292\",\n \"arenaName\": \"Fraport Arena\",\n \"bbl_spielID\": \"21562\",\n \"datum\": \"2018-01-20\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"96\",\n \"home\": \"FRAPORT SKYLINERS\",\n \"homeCity\": \"FRAPORT SKYLINERS\",\n \"home_id\": \"426\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/426/21562.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/426/21562.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"18:00:00\",\n \"zuschauer\": \"4740\"\n },\n {\n \"arenaLat\": \"52.50555\",\n \"arenaLon\": \"13.44333\",\n \"arenaName\": \"Mercedes Benz Arena\",\n \"bbl_spielID\": \"21563\",\n \"datum\": \"2018-01-21\",\n \"gast\": \"MHP RIESEN Ludwigsburg\",\n \"gastCity\": \"Ludwigsburg\",\n \"gast_id\": \"433\",\n \"gast_result\": \"73\",\n \"home\": \"ALBA BERLIN\",\n \"homeCity\": \"ALBA BERLIN\",\n \"home_id\": \"413\",\n \"home_result\": \"78\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/413/21563.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/413/21563.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6105\"\n },\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21561\",\n \"datum\": \"2018-01-21\",\n \"gast\": \"Brose Bamberg\",\n \"gastCity\": \"Brose Bamberg\",\n \"gast_id\": \"420\",\n \"gast_result\": \"97\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"101\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21561.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21561.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6523\"\n }\n ]\n },\n {\n \"@attributes\": {\n \"ID\": \"102\",\n \"title\": \"BBL-Pokal Halbfinale\"\n },\n \"spiel\": [\n {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21557\",\n \"datum\": \"2018-02-17\",\n \"gast\": \"ratiopharm ulm\",\n \"gastCity\": \"Ulm\",\n \"gast_id\": \"418\",\n \"gast_result\": \"73\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"84\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21557.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21557.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"16:00:00\",\n \"zuschauer\": \"6200\"\n },\n {\n \"arenaLat\": \"49.94470\",\n \"arenaLon\": \"11.58405\",\n \"arenaName\": \"Oberfrankenhalle\",\n \"bbl_spielID\": \"21558\",\n \"datum\": \"2018-02-17\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"96\",\n \"home\": \"medi bayreuth\",\n \"homeCity\": \"Bayreuth\",\n \"home_id\": \"425\",\n \"home_result\": \"74\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/425/21558.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/425/21558.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"19:00:00\",\n \"zuschauer\": \"6200\"\n }\n ]\n },\n {\n \"@attributes\": {\n \"ID\": \"101\",\n \"title\": \"BBL-Pokal Spiel um Platz 3\"\n },\n \"spiel\": {\n \"arenaLat\": \"48.38170\",\n \"arenaLon\": \"10.00294\",\n \"arenaName\": \"ratiopharm arena\",\n \"bbl_spielID\": \"21559\",\n \"datum\": \"2018-02-18\",\n \"gast\": \"medi bayreuth\",\n \"gastCity\": \"Bayreuth\",\n \"gast_id\": \"425\",\n \"gast_result\": \"79\",\n \"home\": \"ratiopharm ulm\",\n \"homeCity\": \"Ulm\",\n \"home_id\": \"418\",\n \"home_result\": \"81\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/418/21559.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/418/21559.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"12:00:00\",\n \"zuschauer\": \"5500\"\n }\n },\n {\n \"@attributes\": {\n \"ID\": \"100\",\n \"title\": \"BBL-Pokal Finale\"\n },\n \"spiel\": {\n \"arenaLat\": \"48.12611\",\n \"arenaLon\": \"11.52489\",\n \"arenaName\": \"Audi Dome\",\n \"bbl_spielID\": \"21560\",\n \"datum\": \"2018-02-18\",\n \"gast\": \"ALBA BERLIN\",\n \"gastCity\": \"ALBA BERLIN\",\n \"gast_id\": \"413\",\n \"gast_result\": \"75\",\n \"home\": \"FC Bayern M\\u00fcnchen\",\n \"homeCity\": \"M\\u00fcnchen\",\n \"home_id\": \"486\",\n \"home_result\": \"80\",\n \"init_url\": \"http://live.beko-bbl.de/data/bbl/486/21560.JSN\",\n \"live_url\": \"http://live.beko-bbl.de/data/bbl/486/21560.JSN\",\n \"spiel_nummer\": \"0\",\n \"tag\": \"1\",\n \"uhrzeit\": \"15:00:00\",\n \"zuschauer\": \"6200\"\n }\n }\n ],\n \"timestamp\": \"1530964990\",\n \"valid_from\": \"2017-09-29\",\n \"valid_till\": \"2018-06-16\"\n}\n" ], [ "\n\narena=[]\nhome_ids=[]\nfor i in range(0,len(games['competition'][0]['spiel'])):\n \n if games['competition'][0]['spiel'][i]['home_id'] not in home_ids:\n arena.append(games['competition'][0]['spiel'][i]['arenaName'])\n home_ids.append(games['competition'][0]['spiel'][i]['home_id'])\n\nprint(arena)\nprint(len(arena))\nprint(home_ids)\n\n ", "['S.Oliver-Arena', 'Volkswagen Halle', 'Sparkassen Arena', 'ratiopharm arena', 'Sparkassen Arena', 'Sporthalle Gießen-Ost', 'Paul-Horn-Arena', 'Stadthalle', 'Mercedes Benz Arena', 'Brose Arena', 'Fraport Arena', 'Oberfrankenhalle', 'Audi Dome', 'Messehalle Erfurt', 'Telekom Dome', 'Stadthalle Bremerhaven', 'EWE Arena ', 'MHP Arena']\n18\n['540', '422', '483', '418', '477', '421', '432', '428', '413', '420', '426', '425', '486', '517', '415', '439', '430', '433']\n" ], [ "from datetime import datetime\n\ndatetime_object = datetime.strptime(games['competition'][0]['spiel'][0]['datum']+\" \"+games['competition'][0]['spiel'][0]['uhrzeit'] , '%Y-%m-%d %H:%M:%S')\n\nprint(datetime_object)\nprint(datetime_object.strftime('%U'))\nprint(datetime_object.strftime('%w'))\n", "2017-09-29 20:30:00\n39\n5\n" ], [ "#dictionary für die Hallenkapazitäten\narenakap = {486:6594,413:14500,433:4200,420:6150,415:6000,425:3300,430:6000,426:5002,540:3140,418:6200,421:4003,422:3603,483:3076,477:3447,428:3000,439:4200,517:3533,432:3132}\nprint(arenakap)\nprint(len(arenakap))\n", "{486: 6594, 413: 14500, 433: 4200, 420: 6150, 415: 6000, 425: 3300, 430: 6000, 426: 5002, 540: 3140, 418: 6200, 421: 4003, 422: 3603, 483: 3076, 477: 3447, 428: 3000, 439: 4200, 517: 3533, 432: 3132}\n18\n" ], [ "print(type(games['competition'][0]['spiel'][0]['home_id']))\n#Die JSON Informationen sind als String angegeben", "<class 'str'>\n" ] ], [ [ "Deshalb parse (int) ich die Zuschauer und home_id für die weitere Berechnung", "_____no_output_____" ] ], [ [ "#Dataset zusammenstellen\ndataset=[]\n\nfor i in range(0,len(games['competition'][0]['spiel'])):\n datasetrow=[] \n datasetrow.append(games['competition'][0]['spiel'][i]['home_id'])\n datasetrow.append(games['competition'][0]['spiel'][i]['gast_id'])\n datasetrow.append(int(games['competition'][0]['spiel'][i]['home_result']>games['competition'][0]['spiel'][i]['gast_result']))\n datasetrow.append(int(games['competition'][0]['spiel'][i]['zuschauer']))\n datasetrow.append(arenakap[int(games['competition'][0]['spiel'][i]['home_id'])])\n \n dataset.append(datasetrow)\n\nprint(dataset)\n\n", "[['540', '420', 1, 3140, 3140], ['422', '439', 1, 2316, 3603], ['483', '426', 0, 2071, 3076], ['418', '413', 0, 6200, 6200], ['477', '430', 0, 2703, 3447], ['421', '486', 0, 3618, 4003], ['432', '425', 0, 2850, 3132], ['428', '517', 1, 2500, 3000], ['413', '439', 0, 8877, 14500], ['420', '421', 1, 6150, 6150], ['426', '477', 1, 4640, 5002], ['483', '540', 0, 2292, 3076], ['425', '428', 1, 3211, 3300], ['486', '422', 0, 6123, 6594], ['517', '430', 0, 2465, 3533], ['415', '418', 1, 4670, 6000], ['439', '433', 0, 2480, 4200], ['413', '432', 1, 7543, 14500], ['517', '420', 0, 2391, 3533], ['477', '486', 0, 3125, 3447], ['418', '425', 0, 6200, 6200], ['428', '413', 0, 2650, 3000], ['430', '483', 1, 5018, 6000], ['540', '439', 1, 3021, 3140], ['432', '420', 0, 2400, 3132], ['422', '415', 0, 2431, 3603], ['421', '517', 0, 3189, 4003], ['433', '426', 1, 2700, 4200], ['426', '422', 1, 3340, 5002], ['430', '425', 0, 5007, 6000], ['477', '413', 0, 2912, 3447], ['486', '540', 0, 5912, 6594], ['483', '418', 1, 2024, 3076], ['433', '421', 0, 2627, 4200], ['432', '428', 1, 2650, 3132], ['415', '517', 1, 4350, 6000], ['425', '483', 0, 3018, 3300], ['418', '477', 1, 6200, 6200], ['413', '415', 1, 8111, 14500], ['422', '433', 0, 1699, 3603], ['428', '426', 0, 1950, 3000], ['486', '430', 1, 5256, 6594], ['421', '439', 1, 2985, 4003], ['540', '432', 1, 3012, 3140], ['421', '432', 0, 2928, 4003], ['413', '517', 1, 7991, 14500], ['422', '540', 1, 1901, 3603], ['477', '483', 1, 3024, 3447], ['415', '428', 0, 4510, 6000], ['433', '420', 1, 3806, 4200], ['430', '418', 1, 5384, 6000], ['439', '486', 0, 7100, 4200], ['426', '425', 1, 4600, 5002], ['418', '439', 1, 6200, 6200], ['540', '430', 0, 3140, 3140], ['486', '426', 1, 5831, 6594], ['428', '477', 0, 2400, 3000], ['483', '433', 0, 2608, 3076], ['420', '413', 0, 6150, 6150], ['425', '421', 1, 3199, 3300], ['432', '415', 0, 3000, 3132], ['517', '422', 0, 2230, 3533], ['477', '540', 1, 3254, 3447], ['422', '420', 0, 3025, 3603], ['421', '428', 0, 3325, 4003], ['432', '418', 0, 3132, 3132], ['483', '415', 1, 2150, 3076], ['439', '425', 1, 2085, 4200], ['413', '486', 0, 13566, 14500], ['426', '430', 1, 4820, 5002], ['433', '517', 1, 3629, 4200], ['420', '477', 0, 6150, 6150], ['428', '433', 0, 2050, 3000], ['418', '422', 1, 6200, 6200], ['430', '421', 1, 5079, 6000], ['425', '413', 1, 3300, 3300], ['439', '477', 0, 2567, 4200], ['415', '540', 1, 5320, 6000], ['486', '432', 1, 5743, 6594], ['517', '483', 1, 3635, 3533], ['420', '426', 1, 6150, 6150], ['477', '422', 0, 3447, 3447], ['426', '418', 0, 4900, 5002], ['430', '413', 0, 6000, 6000], ['432', '517', 0, 3050, 3132], ['421', '483', 1, 3314, 4003], ['540', '428', 1, 3112, 3140], ['415', '425', 1, 5500, 6000], ['486', '420', 1, 6700, 6594], ['439', '432', 1, 2327, 4200], ['413', '421', 1, 9154, 14500], ['486', '415', 1, 6167, 6594], ['422', '430', 1, 2589, 3603], ['425', '540', 1, 3300, 3300], ['418', '428', 1, 6200, 6200], ['433', '477', 1, 3499, 4200], ['483', '486', 0, 3076, 3076], ['517', '426', 0, 2287, 3533], ['420', '415', 1, 6150, 6150], ['428', '422', 1, 2100, 3000], ['426', '439', 1, 4540, 5002], ['540', '413', 0, 3140, 3140], ['486', '433', 1, 6700, 6594], ['432', '477', 1, 2850, 3132], ['420', '483', 1, 6150, 6150], ['421', '418', 0, 3226, 4003], ['415', '430', 1, 5080, 6000], ['425', '517', 1, 2905, 3300], ['420', '439', 1, 6150, 6150], ['439', '428', 0, 2175, 4200], ['422', '421', 0, 2786, 3603], ['418', '540', 1, 6200, 6200], ['477', '415', 0, 3447, 3447], ['433', '425', 1, 3744, 4200], ['517', '486', 0, 3443, 3533], ['430', '420', 1, 6000, 6000], ['426', '413', 1, 4860, 5002], ['483', '432', 1, 2340, 3076], ['421', '426', 1, 3752, 4003], ['418', '517', 1, 6200, 6200], ['425', '486', 0, 3300, 3300], ['428', '430', 0, 2300, 3000], ['413', '483', 0, 8959, 14500], ['540', '433', 1, 3140, 3140], ['432', '422', 0, 3132, 3132], ['422', '425', 1, 2719, 3603], ['426', '432', 1, 3920, 5002], ['517', '540', 1, 2217, 3533], ['477', '421', 0, 3447, 3447], ['420', '428', 0, 6150, 6150], ['433', '415', 1, 4200, 4200], ['483', '439', 1, 3076, 3076], ['413', '422', 1, 10251, 14500], ['540', '426', 1, 3140, 3140], ['415', '421', 1, 5920, 6000], ['418', '486', 0, 6200, 6200], ['517', '477', 1, 2811, 3533], ['439', '430', 0, 4050, 4200], ['432', '433', 0, 3132, 3132], ['428', '483', 1, 3000, 3000], ['430', '433', 0, 5633, 6000], ['425', '420', 1, 3300, 3300], ['422', '483', 1, 3191, 3603], ['477', '425', 0, 2938, 3447], ['439', '517', 1, 5683, 4200], ['421', '540', 0, 3529, 4003], ['433', '413', 0, 4200, 4200], ['430', '432', 1, 5347, 6000], ['426', '415', 0, 5002, 5002], ['428', '486', 0, 5180, 3000], ['420', '418', 1, 6150, 6150], ['421', '422', 1, 3172, 4003], ['415', '439', 0, 4530, 6000], ['430', '422', 1, 5237, 6000], ['428', '540', 0, 2100, 3000], ['439', '483', 0, 2525, 4200], ['415', '432', 1, 5100, 6000], ['517', '418', 0, 2712, 3533], ['540', '486', 0, 3140, 3140], ['413', '428', 1, 9235, 14500], ['418', '483', 1, 6200, 6200], ['421', '430', 0, 3447, 4003], ['433', '439', 1, 3379, 4200], ['432', '426', 0, 2900, 3132], ['425', '477', 1, 3104, 3300], ['415', '420', 0, 5750, 6000], ['422', '517', 1, 2862, 3603], ['428', '432', 1, 2200, 3000], ['439', '540', 1, 2270, 4200], ['477', '418', 0, 3321, 3447], ['486', '425', 1, 6500, 6594], ['430', '415', 0, 6000, 6000], ['413', '420', 1, 11431, 14500], ['483', '422', 0, 2468, 3076], ['426', '433', 0, 4860, 5002], ['517', '421', 0, 2882, 3533], ['422', '426', 1, 2055, 3603], ['540', '477', 1, 3007, 3140], ['418', '421', 0, 6200, 6200], ['430', '517', 1, 5118, 6000], ['483', '413', 0, 3076, 3076], ['425', '432', 1, 3079, 3300], ['415', '433', 0, 6000, 6000], ['428', '439', 1, 2300, 3000], ['420', '486', 0, 6150, 6150], ['413', '430', 1, 7512, 14500], ['418', '426', 0, 6200, 6200], ['425', '415', 1, 3033, 3300], ['432', '439', 0, 2450, 3132], ['433', '428', 1, 3251, 4200], ['486', '477', 1, 4856, 6594], ['483', '420', 1, 2386, 3076], ['540', '517', 1, 3051, 3140], ['422', '428', 1, 3373, 3603], ['433', '418', 1, 3908, 4200], ['439', '415', 0, 2040, 4200], ['477', '432', 1, 3363, 3447], ['413', '425', 0, 11697, 14500], ['433', '486', 0, 4200, 4200], ['426', '540', 1, 5002, 5002], ['483', '430', 0, 2508, 3076], ['421', '420', 1, 3752, 4003], ['425', '422', 1, 3079, 3300], ['477', '426', 1, 2961, 3447], ['432', '430', 0, 2400, 3132], ['439', '413', 0, 3430, 4200], ['517', '433', 0, 2421, 3533], ['418', '420', 0, 6200, 6200], ['486', '428', 0, 5346, 6594], ['415', '483', 0, 5010, 6000], ['540', '421', 1, 3009, 3140], ['483', '425', 0, 2234, 3076], ['413', '477', 1, 10458, 14500], ['418', '432', 1, 6200, 6200], ['422', '486', 0, 4011, 3603], ['421', '433', 1, 3426, 4003], ['420', '540', 1, 6150, 6150], ['428', '415', 0, 2800, 3000], ['430', '439', 1, 6000, 6000], ['426', '517', 1, 3830, 5002], ['477', '433', 0, 2712, 3447], ['432', '421', 1, 2300, 3132], ['540', '418', 0, 3140, 3140], ['425', '430', 1, 3204, 3300], ['433', '483', 1, 3350, 4200], ['517', '428', 0, 2682, 3533], ['439', '422', 1, 2720, 4200], ['486', '413', 0, 6500, 6594], ['415', '426', 0, 5810, 6000], ['477', '420', 0, 3268, 3447], ['426', '421', 0, 4520, 5002], ['517', '413', 0, 2773, 3533], ['421', '425', 0, 3468, 4003], ['430', '486', 0, 6000, 6000], ['483', '477', 0, 2128, 3076], ['517', '439', 1, 2071, 3533], ['413', '540', 1, 8267, 14500], ['418', '415', 0, 6200, 6200], ['420', '433', 1, 6150, 6150], ['422', '432', 1, 2914, 3603], ['426', '428', 1, 4220, 5002], ['486', '418', 0, 6014, 6594], ['425', '426', 1, 3004, 3300], ['477', '517', 0, 3447, 3447], ['486', '421', 0, 4939, 6594], ['540', '422', 1, 3017, 3140], ['433', '430', 1, 3542, 4200], ['432', '483', 0, 2000, 3132], ['428', '418', 1, 2100, 3000], ['439', '420', 0, 7380, 4200], ['415', '413', 0, 6000, 6000], ['420', '425', 1, 6150, 6150], ['477', '439', 1, 3447, 3447], ['413', '433', 1, 11115, 14500], ['421', '415', 0, 3437, 4003], ['483', '428', 0, 2978, 3076], ['420', '432', 1, 6150, 6150], ['430', '540', 0, 6000, 6000], ['426', '486', 0, 5002, 5002], ['422', '418', 1, 2507, 3603], ['517', '425', 0, 2077, 3533], ['540', '483', 1, 2968, 3140], ['439', '426', 0, 2150, 4200], ['420', '430', 1, 6150, 6150], ['425', '418', 1, 3025, 3300], ['428', '421', 1, 2100, 3000], ['415', '477', 1, 5060, 6000], ['433', '422', 1, 4096, 4200], ['486', '517', 0, 5291, 6594], ['432', '413', 1, 2500, 3132], ['486', '483', 0, 5345, 6594], ['418', '433', 1, 6200, 6200], ['430', '428', 1, 5073, 6000], ['421', '477', 0, 3236, 4003], ['426', '420', 1, 4650, 5002], ['422', '413', 0, 3201, 3603], ['540', '415', 1, 3012, 3140], ['425', '439', 1, 2719, 3300], ['517', '432', 0, 2519, 3533], ['439', '418', 0, 2510, 4200], ['420', '517', 1, 6150, 6150], ['413', '426', 0, 8739, 14500], ['483', '421', 1, 2376, 3076], ['428', '425', 0, 1900, 3000], ['433', '540', 1, 3030, 4200], ['415', '422', 1, 5090, 6000], ['432', '486', 0, 2600, 3132], ['430', '477', 1, 5604, 6000], ['486', '439', 1, 4848, 6594], ['421', '413', 0, 3418, 4003], ['517', '415', 0, 3080, 3533], ['426', '483', 1, 4540, 5002], ['477', '428', 1, 3447, 3447], ['418', '430', 0, 6200, 6200], ['420', '422', 1, 6150, 6150], ['432', '540', 0, 2400, 3132], ['425', '433', 0, 2910, 3300], ['433', '432', 1, 2863, 4200], ['439', '421', 1, 3420, 4200], ['415', '486', 0, 6000, 6000], ['483', '517', 1, 3076, 3076], ['422', '477', 1, 3603, 3603], ['413', '418', 0, 8899, 14500], ['430', '426', 0, 5675, 6000], ['540', '425', 1, 3140, 3140], ['428', '420', 0, 2350, 3000]]\n" ], [ "# Umwandlung des Datasets in ein Numpy Array \nimport numpy as np\n# : -> auslesen aller zeilen\ndataset=np.asarray(dataset)\nprint(dataset[:,0])\nprint(len(dataset))", "['540' '422' '483' '418' '477' '421' '432' '428' '413' '420' '426' '483'\n '425' '486' '517' '415' '439' '413' '517' '477' '418' '428' '430' '540'\n '432' '422' '421' '433' '426' '430' '477' '486' '483' '433' '432' '415'\n '425' '418' '413' '422' '428' '486' '421' '540' '421' '413' '422' '477'\n '415' '433' '430' '439' '426' '418' '540' '486' '428' '483' '420' '425'\n '432' '517' '477' '422' '421' '432' '483' '439' '413' '426' '433' '420'\n '428' '418' '430' '425' '439' '415' '486' '517' '420' '477' '426' '430'\n '432' '421' '540' '415' '486' '439' '413' '486' '422' '425' '418' '433'\n '483' '517' '420' '428' '426' '540' '486' '432' '420' '421' '415' '425'\n '420' '439' '422' '418' '477' '433' '517' '430' '426' '483' '421' '418'\n '425' '428' '413' '540' '432' '422' '426' '517' '477' '420' '433' '483'\n '413' '540' '415' '418' '517' '439' '432' '428' '430' '425' '422' '477'\n '439' '421' '433' '430' '426' '428' '420' '421' '415' '430' '428' '439'\n '415' '517' '540' '413' '418' '421' '433' '432' '425' '415' '422' '428'\n '439' '477' '486' '430' '413' '483' '426' '517' '422' '540' '418' '430'\n '483' '425' '415' '428' '420' '413' '418' '425' '432' '433' '486' '483'\n '540' '422' '433' '439' '477' '413' '433' '426' '483' '421' '425' '477'\n '432' '439' '517' '418' '486' '415' '540' '483' '413' '418' '422' '421'\n '420' '428' '430' '426' '477' '432' '540' '425' '433' '517' '439' '486'\n '415' '477' '426' '517' '421' '430' '483' '517' '413' '418' '420' '422'\n '426' '486' '425' '477' '486' '540' '433' '432' '428' '439' '415' '420'\n '477' '413' '421' '483' '420' '430' '426' '422' '517' '540' '439' '420'\n '425' '428' '415' '433' '486' '432' '486' '418' '430' '421' '426' '422'\n '540' '425' '517' '439' '420' '413' '483' '428' '433' '415' '432' '430'\n '486' '421' '517' '426' '477' '418' '420' '432' '425' '433' '439' '415'\n '483' '422' '413' '430' '540' '428']\n306\n" ] ], [ [ "One hot encoding\n\n", "_____no_output_____" ] ], [ [ "from sklearn.preprocessing import LabelBinarizer\nencoder = LabelBinarizer()\ntransformed_home_ids = encoder.fit_transform(dataset[:,0])\n\nprint(transformed_home_ids)", "[[0 0 0 ... 0 0 1]\n [0 0 0 ... 0 0 0]\n [0 0 0 ... 0 0 0]\n ...\n [0 0 0 ... 0 0 0]\n [0 0 0 ... 0 0 1]\n [0 0 0 ... 0 0 0]]\n" ], [ "#ohne fit, damit die Teams eindeutig bleiben, nur transformation notwendig\ntransformed_gast_ids = encoder.transform(dataset[:,1])\nprint(transformed_gast_ids)", "[[0 0 0 ... 0 0 0]\n [0 0 0 ... 0 0 0]\n [0 0 0 ... 0 0 0]\n ...\n [0 0 0 ... 0 0 0]\n [0 0 0 ... 0 0 0]\n [0 0 0 ... 0 0 0]]\n" ], [ "# Umformung der Zuschauer in eine Spalte (vorher war es nur eine Zeile)\nprint(np.reshape(dataset[:,3],(306,1)))\n", "[['3140']\n ['2316']\n ['2071']\n ['6200']\n ['2703']\n ['3618']\n ['2850']\n ['2500']\n ['8877']\n ['6150']\n ['4640']\n ['2292']\n ['3211']\n ['6123']\n ['2465']\n ['4670']\n ['2480']\n ['7543']\n ['2391']\n ['3125']\n ['6200']\n ['2650']\n ['5018']\n ['3021']\n ['2400']\n ['2431']\n ['3189']\n ['2700']\n ['3340']\n ['5007']\n ['2912']\n ['5912']\n ['2024']\n ['2627']\n ['2650']\n ['4350']\n ['3018']\n ['6200']\n ['8111']\n ['1699']\n ['1950']\n ['5256']\n ['2985']\n ['3012']\n ['2928']\n ['7991']\n ['1901']\n ['3024']\n ['4510']\n ['3806']\n ['5384']\n ['7100']\n ['4600']\n ['6200']\n ['3140']\n ['5831']\n ['2400']\n ['2608']\n ['6150']\n ['3199']\n ['3000']\n ['2230']\n ['3254']\n ['3025']\n ['3325']\n ['3132']\n ['2150']\n ['2085']\n ['13566']\n ['4820']\n ['3629']\n ['6150']\n ['2050']\n ['6200']\n ['5079']\n ['3300']\n ['2567']\n ['5320']\n ['5743']\n ['3635']\n ['6150']\n ['3447']\n ['4900']\n ['6000']\n ['3050']\n ['3314']\n ['3112']\n ['5500']\n ['6700']\n ['2327']\n ['9154']\n ['6167']\n ['2589']\n ['3300']\n ['6200']\n ['3499']\n ['3076']\n ['2287']\n ['6150']\n ['2100']\n ['4540']\n ['3140']\n ['6700']\n ['2850']\n ['6150']\n ['3226']\n ['5080']\n ['2905']\n ['6150']\n ['2175']\n ['2786']\n ['6200']\n ['3447']\n ['3744']\n ['3443']\n ['6000']\n ['4860']\n ['2340']\n ['3752']\n ['6200']\n ['3300']\n ['2300']\n ['8959']\n ['3140']\n ['3132']\n ['2719']\n ['3920']\n ['2217']\n ['3447']\n ['6150']\n ['4200']\n ['3076']\n ['10251']\n ['3140']\n ['5920']\n ['6200']\n ['2811']\n ['4050']\n ['3132']\n ['3000']\n ['5633']\n ['3300']\n ['3191']\n ['2938']\n ['5683']\n ['3529']\n ['4200']\n ['5347']\n ['5002']\n ['5180']\n ['6150']\n ['3172']\n ['4530']\n ['5237']\n ['2100']\n ['2525']\n ['5100']\n ['2712']\n ['3140']\n ['9235']\n ['6200']\n ['3447']\n ['3379']\n ['2900']\n ['3104']\n ['5750']\n ['2862']\n ['2200']\n ['2270']\n ['3321']\n ['6500']\n ['6000']\n ['11431']\n ['2468']\n ['4860']\n ['2882']\n ['2055']\n ['3007']\n ['6200']\n ['5118']\n ['3076']\n ['3079']\n ['6000']\n ['2300']\n ['6150']\n ['7512']\n ['6200']\n ['3033']\n ['2450']\n ['3251']\n ['4856']\n ['2386']\n ['3051']\n ['3373']\n ['3908']\n ['2040']\n ['3363']\n ['11697']\n ['4200']\n ['5002']\n ['2508']\n ['3752']\n ['3079']\n ['2961']\n ['2400']\n ['3430']\n ['2421']\n ['6200']\n ['5346']\n ['5010']\n ['3009']\n ['2234']\n ['10458']\n ['6200']\n ['4011']\n ['3426']\n ['6150']\n ['2800']\n ['6000']\n ['3830']\n ['2712']\n ['2300']\n ['3140']\n ['3204']\n ['3350']\n ['2682']\n ['2720']\n ['6500']\n ['5810']\n ['3268']\n ['4520']\n ['2773']\n ['3468']\n ['6000']\n ['2128']\n ['2071']\n ['8267']\n ['6200']\n ['6150']\n ['2914']\n ['4220']\n ['6014']\n ['3004']\n ['3447']\n ['4939']\n ['3017']\n ['3542']\n ['2000']\n ['2100']\n ['7380']\n ['6000']\n ['6150']\n ['3447']\n ['11115']\n ['3437']\n ['2978']\n ['6150']\n ['6000']\n ['5002']\n ['2507']\n ['2077']\n ['2968']\n ['2150']\n ['6150']\n ['3025']\n ['2100']\n ['5060']\n ['4096']\n ['5291']\n ['2500']\n ['5345']\n ['6200']\n ['5073']\n ['3236']\n ['4650']\n ['3201']\n ['3012']\n ['2719']\n ['2519']\n ['2510']\n ['6150']\n ['8739']\n ['2376']\n ['1900']\n ['3030']\n ['5090']\n ['2600']\n ['5604']\n ['4848']\n ['3418']\n ['3080']\n ['4540']\n ['3447']\n ['6200']\n ['6150']\n ['2400']\n ['2910']\n ['2863']\n ['3420']\n ['6000']\n ['3076']\n ['3603']\n ['8899']\n ['5675']\n ['3140']\n ['2350']]\n" ], [ "# Featurescaling der Zuschaueranzahl & Hallenkapazitäten\nfrom sklearn.preprocessing import MinMaxScaler\n\narenaKap_scaler=MinMaxScaler()\narenaKap_scaler.fit([[0],[14500]]) #Maximum Berlin und 0 Minimum\n#reshaping\ntransformed_zuschauer=arenaKap_scaler.transform(np.reshape(dataset[:,3],(306,1)))\ntransformed_kap=arenaKap_scaler.transform(np.reshape(dataset[:,4],(306,1)))\nprint(transformed_kap)", "[[0.21655172]\n [0.24848276]\n [0.21213793]\n [0.42758621]\n [0.23772414]\n [0.27606897]\n [0.216 ]\n [0.20689655]\n [1. ]\n [0.42413793]\n [0.34496552]\n [0.21213793]\n [0.22758621]\n [0.45475862]\n [0.24365517]\n [0.4137931 ]\n [0.28965517]\n [1. ]\n [0.24365517]\n [0.23772414]\n [0.42758621]\n [0.20689655]\n [0.4137931 ]\n [0.21655172]\n [0.216 ]\n [0.24848276]\n [0.27606897]\n [0.28965517]\n [0.34496552]\n [0.4137931 ]\n [0.23772414]\n [0.45475862]\n [0.21213793]\n [0.28965517]\n [0.216 ]\n [0.4137931 ]\n [0.22758621]\n [0.42758621]\n [1. ]\n [0.24848276]\n [0.20689655]\n [0.45475862]\n [0.27606897]\n [0.21655172]\n [0.27606897]\n [1. ]\n [0.24848276]\n [0.23772414]\n [0.4137931 ]\n [0.28965517]\n [0.4137931 ]\n [0.28965517]\n [0.34496552]\n [0.42758621]\n [0.21655172]\n [0.45475862]\n [0.20689655]\n [0.21213793]\n [0.42413793]\n [0.22758621]\n [0.216 ]\n [0.24365517]\n [0.23772414]\n [0.24848276]\n [0.27606897]\n [0.216 ]\n [0.21213793]\n [0.28965517]\n [1. ]\n [0.34496552]\n [0.28965517]\n [0.42413793]\n [0.20689655]\n [0.42758621]\n [0.4137931 ]\n [0.22758621]\n [0.28965517]\n [0.4137931 ]\n [0.45475862]\n [0.24365517]\n [0.42413793]\n [0.23772414]\n [0.34496552]\n [0.4137931 ]\n [0.216 ]\n [0.27606897]\n [0.21655172]\n [0.4137931 ]\n [0.45475862]\n [0.28965517]\n [1. ]\n [0.45475862]\n [0.24848276]\n [0.22758621]\n [0.42758621]\n [0.28965517]\n [0.21213793]\n [0.24365517]\n [0.42413793]\n [0.20689655]\n [0.34496552]\n [0.21655172]\n [0.45475862]\n [0.216 ]\n [0.42413793]\n [0.27606897]\n [0.4137931 ]\n [0.22758621]\n [0.42413793]\n [0.28965517]\n [0.24848276]\n [0.42758621]\n [0.23772414]\n [0.28965517]\n [0.24365517]\n [0.4137931 ]\n [0.34496552]\n [0.21213793]\n [0.27606897]\n [0.42758621]\n [0.22758621]\n [0.20689655]\n [1. ]\n [0.21655172]\n [0.216 ]\n [0.24848276]\n [0.34496552]\n [0.24365517]\n [0.23772414]\n [0.42413793]\n [0.28965517]\n [0.21213793]\n [1. ]\n [0.21655172]\n [0.4137931 ]\n [0.42758621]\n [0.24365517]\n [0.28965517]\n [0.216 ]\n [0.20689655]\n [0.4137931 ]\n [0.22758621]\n [0.24848276]\n [0.23772414]\n [0.28965517]\n [0.27606897]\n [0.28965517]\n [0.4137931 ]\n [0.34496552]\n [0.20689655]\n [0.42413793]\n [0.27606897]\n [0.4137931 ]\n [0.4137931 ]\n [0.20689655]\n [0.28965517]\n [0.4137931 ]\n [0.24365517]\n [0.21655172]\n [1. ]\n [0.42758621]\n [0.27606897]\n [0.28965517]\n [0.216 ]\n [0.22758621]\n [0.4137931 ]\n [0.24848276]\n [0.20689655]\n [0.28965517]\n [0.23772414]\n [0.45475862]\n [0.4137931 ]\n [1. ]\n [0.21213793]\n [0.34496552]\n [0.24365517]\n [0.24848276]\n [0.21655172]\n [0.42758621]\n [0.4137931 ]\n [0.21213793]\n [0.22758621]\n [0.4137931 ]\n [0.20689655]\n [0.42413793]\n [1. ]\n [0.42758621]\n [0.22758621]\n [0.216 ]\n [0.28965517]\n [0.45475862]\n [0.21213793]\n [0.21655172]\n [0.24848276]\n [0.28965517]\n [0.28965517]\n [0.23772414]\n [1. ]\n [0.28965517]\n [0.34496552]\n [0.21213793]\n [0.27606897]\n [0.22758621]\n [0.23772414]\n [0.216 ]\n [0.28965517]\n [0.24365517]\n [0.42758621]\n [0.45475862]\n [0.4137931 ]\n [0.21655172]\n [0.21213793]\n [1. ]\n [0.42758621]\n [0.24848276]\n [0.27606897]\n [0.42413793]\n [0.20689655]\n [0.4137931 ]\n [0.34496552]\n [0.23772414]\n [0.216 ]\n [0.21655172]\n [0.22758621]\n [0.28965517]\n [0.24365517]\n [0.28965517]\n [0.45475862]\n [0.4137931 ]\n [0.23772414]\n [0.34496552]\n [0.24365517]\n [0.27606897]\n [0.4137931 ]\n [0.21213793]\n [0.24365517]\n [1. ]\n [0.42758621]\n [0.42413793]\n [0.24848276]\n [0.34496552]\n [0.45475862]\n [0.22758621]\n [0.23772414]\n [0.45475862]\n [0.21655172]\n [0.28965517]\n [0.216 ]\n [0.20689655]\n [0.28965517]\n [0.4137931 ]\n [0.42413793]\n [0.23772414]\n [1. ]\n [0.27606897]\n [0.21213793]\n [0.42413793]\n [0.4137931 ]\n [0.34496552]\n [0.24848276]\n [0.24365517]\n [0.21655172]\n [0.28965517]\n [0.42413793]\n [0.22758621]\n [0.20689655]\n [0.4137931 ]\n [0.28965517]\n [0.45475862]\n [0.216 ]\n [0.45475862]\n [0.42758621]\n [0.4137931 ]\n [0.27606897]\n [0.34496552]\n [0.24848276]\n [0.21655172]\n [0.22758621]\n [0.24365517]\n [0.28965517]\n [0.42413793]\n [1. ]\n [0.21213793]\n [0.20689655]\n [0.28965517]\n [0.4137931 ]\n [0.216 ]\n [0.4137931 ]\n [0.45475862]\n [0.27606897]\n [0.24365517]\n [0.34496552]\n [0.23772414]\n [0.42758621]\n [0.42413793]\n [0.216 ]\n [0.22758621]\n [0.28965517]\n [0.28965517]\n [0.4137931 ]\n [0.21213793]\n [0.24848276]\n [1. ]\n [0.4137931 ]\n [0.21655172]\n [0.20689655]]\n" ] ], [ [ "### Data - Zusammenfügen der Spalten home_ids, gast_ids, zuschauer, Hallenkapazität, home_win", "_____no_output_____" ] ], [ [ "data=np.c_[transformed_home_ids,transformed_gast_ids,transformed_zuschauer,transformed_kap,dataset[:,2]]\nprint(data)", "[['0' '0' '0' ... '0.21655172413793106' '0.21655172413793106' '1']\n ['0' '0' '0' ... '0.1597241379310345' '0.24848275862068966' '1']\n ['0' '0' '0' ... '0.14282758620689656' '0.21213793103448278' '0']\n ...\n ['0' '0' '0' ... '0.3913793103448276' '0.41379310344827586' '0']\n ['0' '0' '0' ... '0.21655172413793106' '0.21655172413793106' '1']\n ['0' '0' '0' ... '0.1620689655172414' '0.20689655172413793' '0']]\n" ], [ "print(len(data[0]))", "39\n" ] ], [ [ "# Netz Modellierung", "_____no_output_____" ] ], [ [ "# Importing the Keras libraries and packages \nfrom keras.models import Sequential\nfrom keras.layers import Dense\n\n# Initialising the ANN\nregressor = Sequential()\n\n# Adding the input layer and the first hidden layer\nregressor.add(Dense(units = 38, kernel_initializer = 'uniform', activation = 'relu', input_shape = (38,)))\n\n# Adding the second hidden layer\nregressor.add(Dense(units = 18, kernel_initializer = 'uniform', activation = 'relu'))\n\n# Adding the output layer\nregressor.add(Dense(units = 1, kernel_initializer = 'uniform', activation = 'sigmoid'))\n\n#Summary anzeigen\nregressor.summary()\n\n# Compiling the ANN - wie soll es lernen\nregressor.compile(optimizer = 'adam', loss = 'mean_squared_error', metrics = ['accuracy'])#binary_crossentropy\n\n# Fitting the ANN to the Training set \n#input = data[:,0:4] output= (data[:,4]\nhistory = regressor.fit(data[:,0:38], data[:,38], batch_size = 10, epochs = 100, validation_split = 0.1)\n\n\n\n", "_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\ndense_1 (Dense) (None, 38) 1482 \n_________________________________________________________________\ndense_2 (Dense) (None, 18) 702 \n_________________________________________________________________\ndense_3 (Dense) (None, 1) 19 \n=================================================================\nTotal params: 2,203\nTrainable params: 2,203\nNon-trainable params: 0\n_________________________________________________________________\nTrain on 275 samples, validate on 31 samples\nEpoch 1/100\n275/275 [==============================] - 0s 1ms/step - loss: 0.2499 - acc: 0.5273 - val_loss: 0.2499 - val_acc: 0.5161\nEpoch 2/100\n275/275 [==============================] - 0s 164us/step - loss: 0.2495 - acc: 0.5418 - val_loss: 0.2493 - val_acc: 0.5161\nEpoch 3/100\n275/275 [==============================] - 0s 154us/step - loss: 0.2479 - acc: 0.5600 - val_loss: 0.2465 - val_acc: 0.5484\nEpoch 4/100\n275/275 [==============================] - 0s 149us/step - loss: 0.2413 - acc: 0.5964 - val_loss: 0.2384 - val_acc: 0.6452\nEpoch 5/100\n275/275 [==============================] - 0s 152us/step - loss: 0.2264 - acc: 0.6945 - val_loss: 0.2250 - val_acc: 0.6129\nEpoch 6/100\n275/275 [==============================] - 0s 146us/step - loss: 0.2074 - acc: 0.7018 - val_loss: 0.2073 - val_acc: 0.6774\nEpoch 7/100\n275/275 [==============================] - 0s 155us/step - loss: 0.1889 - acc: 0.7418 - val_loss: 0.2014 - val_acc: 0.7097\nEpoch 8/100\n275/275 [==============================] - 0s 141us/step - loss: 0.1757 - acc: 0.7418 - val_loss: 0.2019 - val_acc: 0.6774\nEpoch 9/100\n275/275 [==============================] - 0s 146us/step - loss: 0.1671 - acc: 0.7600 - val_loss: 0.2042 - val_acc: 0.6774\nEpoch 10/100\n275/275 [==============================] - 0s 149us/step - loss: 0.1643 - acc: 0.7527 - val_loss: 0.2080 - val_acc: 0.7097\nEpoch 11/100\n275/275 [==============================] - 0s 170us/step - loss: 0.1608 - acc: 0.7709 - val_loss: 0.2123 - val_acc: 0.7097\nEpoch 12/100\n275/275 [==============================] - 0s 165us/step - loss: 0.1560 - acc: 0.7782 - val_loss: 0.2141 - val_acc: 0.6774\nEpoch 13/100\n275/275 [==============================] - 0s 163us/step - loss: 0.1554 - acc: 0.7818 - val_loss: 0.2163 - val_acc: 0.7097\nEpoch 14/100\n275/275 [==============================] - 0s 157us/step - loss: 0.1574 - acc: 0.7818 - val_loss: 0.2193 - val_acc: 0.6774\nEpoch 15/100\n275/275 [==============================] - 0s 159us/step - loss: 0.1547 - acc: 0.7927 - val_loss: 0.2183 - val_acc: 0.7097\nEpoch 16/100\n275/275 [==============================] - 0s 154us/step - loss: 0.1499 - acc: 0.8036 - val_loss: 0.2196 - val_acc: 0.7097\nEpoch 17/100\n275/275 [==============================] - 0s 158us/step - loss: 0.1487 - acc: 0.8073 - val_loss: 0.2169 - val_acc: 0.7097\nEpoch 18/100\n275/275 [==============================] - 0s 162us/step - loss: 0.1490 - acc: 0.8145 - val_loss: 0.2198 - val_acc: 0.7097\nEpoch 19/100\n275/275 [==============================] - 0s 159us/step - loss: 0.1454 - acc: 0.8073 - val_loss: 0.2180 - val_acc: 0.7097\nEpoch 20/100\n275/275 [==============================] - 0s 158us/step - loss: 0.1436 - acc: 0.8218 - val_loss: 0.2186 - val_acc: 0.7097\nEpoch 21/100\n275/275 [==============================] - 0s 154us/step - loss: 0.1421 - acc: 0.8182 - val_loss: 0.2205 - val_acc: 0.7097\nEpoch 22/100\n275/275 [==============================] - 0s 162us/step - loss: 0.1416 - acc: 0.8145 - val_loss: 0.2219 - val_acc: 0.7097\nEpoch 23/100\n275/275 [==============================] - 0s 160us/step - loss: 0.1408 - acc: 0.8036 - val_loss: 0.2199 - val_acc: 0.7097\nEpoch 24/100\n275/275 [==============================] - 0s 154us/step - loss: 0.1360 - acc: 0.8327 - val_loss: 0.2209 - val_acc: 0.7097\nEpoch 25/100\n275/275 [==============================] - 0s 151us/step - loss: 0.1337 - acc: 0.8364 - val_loss: 0.2192 - val_acc: 0.7097\nEpoch 26/100\n275/275 [==============================] - 0s 154us/step - loss: 0.1318 - acc: 0.8400 - val_loss: 0.2187 - val_acc: 0.7097\nEpoch 27/100\n275/275 [==============================] - 0s 154us/step - loss: 0.1302 - acc: 0.8364 - val_loss: 0.2218 - val_acc: 0.7097\nEpoch 28/100\n275/275 [==============================] - 0s 160us/step - loss: 0.1276 - acc: 0.8364 - val_loss: 0.2190 - val_acc: 0.7097\nEpoch 29/100\n275/275 [==============================] - 0s 156us/step - loss: 0.1263 - acc: 0.8545 - val_loss: 0.2207 - val_acc: 0.7097\nEpoch 30/100\n275/275 [==============================] - 0s 153us/step - loss: 0.1235 - acc: 0.8473 - val_loss: 0.2206 - val_acc: 0.7097\nEpoch 31/100\n275/275 [==============================] - 0s 155us/step - loss: 0.1202 - acc: 0.8509 - val_loss: 0.2191 - val_acc: 0.7097\nEpoch 32/100\n275/275 [==============================] - 0s 156us/step - loss: 0.1177 - acc: 0.8655 - val_loss: 0.2207 - val_acc: 0.7097\nEpoch 33/100\n275/275 [==============================] - 0s 153us/step - loss: 0.1150 - acc: 0.8655 - val_loss: 0.2177 - val_acc: 0.7097\nEpoch 34/100\n275/275 [==============================] - 0s 156us/step - loss: 0.1139 - acc: 0.8618 - val_loss: 0.2213 - val_acc: 0.7097\nEpoch 35/100\n275/275 [==============================] - 0s 157us/step - loss: 0.1107 - acc: 0.8800 - val_loss: 0.2148 - val_acc: 0.7097\nEpoch 36/100\n275/275 [==============================] - 0s 162us/step - loss: 0.1081 - acc: 0.8873 - val_loss: 0.2220 - val_acc: 0.7097\nEpoch 37/100\n275/275 [==============================] - 0s 157us/step - loss: 0.1047 - acc: 0.8909 - val_loss: 0.2192 - val_acc: 0.7097\nEpoch 38/100\n275/275 [==============================] - 0s 159us/step - loss: 0.1010 - acc: 0.8982 - val_loss: 0.2176 - val_acc: 0.7097\nEpoch 39/100\n275/275 [==============================] - 0s 147us/step - loss: 0.0994 - acc: 0.8982 - val_loss: 0.2125 - val_acc: 0.7419\nEpoch 40/100\n275/275 [==============================] - 0s 148us/step - loss: 0.0947 - acc: 0.9055 - val_loss: 0.2207 - val_acc: 0.7097\nEpoch 41/100\n275/275 [==============================] - 0s 144us/step - loss: 0.0915 - acc: 0.9091 - val_loss: 0.2206 - val_acc: 0.7097\nEpoch 42/100\n275/275 [==============================] - 0s 148us/step - loss: 0.0867 - acc: 0.9127 - val_loss: 0.2206 - val_acc: 0.7097\nEpoch 43/100\n275/275 [==============================] - 0s 153us/step - loss: 0.0850 - acc: 0.9164 - val_loss: 0.2172 - val_acc: 0.7097\nEpoch 44/100\n275/275 [==============================] - 0s 148us/step - loss: 0.0800 - acc: 0.9200 - val_loss: 0.2218 - val_acc: 0.7097\nEpoch 45/100\n275/275 [==============================] - 0s 148us/step - loss: 0.0763 - acc: 0.9309 - val_loss: 0.2189 - val_acc: 0.7097\nEpoch 46/100\n275/275 [==============================] - 0s 146us/step - loss: 0.0724 - acc: 0.9309 - val_loss: 0.2271 - val_acc: 0.6774\nEpoch 47/100\n275/275 [==============================] - 0s 155us/step - loss: 0.0710 - acc: 0.9345 - val_loss: 0.2251 - val_acc: 0.6774\nEpoch 48/100\n275/275 [==============================] - 0s 164us/step - loss: 0.0690 - acc: 0.9455 - val_loss: 0.2240 - val_acc: 0.7097\nEpoch 49/100\n275/275 [==============================] - 0s 162us/step - loss: 0.0629 - acc: 0.9491 - val_loss: 0.2297 - val_acc: 0.6452\nEpoch 50/100\n275/275 [==============================] - 0s 156us/step - loss: 0.0595 - acc: 0.9491 - val_loss: 0.2249 - val_acc: 0.6774\nEpoch 51/100\n275/275 [==============================] - 0s 159us/step - loss: 0.0572 - acc: 0.9527 - val_loss: 0.2326 - val_acc: 0.6774\nEpoch 52/100\n275/275 [==============================] - 0s 157us/step - loss: 0.0530 - acc: 0.9527 - val_loss: 0.2269 - val_acc: 0.6774\nEpoch 53/100\n275/275 [==============================] - 0s 162us/step - loss: 0.0514 - acc: 0.9491 - val_loss: 0.2327 - val_acc: 0.6774\nEpoch 54/100\n275/275 [==============================] - 0s 162us/step - loss: 0.0504 - acc: 0.9600 - val_loss: 0.2365 - val_acc: 0.6774\nEpoch 55/100\n" ], [ "#\nimport matplotlib.pyplot as plt\n\nhandles = []\n\nlabel, = plt.plot(history.history['acc'], label=\"acc\")\nhandles.append(label)\nlabel, = plt.plot(history.history['val_acc'], label=\"val_acc\")\nhandles.append(label)\nplt.title('Kostenfunktion')\nplt.ylabel('Kosten')\nplt.xlabel('Epochen')\nplt.legend(handles=handles, loc='upper right')\nfigure = plt.gcf() # get current figure\nfigure.set_size_inches(8, 6) # um die größe des Plots anzupassen\n#plt.savefig(pathpathpaht) # hiermit kannst das ding als auch als bild an dem angegebenen ort plus name ablegen\nplt.show()\n\n", "_____no_output_____" ], [ "handles = []\n\nlabel, = plt.plot(history.history['loss'], label=\"loss\")\nhandles.append(label)\nlabel, = plt.plot(history.history['val_loss'], label=\"val_loss\")\nhandles.append(label)\nplt.title('Kostenfunktion')\nplt.ylabel('Kosten')\nplt.xlabel('Epochen')\nplt.legend(handles=handles, loc='upper right')\nfigure = plt.gcf() # get current figure\nfigure.set_size_inches(8, 6) # um die größe des Plots anzupassen\n#plt.savefig(pathpathpaht) # hiermit kannst das ding als auch als bild an dem angegebenen ort plus name ablegen\nplt.show()", "_____no_output_____" ], [ "import time as tm\nimport datetime\nimport pickle\n \n \ndef create_file_name():\n ts = tm.time()\n name = datetime.datetime.fromtimestamp(ts).strftime('%Y%m%d%H%M%S') + '_ann'\n return name\n\npath='./Netze/'\nname_file= create_file_name()\n\n", "_____no_output_____" ], [ "with open(path + name_file + '.pkl', 'wb') as output:\n ann_net = {'history_val_loss':history.history['val_loss'],'history_loss':history.history['loss']}\n pickle.dump(ann_net, output)", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ] ]
e7e49d66ceac0330d690e822f83ae0c4ba56e621
8,427
ipynb
Jupyter Notebook
Generate Sales Mix Starting Point.ipynb
ischultz-cadeo/TO_43_Sales_Data
cbd54a05adfcbba797efc5f906ed2882b22f8228
[ "MIT" ]
null
null
null
Generate Sales Mix Starting Point.ipynb
ischultz-cadeo/TO_43_Sales_Data
cbd54a05adfcbba797efc5f906ed2882b22f8228
[ "MIT" ]
null
null
null
Generate Sales Mix Starting Point.ipynb
ischultz-cadeo/TO_43_Sales_Data
cbd54a05adfcbba797efc5f906ed2882b22f8228
[ "MIT" ]
null
null
null
31.095941
178
0.423164
[ [ [ "import pandas as pd\nimport pickle as pkl", "_____no_output_____" ] ], [ [ "This is a simple workbook used to generate the starting point for the weighting process. The tables in the workbook were in a strange format so I just did it manually here.", "_____no_output_____" ] ], [ [ "all_rows_post = pd.read_pickle('all_rows_post2.pkl')", "_____no_output_____" ], [ "all_rows_post = all_rows_post.groupby(['yearSale','Sector','Technology','HeatingEfficiency','CoolingEfficiency']).sum().reset_index()\nall_rows_post = all_rows_post[all_rows_post['Sector'] == 'Residential']\nkey_techs = ['Heat Pump','Heat Pump - Ductless','Central Air Conditioning - Condenser','Gas Furnace']\nall_rows_post = all_rows_post[all_rows_post['Technology'].isin(key_techs)]\nall_rows_post = all_rows_post.drop(['Reported Quantity','Supplier','extrapped_qty','TOTAL'], axis=1)\nall_rows_post = all_rows_post.replace('NA','UNDEFINED')", "_____no_output_____" ], [ "all_rows_post.to_pickle('sales_mix.pkl')", "_____no_output_____" ], [ "all_rows_post", "_____no_output_____" ] ] ]
[ "code", "markdown", "code" ]
[ [ "code" ], [ "markdown" ], [ "code", "code", "code", "code" ] ]
e7e4af70dcbaa8b5f41023cf378e51e30fc924a4
61,879
ipynb
Jupyter Notebook
recurrent-neural-networks/char-rnn/Character_Level_RNN_Solution.ipynb
jiayinjx/deep-learning-v2-pytorch
98e551a33c696fc5d5bc5f5d1d60397e9bbbf7fc
[ "MIT" ]
1
2019-10-23T02:51:01.000Z
2019-10-23T02:51:01.000Z
recurrent-neural-networks/char-rnn/Character_Level_RNN_Solution.ipynb
jiayinjx/deep-learning-v2-pytorch
98e551a33c696fc5d5bc5f5d1d60397e9bbbf7fc
[ "MIT" ]
null
null
null
recurrent-neural-networks/char-rnn/Character_Level_RNN_Solution.ipynb
jiayinjx/deep-learning-v2-pytorch
98e551a33c696fc5d5bc5f5d1d60397e9bbbf7fc
[ "MIT" ]
null
null
null
47.3443
564
0.55594
[ [ [ "empty" ] ] ]
[ "empty" ]
[ [ "empty" ] ]
e7e4affb56bad3b6413588d4d2546119bf5b3b5d
64,382
ipynb
Jupyter Notebook
notebook/test.ipynb
Kelvinrr/themis
ce0dd18f56de4e00310ed3983c6da954be9c7856
[ "Unlicense" ]
null
null
null
notebook/test.ipynb
Kelvinrr/themis
ce0dd18f56de4e00310ed3983c6da954be9c7856
[ "Unlicense" ]
null
null
null
notebook/test.ipynb
Kelvinrr/themis
ce0dd18f56de4e00310ed3983c6da954be9c7856
[ "Unlicense" ]
null
null
null
100.596875
30,336
0.791976
[ [ [ "import sys\nimport os \nsys.path.insert(0, os.path.abspath('..'))\n\nfrom functools import reduce \n\nfrom pysis.isis import spiceinit, footprintinit, jigsaw, pointreg, cam2map\nfrom pysis.exceptions import ProcessError\nimport pvl \nimport matplotlib.pyplot as plt\n\nimport autocnet\nfrom autocnet import CandidateGraph\nfrom autocnet.graph.edge import Edge\nfrom autocnet.matcher import suppression_funcs\n\n\nfrom functools import partial\n\nimport subprocess\nfrom subprocess import Popen, PIPE\n\nimport gdal\nimport plio \nfrom plio.io.io_gdal import GeoDataset\n\n\nimport themis\nfrom themis import config\nfrom themis.examples import get_path\n\n\n%matplotlib inline", "_____no_output_____" ], [ "from pylab import rcParams\nrcParams['figure.figsize'] = 50, 100", "_____no_output_____" ], [ "!module load davinci\n!source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh isis3", " ISIS3 Setup In: /usgs/pkgs/isis3.5.2/isis - Successful\r\n\r\n" ], [ "mapfile = pvl.loads(\"\"\"\nGroup = Mapping\n ProjectionName = Equirectangular\n CenterLongitude = 0.0\n TargetName = Mars\n LatitudeType = Planetocentric\n LongitudeDirection = PositiveEast\n LongitudeDomain = 180\nEnd_Group\n\"\"\")", "_____no_output_____" ], [ "def run_davinci(script, infile=None, outfile=None, bin_dir=config.davinci_bin, args=[]):\n '''\n '''\n command = ['davinci', '-f', os.path.join(bin_dir, script), 'from={}'.format(infile), 'to={}'.format(outfile)]\n\n # add additional positional args\n if args:\n command.extend(args)\n\n print(' '.join(command))\n p = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE)\n output, err = p.communicate(b\"input data that is passed to subprocess' stdin\")\n rc = p.returncode\n\n if rc != 0:\n raise Exception('Davinci returned non-zero error code {} : {}'.format(rc, err.decode('utf-8')))\n return output.decode('utf-8'), err.decode('utf-8')\n\ndef init(thm_id, outfile):\n '''\n Downloads Themis file by ID and runs it through spice init and\n footprint init.\n '''\n\n # Download themis file\n out, err = run_davinci('thm_pre_process.dv', infile=thm_id, outfile=outfile)\n \n # Run spiceinit and footprintint\n try:\n spiceinit(from_=outfile)\n except ProcessError as e:\n print('Spice Init Error')\n print('file: {}'.format(outfile))\n print(\"STDOUT:\", e.stdout.decode('utf-8'))\n print(\"STDERR:\", e.stderr.decode('utf-8'))\n try:\n footprintinit(from_=outfile)\n except ProcessError as e:\n print('Footprint Init Error')\n print('file: {}'.format(outfile))\n print(\"STDOUT:\", e.stdout.decode('utf-8'))\n print(\"STDERR:\", e.stderr.decode('utf-8'))\n\ndef thm_crop(infile, outfile, minlat, maxlat):\n run_davinci('thm_crop_lat.dv', infile, outfile, args=['minlat={}'.format(str(minlat)), 'maxlat={}'.format(maxlat)])\n\n\ndef match(img1, img2, extraction_kwargs={}, fmatrix_params={}, suppr_params={}, pointreg_params={}, bundle_params={}):\n '''\n Matches a list of files.\n\n Parameters\n ----------\n filelist : list\n list of files to match, they must of had spiceinit and footprint init run on them\n\n fmatrix_params : dict\n Dictionary of params for computing the fundamental matrix\n\n suppr_params : dict\n Dictionary of params for spatially suppressing control points\n\n pointreg_params : dict\n parameters for the isis3 application point for subpixel registration\n\n bundle_params : dict\n parameters for the isis3 application jigsaw for bundle adjustment\n\n See Also\n --------\n extractor params: https://github.com/USGS-Astrogeology/autocnet/blob/dev/autocnet/matcher/cpu_extractor.py\n ration check params: https://github.com/USGS-Astrogeology/autocnet/blob/dev/autocnet/matcher/cpu_outlier_detector.py\n spatial suppression params: https://github.com/USGS-Astrogeology/autocnet/blob/dev/autocnet/matcher/cpu_outlier_detector.py\n jigsaw: https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/jigsaw/jigsaw.html\n pointreg: https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/pointreg/pointreg.html\n '''\n filelist = [img1_path, img2_path]\n cg = CandidateGraph.from_filelist(filelist)\n # The range of DN values over the data is small, so the threshold for differentiating interesting features must be small.\n cg.extract_features(extractor_parameters={'contrastThreshold':0.000001})\n cg.match()\n\n e = cg[0][1]['data'] \n e.symmetry_check()\n e.ratio_check(clean_keys=['symmetry'])\n\n cg.compute_fundamental_matrices(clean_keys=['symmetry', 'ratio'], reproj_threshold=1, mle_reproj_threshold=0.2)\n cg.suppress(clean_keys=['symmetry', 'ratio','fundamental'], suppression_func=suppression_funcs.distance, k=30)\n cg.generate_control_network(clean_keys=['fundamental', 'suppression'])\n return cg\n\n \ndef project(img1, img2, img1proj, img2proj, mapfile='equirectangular.map'):\n cam2map_params1 = {\n 'from_' : img1,\n 'map' : mapfile,\n 'to' : img1proj\n }\n\n cam2map_params2 = {\n 'from_' : img2,\n 'map' : img1proj,\n 'to' : img2proj,\n 'matchmap' : 'yes'\n }\n\n try:\n print('Running cam2map on {}'.format(img1))\n cam2map(**cam2map_params1)\n print('Running cam2map on {}'.format(img2))\n cam2map(**cam2map_params2)\n except ProcessError as e:\n print('cam2map Error')\n print(\"STDOUT:\", e.stdout.decode('utf-8'))\n print(\"STDERR:\", e.stderr.decode('utf-8'))\n \n \ndef subpixel_registration(filelist, cnet_file, pointreg_file):\n if isinstance(pointreg_file, list):\n pointreg_file = [pointreg_file]\n \n for regfile in pointreg_file:\n pointreg_params = {\n 'from_' : cubelis,\n 'cnet' : cnet_file,\n 'onet' : cnet_file,\n 'deffile': regfile\n }\n \n try:\n pointreg(**pointreg_params)\n except ProcessError as e:\n print('Pointreg Error')\n print(\"STDOUT:\", e.stdout.decode('utf-8'))\n print(\"STDERR:\", e.stderr.decode('utf-8'))\n\n", "_____no_output_____" ], [ "config.data = \"/scratch/krodriguez/thm_matches\"", "_____no_output_____" ], [ "data_dir = config.data\n\nid1 = 'I01001001'\nid2 = 'I01001001'\n\n# enforce ID1 < ID2 \nid1, id2 = sorted([id1, id2])\n\n# Directory Structure: \n# IMG1 \n# - image.cube \n# - IMG2/\n# - IMG2.cub \n# - metadata.json \n# - filelist.txt\n# - proj.map\n# - cnet.net\n# - IMG3/\n# .\n# .\n# . \nimg1_datapath = os.path.join(data_dir, id1)\npair_datapath = os.path.join(data_dir, id1, id2)\n\nimg1_path = os.path.join(img1_datapath, '{}.cub'.format(id1))\nimg2_path = os.path.join(pair_datapath, '{}.cub'.format(id2))\n\nimg1_cropped_path = os.path.join(img1_datapath, '{}.cropped.cub'.format(id1))\nimg2_cropped_path = os.path.join(pair_datapath, '{}.cropped.cub'.format(id2))\n\ncubelis = os.path.join(pair_datapath, 'filelist.txt')\ncnet_path = os.path.join(pair_datapath, 'cnet.net')\n\nprint('Making directories {} and {}'.format(img1_datapath, pair_datapath))\nos.makedirs(img1_datapath, exist_ok=True)\nos.makedirs(pair_datapath, exist_ok=True)\n\n# write out cubelist\nwith open(cubelis, 'w') as f:\n f.write(img1_path + '\\n')\n f.write(img2_path + '\\n')\n\nimg1proj = '{}.proj.cub'.format(img1_path.split('.')[0])\nimg2proj = '{}.proj.cub'.format(img2_path.split('.')[0])\n\nif not os.path.exists(img1_path):\n init(id1, img1_path)\nelse:\n print(\"{} already in cache, skipping redownload\".format(img1_path))\n \nif not os.path.exists(img2_path):\n init(id2, img2_path)\nelse:\n print(\"{} already in cache, skipping redownload\".format(img2_path))", "Making directories /scratch/krodriguez/thm_matches/I01001001 and /scratch/krodriguez/thm_matches/I01001001/I01001001\ndavinci -f ~/Downloads/davinci/thm_pre_process.dv from=I01001001 to=/scratch/krodriguez/thm_matches/I01001001/I01001001.cub\nSpice Init Error\nfile: /scratch/krodriguez/thm_matches/I01001001/I01001001.cub\nSTDOUT: \nSTDERR: **I/O ERROR** Unable to open [/scratch/krodriguez/thm_matches/I01001001/I01001001.cub].\n\nFootprint Init Error\nfile: /scratch/krodriguez/thm_matches/I01001001/I01001001.cub\nSTDOUT: \nSTDERR: **I/O ERROR** Unable to open [/scratch/krodriguez/thm_matches/I01001001/I01001001.cub].\n\n/scratch/krodriguez/thm_matches/I01001001/I01001001/I01001001.cub already in cache, skipping redownload\n" ], [ "img1_fh = GeoDataset(img1_path)\nimg2_fh = GeoDataset(img2_path)\n\n# minLat maxLat minLon maxLon\n# minLat, maxLat,_,_ = img1_fh.footprint.Intersection(img2_fh.footprint).GetEnvelope()\n# thm_crop(img1_path, img1_cropped_path, minLat, maxLat)\n# thm_crop(img2_path, img2_cropped_path, minLat, maxLat)\n\nimg1_cropped_fh = GeoDataset(img1_cropped_path)\nimg1_cropped_fh.read_array()", "_____no_output_____" ], [ "img1_cropped_path, img2_cropped_path", "_____no_output_____" ], [ "# plt.imshow(GeoDataset(img1_path).read_array())", "_____no_output_____" ], [ "img1_fh.footprint.Intersection(img2_fh.footprint).GetEnvelope", "_____no_output_____" ], [ "img1_fh.footprint.Intersection(img2_fh.footprint).GetEnvelope", "_____no_output_____" ], [ "cg = match(img1_cropped_path, img2_cropped_path)\ncg.to_isis(os.path.splitext(cnet_path)[0])", "_____no_output_____" ], [ "# isis_files = get_path('isis_files')\n# pass1_file = os.path.join(isis_files, 'pointreg_pass1.def')\n# pass2_file = os.path.join(isis_files, 'pointreg_pass2.def')\n# subpixel_registration(cubelis, cnet_path, [pass1_file, pass2_file])", "_____no_output_____" ], [ "import pandas as pd \nbundle_parameters = {\n 'from_' : cubelis,\n 'cnet' : cnet_path,\n 'onet' : cnet_path,\n 'radius' : 'yes',\n 'update' : 'yes',\n 'errorpropagation' : 'no',\n 'outlier_rejection' : 'no',\n 'sigma0' : '1.0e-10',\n 'maxits' : 10,\n 'camsolve' : 'accelerations',\n 'twist' : 'yes',\n 'overexisting' : 'yes',\n 'spsolve' : 'no',\n 'camera_angles_sigma' : .25,\n 'camera_angular_velocity_sigma' : .1,\n 'camera_angular_acceleration_sigma' : .01,\n 'point_radius_sigma' : 50\n}\n\ntry:\n jigsaw(**bundle_parameters)\nexcept ProcessError as e:\n print('Jigsaw Error')\n print(\"STDOUT:\", e.stdout.decode('utf-8'))\n print(\"STDERR:\", e.stderr.decode('utf-8'))\n\ndf = pd.read_csv('residuals.csv', header=1)\n\nresiduals = df.iloc[1:]['residual.1'].astype(float)\n", "Jigsaw Error\nSTDOUT: \nSTDERR: **I/O ERROR** Invalid control network [/scratch/krodriguez/thm_matches/I01001001/I01001001/cnet.net].\n**I/O ERROR** Reading the control network [cnet.net] failed.\n**I/O ERROR** Failed to convert protobuf version 2 control point at index [0] into a ControlPoint.\n**PROGRAMMER ERROR** The SerialNumber is not unique. A measure with serial number [Odyssey/THEMIS_IR/699921894.230] already exists for ControlPoint [0].\n\n" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e4b550952de614f72569dd209ebebc441a0c5f
61,099
ipynb
Jupyter Notebook
notebooks/01.01_PL_sentiment_analysis_2020_05_18.ipynb
bhattbhuwan13/fuseai-training
2739c8bd51f5ab6ad8e765184ecae1d1c2881945
[ "FTL" ]
1
2020-08-13T04:27:08.000Z
2020-08-13T04:27:08.000Z
notebooks/01.01_PL_sentiment_analysis_2020_05_18.ipynb
prajwollamichhane11/fuseai-training
2739c8bd51f5ab6ad8e765184ecae1d1c2881945
[ "FTL" ]
3
2021-04-30T21:15:06.000Z
2021-09-08T02:02:12.000Z
notebooks/01.01_PL_sentiment_analysis_2020_05_18.ipynb
prajwollamichhane11/fuseai-training
2739c8bd51f5ab6ad8e765184ecae1d1c2881945
[ "FTL" ]
1
2020-08-13T04:27:03.000Z
2020-08-13T04:27:03.000Z
33.242111
8,576
0.481825
[ [ [ "import numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom collections import Counter", "_____no_output_____" ], [ "import pickle", "_____no_output_____" ], [ "from sklearn.feature_extraction.text import TfidfVectorizer\nimport nltk", "_____no_output_____" ], [ "from sklearn.naive_bayes import MultinomialNB\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.neighbors import KNeighborsClassifier", "_____no_output_____" ], [ "from sklearn.decomposition import TruncatedSVD\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score, classification_report", "_____no_output_____" ] ], [ [ "Loading datas", "_____no_output_____" ] ], [ [ "datas = pd.read_csv('datasets/ISEAR.csv')", "_____no_output_____" ], [ "datas.head()", "_____no_output_____" ], [ "datas.columns", "_____no_output_____" ], [ "datas.drop('0', axis=1, inplace=True)", "_____no_output_____" ], [ "datas.size", "_____no_output_____" ], [ "datas.shape", "_____no_output_____" ], [ "column_name = datas.columns", "_____no_output_____" ], [ "datas = datas.rename(columns={column_name[0]: \"Emotion\",\n column_name[1]: \"Sentence\"})", "_____no_output_____" ], [ "datas.head()", "_____no_output_____" ] ], [ [ "Adding $joy$ back to the dataset", "_____no_output_____" ] ], [ [ "missing_data = {\"Emotion\": column_name[0],\n \"Sentence\": column_name[1]}", "_____no_output_____" ], [ "missing_data", "_____no_output_____" ], [ "datas = datas.append(missing_data, ignore_index=True)", "_____no_output_____" ] ], [ [ "Visualizing emotion ditribution", "_____no_output_____" ] ], [ [ "sns.catplot(kind='count', x='Emotion', data = datas)\nplt.show()", "_____no_output_____" ], [ "datas.isna().sum()", "_____no_output_____" ], [ "datas.tail()", "_____no_output_____" ], [ "y = datas['Emotion']", "_____no_output_____" ], [ "y.head()", "_____no_output_____" ], [ "X = datas['Sentence']", "_____no_output_____" ], [ "X.head()", "_____no_output_____" ] ], [ [ "Converting all text to lovercase", "_____no_output_____" ] ], [ [ "Counter(y)", "_____no_output_____" ], [ "tfidf = TfidfVectorizer(tokenizer=nltk.word_tokenize, stop_words='english', min_df=3, ngram_range=(1, 2), lowercase=True)", "_____no_output_____" ], [ "tfidf.fit(X)", "_____no_output_____" ], [ "with open('tfidt_feature_vector.pkl', 'wb') as fp:\n pickle.dump(tfidf, fp)", "_____no_output_____" ], [ "X = tfidf.transform(X)", "_____no_output_____" ], [ "tfidf.vocabulary_", "_____no_output_____" ] ], [ [ "Making Models", "_____no_output_____" ] ], [ [ "bayes_classification = MultinomialNB()\ndtree_classification = DecisionTreeClassifier()\nKnn = KNeighborsClassifier()", "_____no_output_____" ], [ "def calculate_performance(test, pred, algorithm):\n print(f'####For {algorithm}')\n print(f'{classification_report(test, pred)}')", "_____no_output_____" ], [ "def train(X, y):\n X_train, X_test, y_train, y_test = train_test_split(X, y)\n bayes_classification.fit(X_train, y_train)\n bayes_pred = bayes_classification.predict(X_test)\n calculate_performance(y_test, bayes_pred, 'Naive Bayes')\n pickle.dump(bayes_classification, open(\"Naive_bayes_model.pkl\", 'wb'))\n \n dtree_classification.fit(X_train, y_train)\n dtree_pred = dtree_classification.predict(X_test)\n calculate_performance(y_test, dtree_pred, 'Decision Tree')\n \n Knn.fit(X_train, y_train)\n knn_pred = Knn.predict(X_test)\n print(knn_pred)\n calculate_performance(y_test, dtree_pred, 'KNN')", "_____no_output_____" ], [ "train(X, y)", "####For Naive Bayes\n precision recall f1-score support\n\n anger 0.46 0.43 0.45 265\n disgust 0.59 0.60 0.59 264\n fear 0.62 0.66 0.64 260\n guilt 0.51 0.48 0.50 262\n joy 0.66 0.74 0.70 278\n sadness 0.56 0.58 0.57 271\n shame 0.53 0.47 0.49 262\n\n accuracy 0.57 1862\n macro avg 0.56 0.57 0.56 1862\nweighted avg 0.56 0.57 0.56 1862\n\n####For Decision Tree\n precision recall f1-score support\n\n anger 0.36 0.33 0.34 265\n disgust 0.41 0.47 0.44 264\n fear 0.56 0.56 0.56 260\n guilt 0.39 0.36 0.37 262\n joy 0.54 0.57 0.56 278\n sadness 0.54 0.46 0.50 271\n shame 0.35 0.39 0.37 262\n\n accuracy 0.45 1862\n macro avg 0.45 0.45 0.45 1862\nweighted avg 0.45 0.45 0.45 1862\n\n['guilt' 'anger' 'shame' ... 'anger' 'anger' 'sadness']\n####For KNN\n precision recall f1-score support\n\n anger 0.36 0.33 0.34 265\n disgust 0.41 0.47 0.44 264\n fear 0.56 0.56 0.56 260\n guilt 0.39 0.36 0.37 262\n joy 0.54 0.57 0.56 278\n sadness 0.54 0.46 0.50 271\n shame 0.35 0.39 0.37 262\n\n accuracy 0.45 1862\n macro avg 0.45 0.45 0.45 1862\nweighted avg 0.45 0.45 0.45 1862\n\n" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ] ]
e7e4c585b77e53633339c44722980860400bcd45
359,017
ipynb
Jupyter Notebook
01-data-model/01-data-model.ipynb
yuechuanx/fluent-python-code-and-notes
acb1ec19cb395746f4262aca498aba913719f571
[ "MIT" ]
2
2019-12-23T12:41:14.000Z
2020-04-26T03:54:30.000Z
01-data-model/01-data-model.ipynb
yuechuanx/fluent-python-code-and-notes
acb1ec19cb395746f4262aca498aba913719f571
[ "MIT" ]
null
null
null
01-data-model/01-data-model.ipynb
yuechuanx/fluent-python-code-and-notes
acb1ec19cb395746f4262aca498aba913719f571
[ "MIT" ]
null
null
null
879.943627
350,024
0.958453
[ [ [ "# Python 数据类型\n> Guido 对语言设计美学的深入理解让人震惊。我认识不少很不错的编程语言设计者,他们设计出来的东西确实很精彩,但是从来都不会有用户。Guido 知道如何在理论上做出一定妥协,设计出来的语言让使用者觉得如沐春风,这真是不可多得。 \n> ——Jim Hugunin \n> Jython 的作者,AspectJ 的作者之一,.NET DLR 架构师\n\n\nPython 最好的品质之一是**一致性**:你可以轻松理解 Python 语言,并通过 Python 的语言特性在类上定义**规范的接口**,来支持 Python 的核心语言特性,从而写出具有“Python 风格”的对象。 \n\nPython 解释器在碰到特殊的句法时,会使用特殊方法(我们称之为魔术方法)去激活一些基本的对象操作。\n> `__getitem__` 以双下划线开头的特殊方法,称为 dunder-getitem。特殊方法也称为双下方法(dunder-method)\n\n如 `my_c[key]` 语句执行时,就会调用 `my_c.__getitem__` 函数。这些特殊方法名能让你自己的对象实现和支持一下的语言构架,并与之交互:\n* 迭代\n* 集合类\n* 属性访问\n* 运算符重载\n* 函数和方法的调用\n* 对象的创建和销毁\n* 字符串表示形式和格式化\n* 管理上下文(即 `with` 块)\n\n## 实现一个 Pythonic 的牌组", "_____no_output_____" ] ], [ [ "# 通过实现魔术方法,来让内置函数支持你的自定义对象\n# https://github.com/fluentpython/example-code/blob/master/01-data-model/frenchdeck.py\nimport collections\nimport random\n\nCard = collections.namedtuple('Card', ['rank', 'suit'])\n\nclass FrenchDeck:\n ranks = [str(n) for n in range(2, 11)] + list('JQKA')\n suits = 'spades diamonds clubs hearts'.split()\n\n def __init__(self):\n self._cards = [Card(rank, suit) for suit in self.suits\n for rank in self.ranks]\n\n def __len__(self):\n return len(self._cards)\n\n def __getitem__(self, position):\n return self._cards[position]\n \ndeck = FrenchDeck()", "_____no_output_____" ] ], [ [ "可以容易地获得一个纸牌对象", "_____no_output_____" ] ], [ [ "beer_card = Card('7', 'diamonds')\nprint(beer_card)", "_____no_output_____" ] ], [ [ "和标准 Python 集合类型一样,使用 `len()` 查看一叠纸牌有多少张", "_____no_output_____" ] ], [ [ "deck = FrenchDeck()\n# 实现 __len__ 以支持下标操作\nprint(len(deck))", "_____no_output_____" ] ], [ [ "可选取特定一张纸牌,这是由 `__getitem__` 方法提供的", "_____no_output_____" ] ], [ [ "# 实现 __getitem__ 以支持下标操作\nprint(deck[1])\nprint(deck[5::13])", "_____no_output_____" ] ], [ [ "随机抽取一张纸牌,使用 python 内置函数 `random.choice`", "_____no_output_____" ] ], [ [ "from random import choice\n# 可以多运行几次观察\nchoice(deck)", "_____no_output_____" ] ], [ [ "实现特殊方法的两个好处:\n- 对于标准操作有固定命名\n- 更方便利用 Python 标准库", "_____no_output_____" ], [ "`__getitem__` 方法把 [] 操作交给了 `self._cards` 列表,deck 类自动支持切片操作", "_____no_output_____" ] ], [ [ "deck[12::13]\ndeck[:3]", "_____no_output_____" ] ], [ [ "同时 deck 类支持迭代", "_____no_output_____" ] ], [ [ "for card in deck:\n print(card)\n \n# 反向迭代\nfor card in reversed(deck):\n print(card)", "_____no_output_____" ] ], [ [ "迭代通常是隐式的,如果一个集合没有实现 `__contains__` 方法,那么 in 运算符会顺序做一次迭代搜索。", "_____no_output_____" ] ], [ [ "Card('Q', 'hearts') in deck \nCard('7', 'beasts') in deck", "_____no_output_____" ] ], [ [ "进行排序,排序规则:\n2 最小,A最大。花色 黑桃 > 红桃 > 方块 > 梅花", "_____no_output_____" ] ], [ [ "card.rank", "_____no_output_____" ], [ "suit_values = dict(spades=3, hearts=2, diamonds=1, clubs=0)\n\ndef spades_high(card):\n rank_value = FrenchDeck.ranks.index(card.rank)\n \n return rank_value * len(suit_values) + suit_values[card.suit]\n\nfor card in sorted(deck, key=spades_high):\n print(card)", "_____no_output_____" ] ], [ [ "FrenchDeck 继承了 object 类。通过 `__len__`, `__getitem__` 方法,FrenchDeck和 Python 自有序列数据类型一样,可体现 Python 核心语言特性(如迭代和切片),", "_____no_output_____" ], [ "Python 支持的所有魔术方法,可以参见 Python 文档 [Data Model](https://docs.python.org/3/reference/datamodel.html) 部分。\n\n比较重要的一点:不要把 `len`,`str` 等看成一个 Python 普通方法:由于这些操作的频繁程度非常高,所以 Python 对这些方法做了特殊的实现:它可以让 Python 的内置数据结构走后门以提高效率;但对于自定义的数据结构,又可以在对象上使用通用的接口来完成相应工作。但在代码编写者看来,`len(deck)` 和 `len([1,2,3])` 两个实现可能差之千里的操作,在 Python 语法层面上是高度一致的。\n\n", "_____no_output_____" ], [ "## 如何使用特殊方法\n\n特殊方法的存在是为了被 Python 解释器调用\n除非大量元编程,通常代码无需直接使用特殊方法\n通过内置函数来使用特殊方法是最好的选择\n\n### 模拟数值类型\n实现一个二维向量(Vector)类\n\n![image.png](attachment:image.png)", "_____no_output_____" ] ], [ [ "from math import hypot\n\nclass Vector:\n\n def __init__(self, x=0, y=0):\n self.x = x\n self.y = y\n\n def __repr__(self):\n return 'Vector(%r, %r)' % (self.x, self.y)\n\n def __abs__(self):\n return hypot(self.x, self.y)\n\n def __bool__(self):\n return bool(abs(self))\n\n def __add__(self, other):\n x = self.x + other.x\n y = self.y + other.y\n return Vector(x, y)\n\n def __mul__(self, scalar):\n return Vector(self.x * scalar, self.y * scalar)\n\n# 使用 + 运算符\nv1 = Vector(2, 4)\nv2 = Vector(2, 1)\nv1 + v2\n\n# 调用 abs 内置函数\nv = Vector(3, 4)\nabs(v)\n\n# 使用 * 运算符\nv * 3", "_____no_output_____" ] ], [ [ "Vector 类中 6 个方法(除 `__init__` 外)并不会在类自身的代码中调用。一般只有解释器会频繁调用这些方法", "_____no_output_____" ], [ "### 字符串的表示形式\n\n内置函数 repr, 通过 `__repr__` 特殊方法来得到一个对象的字符串表示形式。\n\n### 算数运算符\n\n通过 `__add__`, `__mul__`, 向量类能够操作 + 和 * 两个算数运算符。\n> 运算符操作对象不发生改变,返回一个产生的新值", "_____no_output_____" ], [ "### 自定义的布尔值\n\n- 任何对象可用于需要布尔值的上下文中(if, while 语句, and, or, not 运算符)\n- Python 调用 bool(x) 判定一个值 x,bool(x) 只能返回 True 或者 False\n- 如果类没有实现 `__bool__`,则调用 `__len__`, 若返回 0,则 bool 返回 False\n\n## 特殊方法一览\n\n[Reference](https://docs.python.org/3/reference/datamodel.html)\n\n## 为何 len 不是普通方法\n\n> “实用胜于纯粹“\n> ---\n> *The Zen of Python*\n\n为了让 Python 自带的数据结构走后门, CPython 会直接从结构体读取对象的长度,而不会调用方法.\n这种处理方式在保持内置类型的效率和语言一致性保持了一个平衡.\n\n## 小结\n\n- 通过实现特殊方法,自定义数据类型可以像内置类型一样处理\n- 合理的字符串表示形式是Python对象的基本要求。`__repr__`, `__str__`\n- 序列类型的模拟是特殊方法最常用的地方\n", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ] ]
e7e4d48561ff3e2da8f71354c3b024d88de73a1a
4,114
ipynb
Jupyter Notebook
Natural Language Processing & Word Embeddings.ipynb
reata/DeepLearning
7920096b3853f1e8a3a16632e3e042ad28618d22
[ "MIT" ]
null
null
null
Natural Language Processing & Word Embeddings.ipynb
reata/DeepLearning
7920096b3853f1e8a3a16632e3e042ad28618d22
[ "MIT" ]
null
null
null
Natural Language Processing & Word Embeddings.ipynb
reata/DeepLearning
7920096b3853f1e8a3a16632e3e042ad28618d22
[ "MIT" ]
1
2018-10-08T15:37:07.000Z
2018-10-08T15:37:07.000Z
23.780347
165
0.57438
[ [ [ "# 自然语言处理&词嵌入 Natural Language Processing & Word Embeddings", "_____no_output_____" ], [ "## 1. 词嵌入简介 Introduction to Word Embeddings", "_____no_output_____" ], [ "### 1.1 词汇表征 Word Representation\n\n此前对于词的表示:用词典,配合One-Hot编码。算法很难发现词与词之间的关系,也就无法利用同义词或同属性词的关系来做推断。任意两个One-Hot编码的向量的内积都是0。\n\n如果用特征来表示词呢?比如每个词都有诸如性别、年龄、食物等等[-1, 1]区间内的特征。这样如果有 $e$ 个特征,那么每个词都可以表示为 $e$ 维的向量。向量之间的相似度,可以给算法更多信息进行推断。\n\n而所谓词嵌入,就是用来寻找这样高维特征的办法。\n\n有了高维特征之后,人们也经常会将其降维到二维特征进行可视化。一个常见的算法是t-SNE。\n\n词嵌入是自然语言处理中一个非常重要的技术。", "_____no_output_____" ], [ "### 1.2 使用词嵌入 Using Word Embeddings\n\n以命名实体识别问题为例,只需要将词汇的One-Hot向量替换为特征向量即可。具体步骤:\n\n1. 从一个非常大(上亿级别)的语料库中,学习词嵌入;(或者下载提前训练好的)\n2. 将词嵌入,迁移学习到一个具有相对小训练集(比如10万的词汇)的任务,比如命名实体识别;\n3. 可选:用新的数据继续对词嵌入调参\n\n当训练集的数量相对较小时,使用词嵌入能大幅提高NLP问题的效果,比如命名实体识别、文本摘要(text summarization)、指代消解(co-reference resolution)、句法分析(parsing)。而对于语言模型、机器翻译则帮助不大。", "_____no_output_____" ], [ "### 1.3 词嵌入的特性 Properties of Word Embeddings\n\n词嵌入还可以用来帮助解决**类比推理 analogy reasoning**问题,Man is to Woman as King is to ? 只需要计算 $e_{man} - e_{woman} \\approx e_{king} - e_{?}$,这个公式可以正规地定义为对cosine相似度求最小值的优化问题。", "_____no_output_____" ], [ "### 1.4 嵌入矩阵 Embedding Matrix\n\n学习词嵌入,最终就是为了学习 #features × #words 的嵌入矩阵。用 $E$ 表示嵌入矩阵,$o_i$ 表示第 $i$ 个词的One-Hot向量,$e_i$ 表示第 $i$ 个词的嵌入向量,则有 $ E \\cdot o_i = e_i$", "_____no_output_____" ], [ "## 2. 学习词嵌入:Word2vec & GloVe ", "_____no_output_____" ], [ "### 2.1 学习词嵌入 Learning Word Embeddings\n\n[A Neural Probabilistic Language Model](http://www.jmlr.org/papers/volume3/bengio03a/bengio03a.pdf)", "_____no_output_____" ], [ "### 2.2 Word2Vec\n\n[Efficient Estimation of Word Representations in Vector Space](https://arxiv.org/pdf/1301.3781.pdf)", "_____no_output_____" ], [ "### 2.3 Negative Sampling\n\n[Distributed Representations of Words and Phrases and their Compositionality](https://arxiv.org/pdf/1310.4546.pdf)", "_____no_output_____" ], [ "### 2.4 GloVe word vectors\n\n[GloVe: Global Vectors for Word Representation](https://www.aclweb.org/anthology/D14-1162)", "_____no_output_____" ], [ "## 3. 词嵌入的应用 Applications using Word Embeddings", "_____no_output_____" ], [ "### 3.1 情感分类 Sentiment Classification\n\n方法1:将句子每个词的词嵌入向量做平均(或求和),然后喂给Softmax分类器。缺点:没有考虑词的顺序信息。\n\n方法2:运用每个词的词嵌入向量,喂给RNN,最后输出Softmax。", "_____no_output_____" ], [ "### 3.2 词嵌入除偏 Debiasing Word Embeddings\n\n[Man is to Computer Programmer as Woman is to Homemaker?\nDebiasing Word Embeddings](https://arxiv.org/pdf/1607.06520.pdf)", "_____no_output_____" ] ] ]
[ "markdown" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ] ]
e7e4d91c447b2582c355f6e0455536dab9fe29c1
14,986
ipynb
Jupyter Notebook
pose_classification/pose_classification_lstm.ipynb
julkar9/deep_learning_nano_degree
6bb77313cb95e88dcf90eb16711a2b7fff9bb23d
[ "Apache-2.0" ]
null
null
null
pose_classification/pose_classification_lstm.ipynb
julkar9/deep_learning_nano_degree
6bb77313cb95e88dcf90eb16711a2b7fff9bb23d
[ "Apache-2.0" ]
null
null
null
pose_classification/pose_classification_lstm.ipynb
julkar9/deep_learning_nano_degree
6bb77313cb95e88dcf90eb16711a2b7fff9bb23d
[ "Apache-2.0" ]
null
null
null
34.292906
152
0.521754
[ [ [ "The JSON data is fetched and stored in numpy arrays in sequences of 45 frames which is\nabout 1.5 seconds of the video [2].\n60% of the dataset has been used for training,\n20% for testing\nand 20% for validation. \n\nThe training data has 7989 sequences of 45 frames, each containing the \n\n2D coordinates of the 18 keypoints captured by OpenPose. \nThe validation data consists of 2224\nsuch sequences and the test data contains 2598 sequences.\nThe number of frames varied from 60,20,20 split at the video level. \nThis was because of the difference in duration of videos.\n", "_____no_output_____" ] ], [ [ "import torch\nimport numpy as np\nimport numpy as np\nimport pandas as pd\nimport ast\nfrom sklearn.model_selection import train_test_split\nfrom torch.utils.data import DataLoader, TensorDataset\nfrom os import listdir\n\n# check if CUDA is available\ntrain_on_gpu = torch.cuda.is_available()\n\nif not train_on_gpu:\n print('CUDA is not available. Training on CPU ...')\nelse:\n print('CUDA is available! Training on GPU ...')\n\nbatch_size = 5", "_____no_output_____" ], [ "\nfilepaths = [ str(\"./20220201\") + \"/\" + str(f) for f in listdir(\"./20220201/\") if f.endswith('.csv')]\ndata = pd.concat(map(pd.read_csv, filepaths))\ndata.drop(data.columns[0], axis=1, inplace=True)\ny = data[['1']]\nx = data.drop(['1','2'] , axis=1)\nx_train, x_test, y_train, y_test = train_test_split(x, y,test_size=0.2)\n\nX = []\nfor i in x_train.values: \n X.append(np.array(ast.literal_eval(i[0]))[0].T.astype(int))\nx_train = np.array(X)\nx_train = x_train[:, :2 , : ]\n\n\nX_t = []\nfor i in x_test.values: \n X_t.append(np.array(ast.literal_eval(i[0]))[0].T.astype(int))\nx_test = np.array(X_t)\nx_test = x_test[:, :2 , : ]\n\ntrain_data = TensorDataset(torch.tensor(np.array(x_train) , dtype=torch.float) , torch.tensor(np.array(y_train).squeeze() , dtype=torch.long))\ntrain_loader = DataLoader(train_data, batch_size=5, shuffle=True)\n\nvalid_data = TensorDataset(torch.tensor(np.array(x_test) , dtype=torch.float) , torch.tensor(np.array(y_test).squeeze() , dtype=torch.long))\nvalid_loader = DataLoader(valid_data, batch_size=5, shuffle=True)\n\nclasses = ['laying','setting', 'standing']\n\nx_train[0]", "_____no_output_____" ] ], [ [ "---\n![title](rnn_lstm_00.png)\n\n![title](rnn_lstm_0.png)\n\n![title](cnn_lstm.png)", "_____no_output_____" ], [ "### Define model structure", "_____no_output_____" ] ], [ [ "from torch import nn\nimport torch.nn.functional as F\n\nclass TimeDistributed(nn.Module):\n def __init__(self, module, batch_first=True):\n super(TimeDistributed, self).__init__()\n self.module = module\n self.batch_first = batch_first\n\n def forward(self, x):\n if len(x.size()) <= 2:\n return self.module(x)\n\n # Squash samples and timesteps into a single axis\n x_reshape = x.contiguous().view(-1, x.size(-1)) # (samples * timesteps, input_size)\n y = self.module(x_reshape)\n # We have to reshape Y\n if self.batch_first:\n y = y.contiguous().view(x.size(0), -1, y.size(-1)) # (samples, timesteps, output_size)\n else:\n y = y.view(-1, x.size(1), y.size(-1)) # (timesteps, samples, output_size)\n\n return y\n\n\nclass CNN(nn.Module):\n def __init__(self):\n super(CNN, self).__init__()\n # convolutional layer (sees 28x28x1 image tensor)\n # (W−F+2P)/S+1 = (28 - 3 )/1 + 1 = 26\n \n self.conv1 = nn.Conv1d(2, 16, kernel_size=3, padding=1)\n self.bnm = nn.BatchNorm1d(16, momentum=0.1)\n \n # (W−F+2P)/S+1 = (13 - 3 )/1 + 1 = 11\n self.conv2 = nn.Conv1d(16, 32, kernel_size=3 , padding=1)\n self.bnm2 = nn.BatchNorm1d(32, momentum=0.1)\n \n \n self.conv3 = nn.Conv1d(32, 64, kernel_size=3 , padding=1)\n self.bnm3 = nn.BatchNorm1d(64, momentum=0.1)\n \n \n self.conv4 = nn.Conv1d(64, 128, kernel_size=3 , padding=1)\n self.bnm4 = nn.BatchNorm1d(128, momentum=0.1)\n \n self.dropout = nn.Dropout(p=0.2)\n\n def forward(self, x):\n x = F.relu(self.dropout(self.bnm(self.conv1(x))))\n # print(\"conv1\", x.size())\n x = F.relu(self.dropout(self.bnm2(self.conv2(x))))\n # print(\"conv2\", x.size())\n x = F.relu(self.dropout(self.bnm3(self.conv3(x))))\n # print(\"conv3\", x.size())\n x = F.relu(self.dropout(self.bnm4(self.conv4(x))))\n # print(\"conv4\", x.size())\n x = x.view(-1, 2176)\n return x\n\n\nclass Combine(nn.Module):\n def __init__(self):\n super(Combine, self).__init__()\n self.cnn = CNN()\n self.rnn = nn.LSTM(\n input_size=128,\n hidden_size=64,\n num_layers=1,\n batch_first=True)\n self.linear = nn.Linear(64,3)\n\n def forward(self, x):\n batch_size, C, timesteps = x.size()\n # x = x.view(-1, C, timesteps)\n c_out = self.cnn(x)\n r_in = c_out.view(batch_size, timesteps, -1)\n r_out, (h_n, h_c) = self.rnn(r_in)\n r_out2 = self.linear(r_out[:, -1, :])\n return F.log_softmax(r_out2, dim=1)\n ", "_____no_output_____" ], [ "\n# define model\n# model = Sequential()\n# model.add(TimeDistributed(Conv1D(filters=64, kernel_size=3, activation='relu'), input_shape=(None,n_length,n_features)))\n# model.add(TimeDistributed(Conv1D(filters=64, kernel_size=3, activation='relu')))\n# model.add(TimeDistributed(Dropout(0.5)))\n# model.add(TimeDistributed(MaxPooling1D(pool_size=2)))\n# model.add(TimeDistributed(Flatten()))\n# model.add(LSTM(100))\n# model.add(Dropout(0.5))\n# model.add(Dense(100, activation='relu'))\n# model.add(Dense(n_outputs, activation='softmax'))\n", "_____no_output_____" ] ], [ [ "## Train the model\n", "_____no_output_____" ] ], [ [ "import torch.optim as optim\n\nmodel = Combine()\nif train_on_gpu:\n model.cuda()\ncriterion = nn.CrossEntropyLoss()\noptimizer = optim.SGD(model.parameters(), lr=0.01)\n", "_____no_output_____" ], [ "# number of epochs to train the model\nn_epochs = 20\n\nvalid_loss_min = np.Inf # track change in validation loss\n\nfor epoch in range(1, n_epochs+1):\n\n # keep track of training and validation loss\n train_loss = 0.0\n valid_loss = 0.0\n \n ###################\n # train the model #\n ###################\n model.train()\n for data, target in train_loader:\n # print(target)\n # print(target)\n # move tensors to GPU if CUDA is available\n if train_on_gpu:\n data, target = data.cuda(), target.cuda()\n # clear the gradients of all optimized variables\n optimizer.zero_grad()\n # forward pass: compute predicted outputs by passing inputs to the model\n output = model(data)\n # print(output)\n # calculate the batch loss\n loss = criterion(output, target)\n # backward pass: compute gradient of the loss with respect to model parameters\n loss.backward()\n # perform a single optimization step (parameter update)\n optimizer.step()\n # update training loss\n train_loss += loss.item()*data.size(0)\n \n ###################### \n # validate the model #\n ######################\n model.eval()\n for data, target in valid_loader:\n # move tensors to GPU if CUDA is available\n if train_on_gpu:\n data, target = data.cuda(), target.cuda()\n # forward pass: compute predicted outputs by passing inputs to the model\n # print(data.shape)\n output = model(data)\n # calculate the batch loss\n loss = criterion(output, target)\n # update average validation loss \n valid_loss += loss.item()*data.size(0)\n \n # calculate average losses\n train_loss = train_loss/len(train_loader.sampler)\n valid_loss = valid_loss/len(valid_loader.sampler)\n \n # print training/validation statistics \n print('Epoch: {} \\tTraining Loss: {:.6f} \\tValidation Loss: {:.6f}'.format(\n epoch, train_loss, valid_loss))\n \n # save model if validation loss has decreased\n if valid_loss <= valid_loss_min:\n print('Validation loss decreased ({:.6f} --> {:.6f}). Saving model ...'.format(valid_loss_min,valid_loss))\n torch.save(model.state_dict(), 'model_cifar.pt')\n valid_loss_min = valid_loss", "_____no_output_____" ] ], [ [ "---\n# Test you model", "_____no_output_____" ] ], [ [ "model.load_state_dict(torch.load('model_cifar.pt')) \nmodel", "_____no_output_____" ], [ "\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import confusion_matrix\nimport seaborn as sn\nimport pandas as pd\n\n# track test loss\ntest_loss = 0.0\nclass_correct = list(0. for i in range(3))\nclass_total = list(0. for i in range(3))\ny_pred = []\ny_true = []\n\nmodel.eval()\n# iterate over test data\nfor data, target in valid_loader:\n # move tensors to GPU if CUDA is available\n if train_on_gpu:\n data, target = data.cuda(), target.cuda()\n # forward pass: compute predicted outputs by passing inputs to the model\n\n output = model(data)\n y_true.extend(target.cpu()) # Save Truth\n # calculate the batch loss\n loss = criterion(output, target)\n # update test loss \n test_loss += loss.item()*data.size(0)\n # convert output probabilities to predicted class\n _, pred = torch.max(output, 1)\n y_pred.extend(pred.cpu()) \n\n # compare predictions to true label\n correct_tensor = pred.eq(target.data.view_as(pred))\n\n print(correct_tensor)\n \n correct = np.squeeze(correct_tensor.numpy()) if not train_on_gpu else np.squeeze(correct_tensor.cpu().numpy())\n \n # calculate test accuracy for each object class\n \n \n\n for i in range(batch_size):\n label = target.data[i]\n class_correct[label] += correct[i].item()\n class_total[label] += 1\n\n# average test loss\ntest_loss = test_loss/len(valid_loader.dataset)\nprint('Test Loss: {:.6f}\\n'.format(test_loss))\n\nfor i in range(3):\n if class_total[i] > 0:\n print('Test Accuracy of %5s: %2d%% (%2d/%2d)' % (\n classes[i], 100 * class_correct[i] / class_total[i],\n np.sum(class_correct[i]), np.sum(class_total[i])))\n else:\n print('Test Accuracy of %5s: N/A (no training examples)' % (classes[i]))\n\nprint('\\nTest Accuracy (Overall): %2d%% (%2d/%2d)' % ( 100. * np.sum(class_correct) / np.sum(class_total), \nnp.sum(class_correct), np.sum(class_total)))\n\n# Build confusion matrix\ncf_matrix = confusion_matrix(y_true, y_pred)\ndf_cm = pd.DataFrame(cf_matrix/np.sum(cf_matrix) *10, index = [i for i in classes],\n columns = [i for i in classes])\nplt.figure(figsize = (12,7))\nsn.heatmap(df_cm, annot=True)\nplt.savefig('output.png')", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ] ]
e7e50ff0e0c20e52c959c40d5fa78f0873c47ac7
1,654
ipynb
Jupyter Notebook
docs/contents/tools/classes/openff_Topology/to_molsysmt_MolSys.ipynb
dprada/molsysmt
83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d
[ "MIT" ]
null
null
null
docs/contents/tools/classes/openff_Topology/to_molsysmt_MolSys.ipynb
dprada/molsysmt
83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d
[ "MIT" ]
null
null
null
docs/contents/tools/classes/openff_Topology/to_molsysmt_MolSys.ipynb
dprada/molsysmt
83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d
[ "MIT" ]
null
null
null
20.170732
84
0.542322
[ [ [ "# To molsysmt.MolSys", "_____no_output_____" ] ], [ [ "from molsysmt.tools import openff_Topology", "Warning: importing 'simtk.openmm' is deprecated. Import 'openmm' instead.\n" ], [ "#openff_Topology.to_molsysmt_MolSys(item)", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code", "code" ] ]
e7e5249613085515e90337c95d89c85d8ff32d2e
47,178
ipynb
Jupyter Notebook
DeepLearning/ForecastingAirPassengersLSTM.ipynb
mdavis29/DataScience101
cc2f5ccfb0396a62e318483987a5550accee2ee4
[ "MIT" ]
3
2020-01-09T22:01:03.000Z
2021-06-09T14:03:57.000Z
DeepLearning/ForecastingAirPassengersLSTM.ipynb
mdavis29/DataScience101
cc2f5ccfb0396a62e318483987a5550accee2ee4
[ "MIT" ]
null
null
null
DeepLearning/ForecastingAirPassengersLSTM.ipynb
mdavis29/DataScience101
cc2f5ccfb0396a62e318483987a5550accee2ee4
[ "MIT" ]
5
2020-01-21T15:27:23.000Z
2020-04-28T15:06:16.000Z
142.531722
36,560
0.870088
[ [ [ "\n#### Forecast using Air Passenger Data\nHere the famous Air Passenger dataset is use to create on step ahead forecast models using recurrent neural networks. \n\n+ LSTM cells take input of the (n_obs, n_xdims, n_time)\n+ Statefull networks require the entire sequence of data to be preprocessed\n+", "_____no_output_____" ] ], [ [ "import pandas as pd\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom sklearn.preprocessing import MinMaxScaler, RobustScaler\nfrom sklearn.metrics import r2_score, mean_squared_error\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import LSTM, Dropout, BatchNormalization, Activation\n%matplotlib inline \n\nurl = 'https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/master/csv/datasets/AirPassengers.csv'\nairPass = pd.read_csv(url)\nairPass.index = airPass['time']\nairPass.drop(['Unnamed: 0','time'], inplace=True, axis=1)\nairPass.head()", "_____no_output_____" ] ], [ [ "#### Data Pre Processing for Forecasting\n+ data is lag so that time x = time0 and y= time +1 (One Step ahead)\n+ in this example, x is used twice to simulate a multi dimension x input for forecasting\n+ X, and Y sides are scale between (0,1) ( we will reverse the scaling for calculating error metrics\n+ Y is scaled so that the loss propagating back is all on the same scale, does create instablility", "_____no_output_____" ] ], [ [ "n_obs = len(airPass['value'].values)\nn_ahead = 1 # in this case th\nn_time_steps = 12 # each observation will have 12 months of data\nn_obs_trimmed = int(n_obs/n_time_steps)\nn_xdims = 1 # created by hstacking the sequence to simumlate multi dimensional input\nn_train_obs = 9\nn_outputs = 12\n\nx = np.reshape(airPass['value'].values[0:n_obs_trimmed * n_time_steps ], (-1, 1))\nscaler = MinMaxScaler().fit(x) \nx_scaled = scaler.transform(x)\nx_reshaped_scaled = np.reshape(x_scaled, (-1,n_xdims ,n_time_steps ))\n\n# trains on only the first n_train_observations, lags by n_ahead (in this case one year)\nX_train = x_reshaped_scaled[0:n_train_obs]\ny_train = x_reshaped_scaled[n_ahead:(n_train_obs + n_ahead)].squeeze() # squeeze reshapes from 3 to 2d\n\n# test on full data set \nX_test = x_reshaped_scaled[n_ahead:]\ny_test = x_reshaped_scaled[n_ahead:].squeeze() \n\nprint('(n_years ie: obs), (n_xdims) , (time_steps ie months to consider)')\nprint('x_train: {0}, y_train: {1}'.format(X_train.shape, y_train.shape))\nprint('x_test: {0}, y_test: {1}'.format(X_test.shape, y_test.shape))\n", "(n_years ie: obs), (n_xdims) , (time_steps ie months to consider)\nx_train: (9, 1, 12), y_train: (9, 12)\nx_test: (11, 1, 12), y_test: (11, 12)\n" ] ], [ [ "#### Modeling\nKeras lstm with 12 cells is used, with 12 outputs (one for each month of the year)\nThis forecasting system will forecast an entire year at a time. \n+ Dropout is used to prevent over fitting\n+ one row of input to this model is essentually 12 months of passenger counts of shape (1, 1, 12)", "_____no_output_____" ] ], [ [ "from keras.callbacks import EarlyStopping\nesm = EarlyStopping(patience=4)\n\n# design network\nmodel = Sequential()\n\nmodel.add(LSTM(12, input_shape=(n_xdims, n_time_steps ),return_sequences=False, \n dropout=0.2, recurrent_dropout=0.2, stateful=False, batch_size=1))\nmodel.add(Dense(n_outputs ))\nmodel.add(Activation('linear'))\nmodel.compile(loss='mae', optimizer='adam')\nmodel.summary()\n\n# fit the model\nhistory = model.fit(X_train,y_train, epochs=100, batch_size=1, validation_data=(X_test, y_test), verbose=0, shuffle=False, callbacks=[esm])\n\nprint('mse last 5 epochs {}'.format(history.history['val_loss'][-5:]))\n", "_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nlstm_9 (LSTM) (1, 12) 1200 \n_________________________________________________________________\ndense_9 (Dense) (1, 12) 156 \n_________________________________________________________________\nactivation_9 (Activation) (1, 12) 0 \n=================================================================\nTotal params: 1,356\nTrainable params: 1,356\nNon-trainable params: 0\n_________________________________________________________________\nmse last 5 epochs [0.0445328104225072, 0.045325480909510094, 0.04572556675835089, 0.04841325178065083, 0.053399924358183685]\n" ] ], [ [ "##### Peformance on Entire Dataset\nPeformance is check across the entire dataset using mean squared error and R2_score\nThe MaxMin scaler is reversed to get predictions back on the orignal scale ", "_____no_output_____" ] ], [ [ "preds = scaler.inverse_transform(np.reshape(model.predict(X_test, batch_size=1), (-1, 1))).flatten()\ny_true = airPass['value'].values[n_time_steps:]\nval_df = pd.DataFrame({'preds': preds, 'y_true':y_true})\nmse = round(mean_squared_error(y_true, preds), 3)\nr2 = round(r2_score(y_true, preds), 3)\nprint('performance on entire data sets mse: {} r2: {}'.format(mse, r2))", "performance on entire data sets mse: 997.776 r2: 0.925\n" ] ], [ [ "##### Peformance on Test Set\nSince the last two years (24 timesteps) were held out as a test, we can test performance just on that portion\nThe MaxMin scaler is reversed to get predictions back on the orignal scale. This should show a small drop in performance.", "_____no_output_____" ] ], [ [ "y_true_test = airPass['value'].values[n_time_steps:][-24:]\npreds_test = preds[-24:]\nmse_test = round(mean_squared_error(y_true_test, preds_test), 3)\nr2_test = round(r2_score(y_true_test, preds_test), 3)\nprint('performance on last two years only in the test set, mse: {} r2: {}'.format(mse_test, r2_test))", "performance on last two years only in the test set, mse: 648.259 r2: 0.884\n" ], [ "val_df.plot()", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ] ]
e7e53089958c171f0c08cb5666aff30c2cc4f237
665,528
ipynb
Jupyter Notebook
code/DL002-Python Intermediate and Linear Algebra.ipynb
hemendrarajawat/DL-Basic-To-Advanced
d6e5985a4c6ad0506bdf21e8f4b6af4e00480011
[ "MIT" ]
null
null
null
code/DL002-Python Intermediate and Linear Algebra.ipynb
hemendrarajawat/DL-Basic-To-Advanced
d6e5985a4c6ad0506bdf21e8f4b6af4e00480011
[ "MIT" ]
null
null
null
code/DL002-Python Intermediate and Linear Algebra.ipynb
hemendrarajawat/DL-Basic-To-Advanced
d6e5985a4c6ad0506bdf21e8f4b6af4e00480011
[ "MIT" ]
null
null
null
308.114815
291,570
0.903427
[ [ [ "# Pandas", "_____no_output_____" ] ], [ [ "import pandas as pd", "_____no_output_____" ], [ "dataframe = pd.read_csv('../data/MobileRating.csv')", "_____no_output_____" ], [ "dataframe.head()", "_____no_output_____" ], [ "dataframe.tail(7)", "_____no_output_____" ], [ "print(len(dataframe))\nprint(dataframe.shape)", "341\n(341, 88)\n" ], [ "# Accessing individual row\ndataframe.loc[3]", "_____no_output_____" ], [ "dataframe_short = dataframe[40:45]\ndataframe_short", "_____no_output_____" ], [ "dataframe_thin = dataframe[['PhoneId', 'RAM', 'Processor_frequency', 'Height', 'Capacity', 'Rating', 'Sim1_4G']]\ndataframe_thin.head()", "_____no_output_____" ], [ "good_battery_df = dataframe_thin[dataframe_thin['Capacity'] >= 5000]\ngood_battery_df", "_____no_output_____" ], [ "good_battery_df.describe()", "_____no_output_____" ], [ "dataframe_thin.dtypes", "_____no_output_____" ], [ "good_battery_df[good_battery_df['Rating'] > 4]['Capacity'].mean()", "_____no_output_____" ], [ "group = good_battery_df.groupby(['RAM'])", "_____no_output_____" ], [ "for key, df_key in group:\n print(key)\n print(df_key)\n print('-----')", "1\n PhoneId RAM Processor_frequency Height Capacity Rating Sim1_4G\n192 260 1 1.3 149.5 5000 3.8 1\n-----\n2\n PhoneId RAM Processor_frequency Height Capacity Rating Sim1_4G\n208 286 2 1.0 156.0 5000 4.1 1\n-----\n3\n PhoneId RAM Processor_frequency Height Capacity Rating Sim1_4G\n84 109 3 1.4 160.9 5000 4.1 1\n124 164 3 1.3 149.5 5000 3.9 1\n139 188 3 1.3 155.0 5000 4.0 1\n303 420 3 1.3 152.8 5000 4.0 1\n304 421 3 1.3 160.9 5020 4.0 1\n314 436 3 2.0 153.0 5100 4.3 1\n-----\n4\n PhoneId RAM Processor_frequency Height Capacity Rating Sim1_4G\n28 44 4 1.95 157.9 5000 4.4 1\n95 125 4 2.00 174.1 5300 4.4 1\n102 135 4 1.80 161.7 5000 4.2 1\n-----\n6\n PhoneId RAM Processor_frequency Height Capacity Rating Sim1_4G\n32 49 6 1.8 159.0 5000 4.3 1\n165 224 6 2.0 169.4 13000 4.7 1\n-----\n" ], [ "group.mean()", "_____no_output_____" ] ], [ [ "## Plotting Dataframes", "_____no_output_____" ] ], [ [ "import matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set()", "_____no_output_____" ], [ "ax = sns.boxplot(x=\"Internal Memory\", y=\"Weight\", data=dataframe)", "_____no_output_____" ], [ "ax = sns.pairplot(dataframe_thin.drop(['PhoneId'], axis=1), diag_kind='hist')", "_____no_output_____" ], [ "ax = sns.pairplot(dataframe_thin.drop('PhoneId', axis=1), diag_kind='hist', hue='Sim1_4G')", "_____no_output_____" ], [ "sns.reset_orig()", "_____no_output_____" ] ], [ [ "# Vectors\n\nVector is a collection of coordinates a point has in a given space.", "_____no_output_____" ], [ "Vector has both magnitude and direction.\n\nIn geometery, a two or more dimension space is called a Euclidean space. A space in any finite no. of dimensions, in which points are designated by coordinates(one for each dimension) and the distance b/w two points is given by a distance formula. L2 norm is also called Euclidean norm(Magnitude).\n\nMagnitude of a vector is given by: $\\large \\sqrt{\\sum_{i=1}^{N} x_i^2}$", "_____no_output_____" ], [ "## Plotting Vectors", "_____no_output_____" ] ], [ [ "import numpy as np\nimport matplotlib.pyplot as plt\n\nplt.quiver(0,0,4,5, scale_units='xy', angles='xy', scale=1)\nplt.xlim(-10, 10)\nplt.ylim(-10, 10)\nplt.show()", "_____no_output_____" ], [ "# Plot multiple vectors\nplt.quiver(0,0,4,5, scale_units='xy', angles='xy', scale=1, color='r')\nplt.quiver(0,0,-4,5, scale_units='xy', angles='xy', scale=1, color='b')\nplt.xlim(-10, 10)\nplt.ylim(-10, 10)\nplt.show()", "_____no_output_____" ], [ "# Creating a method to plot multiple vectors\ndef plot_vectors(vectors):\n colors = [\n 'r', 'y', 'b', 'g', 'c', 'm', 'tan', 'black', 'darkorange', 'limegreen',\n 'aqua', 'violet', 'pink', 'magenta', 'teal', 'indigo'\n ]\n \n i = 0\n for vector in vectors:\n plt.quiver(0, 0, vector[0], vector[1], scale_units='xy', angles='xy', scale=1, color=colors[i%len(colors)], label=vector)\n i += 1\n\n plt.xlim(-10, 10)\n plt.ylim(-15, 15)\n plt.legend()\n plt.show()", "_____no_output_____" ], [ "vectors = np.array([[4,3], [-4,3], [7,1], [3,6]])\nplot_vectors(vectors)", "_____no_output_____" ] ], [ [ "## Vectors Addition and Substraction", "_____no_output_____" ] ], [ [ "# Addition of two vectors\nprint(vectors[0] - vectors[1])\nplot_vectors([vectors[0], vectors[1], vectors[0] + vectors[1]])", "[8 0]\n" ], [ "# Subtraction of two vectors\nprint(vectors[0] - vectors[2])\nplot_vectors([vectors[0], vectors[2], vectors[0] - vectors[2]])", "[-3 2]\n" ] ], [ [ "## Vector Dot Product\n\n$\\large{\\vec{a}\\cdot\\vec{b} = |\\vec{a}| |\\vec{b}| \\cos(\\theta) = a_x b_x + a_y b_y} = a^T b$", "_____no_output_____" ] ], [ [ "print(vectors[0], vectors[2])\ndot_product = np.dot(vectors[0], vectors[2])\n\nprint(dot_product)", "[4 3] [7 1]\n31\n" ] ], [ [ "## Projection of one vector(a) on another vector(b)\n\n$\\large{a_b = |\\vec{a}| \\cos{\\theta} = |\\vec{a}| \\frac{\\vec{a} \\cdot \\vec{b}}{|\\vec{a}| |\\vec{b}|} = \\frac{\\vec{a} \\cdot \\vec{b}}{|\\vec{b}|}}$\n\n$\\large{ \\vec{a_b} = a_b \\hat{b} = a_b \\frac{\\vec{b}}{|\\vec{b}|} }$", "_____no_output_____" ] ], [ [ "a = vectors[0]\nb = vectors[2]\n\nplot_vectors([a, b])\n\na_b = np.dot(a, b)/np.linalg.norm(b)\nprint('Magnitude of projected vector:', a_b)\n\nvec_a_b = (a_b/np.linalg.norm(b))*b\nprint('Projected vector:', vec_a_b)\n\nplot_vectors([a, b, vec_a_b])", "_____no_output_____" ], [ "# Another example\na = vectors[1]\nb = vectors[2]\n\nplot_vectors([a, b])\n\na_b = np.dot(a, b)/np.linalg.norm(b)\nprint('Magnitude of projected vector:', a_b)\n\nvec_a_b = (a_b/np.linalg.norm(b))*b\nprint('Projected vector:', vec_a_b)\n\nplot_vectors([a, b, vec_a_b])", "_____no_output_____" ] ], [ [ "# Matrices\n\nA matrix is a collection of vectors.", "_____no_output_____" ] ], [ [ "# Row matrix\n\nrow_matrix = np.random.random((1, 4))\nprint(row_matrix)", "[[0.65475309 0.1545054 0.39163602 0.26967738]]\n" ], [ "# Column matrix\n\ncolumn_matrix = np.random.random((4, 1))\nprint(column_matrix)", "[[0.50652656]\n [0.99386151]\n [0.6596067 ]\n [0.88428846]]\n" ] ], [ [ "## Multiplying a matrix with a vector\n\nThe vector gets transformed into a new vector(it strays from its path).", "_____no_output_____" ] ], [ [ "matrix = np.asarray([[1, 2], [2, 4]])\nvector = np.asarray([3, 1]).reshape(-1, 1)\n\n# plot_vectors([vector])\n\nprint(matrix)\nprint(vector)\n\nnew_vector = np.dot(matrix, vector)\nprint(new_vector)\n\nplot_vectors([vector, new_vector])", "[[1 2]\n [2 4]]\n[[3]\n [1]]\n[[ 5]\n [10]]\n" ] ], [ [ "## Matrix Addition and Substraction", "_____no_output_____" ] ], [ [ "matrix_1 = np.asarray([\n [1, 0, 3],\n [3, 1, 1],\n [0, 2, 5]\n])\nmatrix_2 = np.asarray([\n [0, 1, 2],\n [3, 0, 5],\n [1, 2, 1]\n])", "_____no_output_____" ], [ "print(matrix_1 + matrix_2)", "[[1 1 5]\n [6 1 6]\n [1 4 6]]\n" ], [ "print(matrix_1 - matrix_2)", "[[ 1 -1 1]\n [ 0 1 -4]\n [-1 0 4]]\n" ] ], [ [ "## Matrix Multiplication", "_____no_output_____" ] ], [ [ "print(np.dot(matrix_1, matrix_2))", "[[ 3 7 5]\n [ 4 5 12]\n [11 10 15]]\n" ] ], [ [ "# Why do we care about vector and matrices?", "_____no_output_____" ], [ "Going forward we will be working on the below dimension data:\n\n\n$\\large w \\cdot x + b$, Formula used in one neuron\n\n\n$w$ = Weight matrix of $R^{1 \\times n}$\n\n$x$ = Input Vector of $R^{n \\times m}$\n\n$b$ = Bias Vector of $R^{1 \\times m}$\n\nwhere m = no. of training examples, n = no. of features in one training example", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ] ]
e7e538855b5ab15c6aa276f8640b9835234f108a
195,735
ipynb
Jupyter Notebook
_projects/project1.ipynb
M-Sender/cmps3160
54546d307f913b35caa45efe6c5528dadb8055f2
[ "MIT" ]
null
null
null
_projects/project1.ipynb
M-Sender/cmps3160
54546d307f913b35caa45efe6c5528dadb8055f2
[ "MIT" ]
null
null
null
_projects/project1.ipynb
M-Sender/cmps3160
54546d307f913b35caa45efe6c5528dadb8055f2
[ "MIT" ]
null
null
null
73.308989
53,338
0.671459
[ [ [ "We are working together on this via vscode live share and are talking over zoom. \nIn terms of sharing the file we have a github repository set up. We met three times to work in total.\n", "_____no_output_____" ] ], [ [ "import pandas as pd\nimport bs4\nfrom bs4 import BeautifulSoup\nimport requests\nfrom datetime import datetime as dt\nimport numpy as np\nimport re", "_____no_output_____" ], [ "#2\nurl = \"https://www.spaceweatherlive.com/en/solar-activity/top-50-solar-flares\"\nwebpage = requests.get(url)\nprint(webpage) #response 403, this means that the webserver refused to authorize the request\n#to fix do this \nheaders = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}\nwebpage = requests.get(url, headers=headers)\nprint(webpage) #now response 200\nsoup_content = BeautifulSoup(webpage.content,'html.parser')\npretty = soup_content.prettify()\n#print(pretty)\ntable_html = soup_content.find(\"table\",{\"class\":\"table table-striped\"})#['data-value'] #from stackoverflow\ndf = pd.read_html(table_html.prettify())[0]\ndf.rename(columns={'Unnamed: 0':\"rank\",'Unnamed: 1':\"x_class\",'Unnamed: 2':\"date\",'Start':\"start_time\",'Maximum':\"max_time\",'End':\"end_time\",'Unnamed: 7':\"movie\",'Region':\"region\"},inplace=True)\ndf.head()\n", "<Response [403]>\n<Response [200]>\n" ], [ "dataFrame = df.drop(\"movie\",axis=1)\ndataFrame.head()\n\nfor row in dataFrame.iterrows():\n date = pd.to_datetime(row[1].date)\n time_start = pd.to_datetime(row[1].start_time)\n str_time = str(date)[:11]+str(time_start)[11:]\n startTime = pd.to_datetime(str_time)\n dataFrame.at[row[0],'start_time'] = startTime\n \n time_max= pd.to_datetime(row[1].max_time)\n str_time = str(date)[:11]+str(time_max)[11:]\n maxTime = pd.to_datetime(str_time)\n dataFrame.at[row[0],'max_time'] = maxTime\n \n time_end = pd.to_datetime(row[1].end_time)\n str_time = str(date)[:11]+str(time_end)[11:]\n endTime = pd.to_datetime(str_time)\n dataFrame.at[row[0],'end_time'] = endTime\n #date_time_obj = dt.strftime(str_time, '%y-%m-%d %H:%M:%S')\n #dt.combine(date,time_start)\ndataFrame = dataFrame.replace('-',np.nan)\ndataFrame_update = dataFrame.drop(\"date\",axis=1)\ndataFrame_update.rename(columns={'start_time':'start_datetime','max_time':'max_datetime','end_time':'end_datetime'},inplace=True)\nregion_column = dataFrame_update.region\ndataFrame_update=dataFrame_update.drop(['region'],axis=1)\ndataFrame_update['region'] = region_column\ndataFrame_update.start_datetime = dataFrame_update.start_datetime.astype('datetime64[ns]')\ndataFrame_update.max_datetime = dataFrame_update.max_datetime.astype('datetime64[ns]')\ndataFrame_update.end_datetime = dataFrame_update.end_datetime.astype('datetime64[ns]')\nprint(dataFrame_update.dtypes)\ndataFrame_update\n\n", "rank int64\nx_class object\nstart_datetime datetime64[ns]\nmax_datetime datetime64[ns]\nend_datetime datetime64[ns]\nregion int64\ndtype: object\n" ], [ "#Step 3\nurl = \"http://cdaw.gsfc.nasa.gov/CME_list/radio/waves_type2.html\"\nheaders = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}\nwebpage = requests.get(url, headers=headers)\nsoup_content = BeautifulSoup(webpage.content,'html.parser')\n#pretty = soup_content.prettify()\n#print(pretty)\nrow_split = soup_content.find(\"pre\").prettify().split('\\n') \n", "_____no_output_____" ], [ "colomns = []\ndata = []\nregex = r'>(.*)<'\nfor row in row_split[12:-2]:\n row = row.replace('<a','')\n data_split = row.split(' ')#remove ''\n while True:\n try:\n data_split.remove('')\n except:\n break\n try:\n cme_date = re.search( regex ,data_split[9]).groups()[0] #cme\n except:\n cme_date = data_split[9]\n cme_time = data_split[10]\n cpa = data_split[11]\n end_date = data_split[2]\n try:\n end_frequency = re.search( regex ,data_split[5]).groups()[0]\n except:\n end_frequency = data_split[5]\n end_time = data_split[3]\n flare_location = data_split[6]\n flare_region = data_split[7]\n importance = data_split[8]\n try:\n speed = re.search( regex ,data_split[13]).groups()[0]\n except:\n speed = data_split[13]\n start_date = data_split[0]\n try:\n start_frequency = re.search( regex ,data_split[4]).groups()[0]\n except:\n start_frequency = data_split[4]\n start_time = data_split[1]\n width = data_split[12]\n data.append([cme_date,cme_time,cpa,end_date,end_frequency,end_time,\n flare_location,flare_region,importance,speed,start_date,\n start_frequency,start_time,width])\ncolumns = [\"cme_date\",\"cme_time\",\"cpa\",\"end_date\",\"end_frequency\",\"end_time\",\n \"flare_location\",\"flare_region\",\"importance\",\"speed\",\"start_date\",\n \"start_frequency\",\"start_time\",\"width\"]\nnasa_df = pd.DataFrame(data,columns = columns)\nnasa_df.head()", "_____no_output_____" ], [ "#step 4\nnasa_df.replace(['--/--'],[np.nan],inplace=True)\nnasa_df.replace(['-----'],[np.nan],inplace=True)\nnasa_df.replace(['----'],[np.nan],inplace=True)\nnasa_df.replace(['????'],[np.nan],inplace=True)\nnasa_df.replace(['--:--'],[np.nan],inplace=True)\nnasa_df.replace(['------'],[np.nan],inplace=True)\nnasa_df['flare_location'].replace(['BACK'],['Back'],inplace=True)\nnasa_df['flare_location'].replace(['back'],['Back'],inplace=True)\nnasa_df['flare_region'].replace(['DSF'],['FILA'],inplace=True)\nnasa_df['width'].replace(['360h'],['360'],inplace=True)\nnasa_df[\"width\"].replace(['---'],[np.nan],inplace=True)\nnasa_df.replace(['24:00'], ['23:59'], inplace=True)\nhalo_flare = []\nwidth_lower_bound = []\nhelper = nasa_df.iterrows()\nstart_datetime = []\nend_datetime = []\ncme_datetime = []\nfor i in helper:\n #print(i[1]['cpa'])\n if i[1]['cpa'] == \"Halo\":\n halo_flare.append(True)\n else:\n halo_flare.append(False)\n if '&gt;' in str(i[1]['width']):\n width_lower_bound.append(True)\n nasa_df['width'][i[0]] = i[1]['width'][4:]\n else:\n width_lower_bound.append(False)\n #date time\n \n start_datetime.append(pd.to_datetime(str(i[1]['start_date'])+\" \"+str(i[1]['start_time'])))\n end_datetime.append(pd.to_datetime((str(i[1]['start_date'])[0:5]+str(i[1]['end_date'])+\" \"+str(i[1]['end_time']))))\n try:\n cme_datetime.append(pd.to_datetime((str(i[1]['start_date'])[0:5]+str(i[1]['cme_date'])+\" \"+str(i[1]['cme_time']))))\n except:\n cme_datetime.append(np.datetime64(\"NaT\"))\nnasa_df.drop(columns = ['start_time', 'start_date', 'end_date', 'end_time', 'cme_date', 'cme_time'], inplace= True)\nnasa_df['is_flare'] = halo_flare\nnasa_df['width_lower_bound'] = width_lower_bound\nnasa_df['start_datetime'] = start_datetime\nnasa_df['end_datetime'] = end_datetime\nnasa_df['cme_datetime'] = cme_datetime\nnasa_df['cpa'].replace(['Halo'],[np.nan],inplace=True) #do not run more than once", "_____no_output_____" ], [ "\nnasa_df = nasa_df.astype({'cpa':'float','end_frequency':'float','speed':'float','start_frequency':'float','width':'float'})\nprint(nasa_df.dtypes)\nnasa_df= nasa_df[['start_datetime','end_datetime','start_frequency','end_frequency','flare_location','flare_region','importance', 'cme_datetime','cpa', 'width','speed','is_flare','width_lower_bound']]\nnasa_df.head(10)", "cpa float64\nend_frequency float64\nflare_location object\nflare_region object\nimportance object\nspeed float64\nstart_frequency float64\nwidth float64\nis_flare bool\nwidth_lower_bound bool\nstart_datetime datetime64[ns]\nend_datetime datetime64[ns]\ncme_datetime datetime64[ns]\ndtype: object\n" ], [ "#Part 2 start\n\nnasa_x_df = nasa_df[nasa_df['importance'].str[0]=='X']\nnasa_x_df[\"importance\"] = nasa_x_df[\"importance\"].str[1:]\nnasa_x_df = nasa_x_df.astype({'importance':'float'}).sort_values(by='importance',ascending = False)\nnasa_x_df = nasa_x_df.astype({'importance':'string'})\nnasa_x_df[\"importance\"] = 'X' + nasa_x_df[\"importance\"]\ncompare_df = nasa_x_df.head(50)\ndisplay(compare_df.head())\ndataFrame_update.head()\n#We were able to replicate the top 50 solar flares pretty well, but when comparing\n#the two dataframes, some importance classification did not line up perfectly.\n", "C:\\WINDOWS\\TEMP/ipykernel_1872/2219630430.py:4: SettingWithCopyWarning: \nA value is trying to be set on a copy of a slice from a DataFrame.\nTry using .loc[row_indexer,col_indexer] = value instead\n\nSee the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n nasa_x_df[\"importance\"] = nasa_x_df[\"importance\"].str[1:]\n" ], [ "#Question 2\ndef date_compare(date): # date is in the format x days xx:xx:xx\n date_split = date.split(\" \")\n if int(date_split[0])>=1:\n return False\n new_split = date_split[2].split(':')\n if int(new_split[0])>2:\n return False\n return True\n \ndef comparer(df1,df2):\n val = 0\n \n start_diff = abs(df1['start_datetime']-df2['start_datetime'])\n end_diff = abs(df1['end_datetime']- df2['end_datetime'])\n \n if date_compare(str(start_diff)):\n val+=1\n if date_compare(str(end_diff)):\n val+=1\n return val\n\narr_ranking_temp = []\nfor top_i in dataFrame_update.iterrows():\n # (0=id,1 =info)\n temp_dict = dict()\n for nasa_i in compare_df.iterrows():\n temp_dict[nasa_i[0]] = comparer(top_i[1],nasa_i[1])\n arr_ranking_temp.append(temp_dict)\n \ndict_ranking = dict()\ncount = 0\nfor i in arr_ranking_temp:\n if max(i.values()) == 0:\n dict_ranking[count] = np.nan\n else:\n dict_ranking[count] = (max(i,key=i.get), max(i.values()))\n count += 1\n\nmatch_rank = []\nindex = []\nfor i in dict_ranking:\n if type(dict_ranking[i]) == tuple:\n #print(arr_ranking[i])\n index.append(dict_ranking[i][0])\n match_rank.append(dict_ranking[i][1])\n#print(match_rank)\n#print(index)\n\nmatchrank_df = pd.DataFrame(data={'match_rank': match_rank}, index=index)\nmatchable = compare_df.merge(matchrank_df, how='right', right_index=True, left_index=True)\nmatchable", "_____no_output_____" ] ], [ [ "We matched the rows by comparing their start time and end time. If both rows' start times were within three hours of each other, they would get a one point increase in their match rank - and same goes for end times. This means that the maximum possible match rank is 2. The NASA dataframe was sorted by importance in decreasing order, so we got the top 50 from it and compared it with the other dataset.", "_____no_output_____" ] ], [ [ "%matplotlib inline\nimport matplotlib.pyplot as plt\n\n# Give each flare an overall rank\nmatchable[\"overall_rank\"] = list(range(1,36))\n\nnew_speed = matchable[\"speed\"] / 9\nmatchable.plot.scatter(x='start_datetime', y='start_frequency', s=new_speed,title=\"Top 50 Solar Flares, size=speed\")\n#Graph below has the top 50 solar flares plotted by date and the size of each dot is the speed of the flare. You can see that with the intensity, there is a positive tend over time.\n", "_____no_output_____" ], [ "speeds = nasa_df.speed/9\nnasa_df.plot.scatter(x='start_datetime', y='start_frequency',s=speeds, title=\"Entire Nasa Data Set, size=speed\")\n#Same as above, but with the entire nasa dataset", "_____no_output_____" ], [ "matchable.is_flare.value_counts().plot.pie(title=\"Top 50 Solar Flares\")\n#Below is the top 50 solar flares the top 50 solar flares for if they had a halo cme.", "_____no_output_____" ], [ "nasa_df.is_flare.value_counts().plot.pie(title=\"Whole Nasa Dataset\")\n#Below is the whole nasa dataset for if they have a halo cme.\n#As you can see, there was a higher proportion of halo cmes in the top 50 solar flares than when compared to the whole dataset.", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ] ]
e7e539249545fd31def0f59f221db553fb4c833f
29,739
ipynb
Jupyter Notebook
notebooks/Lambda Notebook Demo.ipynb
poetaster-org/lambda-notebook
9959fac57e995b5915648c1f0ce53525690f29ee
[ "BSD-3-Clause" ]
13
2016-01-18T17:33:50.000Z
2022-01-19T02:43:08.000Z
notebooks/Lambda Notebook Demo.ipynb
poetaster-org/lambda-notebook
9959fac57e995b5915648c1f0ce53525690f29ee
[ "BSD-3-Clause" ]
11
2016-02-10T20:48:44.000Z
2019-09-06T15:31:53.000Z
notebooks/Lambda Notebook Demo.ipynb
poetaster-org/lambda-notebook
9959fac57e995b5915648c1f0ce53525690f29ee
[ "BSD-3-Clause" ]
4
2018-11-27T14:45:49.000Z
2021-06-05T17:08:40.000Z
30.039394
425
0.591277
[ [ [ "# Lambda notebook demo v. 1.0.1\n## Author: Kyle Rawlins\n\nThis notebook provides a demo of the core capabilities of the lambda notebook, aimed at linguists who already have training in semantics (but not necessarily implemented semantics).\n\nLast updated Dec 2018. Version history:\n\n * 0.5: first version\n * 0.6: updated to work with refactored class hierarchy (Apr 2013)\n * 0.6.1: small fixes to adapt to changes in various places (Sep 2013)\n * 0.7: various fixes to work with alpha release (Jan 2014)\n * 0.9: substantial updates, merge content from LSA poster (Apr 2014)\n * 0.95: substantial updates for a series of demos in Apr-May 2014\n * 1.0: various changes / fixes, more stand-alone text (2017)\n * 1.0.1: small tweaks (Nov/Dec 2018)\n \nTo run through this demo incrementally, use shift-enter (runs and moves to next cell). If you run things out of order, you may encounter problems (missing variables etc.)", "_____no_output_____" ] ], [ [ "reload_lamb()\nfrom lamb.types import TypeMismatch, type_e, type_t, type_property\nfrom lamb.meta import TypedTerm, TypedExpr, LFun, CustomTerm\nfrom IPython.display import display", "_____no_output_____" ], [ "# Just some basic configuration\nmeta.constants_use_custom(False)\nlang.bracket_setting = lang.BRACKET_FANCY\nlamb.display.default(style=lamb.display.DerivStyle.BOXES) # you can also try lamb.display.DerivStyle.PROOF", "_____no_output_____" ] ], [ [ "# First pitch\n\nHave you ever wanted to type something like this in, and have it actually do something?", "_____no_output_____" ] ], [ [ "%%lamb\n||every|| = λ f_<e,t> : λ g_<e,t> : Forall x_e : f(x) >> g(x)\n||student|| = L x_e : Student(x)\n||danced|| = L x_e : Danced(x)", "_____no_output_____" ], [ "r = ((every * student) * danced)\nr", "_____no_output_____" ], [ "r.tree()", "_____no_output_____" ] ], [ [ "# Two problems in formal semantics #\n\n1. Type-driven computation could be a lot easier to visualize and check. (Q: could it be made too easy?)\n\n2. Grammar fragments as in Montague Grammar: good idea in principle, hard to use in practice.\n\n * A **fragment** is a *complete* formalization of *sublanguage* consisting of the *key relevant phenomena* for the problem at hand. (Potential problem-points italicized.)\n\nSolution: a system for developing interactive fragments: \"*IPython Lambda Notebook*\"\n\n* Creator can work interactively with analysis -- accelerate development, limit time spent on tedious details.\n* Reader can explore derivations in ways that are not typically possible in typical paper format.\n* Creator and reader can be certain that derivations work, verified by the system.\n* Bring closer together formal semantics and computational modeling.\n\nInspired by:\n\n * Von Eijck and Unger (2013): implementation of compositional semantics in Haskell. No interface (beyond standard Haskell terminal); great if you like Haskell. Introduced the idea of a fragment in digital form.\n * UPenn Lambda calculator (Champollion, Tauberer, and Romero 2007): teaching oriented. (Now under development again.)\n * `nltk.sem`: implementation of the lambda calculus with a typed metalanguage, interface with theorem provers. No interactive interface.\n * Jealousy of R studio, Matlab, Mathematica, etc.\n\n### The role of formalism & fragments ###\n\nWhat does *formal* mean in semantics? What properties should a theory have?\n\n 1. Mathematically precise (lambda calculus, type theory, logic, model theory(?), ...)\n 2. Complete (covers \"all\" the relevant data).\n 3. Predictive (like any scientific theory).\n 4. Consistent, or at least compatible (with itself, analyses of other phenomena, some unifying conception of the grammar).\n \nThe *method of fragments* (Partee 1979, Partee and Hendriks 1997) provides a structure for meeting these criteria.\n\n * Paper with a fragment provides a working system. (Probably.)\n * Explicit outer bound for empirical coverage.\n * Integration with a particular theory of grammar. (To some extent.)\n * Explicit answer to many detailed questions not necessarily dealt with in the text.\n \n**Claim**: fragments are a method of replicability, similar to a computational modeller providing their model.\n\n * To be clear, a fragment is neither necessary nor sufficient for having a good theory / analysis / paper...\n\nAdditional benefit: useful internal check for researcher.\n\n>\"...But I feel strongly that it is important to try to [work with fully explicit fragments] periodically, because otherwise it is extremely easy to think that you have a solution to a problem when in fact you don't.\" (Partee 1979, p. 41)\n\n### The challenges of fragments\n\nPart 1 of the above quote:\n\n>\"It can be very frustrating to try to specify frameworks and fragments explicitly; this project has not been entirely rewarding. I would not recommend that one always work with the constraint of full explicitness.\" (Ibid.)\n\n * Fragments can be tedious and time-consuming to write (not to mention hard).\n * Fragments as traditionally written are in practice not easy for a reader to use.\n \n - Dense/unapproachable. With exactness can come a huge chunk of hard-to-digest formalism. E.g. Partee (1979), about 10% of the paper.\n - Monolithic/non-modular. For the specified sublanguage, everything specified. Outside the bounds of the sublanguage, nothing specified. How does the theory fit in with others?\n - Exact opposite of the modern method -- researchers typically hold most aspects of the grammar constant (implicitly) while changing a few key points. (*Portner and Partee intro*)\n\n**Summary:** In practice, the typical payoff for neither the reader nor the writer of a fragment exceeded the effort.\n", "_____no_output_____" ], [ "# A solution: digital fragments\n\nVon Eijck and Unger 2010: specify a fragment in digital form.\n\n* They use Haskell. Type system of Haskell extremely well-suited to natural language semantics.\n* (Provocative statement) Interface, learning curve of Haskell not well suited to semanticists (or most people)?\n\n### Benefits of digital fragments (in principle)\n\n* Interactive.\n* Easy to distribute, adapt, modify.\n* Possibility of modularity. (E.g. abstract a 'library' for compositional systems away from the analysis of a particular phenomenon.)\n* Bring closer together the CogSci idea of a 'computational model' to the project of natural language semantics.\n* Connections to computational semantics. (weak..)\n\n### What sorts of things might we want in a fragment / system for fragments?\n\n* Typed lambda calculus.\n* Logic / logical metalanguage.\n* Framework for semantic composition. (Broad...)\n* Model theory? (x)\n* Interface with theorem provers? (x)\n\nIPython Lambda Notebook aims to provide these tools in a usable, interactive, format.\n\n* Choose Python, rather than Haskell/Java. Easy learning curve, rapid prototyping, existence of IPython.\n\n**Layer 1**: interface using IPython Notebook.\n\n**Layer 2**: flexible typed metalanguage.\n\n**Layer 3**: composition system for object language, building on layer 2.", "_____no_output_____" ], [ "## Layer 1: an interface using IPython/Jupyter Notebook (Perez and Granger 2007) ##\n\n * Client-server system where a specialized IPython \"kernel\" is running in the background. This kernel implements various tools for formal semantics (see parts 2-3).\n * Page broken down into cells in which can be entered python code, markdown code, raw text, other formats.\n * Jupyter: supports display of graphical representations of python objects.\n * Notebook format uses the \"MathJax\" framework to enable it to render most math-mode latex. Can have python objects automatically generate decent-looking formulas. Can use latex math mode in documentation as well (e.g. $\\lambda x \\in D_e : \\mathit{CAT}(x)$)\n\nThis all basically worked off-the-shelf.\n\n* Bulk of interface work so far: rendering code for logical and compositional representations.\n* Future: interactive widgets, etc.", "_____no_output_____" ] ], [ [ "meta.pmw_test1", "_____no_output_____" ], [ "meta.pmw_test1._repr_latex_()", "_____no_output_____" ] ], [ [ "&nbsp;\n\n## Part 2: a typed metalanguage ##", "_____no_output_____" ], [ "The **metalanguage** infrastructure is a set of classes that implement the building blocks of logical expressions, lambda terms, and various combinations combinations. This rests on an implementation of a **type system** that matches what semanticists tend to assume.\n\nStarting point (2012): a few implementations of things like predicate logic do exist, this is an intro AI exercise sometimes. I started with the [AIMA python](http://code.google.com/p/aima-python/) _Expr_ class, based on the standard Russell and Norvig AI text. But, had to scrap most of it. Another starting point would have been `nltk.sem` (I was unaware of its existence at the time.)\n\nPreface cell with `%%lamb` to enter metalanguage formulas directly. The following cell defines a variable `x` that has type e, and exports it to the notebook's environment.", "_____no_output_____" ] ], [ [ "%%lamb reset\nx = x_e # define x to have this type", "_____no_output_____" ], [ "x.type", "_____no_output_____" ] ], [ [ "This next cell defines some variables whose values are more complex object -- in fact, functions in the typed lambda calculus.", "_____no_output_____" ] ], [ [ "%%lamb\ntest1 = L p_t : L x_e : P(x) & p # based on a Partee et al example\ntest1b = L x_e : P(x) & Q(x)\nt2 = Q(x_e)", "_____no_output_____" ] ], [ [ "These are now registered as variables in the python namespace and can be manipulated directly. A typed lambda calculus is fully implemented with all that that entails -- e.g. the value of `test1` includes the whole syntactic structure of the formula, its type, etc. and can be used in constructing new formulas. The following cells build a complex function-argument formula, and following that, does the reduction.\n\n(Notice that beta reduction works properly, i.e. bound $x$ in the function is renamed in order to avoid collision with the free `x` in the argument.)", "_____no_output_____" ] ], [ [ "test1(t2)", "_____no_output_____" ], [ "test1(t2).reduce()", "_____no_output_____" ], [ "%%lamb\ncatf = L x_e: Cat(x)\ndogf = λx: Dog(x_e)", "_____no_output_____" ], [ "(catf(x)).type", "_____no_output_____" ], [ "catf.type", "_____no_output_____" ] ], [ [ "Type checking of course is a part of all this. If the types don't match, the computation will throw a `TypeMismatch` exception. The following cell uses python syntax to catch and print such errors.", "_____no_output_____" ] ], [ [ "result = None\ntry:\n result = test1(x) # function is type <t<et>> so will trigger a type mismatch. This is a python exception so adds all sorts of extraneous stuff, but look to the bottom\nexcept TypeMismatch as e:\n result = e\nresult", "_____no_output_____" ] ], [ [ "A more complex expression:", "_____no_output_____" ] ], [ [ "%%lamb\np2 = (Cat_<e,t>(x_e) & p_t) >> (Exists y: Dog_<e,t>(y_e))", "_____no_output_____" ] ], [ [ "What is going on behind the scenes? The objects manipulated are recursively structured python objects of class TypedExpr.\n\nClass _TypedExpr_: parent class for typed expressions. Key subclasses:\n\n* BinaryOpExpr: parent class for things like conjunction.\n* TypedTerm: variables, constants of arbitrary type\n* BindingOp: operators that bind a single variable\n * LFun: lambda expression\n\nMany straightforward expressions can be parsed. Most expressions are created using a call to TypedExpr.factory, which is abbreviated as \"te\" in the following examples. The `%%lamb` magic is calling this behind the scenes.\n\nThree ways of instantiating a variable `x` of type `e`:", "_____no_output_____" ] ], [ [ "%%lamb \nx = x_e # use cell magic", "_____no_output_____" ], [ "x = te(\"x_e\") # use factory function to parse string\nx", "_____no_output_____" ], [ "x = meta.TypedTerm(\"x\", types.type_e) # use object constructer\nx", "_____no_output_____" ] ], [ [ "Various convenience python operators are overloaded, including functional calls. Here is an example repeated from earlier in two forms:", "_____no_output_____" ] ], [ [ "%%lamb\np2 = (Cat_<e,t>(x_e) & p_t) >> (Exists y: Dog_<e,t>(y_e))", "_____no_output_____" ], [ "p2 = (te(\"Cat_<e,t>(x)\") & te(\"p_t\")) >> te(\"(Exists y: Dog_<e,t>(y_e))\")\np2", "_____no_output_____" ] ], [ [ "Let's examine in detail what happens when a function and argument combine.", "_____no_output_____" ] ], [ [ "catf = meta.LFun(types.type_e, te(\"Cat(x_e)\"), \"x\")\ncatf", "_____no_output_____" ], [ "catf(te(\"y_e\"))", "_____no_output_____" ] ], [ [ "Building a function-argument expression builds a complex, unreduced expression. This can be explicitly reduced (note that the `reduce_all()` function would be used to apply reduction recursively):", "_____no_output_____" ] ], [ [ "catf(te(\"y_e\")).reduce()", "_____no_output_____" ], [ "(catf(te(\"y_e\")).reduce()).derivation", "_____no_output_____" ] ], [ [ "The metalanguage supports some basic type inference. Type inference happens already on combination of a function and argument into an unreduced expression, not on beta-reduction.", "_____no_output_____" ] ], [ [ "%lamb ttest = L x_X : P_<?,t>(x) # type <?,t>\n%lamb tvar = y_t\nttest(tvar)", "_____no_output_____" ] ], [ [ "&nbsp;\n\n## Part 3: composition systems for an object language ##\n\nOn top of the metalanguage are '**composition systems**' for modeling (step-by-step) semantic composition in an object language such as English. This is the part of the lambda notebook that tracks and manipulates mappings between object language elements (words, trees, etc) and denotations in the metalanguage. \n\nA composition at its core consists of a set of composition rules; the following cell defines a simple composition system that will be familiar to anyone who has taken a basic course in compositional semantics. (This example is just a redefinition of the default composition system.)", "_____no_output_____" ] ], [ [ "# none of this is strictly necessary, the built-in library already provides effectively this system.\nfa = lang.BinaryCompositionOp(\"FA\", lang.fa_fun, reduce=True)\npm = lang.BinaryCompositionOp(\"PM\", lang.pm_fun, commutative=False, reduce=True)\npa = lang.BinaryCompositionOp(\"PA\", lang.pa_fun, allow_none=True)\ndemo_hk_system = lang.CompositionSystem(name=\"demo system\", rules=[fa, pm, pa])\nlang.set_system(demo_hk_system)\ndemo_hk_system", "_____no_output_____" ] ], [ [ "Expressing denotations is done in a `%%lamb` cell, and almost always begins with lexical items. The following cell defines several lexical items that will be familiar from introductory exercises in the Heim & Kratzer 1998 textbook \"Semantics in Generative Grammar\". These definitions produce items that are subclasses of the class `Composable`.", "_____no_output_____" ] ], [ [ "%%lamb\n||cat|| = L x_e: Cat(x)\n||gray|| = L x_e: Gray(x)\n||john|| = John_e\n||julius|| = Julius_e\n||inP|| = L x_e : L y_e : In(y, x) # `in` is a reserved word in python\n||texas|| = Texas_e\n||isV|| = L p_<e,t> : p # `is` is a reserved word in python", "_____no_output_____" ] ], [ [ "In the purely type-driven mode, composition is triggered by using the '`*`' operator on a `Composable`. This searches over the available composition operations in the system to see if any results can be had. `inP` and `texas` above should be able to compose using the FA rule:", "_____no_output_____" ] ], [ [ "inP * texas", "_____no_output_____" ] ], [ [ "On the other hand `isV` is looking for a property, so we shouldn't expect succesful composition. Below this I have given a complete sentence and shown some introspection on that composition result.", "_____no_output_____" ] ], [ [ "julius * isV # will fail due to type mismatches", "_____no_output_____" ], [ "sentence1 = julius * (isV * (inP * texas))\nsentence1", "_____no_output_____" ], [ "sentence1.trace()", "_____no_output_____" ] ], [ [ "Composition will find all possible paths (beware of combinatorial explosion). I have temporarily disabled the fact that standard PM is symmetric/commutative (because of conjunction), to illustrate a case with multiple composition paths:", "_____no_output_____" ] ], [ [ "gray * cat", "_____no_output_____" ], [ "gray * (cat * (inP * texas))", "_____no_output_____" ], [ "a = lang.Item(\"a\", isV.content) # identity function for copula as well\nisV * (a * (gray * cat * (inP * texas)))", "_____no_output_____" ], [ "np = ((gray * cat) * (inP * texas))\nvp = (isV * (a * np))\nsentence2 = julius * vp\nsentence2", "_____no_output_____" ], [ "sentence1.results[0]", "_____no_output_____" ], [ "sentence1.results[0].tree()", "_____no_output_____" ], [ "sentence2.results[0].tree()", "_____no_output_____" ] ], [ [ "One of the infamous exercise examples from Heim and Kratzer (names different):\n\n (1) Julius is a gray cat in Texas fond of John.\n \nFirst let's get rid of all the extra readings, to keep this simple.", "_____no_output_____" ] ], [ [ "demo_hk_system.get_rule(\"PM\").commutative = True", "_____no_output_____" ], [ "fond = lang.Item(\"fond\", \"L x_e : L y_e : Fond(y)(x)\")\nofP = lang.Item(\"of\", \"L x_e : x\")\nsentence3 = julius * (isV * (a * (((gray * cat) * (inP * texas)) * (fond * (ofP * john)))))\nsentence3", "_____no_output_____" ], [ "sentence3.tree()", "_____no_output_____" ] ], [ [ "The _Composite_ class subclasses _nltk.Tree_, and so supports the things that class does. E.g. []-based paths:", "_____no_output_____" ] ], [ [ "parse_tree3 = sentence3.results[0]\nparse_tree3[0][1][1].tree()", "_____no_output_____" ] ], [ [ "There is support for traces and indexed pronouns, using the PA rule. (The implementation may not be what you expect.)", "_____no_output_____" ] ], [ [ "binder = lang.Binder(23)\nbinder2 = lang.Binder(5)\nt = lang.Trace(23, types.type_e)\nt2 = lang.Trace(5)\ndisplay(t, t2, binder)", "_____no_output_____" ], [ "((t * gray))", "_____no_output_____" ], [ "b1 = (binder * (binder2 * (t * (inP * t2))))\nb2 = (binder2 * (binder * (t * (inP * t2))))\ndisplay(b1, b2)", "_____no_output_____" ], [ "b1.trace()", "_____no_output_____" ], [ "b1.results[0].tree()", "_____no_output_____" ] ], [ [ "### Composition in tree structures\n\nSome in-progress work: implementing tree-based computation, and top-down/deferred computation\n\n* using nltk Tree objects.\n* system for deferred / uncertain types -- basic inference over unknown types\n* arbitrary order of composition expansion. (Of course, some orders will be far less efficient!)", "_____no_output_____" ] ], [ [ "reload_lamb()\nlang.set_system(lang.hk3_system)", "_____no_output_____" ], [ "%%lamb\n||gray|| = L x_e : Gray_<e,t>(x)\n||cat|| = L x_e : Cat_<e,t>(x)", "_____no_output_____" ], [ "t2 = Tree(\"S\", [\"NP\", \"VP\"])\nt2", "_____no_output_____" ], [ "t2 = Tree(\"S\", [\"NP\", \"VP\"])\nr2 = lang.hk3_system.compose(t2)\nr2.tree()\nr2.paths()", "_____no_output_____" ], [ "Tree = lamb.utils.get_tree_class()\nt = Tree(\"NP\", [\"gray\", Tree(\"N\", [\"cat\"])])\nt", "_____no_output_____" ], [ "t2 = lang.CompositionTree.tree_factory(t)\nr = lang.hk3_system.compose(t2)\nr", "_____no_output_____" ], [ "r.tree()", "_____no_output_____" ], [ "r = lang.hk3_system.expand_all(t2)\nr", "_____no_output_____" ], [ "r.tree()", "_____no_output_____" ], [ "r.paths()", "_____no_output_____" ] ], [ [ "&nbsp;\n\n## Some future projects, non-exhaustive ##\n\n* complete fragment of Heim and Kratzer\n* In general: more fragments!\n* extend fragment coverage. Some interesting targets where interactivity would be useful to understanding:\n * Compositional hamblin semantics (partial)\n * Compositional DRT (partial)\n * QR\n* underlying model theory.\n* various improvements to the graphics -- trees (d3? graphviz?), interactive widgets, ...\n* full latex output (trees in tikz-qtree and so on).\n\nLonger term:\n\n* integration with SymPy (?)\n* deeper integration with nltk.\n* parsing that makes less use of python `eval`, and is generally less ad-hoc.\n * this is an issue where in principle, a language like Haskell is a better choice than python. But I think the usability / robustness of python and its libraries has the edge here overall, not to mention ipython notebook...\n* toy spatial language system\n* side-by-side comparison of e.g. multiple analyses of presupposition projection", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ] ]
e7e546ad18be908af374c1ab22637d8e646d9454
45,159
ipynb
Jupyter Notebook
lab2/lab2-Howard.ipynb
erinleighh/WWU-seminar-2018
161c8faaa8a738ea88a9f97a63368f0d397f1ffb
[ "MIT" ]
null
null
null
lab2/lab2-Howard.ipynb
erinleighh/WWU-seminar-2018
161c8faaa8a738ea88a9f97a63368f0d397f1ffb
[ "MIT" ]
7
2018-04-05T16:31:47.000Z
2018-05-23T17:54:52.000Z
lab2/lab2-Howard.ipynb
erinleighh/WWU-seminar-2018
161c8faaa8a738ea88a9f97a63368f0d397f1ffb
[ "MIT" ]
15
2018-04-03T16:29:39.000Z
2018-05-02T23:28:15.000Z
50.85473
12,348
0.621493
[ [ [ "# Algorithms 1: Do Something!\n\nToday's exercise is to make a piece of code that completes a useful task, but write it as generalized as possible to be reusable for other people (including Future You)!", "_____no_output_____" ] ], [ [ "%matplotlib inline\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt", "_____no_output_____" ] ], [ [ "## Documentation\n\nA \"Docstring\" is required for every function you write. Otherwise you will forget what it does and how it does it!\n\nOne very common docstring format is the \"[NumPy/SciPy](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt)\" standard:\n\nBelow is a working function with a valid docstring as an example:", "_____no_output_____" ] ], [ [ "def MyFunc(arg1, arg2, kwarg1=5.0):\n '''\n This is a function to calculate the number of quatloos required\n to reverse the polarity of a neutron flow.\n \n Parameters\n ----------\n arg1 : float\n How many bleeps per blorp\n arg2 : float\n The foo/bar parameter\n kwarg1 : float, optional\n The quatloo to gold-pressed-latinum exchange rate\n Returns\n -------\n float\n A specific resultification index\n '''\n \n if kwarg1 > 5.0:\n print(\"wow, that's a lot of quatloos...\")\n\n # this is the classical formula we learn in grade school\n output = arg1 + arg2 * kwarg1\n \n return output", "_____no_output_____" ], [ "# how to use the function\nx = MyFunc(7,8, kwarg1=9.2)", "wow, that's a lot of quatloos...\n" ], [ "# Check out the function's result\nprint(x)", "80.6\n" ], [ "# convert Kelvin to Fahrenheit\n\ndef TempConvert(temp, K2F = True):\n '''\n This is a function to calculate the temperature in Fahrenheit\n with a given input in Kelvin, and vice versa.\n \n Parameters\n ----------\n temp : float\n The input temperature\n K2F : boolean\n The input temperature's unit, assumes Kelvin to Fahrenheit.\n \n Returns\n -------\n float\n The Fahrenheit equivalent to input.\n '''\n # this is the classical formula we learn in grade school\n if K2F == True:\n output = (9/5 * (temp - 273)) + 32\n else: \n output = (5/9 * (temp - 32)) + 273\n \n return output", "_____no_output_____" ], [ "# Insert the degrees and \"True\" if converting from K to F, \"False\" if converting from F to K.\nx = TempConvert(32, False)\n\n# check\nprint(x)", "273.0\n" ] ], [ [ "## Today's Algorithm\n\nHere's the goal:\n\n**Which constellation is a given point in?**\n\nThis is where you could find the detailed constellation boundary lines data:\nhttp://vizier.cfa.harvard.edu/viz-bin/Cat?cat=VI%2F49\nYou could use this data and do the full \"Ray Casting\" approach, or even cheat using matpltlib functions!\nhttp://stackoverflow.com/a/23453678\n\n**BUT**\nA simplified approach has been developed (that you should use!) from [Roman (1987)](http://cdsads.u-strasbg.fr/abs/1987PASP...99..695R)", "_____no_output_____" ] ], [ [ "# This is how to read in the coordinates and constellation names using Pandas\n# (this is a cleaned up version of Table 1 from Roman (1987) I prepared for you!)\n\ndf = pd.read_csv('data/data.csv')\ndf", "_____no_output_____" ], [ "# Determine which constellation a given coordinate is in.\n\ndef howard_constellation(ra, dec):\n '''\n This is a function to determine which constellation a given coordinate is in.\n \n Parameters\n ----------\n ra : float\n The right assention coordinate of the input.\n \n dec : float\n The declination coordinate of the input.\n \n index : int\n The indeces in which the coordinate passes the conditionals. (Includes MORE than just the constellation it's in.)\n \n boundsIndex : int\n The indeces in which the coordinate passes the conditionals. (Includes MORE than just the constellation it's in.)\n \n Returns\n -------\n string\n The constellation the given coordinate is in.\n plot\n \n '''\n \n # This is how to read in the coordinates and constellation names using Pandas\n\n df = pd.read_csv('data/data.csv')\n \n '''Based on the literature:\n Read down the column headed \"DE_low\" until a declination lower than or \n equal to the declination of the input is reached.\n Read down the column headed \"RA_up\" until a right assention greater than\n or equal to the right assention of the input is reached.\n Read down the column headed \"RA_low\" until a right assention lower than or\n equal to the right assention of the input is reached.\n The FIRST index where this is true is the constellation in which the coordinate\n is located.'''\n\n index = np.where((dec >= df['DE_low']) & (ra <= df['RA_up']) & (ra >= df['RA_low']))[0]\n \n output = df['name'].values[index][0]\n \n '''\n Attempting to draw the constellation boundaries and the point of the ra/dec input.\n '''\n \n boundsIndex = np.where(df['name'] == output)[0]\n plt.plot(df['RA_up'][boundsIndex], df['DE_low'][boundsIndex])\n plt.plot(df['RA_low'][boundsIndex], df['DE_low'][boundsIndex])\n plt.scatter(ra,dec)\n plt.show()\n \n return output", "_____no_output_____" ], [ "# TESTS FOR YOUR FUNCTION!\n\n# these coordinates SHOULD be in constellation \"LYR\"\nra=18.62\ndec=38.78\n\nx = constellation(ra, dec)\nprint(x)\n\n# these should be in \"APS\"\nra=14.78\ndec=-79.03\n\nx = constellation(ra, dec)\nprint(x)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ] ]
e7e54d9ab485a5f6f9192e708db782e64717dd17
9,759
ipynb
Jupyter Notebook
ICCT_en/.ipynb_checkpoints/FAQ-en-checkpoint.ipynb
ICCTerasmus/ICCT
fcd56ab6b5fddc00f72521cc87accfdbec6068f6
[ "BSD-3-Clause" ]
6
2021-05-22T18:42:14.000Z
2021-10-03T14:10:22.000Z
ICCT_en/FAQ-en.ipynb
ICCTerasmus/ICCT
fcd56ab6b5fddc00f72521cc87accfdbec6068f6
[ "BSD-3-Clause" ]
null
null
null
ICCT_en/FAQ-en.ipynb
ICCTerasmus/ICCT
fcd56ab6b5fddc00f72521cc87accfdbec6068f6
[ "BSD-3-Clause" ]
2
2021-05-24T11:40:09.000Z
2021-08-29T16:36:18.000Z
62.159236
700
0.680603
[ [ [ "# FAQ\n\n* * *\n\n## Basic information\n\n* * *\n\n### Can I see a demonstration of the examples featured in this interactive course?\n\nThere are two video demonstrations available. The first one presents the water level control system ([view on YouTube](https://www.youtube.com/watch?v=YEZxOWY4RtU)) and the second one the Fast Fourier Transform ([view on YouTube](https://www.youtube.com/watch?v=M28kAsWAP8o)).\n\n### I would like to give my students/colleagues short instructions on how to register to the course, login and interact with the examples within the course. Do you have such instructions?\n\nInstructions for registration, login procedure and interaction with the examples are available in the form of an iorad tutorial, available [here](https://www.iorad.com/player/1760976/Izdelava-uporabni-kega-ra-una-v-te-aju-ICCT-in-navodila-za-uporabo-te-aja?isPopup=true#_).\n\n### Where can I find the handbook that accompanies the interactive course?\n\nThe PDF version of the handbook (available in English, Croatian, Hungarian, Italian and Slovene language) can be downloaded from [ICCT webpage](https://icct.cafre.unipi.it/project-results/manual).\n\n### Where can I learn more about the ICCT project?\n\nYou can visit project [website](https://icct.cafre.unipi.it), [Twitter](https://twitter.com/ICCT_erasmus) page, [Reddit](https://www.reddit.com/user/icct_erasmus), [GitHub](https://github.com/ICCTerasmus/ICCT#readme) to gather more information about the project. You can also follow the project via [ResearchGate](https://www.researchgate.net/project/Interactive-Course-for-Control-Theory-ICCT), [SCIENTIX](http://www.scientix.eu/projects/project-detail?articleId=1072810) or [Erasmus+ Project Results](https://ec.europa.eu/programmes/erasmus-plus/projects/eplus-project-details/#project/2018-1-SI01-KA203-047081).", "_____no_output_____" ], [ "* * *\n\n## Exams\n\n* * *\n\n### I am a Student. How can I take part in an exam and how do I obtain my grade?\n\nExam can be taken after a Mentor has prepared and released an exam. Once this is done, you have to fetch the exam and provide the answers (see [this tutorial](https://www.iorad.com/player/1645114/ICCT-Platform--for-students----How-to-fetch-an-exam-and-provide-answers-?#trysteps-1) for the instructions). Once you have successfully submitted your answers, you have to wait for a Mentor to collect all the submissions, grade them and generate the feedback. Once this is done you will be able to obtain and inspect Mentor's feedback (see [this tutorial](https://www.iorad.com/player/1652160/ICCT-Platform--for-students----How-to-obtain-and-inspect-feedback-?#trysteps-1) for the instructions).\n\n### I am a Mentor (teacher/lecturer). How can I prepare an exam for Students?\n\nFirst, you need to prepare and release an exam (see [this tutorial](https://www.iorad.com/player/1651571/ICCT-Platform--for-mentors----How-to-prepare-and-release-an-exam-?#trysteps-1) for more information). Then, you have to wait for the exam to end, so that you can collect all submissions, autograde them and generate feedback for Students (see [this tutorial](https://www.iorad.com/player/1652148/ICCT-Platform--for-mentors----How-to-collect-submissions--autograde-them-and-release-feedback-?#trysteps-1) for more information). Once you are done, Students will be able to obtain and inspect provided feedback.", "_____no_output_____" ], [ "* * *\n\n## Personal and commercial use of the contents of the interactive course\n\n* * *\n\n### Is it possible to download the examples and adopt them to my own needs?\n\nYes, download of the examples available within the interactive course is possible via ICCT's GitHub Repository. The instructions are available [here](https://github.com/ICCTerasmus/ICCT#readme). You can adopt the examples according to your needs, however, their usage has to comply with the 3-Clause BSD license. For more information about this license, please click [here](https://opensource.org/licenses/BSD-3-Clause).\n\n### I would like to use the interactive examples for my home/school project. Is it allowed to do it?\n\nAll the interactive examples (Juypter Notebooks) within the course are authored by ICCT Project Consortium, and are licensed under the terms of the 3-Clause BSD license, which is part of the permissive free software licenses. For more information about it, please click [here](https://opensource.org/licenses/BSD-3-Clause).\n\n### I would like to use the interactive examples for commercial purposes. Is it allowed to do it?\n\nAll the interactive examples (Juypter Notebooks) within the course are authored by ICCT Project Consortium, and are licensed under the terms of the 3-Clause BSD license, which is part of the permissive free software licenses. For more information about it, please click [here](https://opensource.org/licenses/BSD-3-Clause).\n\n### I would like to translate the examples to my language. Is it possible to do it?\n\nYes, the interactive examples can be translated to any language by anyone interested. Prior to starting the translations, please contact us via <[email protected]>, so that we provide you with instructions. Please note that our course is currently being translated to Indonesian and Spanish languages.", "_____no_output_____" ], [ "* * *\n\n## Issues\n\n* * *\n\n### After running the selected example by clicking *Cell-Run All* or the corresponding button in the toolbar, the the example does not load properly.\n\n- First, notebook should be run only when the kernel is ready. The 'transient info' about the kernel can be seen in the upper right part of the notebook, during the initial loading (please see Figure 1 below).\n- Second, wait for the icon in the browser tab to change from the hourglass to the book symbol at the initial loading stage (please see Figure 2 below). Please note that examples with long-running simulations may have hourglass visible even after initial loading, i.e., once the simulation actually starts, or when some processing is done in the background.\n- Last, if none of the above solutions work, please run the example twice (by clicking on *Cell-Run All* or the corresponding button once again after the kernel is ready and book symbol is displayed).\n\n<table>\n <tr>\n <th style=\"text-align:center\">Figure 1. Kernel information</th>\n <th style=\"text-align:center\">Figure 2. Loading information</th>\n </tr>\n <tr>\n <td style=\"width:480px; height:150px\"><img src='examples/02/img/kernel-ready.png'></td>\n <td style=\"width:250px; height:150px\"><img src='examples/02/img/loading.png'></td>\n </tr>\n <tr>\n </tr> \n</table>\n\n### The examples are loading and running rather slow. What can I do?\n\n- First, make sure that you have closed and halted the previously opened examples by clicking on *File-Close and Halt*. You can see the examples that are still running under the *Running* tab accessible via the starting page of the course.\n- Second, there might be a lot of users concurrently logged in the course, which might slow down the system.\n- If the issue persists, please contact us via <[email protected]>. \n- Note: You can also always run your examples locally (the loading and running times will depend on your resources). For more information, click [here](https://github.com/ICCTerasmus/ICCT#readme).\n\n### I registered to the course and my default role is Student. How can I change it to Mentor?\n\nPlease note the Mentor role is available only for teachers/lecturers. For obtaining the Mentor role, please send a request to <[email protected]>.\n\n### I have already registered on the old course site (https://icct.riteh.hr). Do I need to register once again on the new site (https://icct.unipi.it)?\n\nYes, you have to register on the new site as well. Please note that the old page is not maintained anymore and will be removed after some time. Thank you for your understanding.\n\n### My issue is not listed here. How can I contact the team behind the interactive course?\n\nYou can contact the ICCT team via email <[email protected]> or through any of the channels listed in the *Basic information* section of these FAQs.", "_____no_output_____" ] ] ]
[ "markdown" ]
[ [ "markdown", "markdown", "markdown", "markdown" ] ]
e7e5550b4376e6a1849c3b7855fe1a9e6fe737b9
78,769
ipynb
Jupyter Notebook
Join_and_Shape_Data.ipynb
kvinne-anc/Data-Science-Notebooks
78766ffb0d277f955db5fb26822a77a56fbecd26
[ "MIT" ]
null
null
null
Join_and_Shape_Data.ipynb
kvinne-anc/Data-Science-Notebooks
78766ffb0d277f955db5fb26822a77a56fbecd26
[ "MIT" ]
null
null
null
Join_and_Shape_Data.ipynb
kvinne-anc/Data-Science-Notebooks
78766ffb0d277f955db5fb26822a77a56fbecd26
[ "MIT" ]
null
null
null
33.937527
249
0.317727
[ [ [ "<a href=\"https://colab.research.google.com/github/kvinne-anc/Data-Science-Notebooks/blob/main/Join_and_Shape_Data.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>", "_____no_output_____" ] ], [ [ "\n#Join Data Practice\n#These are the top 10 most frequently ordered products. How many times was each ordered?\n\n#Banana\n#Bag of Organic Bananas\n#Organic Strawberries\n#Organic Baby Spinach\n#Organic Hass Avocado\n#Organic Avocado\n#Large Lemon\n#Strawberries\n#Limes\n#Organic Whole Milk\n#First, write down which columns you need and which dataframes have them.\n\n#Next, merge these into a single dataframe.\n\n#Then, use pandas functions from the previous lesson to get the counts of the top 10 most frequently ordered products.", "_____no_output_____" ], [ "import pandas as pd \nimport numpy as np \nimport matplotlib.pyplot as plt \n%matplotlib inline \nimport seaborn as sns ", "/usr/local/lib/python3.6/dist-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.\n import pandas.util.testing as tm\n" ], [ "!wget https://s3.amazonaws.com/instacart-datasets/instacart_online_grocery_shopping_2017_05_01.tar.gz", "--2020-05-12 22:56:25-- https://s3.amazonaws.com/instacart-datasets/instacart_online_grocery_shopping_2017_05_01.tar.gz\nResolving s3.amazonaws.com (s3.amazonaws.com)... 52.216.138.133\nConnecting to s3.amazonaws.com (s3.amazonaws.com)|52.216.138.133|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 205548478 (196M) [application/x-gzip]\nSaving to: ‘instacart_online_grocery_shopping_2017_05_01.tar.gz’\n\ninstacart_online_gr 100%[===================>] 196.03M 17.1MB/s in 13s \n\n2020-05-12 22:56:39 (15.1 MB/s) - ‘instacart_online_grocery_shopping_2017_05_01.tar.gz’ saved [205548478/205548478]\n\n" ], [ "!tar --gunzip --extract --verbose --file=instacart_online_grocery_shopping_2017_05_01.tar.gz", "instacart_2017_05_01/\ninstacart_2017_05_01/._aisles.csv\ninstacart_2017_05_01/aisles.csv\ninstacart_2017_05_01/._departments.csv\ninstacart_2017_05_01/departments.csv\ninstacart_2017_05_01/._order_products__prior.csv\ninstacart_2017_05_01/order_products__prior.csv\ninstacart_2017_05_01/._order_products__train.csv\ninstacart_2017_05_01/order_products__train.csv\ninstacart_2017_05_01/._orders.csv\ninstacart_2017_05_01/orders.csv\ninstacart_2017_05_01/._products.csv\ninstacart_2017_05_01/products.csv\n" ], [ "%cd instacart_2017_05_01", "/content/instacart_2017_05_01\n" ], [ "!ls -lh *.csv", "-rw-r--r-- 1 502 staff 2.6K May 2 2017 aisles.csv\n-rw-r--r-- 1 502 staff 270 May 2 2017 departments.csv\n-rw-r--r-- 1 502 staff 551M May 2 2017 order_products__prior.csv\n-rw-r--r-- 1 502 staff 24M May 2 2017 order_products__train.csv\n-rw-r--r-- 1 502 staff 104M May 2 2017 orders.csv\n-rw-r--r-- 1 502 staff 2.1M May 2 2017 products.csv\n" ], [ "#discovered that the 'aisles' and 'departments' files are pretty useless for this task so I eliminated them after exploring them", "_____no_output_____" ], [ "opt = pd.read_csv('order_products__train.csv')\nopt.head(10)", "_____no_output_____" ], [ "opp = pd.read_csv('order_products__prior.csv')\nopp.head()\n", "_____no_output_____" ], [ "ord = pd.read_csv('orders.csv')\nord.head()\n ", "_____no_output_____" ], [ "prod = pd.read_csv('products.csv')\nprod.describe()\n", "_____no_output_____" ], [ "#Attempting to explore the relevant column to find the exact food items - this didn't really help me but I wanted to try it anyway\nfood = prod[['product_name']]\nfood.head()", "_____no_output_____" ], [ "#attempting to group by food and limit this list to just those items - this also did not help \nopp.groupby('add_to_cart_order').head(10)", "_____no_output_____" ], [ "#I was finally able to pull out the individual products I needed - I want to figure out if I can do them all at once \n#Every attempt to combine them produced an error so I did each separately \n#I discovered that almost all of them are in aisle 24, dept 4 - so many those two sets could be useful after all - jk they're not ", "_____no_output_____" ], [ "banana = prod[(prod.product_name == 'Banana')]\nbanana", "_____no_output_____" ], [ "bob = prod[(prod.product_name == 'Bag of Organic Bananas')]\nbob", "_____no_output_____" ], [ "straw = prod[(prod.product_name == 'Strawberries')]\nstraw", "_____no_output_____" ], [ "ostraw = prod[(prod.product_name == 'Organic Strawberries')]\nostraw", "_____no_output_____" ], [ "avo = prod[(prod.product_name == 'Avocado')]\navo", "_____no_output_____" ], [ "oha = prod[(prod.product_name == 'Organic Hass Avocado')]\noha", "_____no_output_____" ], [ "lime = prod[(prod.product_name == 'Limes')]\nlime", "_____no_output_____" ], [ "lemon = prod[(prod.product_name == 'Large Lemon')]\nlemon", "_____no_output_____" ], [ "milk = prod[(prod.product_name == 'Organic Whole Milk')]\nmilk", "_____no_output_____" ], [ "spinach = prod[(prod.product_name == 'Organic Baby Spinach')]\nspinach", "_____no_output_____" ], [ "#Everything is in Dept 4 with the exception of milk in dept 16 ", "_____no_output_____" ], [ "#so, they are all in one list but now I need to get rid of the headings and unnecessary data \n\nfood_list = [lemon, lime, milk, oha, avo, banana, bob, straw, ostraw, spinach] \nfood_list\n", "_____no_output_____" ], [ "#Well that sucks ", "_____no_output_____" ], [ "#combined these because they hold a lot of the same categories \n\nopp_opt = pd.concat([opp, opt], axis=0)\nopp_opt.describe", "_____no_output_____" ], [ "ord_prod = pd.concat([ord, prod], axis=0)\nord_prod.shape", "_____no_output_____" ], [ "#These product ids match the top foods product ids - tbh tho I don't understand what the second column output represents \nopp_opt['product_id'].value_counts()[:10]", "_____no_output_____" ], [ "#Making list of the ids needed: \n\nTop_food = opp_opt['product_id'].value_counts()[:10].index.tolist()\nTop_food", "_____no_output_____" ], [ "#Making list of top ids and cooresponding order info\n\ncondition = opp_opt['product_id'].isin(Top_food)\nsmall_list = opp_opt[condition]\nsmall_list.head(10)", "_____no_output_____" ], [ "#The list has been merged on the common element (product id), inner because it's like joining two sets by the inner part of a venn diagram, but all data from both is included\n\nmerge1 = pd.merge(small_list, prod, on='product_id', how='inner')\nmerge1", "_____no_output_____" ], [ "#Trying to make the dataset look better and display the info needed - it worked! \n\nfin_df = merge1['product_name'].value_counts(sort=True).to_frame()\nfin_df = fin_df.reset_index()\nfin_df.columns = ['product_name', 'amount ordered']\nfin_df\n", "_____no_output_____" ], [ "", "_____no_output_____" ], [ "", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e58a82e8770fdcbecfc71bc882a88239679322
9,101
ipynb
Jupyter Notebook
productionPlanning/planning.ipynb
jordipereiragude/PlanificacionProgramacionOperaciones2020
a3051f88c3605249afb5a464f805caa8f99aa463
[ "CC0-1.0" ]
null
null
null
productionPlanning/planning.ipynb
jordipereiragude/PlanificacionProgramacionOperaciones2020
a3051f88c3605249afb5a464f805caa8f99aa463
[ "CC0-1.0" ]
null
null
null
productionPlanning/planning.ipynb
jordipereiragude/PlanificacionProgramacionOperaciones2020
a3051f88c3605249afb5a464f805caa8f99aa463
[ "CC0-1.0" ]
1
2020-12-11T18:19:49.000Z
2020-12-11T18:19:49.000Z
32.620072
209
0.510274
[ [ [ "empty" ] ] ]
[ "empty" ]
[ [ "empty" ] ]
e7e58ca07531bcce9f0e5bb8d43a8422478a666c
6,972
ipynb
Jupyter Notebook
2021/day20/main.ipynb
GriceTurrble/advent-of-code-2020-answers
71bba823a95d602ab0d6b12125fdb0f0f64b8872
[ "MIT" ]
null
null
null
2021/day20/main.ipynb
GriceTurrble/advent-of-code-2020-answers
71bba823a95d602ab0d6b12125fdb0f0f64b8872
[ "MIT" ]
1
2022-03-31T14:15:59.000Z
2022-03-31T14:15:59.000Z
2021/day20/main.ipynb
GriceTurrble/advent-of-code
71bba823a95d602ab0d6b12125fdb0f0f64b8872
[ "MIT" ]
null
null
null
3,486
6,971
0.552639
[ [ [ "# Day 20 - Trench Map\n\nhttps://adventofcode.com/2021/day/20", "_____no_output_____" ] ], [ [ "from pathlib import Path\n\nINPUTS = Path(\"input.txt\").read_text().strip().split(\"\\n\")\n\nENHANCER = INPUTS[0]\nIMAGE = INPUTS[2:]\n", "_____no_output_____" ], [ "def section_to_decimal(section: str) -> int:\n output = ''.join('1' if x == '#' else '0' for x in section)\n return int(output, base=2)\n\nassert section_to_decimal(section='...#...#.') == 34", "_____no_output_____" ], [ "def enhance_image(\n original: list[str],\n enhancer: str = ENHANCER,\n padder: str = \".\",\n) -> list[str]:\n extra_row = padder * (len(original[0]) + 4)\n # Expand the original 2 pixels in every dimension\n # to more easily grab sections on the edges for enhancing the final image.\n new_original = [\n extra_row,\n extra_row,\n *[f\"{padder*2}{x}{padder*2}\" for x in original],\n extra_row,\n extra_row,\n ]\n output = []\n\n for i in range(len(new_original) - 2):\n outrow = \"\"\n for j in range(len(new_original[0]) - 2):\n section = \"\".join(x[j : j + 3] for x in new_original[i : i + 3])\n index = section_to_decimal(section=section)\n outrow += enhancer[index]\n output.append(outrow)\n return output\n", "_____no_output_____" ], [ "def test_enhance_image():\n enhancer = (\n \"..#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..##\"\n \"#..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###\"\n \".######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#.\"\n \".#..#..##..#...##.######.####.####.#.#...#.......#..#.#.#...####.##.#.....\"\n \".#..#...##.#.##..#...##.#.##..###.#......#.#.......#.#.#.####.###.##...#..\"\n \"...####.#..#..#.##.#....##..#.####....##...##..#...#......#.#.......#.....\"\n \"..##..####..#...#.#.#...##..#.#..###..#####........#..####......#..#\"\n )\n image = [\n \"#..#.\",\n \"#....\",\n \"##..#\",\n \"..#..\",\n \"..###\",\n ]\n enhanced = enhance_image(original=image, enhancer=enhancer)\n expected = [\n \".##.##.\",\n \"#..#.#.\",\n \"##.#..#\",\n \"####..#\",\n \".#..##.\",\n \"..##..#\",\n \"...#.#.\",\n ]\n assert enhanced == expected, \"Output:\\n\" + \"\\n\".join(enhanced)\n\n enhanced2 = enhance_image(original=enhanced, enhancer=enhancer, padder=enhancer[0])\n expected2 = [\n \".......#.\",\n \".#..#.#..\",\n \"#.#...###\",\n \"#...##.#.\",\n \"#.....#.#\",\n \".#.#####.\",\n \"..#.#####\",\n \"...##.##.\",\n \"....###..\",\n ]\n assert enhanced2 == expected2, \"Output:\\n\" + \"\\n\".join(enhanced2)\n light_pixels = sum([sum([1 for y in x if y == \"#\"]) for x in enhanced2])\n assert light_pixels == 35, light_pixels\n\n\ntest_enhance_image()\n", "_____no_output_____" ] ], [ [ "I had some trouble at the next stage with AoC site telling me my count was off, despite everything seeming to work correctly. What I didn't account for was that the enhancement of a pixel surrounded by all dark pixels results in index `0`, and index 0 of my enhancer was a *light* pixel. This meant that every dark pixel in infinite directions would alternate between light and dark on each iteration (subsequently, the 512th pixel in the enhancer is `#`, completing the alternating pattern, as all light pixels results in that final position in the enhancer).\n\nThe fix for this is to adjust the enhancement algorithm so that it adds two new rows and columns on the outsides matching the first pixel in the enhancer on every *even* enhancement. This ensured that even the example code worked the same and that my own enhancer worked correctly.\n\nThis gotcha had me stumped in part 1 for a while, but a couple lines of code later and it's solved.", "_____no_output_____" ] ], [ [ "pass1 = enhance_image(original=IMAGE, enhancer=ENHANCER)\n# As noted above, the second pass has to use the first pixel in the ENHANCER as a padder\n# in order to get back the correct image.\npass2 = enhance_image(original=pass1, enhancer=ENHANCER, padder=ENHANCER[0])\n", "_____no_output_____" ] ], [ [ "Once we had a final image (in `pass2` above), we have to count the light pixels. This was a simple matter of flattening and summing all instances of `#` in the final list of strings.\n\nI could have simplified ever so slightly had I converted the pixels to `1`s and `0`s first, but where's the fun in that?", "_____no_output_____" ] ], [ [ "light_pixels = sum([sum([1 for y in x if y == '#']) for x in pass2])\nprint(f\"Number of light pixels: {light_pixels}\")", "Number of light pixels: 5057\n" ] ], [ [ "## Part 2\n\nRunning the same algorithm 50x isn't much of a deal compared to running it 2x. We just need to be sure to pull the correct padding character on even-numbered iterations, so we have the `padder` line flipping on the result of `i % 2` (if 1, it's `True`, meaning `i == 1` and `3`, which are indices `2` and `4` etc., which are our even-numbered iterations).", "_____no_output_____" ] ], [ [ "image = IMAGE\niterations = 50\nfor i in range(iterations):\n padder = ENHANCER[0] if i % 2 else \".\"\n image = enhance_image(original=image, enhancer=ENHANCER, padder=padder)\n\nlight_pixels = sum([sum([1 for y in x if y == '#']) for x in image])\nprint(f\"Number of light pixels: {light_pixels}\")\n", "Number of light pixels: 18502\n" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e592d4b80f3aadbfa74d23c02647f79956e1d7
1,156
ipynb
Jupyter Notebook
11 - Introduction to Python/8_Iteration/2_While Loops and Incrementing (5:10)/While Loops and Incrementing - Exercise_Py2.ipynb
olayinka04/365-data-science-courses
7d71215432f0ef07fd3def559d793a6f1938d108
[ "Apache-2.0" ]
3
2020-03-24T12:58:37.000Z
2020-08-03T17:22:35.000Z
11 - Introduction to Python/8_Iteration/2_While Loops and Incrementing (5:10)/While Loops and Incrementing - Exercise_Py2.ipynb
olayinka04/365-data-science-courses
7d71215432f0ef07fd3def559d793a6f1938d108
[ "Apache-2.0" ]
null
null
null
11 - Introduction to Python/8_Iteration/2_While Loops and Incrementing (5:10)/While Loops and Incrementing - Exercise_Py2.ipynb
olayinka04/365-data-science-courses
7d71215432f0ef07fd3def559d793a6f1938d108
[ "Apache-2.0" ]
1
2021-10-19T23:59:37.000Z
2021-10-19T23:59:37.000Z
19.59322
96
0.546713
[ [ [ "## While Loops and Incrementing", "_____no_output_____" ], [ "*Suggested Answers follow (usually there are multiple ways to solve a problem in Python).*", "_____no_output_____" ], [ "Create a while loop that will print all odd numbers from 0 to 30 on the same row. \n<br />\n*Hint: There are two ways in which you can create the odd values!*", "_____no_output_____" ] ] ]
[ "markdown" ]
[ [ "markdown", "markdown", "markdown" ] ]
e7e595ec6033187965d099bbdd362f438fb9c11a
95,132
ipynb
Jupyter Notebook
QHack_Project.ipynb
Dran-Z/QHack2022-OpenHackerthon
bbe77714c61b20f2025c3283a1349b95d58ccc24
[ "Apache-2.0" ]
null
null
null
QHack_Project.ipynb
Dran-Z/QHack2022-OpenHackerthon
bbe77714c61b20f2025c3283a1349b95d58ccc24
[ "Apache-2.0" ]
null
null
null
QHack_Project.ipynb
Dran-Z/QHack2022-OpenHackerthon
bbe77714c61b20f2025c3283a1349b95d58ccc24
[ "Apache-2.0" ]
null
null
null
311.908197
27,968
0.927375
[ [ [ "# Error Mitigation using noise-estimation circuit", "_____no_output_____" ] ], [ [ "from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, Aer, transpile, IBMQ\nfrom qiskit.circuit import Gate\nfrom qiskit.tools.visualization import plot_histogram\nfrom typing import Union\nimport numpy as np\nimport math\nimport matplotlib.pyplot as plt", "_____no_output_____" ], [ "qr = QuantumRegister(size = 6, name = 'qr')\ncr = ClassicalRegister(1,name='cr')\ncirc = QuantumCircuit(qr,cr)\n\ncirc.rx(-np.pi/2,qr[0])\ncirc.rx(-np.pi/2,qr[1])\ncirc.rx(-np.pi/2,qr[2])\ncirc.rx(np.pi/2,qr[3])\ncirc.rx(np.pi/2,qr[4])\ncirc.rx(np.pi/2,qr[5])\n", "_____no_output_____" ], [ "def one_time_step(num_qubits, J, to_gate=True) -> Union[Gate, QuantumCircuit]:\n # Define the circuit for one_time_step\n # J: the value of J*dt\n \n qr = QuantumRegister(num_qubits,name='qr')\n qc = QuantumCircuit(qr)\n \n for i in range( (num_qubits-1)//2):\n qc.cnot(qr[1+2*i],qr[2+2*i])\n qc.rx(-J,qr[2*i+1])\n qc.rz(-J,qr[2*i+2])\n qc.cnot(qr[1+2*i],qr[2+2*i])\n \n for i in range(num_qubits//2):\n qc.cnot(qr[2*i],qr[2*i+1])\n qc.rx(-2*J,qr[2*i])\n qc.rz(-2*J,qr[2*i+1])\n qc.cnot(qr[2*i],qr[2*i+1])\n \n for i in range( (num_qubits-1)//2):\n qc.cnot(qr[1+2*i],qr[2+2*i])\n qc.rx(-J,qr[2*i+1])\n qc.rz(-J,qr[2*i+2])\n qc.cnot(qr[1+2*i],qr[2+2*i])\n \n return qc.to_gate(label=' one time step') if to_gate else qc\n ", "_____no_output_____" ], [ "temp_circ = one_time_step(6, 0.1,to_gate=False)\ntemp_circ.draw('mpl')", "_____no_output_____" ], [ "J = 0.25\nstep = 4\n\nfor i in range(step):\n circ.append(one_time_step(6, J), qr)\n \ncirc.draw('mpl')", "_____no_output_____" ], [ "for i in range(6):\n circ.rx(-np.pi/2,qr[i])\n \n\ncirc.measure(qr[5],cr)\n\ncirc.draw('mpl')\n \n", "_____no_output_____" ], [ "simulator = Aer.get_backend('aer_simulator')\n\ncirc_transpiled = transpile(circ, simulator)\n\njob = simulator.run(circ_transpiled, shots = 8192)", "_____no_output_____" ], [ "res = job.result()\ncounts = res.get_counts()\nplot_histogram(counts)\n", "_____no_output_____" ], [ "def HeiSim_Step_Original(num_qubits, J, step, real_device=False):\n \n qr = QuantumRegister(size = num_qubits, name = 'qr')\n cr = ClassicalRegister(1,name='cr')\n circ = QuantumCircuit(qr,cr)\n\n circ.rx(-np.pi/2,qr[0])\n circ.rx(-np.pi/2,qr[1])\n circ.rx(-np.pi/2,qr[2])\n circ.rx(np.pi/2,qr[3])\n circ.rx(np.pi/2,qr[4])\n circ.rx(np.pi/2,qr[5])\n \n for i in range(step):\n circ.append(one_time_step(num_qubits, J), qr)\n \n for i in range(6):\n circ.rx(-np.pi/2,qr[i])\n \n circ.measure(qr[5],cr)\n \n if real_device:\n provider = IBMQ.get_provider(hub='ibm-q-community',group='ibmquantumawards',project='open-science-22')\n backend = provider.get_backend(name='ibmq_jakarta')\n else:\n backend = Aer.get_backend('aer_simulator')\n \n circ_transpiled = transpile(circ, backend)\n job = backend.run(circ_transpiled, shots = 8192)\n res = job.result()\n counts = res.get_counts()\n \n counts_0 = counts.get('0')\n counts_1 = counts.get('1')\n if counts_0!=8192 and counts_1!=8192:\n return (counts.get('0') - counts.get('1'))/8192 \n elif counts_0==8192:\n return 1\n elif counts_1==8192:\n return -1", "_____no_output_____" ], [ "M = []\nfor i in range(15):\n temp = HeiSim_Step_Original(num_qubits = 6, J = 0.1,step = i)\n M.append(temp)\n \nt = 0.2*np.array(range(15))\nplt.plot(t,M)", "_____no_output_____" ], [ "HeiSim_Step_Original(num_qubits = 6, J = 0.2,step = 1,real_device=True)", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e598b857c0c90d5941cf4dc2be4f1f613396e1
75,483
ipynb
Jupyter Notebook
nb/mocha_provabgs_mocks.ipynb
changhoonhahn/GQP_mock_challenge
831d5423edd9955ee1bda8d41e44d30cd3c6bd4b
[ "MIT" ]
3
2019-12-18T20:51:45.000Z
2021-12-11T05:59:24.000Z
nb/mocha_provabgs_mocks.ipynb
changhoonhahn/GQP_mock_challenge
831d5423edd9955ee1bda8d41e44d30cd3c6bd4b
[ "MIT" ]
44
2020-02-20T06:02:00.000Z
2021-04-13T20:00:50.000Z
nb/mocha_provabgs_mocks.ipynb
changhoonhahn/GQP_mock_challenge
831d5423edd9955ee1bda8d41e44d30cd3c6bd4b
[ "MIT" ]
7
2019-10-04T22:25:44.000Z
2020-07-20T02:05:03.000Z
357.739336
70,004
0.933217
[ [ [ "# generate mock SEDs using the `provabgs` pipeline\nThese SEDs will be used to construct BGS-like spectra and DESI-like photometry, which will be used for P1 and S1 mock challenge tests", "_____no_output_____" ] ], [ [ "import os\nimport numpy as np \n# --- plotting --- \nimport corner as DFM\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n#if 'NERSC_HOST' not in os.environ.keys():\n# mpl.rcParams['text.usetex'] = True\nmpl.rcParams['font.family'] = 'serif'\nmpl.rcParams['axes.linewidth'] = 1.5\nmpl.rcParams['axes.xmargin'] = 1\nmpl.rcParams['xtick.labelsize'] = 'x-large'\nmpl.rcParams['xtick.major.size'] = 5\nmpl.rcParams['xtick.major.width'] = 1.5\nmpl.rcParams['ytick.labelsize'] = 'x-large'\nmpl.rcParams['ytick.major.size'] = 5\nmpl.rcParams['ytick.major.width'] = 1.5\nmpl.rcParams['legend.frameon'] = False", "_____no_output_____" ], [ "from provabgs import infer as Infer\nfrom provabgs import models as Models", "_____no_output_____" ], [ "prior = Infer.load_priors([\n Infer.UniformPrior(9., 12., label='sed'), \n Infer.FlatDirichletPrior(4, label='sed'), # flat dirichilet priors\n Infer.UniformPrior(0., 1., label='sed'), # burst fraction\n Infer.UniformPrior(0., 13.27, label='sed'), # tburst\n Infer.UniformPrior(6.9e-5, 7.3e-3, label='sed'),# uniform priors on ZH coeff\n Infer.UniformPrior(6.9e-5, 7.3e-3, label='sed'),# uniform priors on ZH coeff\n Infer.UniformPrior(0., 3., label='sed'), # uniform priors on dust1 \n Infer.UniformPrior(0., 3., label='sed'), # uniform priors on dust2\n Infer.UniformPrior(-2.2, 0.4, label='sed') # uniform priors on dust_index \n])", "_____no_output_____" ] ], [ [ "# sample $\\theta_{\\rm obs}$ from prior", "_____no_output_____" ] ], [ [ "# direcotyr on nersc\n#dat_dir = '/global/cscratch1/sd/chahah/gqp_mc/mini_mocha/provabgs_mocks/'\n# local direcotry\ndat_dir = '/Users/chahah/data/gqp_mc/mini_mocha/provabgs_mocks/'", "_____no_output_____" ], [ "theta_obs = np.load(os.path.join(dat_dir, 'provabgs_mock.theta.npy'))\nz_obs = 0.2", "_____no_output_____" ], [ "m_nmf = Models.NMF(burst=True, emulator=False)", "_____no_output_____" ], [ "wave_full = []\nflux_full = [] \n\nwave_obs = np.linspace(3e3, 1e4, 1000)\nflux_obs = []\nfor i in range(theta_obs.shape[0]):\n w, f = m_nmf.sed(theta_obs[i], z_obs)\n wave_full.append(w)\n flux_full.append(f)\n \n _, f_obs = m_nmf.sed(theta_obs[i], z_obs, wavelength=wave_obs)\n flux_obs.append(f_obs)", "_____no_output_____" ], [ "fig = plt.figure(figsize=(10,5))\nsub = fig.add_subplot(111)\nfor w, f, f_obs in zip(wave_full[:10], flux_full, flux_obs): \n sub.plot(w, f, c='k', ls=':')\n sub.plot(wave_obs, f_obs)\nsub.set_xlim(3e3, 1e4)", "_____no_output_____" ] ], [ [ "# save to file", "_____no_output_____" ] ], [ [ "np.save(os.path.join(dat_dir, 'provabgs_mock.wave_full.npy'), np.array(wave_full))\nnp.save(os.path.join(dat_dir, 'provabgs_mock.flux_full.npy'), np.array(flux_full))\n\nnp.save(os.path.join(dat_dir, 'provabgs_mock.wave_obs.npy'), wave_obs)\nnp.save(os.path.join(dat_dir, 'provabgs_mock.flux_obs.npy'), np.array(flux_obs))", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code" ] ]
e7e59bfb40293c078b80c2c948358dec884aac87
16,322
ipynb
Jupyter Notebook
Pavol/ray_test.ipynb
AidanMar/reinforcement_learning
9186b89e42829f1a3d255ad0faf8cf51b2d3a639
[ "Apache-2.0" ]
null
null
null
Pavol/ray_test.ipynb
AidanMar/reinforcement_learning
9186b89e42829f1a3d255ad0faf8cf51b2d3a639
[ "Apache-2.0" ]
null
null
null
Pavol/ray_test.ipynb
AidanMar/reinforcement_learning
9186b89e42829f1a3d255ad0faf8cf51b2d3a639
[ "Apache-2.0" ]
null
null
null
39.235577
244
0.578912
[ [ [ "import gym\nimport ray\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nray.init()", "_____no_output_____" ] ], [ [ "Load the current s&p 500 ticker list, we will only be trading on these stocks", "_____no_output_____" ] ], [ [ "\ntickers = open('s&p500_tickers.dat', 'r').read().split('\\n')\nprint(tickers)", "_____no_output_____" ] ], [ [ "Data start and end dates and initialise ticker dataframe dictionary", "_____no_output_____" ] ], [ [ "one_day = pd.Timedelta(days=1)\n\ni = 0\ncur_day = pd.to_datetime('1992-06-15', format=r'%Y-%m-%d') #pd.to_datetime('1992-06-15')\nend_day = pd.to_datetime('2020-01-01', format=r'%Y-%m-%d')\n\nend_df = pd.read_csv('equity_data/' + (end_day - one_day).strftime(r'%Y%m%d') + '.csv')\nticker_df = end_df.loc[end_df.symbol.isin(tickers)] # Tickers that are in the dataframe on the last day\nticker_dict = {ticker_df.symbol.iloc[i] : ticker_df.finnhub_id.iloc[i] for i in range(len(ticker_df.index))} # Create a mapping between tickers and finnhub_ids", "_____no_output_____" ] ], [ [ "For all dates between start and end range, load the day into ticker dict with the key being ticker and dataframe indexed by day", "_____no_output_____" ] ], [ [ "\ndf_columns = pd.read_csv('equity_data/' + cur_day.strftime(r'%Y%m%d') + '.csv').columns\nticker_dfs = { ticker : pd.DataFrame(index=pd.date_range(cur_day, end_day - one_day, freq='D'), columns=df_columns) for ticker in tickers }\nsave_df = False\nif save_df:\n pbar = tqdm(total=(end_day - cur_day).days)\n while (cur_day != end_day):\n pbar.update()\n try:\n day_df = pd.read_csv('equity_data/' + cur_day.strftime(r'%Y%m%d') + '.csv')\n except FileNotFoundError:\n cur_day += one_day\n i += 1\n continue\n for ticker in ticker_dict.keys():\n if ticker in day_df.symbol.values:\n row = day_df.loc[day_df.finnhub_id == ticker_dict[ticker]]\n if row.shape[0] == 2:\n print(ticker)\n print(row)\n if not row.shape[0] == 0:\n ticker_dfs[ticker].loc[cur_day] = row.values[0, :]\n cur_day += one_day\n i += 1\n pbar.close()", "_____no_output_____" ], [ "# Loading logic, as the above is slow process and we dont want to perform it every time\nif save_df:\n for ticker, ticker_frame in ticker_dfs.items():\n ticker_frame.reset_index(inplace=True)\n ticker_frame.to_feather('equity_data/stored/' + ticker.lower() + '.feather')\nelse:\n print('Loading from storage...')\n for symbol in ticker_dict.keys():\n ticker_dfs[symbol] = pd.read_feather('equity_data/stored/' + symbol.lower() + '.feather').set_index('index', drop=True)\n print(ticker_dfs)", "_____no_output_____" ], [ "# Clear the data somewhat, we only want frames with more than 2000 days that have gaps no larger than 7 days\nto_delete = []\nfor ticker, frame in ticker_dfs.items():\n prev_day = frame.index[-1]\n frame.dropna(axis='index', how='all', inplace=True)\n if frame.empty:\n to_delete.append(ticker)\n elif len(frame.index) < 2000:\n to_delete.append(ticker)\n else:\n for day in frame.index[::-1][1:]:\n if (prev_day - day).days > 7: # if gap between datapoints larger than 7 days, remove\n to_delete.append(ticker)\n break\n prev_day = day\n\nfor ticker in to_delete:\n del ticker_dfs[ticker]\n print('Deleting ticker: ' + ticker)\nprint(len(ticker_dfs.keys()))", "_____no_output_____" ], [ "# Align dataframes by date and create an intersection\nindex_intersection = ticker_dfs[list(ticker_dfs.keys())[0]].index\nprint(index_intersection)\nfor ticker, ticker_frame in ticker_dfs.items():\n index_intersection = index_intersection.intersection(ticker_frame.index)\n print(ticker + ': ' + str(len(index_intersection)))\nprint(index_intersection)", "_____no_output_____" ], [ "for ticker in ticker_dfs.keys():\n ticker_dfs[ticker] = ticker_dfs[ticker].loc[index_intersection]\nprint(ticker_dfs)", "_____no_output_____" ], [ "# Env config file structure for reference\nn_assets = 0\nn_features = 0\nconfig = {\n 'initial_balance': 0,\n 'initial_portfolio': [0]*n_assets,\n 'tickers': ['']*n_assets, # Tickers to trade, must correspond to tickers in dataframe dict! Implicitly defines number of assets\n 'indicators': [None]*n_features, # Indicator functions/classes to compute features for each stock, implicitly defines number of features. TODO: Support multidimensional indicators\n 'max_indicator_lookback': 0, # Number of days after which all indicators can compute proper values\n 'trading_days': 0,\n 'start_day_offset': None\n}", "_____no_output_____" ], [ "class TradingEnv(gym.Env):\n\n def __init__(self, env_config):\n super(TradingEnv, self).__init__()\n\n self._env_config = env_config\n self._tickers = env_config['tickers']\n self._indicator_funcs = self._env_config['indicators']\n self._max_indicator_lookback = self._env_config['max_indicator_lookback'] # Number of days after which all indicators can compute proper values\n\n self._n_assets = len(self._tickers)\n self._n_features = len(self._indicator_funcs)\n\n assert self._n_assets != 0, 'Number of assets must not be zero!'\n assert self._n_features != 0, 'Number of features must not be zero!'\n\n self._df_dict = env_config['df_dict'] # Daily OHCL data for each stock, indexed and aligned by day\n\n self._days = self._df_dict[self._tickers[0]].index\n self._trading_days = env_config['trading_days'] # Number of days the algorithm will be trading\n self._start_day_idx = env_config['start_day_offset'] # Offset of the first trading day from the first dataframe day\n \n if self._start_day_idx is not None:\n assert self._start_day_idx >= self._max_indicator_lookback, 'start_day_offset must be larger than max_indicator_lookback in order to properly initialise all indicators'\n assert self._start_day_idx + self._trading_days <= len(self._days), 'start_day_idx + trading_days must be lower than the number of days'\n else:\n self._start_day_idx\n \n assert self._trading_days + self._max_indicator_lookback <= len(self._days) ,'The sum of trading_days + max_indicator_lookback must be lower than the number of days in the dataframe'\n\n self._initial_balance = self._env_config['initial_balance']\n self._initial_portfolio = self._env_config['initial_portfolio'] if self._env_config['initial_portfolio'] is not None else [0] * self._n_assets\n\n assert len(self._initial_portfolio) == self._n_assets, 'Size of initial portfolio must equal the number of assets!'\n\n action_shape = (self._n_assets + 1,)\n obs_shape = (self._n_features*self._n_assets + 1,)\n\n self.action_space = gym.spaces.Box(np.full(action_shape, 0), np.full(action_shape, 1), shape=action_shape, dtype=np.float16) # Action space is the assets + cash for rebalancing\n self.observation_space = gym.spaces.Box(np.full(obs_shape, 0), np.inf, shape=obs_shape, dtype=np.float16) # Observation space is all the features for each asset + cash\n self.max_episode_steps = self._trading_days\n\n def reset(self):\n self._balance = self._initial_balance\n self._portfolio = self._initial_portfolio\n\n if self._start_day_idx is None:\n self._start_day_idx = np.random.randint(self._max_indicator_lookback, len(self._days) - self._trading_days) # If no start day chosen, generate a random start\n self._cur_day_idx = self._start_day_idx\n self._cur_day = self._days[self._cur_day_idx]\n self._cur_day_idx += 1 # Advance one day\n \n indicators = self._compute_indicators(self._cur_day) # Compute the indicators for the start date\n \n return np.append(indicators, self._balance) # Observation is number of indicators * number of assets + 1\n\n def _compute_indicators(self, day):\n features = np.empty((self._n_features*self._n_assets,))\n for (i, ticker) in enumerate(self._tickers):\n for (j, indicator) in enumerate(self._indicator_funcs):\n ticker_frame_slice = self._df_dict[ticker].loc[self._days[self._start_day_idx] - pd.Timedelta(days=1)*self._max_indicator_lookback:(day + pd.Timedelta(days=1))] # Get the relevant dataframe up until this day (inclusive)\n features[i*self._n_features + j] = indicator(ticker_frame_slice)\n return features\n\n def _asset_prices(self, day): # Use open prices on the current day\n prices = np.empty((self._n_assets,))\n for i, ticker in enumerate(self._tickers):\n prices[i] = self._df_dict[ticker].loc[day].open\n return prices\n\n def _portfolio_val(self, portfolio, balance, day):\n return np.dot(self._asset_prices(self._cur_day), portfolio) + balance\n \n def _rebalance(self, actions): # TODO: Test this more to see if it makes sense\n weightings = self._softmax(actions) # First weight is for cash\n\n prices = self._asset_prices(self._cur_day) # Get the open prices of assets on the current day\n portfolio_val = np.dot(prices, self._portfolio) + self._balance\n return (portfolio_val*np.divide(weightings[1:], prices), portfolio_val*weightings[0]) # Rebalanced portfolio in the form of (assets, cash)\n\n def _reward(self):\n # For now just compute the increase in portfolio value\n return 1 - self._portfolio_val(self._portfolio, self._balance, self._cur_day) / self._portfolio_val(self._initial_portfolio, self._initial_balance, self._days[self._start_day_idx])\n\n def step(self, action):\n self._cur_day = self._days[self._cur_day_idx]\n #print('Day: ' + str(self._cur_day))\n (self._portfolio, self._balance) = self._rebalance(action)\n\n obs = np.append(self._compute_indicators(self._cur_day), self._balance)\n rw = self._reward()\n done = (self._cur_day_idx - self._start_day_idx) >= self._trading_days\n info = {} # TODO: Add info here\n\n self._cur_day_idx += 1 # Advance one day\n return obs, rw, done, info\n \n def _softmax(self, x):\n \"\"\"Compute softmax values for each sets of scores in x.\"\"\"\n e_x = np.exp(x - np.max(x))\n return e_x / e_x.sum()", "_____no_output_____" ], [ "close_indicator = lambda df: df.close[-1]", "_____no_output_____" ], [ "n_assets = len(ticker_dfs.keys())\nenv_config = {\n 'initial_balance': 1E6,\n 'initial_portfolio': [0]*n_assets,\n 'tickers': list(ticker_dfs.keys()), # Tickers to trade, must correspond to tickers in dataframe dict! Implicitly defines number of assets\n 'indicators': [close_indicator], # Indicator functions/classes to compute features for each stock, implicitly defines number of features. TODO: Support multidimensional indicators\n 'max_indicator_lookback': 0, # Number of days after which all indicators can compute proper values\n 'trading_days': 100,\n 'start_day_offset': None,\n 'df_dict': ticker_dfs\n}", "_____no_output_____" ], [ "import ray.rllib.agents.ppo as ppo\nimport ray.rllib.models.catalog as catalog\nimport ray.tune as tune\nfrom ray.tune.logger import pretty_print\n\nconfig = ppo.DEFAULT_CONFIG.copy()\nconfig[\"num_gpus\"] = 0\nconfig[\"num_workers\"] = 5\nconfig[\"rollout_fragment_length\"] = 100\nconfig[\"train_batch_size\"] = 500\n#config[\"framework\"] = \"torch\"\nconfig[\"env_config\"] = env_config\nconfig[\"log_level\"] = \"DEBUG\"\nconfig[\"env\"] = TradingEnv\n\nmodel_config = catalog.MODEL_DEFAULTS.copy()\nmodel_config[\"use_lstm\"] = True\nmodel_config[\"max_seq_len\"] = 100\n\n#trainer = ppo.PPOTrainer(config=config, env=TradingEnv)\ntune.run(ppo.PPOTrainer, stop={\"training_iteration\": 100}, config=config, local_dir='ray_results')\n\n\"\"\"\n# Can optionally call trainer.restore(path) to load a checkpoint.\n\nfor i in range(1000):\n # Perform one iteration of training the policy with PPO\n result = trainer.train()\n print(pretty_print(result))\n \n checkpoint = trainer.save()\n print(\"checkpoint saved at\", checkpoint)\"\"\"", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e59c808e4d79e7300ceb772149890131c1f698
471,160
ipynb
Jupyter Notebook
GFL Environmental Text Analysis.ipynb
SayantiDutta2000/Financial-Analysis
70b22c0f66a7887cffc050005af5a34016bd156c
[ "MIT" ]
4
2020-11-24T11:49:06.000Z
2021-05-27T04:16:17.000Z
GFL Environmental Text Analysis.ipynb
SayantiDutta2000/Financial-Analysis
70b22c0f66a7887cffc050005af5a34016bd156c
[ "MIT" ]
1
2020-08-01T04:57:51.000Z
2020-08-01T04:58:03.000Z
GFL Environmental Text Analysis.ipynb
SayantiDutta2000/Financial-Analysis
70b22c0f66a7887cffc050005af5a34016bd156c
[ "MIT" ]
1
2020-07-21T17:21:11.000Z
2020-07-21T17:21:11.000Z
746.687797
217,200
0.951711
[ [ [ "# Web Scraping", "_____no_output_____" ] ], [ [ "#Importing the essential libraries\n#Beautiful Soup is a Python library for pulling data out of HTML and XML files\n#The Natural Language Toolkit\n\nimport requests\nimport nltk\nnltk.download('wordnet')\nfrom nltk.stem import WordNetLemmatizer\nfrom nltk.sentiment.vader import SentimentIntensityAnalyzer \nfrom bs4 import BeautifulSoup\nimport numpy as np \nimport pandas as pd \nimport seaborn as sns\nimport matplotlib.pyplot as plt\n%matplotlib inline\nimport random\nfrom wordcloud import WordCloud\nfrom html.parser import HTMLParser\n\nimport bs4 as bs\nimport urllib.request\nimport re\nimport string", "[nltk_data] Downloading package wordnet to C:\\Users\\Sayanti\n[nltk_data] Dutta\\AppData\\Roaming\\nltk_data...\n[nltk_data] Package wordnet is already up-to-date!\n" ], [ "#we are using request package to make a GET request for the website, which means we're getting data from it.\nr=requests.get('http://gflenv.com/about-us/')", "_____no_output_____" ], [ "#Setting the correct text encoding of the HTML page\nr.encoding = 'utf-8'", "_____no_output_____" ], [ "#Extracting the HTML from the request object\nhtml = r.text", "_____no_output_____" ], [ "# Printing the first 500 characters in html\nprint(html[:500])", "<!DOCTYPE html>\n<html lang=\"en-US\" prefix=\"og: http://ogp.me/ns#\" class=\"no-js\">\n<head>\n\t\n<!-- Google Tag Manager -->\n<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','GTM-5C34RXR');</script>\n<!-- End Google Tag Man\n" ], [ "# Creating a BeautifulSoup object from the HTML\nsoup = BeautifulSoup(html)", "_____no_output_____" ], [ "# Getting the text out of the soup\ntext = soup.get_text()", "_____no_output_____" ], [ "#total length\nlen(text)", "_____no_output_____" ], [ "text=text[5000:10000]", "_____no_output_____" ], [ "text_nopunct=''\n\ntext_nopunct= \"\".join([char for char in text if char not in string.punctuation])", "_____no_output_____" ], [ "len(text_nopunct)", "_____no_output_____" ], [ "text_nopunct[2375:3980]", "_____no_output_____" ], [ "text_nopunct=text_nopunct.strip('\\n')\ntext_nopunct=text_nopunct.strip('\\n\\n')\ntext_nopunct=text_nopunct.strip('\\n\\n\\n')", "_____no_output_____" ], [ "text_nopunct[2375:3980]", "_____no_output_____" ], [ "#Creating the tokenizer\ntokenizer = nltk.tokenize.RegexpTokenizer('\\w+')", "_____no_output_____" ], [ "#Tokenizing the text\ntokens = tokenizer.tokenize(text_nopunct)", "_____no_output_____" ], [ "len(tokens)", "_____no_output_____" ], [ "print(tokens[242:262])", "['GFL', 'Environmental', 'Inc', 'is', 'a', 'leading', 'North', 'American', 'provider', 'of', 'diversified', 'environmental', 'solutions', 'Recognized', 'by', 'our', 'signature', 'fleet', 'of', 'wellmaintained']\n" ], [ "#now we shall make everything lowercase for uniformity\n#to hold the new lower case words\n\nwords = []\n\n# Looping through the tokens and make them lower case\nfor word in tokens:\n words.append(word.lower())", "_____no_output_____" ], [ "print(words[242:304])", "['gfl', 'environmental', 'inc', 'is', 'a', 'leading', 'north', 'american', 'provider', 'of', 'diversified', 'environmental', 'solutions', 'recognized', 'by', 'our', 'signature', 'fleet', 'of', 'wellmaintained', 'bright', 'green', 'trucks', 'we', 'offer', 'a', 'robust', 'consolidated', 'and', 'sophisticated', 'approach', 'to', 'meeting', 'our', 'customers', 'environmental', 'service', 'requirements', 'gfl', 'is', 'the', 'only', 'major', 'diversified', 'environmental', 'services', 'company', 'in', 'north', 'america', 'offering', 'services', 'in', 'solid', 'waste', 'management', 'liquid', 'waste', 'management', 'and', 'infrastructure', 'development']\n" ], [ "#Stop words are generally the most common words in a language.\n#English stop words from nltk.\n\nstopwords = nltk.corpus.stopwords.words('english')", "_____no_output_____" ], [ "words_new = []\n\n#Now we need to remove the stop words from the words variable\n#Appending to words_new all words that are in words but not in sw\n\nfor word in words:\n if word not in stopwords:\n words_new.append(word)", "_____no_output_____" ], [ "len(words_new)", "_____no_output_____" ] ], [ [ "# Lemmatization\nLemmatization is the algorithmic process of finding the lemma of a word depending on their meaning. Lemmatization usually refers to the morphological analysis of words, which aims to remove inflectional endings.", "_____no_output_____" ] ], [ [ "from nltk.stem import WordNetLemmatizer \nwn = WordNetLemmatizer()", "_____no_output_____" ], [ "lem_words=[]\n\nfor word in words_new:\n word=wn.lemmatize(word)\n lem_words.append(word)", "_____no_output_____" ], [ "len(lem_words)", "_____no_output_____" ], [ "same=0\ndiff=0\n\nfor i in range(0,416):\n if(lem_words[i]==words_new[i]):\n same=same+1\n elif(lem_words[i]!=words_new[i]):\n diff=diff+1", "_____no_output_____" ], [ "print('Number of words Lemmatized=', diff)\nprint('Number of words not Lemmatized=', same)", "Number of words Lemmatized= 54\nNumber of words not Lemmatized= 362\n" ], [ "#The frequency distribution of the words\nfreq_dist = nltk.FreqDist(lem_words)", "_____no_output_____" ], [ "#Frequency Distribution Plot\nplt.subplots(figsize=(20,12))\nfreq_dist.plot(30)", "_____no_output_____" ], [ "#converting into string\nres=' '.join([i for i in lem_words if not i.isdigit()])", "_____no_output_____" ], [ "plt.subplots(figsize=(16,10))\nwordcloud = WordCloud(\n background_color='black',\n max_words=100,\n width=1400,\n height=1200\n ).generate(res)\n\n\nplt.imshow(wordcloud)\nplt.title('GFL Environmental (100 words)')\nplt.axis('off')\nplt.show()", "_____no_output_____" ], [ "plt.subplots(figsize=(16,10))\nwordcloud = WordCloud(\n background_color='black',\n max_words=200,\n width=1400,\n height=1200\n ).generate(res)\n\n\nplt.imshow(wordcloud)\nplt.title('GFL Environmental (200 words)')\nplt.axis('off')\nplt.show()", "_____no_output_____" ] ], [ [ "# Inferences from Word Cloud\nWords finding large sizes are- GFL,Environmental,service,waste which is kind of obvious as that is the company offers services in solid waste management, liquid waste management and infrastructure development.\n\nThey offer a robust, consolidated and sophisticated approach to meeting our customers’ environmental service requirements.\n\nAll the words in the Word Cloud are such which have high mentions in the article.\n\nThese are the key areas in which the company focuses.", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ] ]
e7e5b1e7bdb46003869b1934d0cf77986a0c009e
5,985
ipynb
Jupyter Notebook
1.data preprocessing/.ipynb_checkpoints/alfabattle_1_parq3-checkpoint.ipynb
Aindstorm/alfabattle2_1stproblem
708d7aea663a421c31df6283ccf76ffa63ed1d32
[ "MIT" ]
32
2021-01-20T11:11:12.000Z
2021-04-20T06:47:31.000Z
1.data preprocessing/.ipynb_checkpoints/alfabattle_1_parq3-checkpoint.ipynb
Aindstorm/alfabattle2_1stproblem
708d7aea663a421c31df6283ccf76ffa63ed1d32
[ "MIT" ]
null
null
null
1.data preprocessing/.ipynb_checkpoints/alfabattle_1_parq3-checkpoint.ipynb
Aindstorm/alfabattle2_1stproblem
708d7aea663a421c31df6283ccf76ffa63ed1d32
[ "MIT" ]
4
2021-01-20T15:55:02.000Z
2021-03-19T17:10:35.000Z
27.580645
177
0.561404
[ [ [ "Все тоже самое, что и в alfabattle_1_parq2, только вместо event_name идет event_category", "_____no_output_____" ] ], [ [ "import numpy as np\nimport pandas as pd\nimport gc\nimport os\nimport re", "_____no_output_____" ], [ "df = pd.read_csv(\"../input/alfabattle1/alfabattle2_abattle_train_target.csv\")", "_____no_output_____" ], [ "parq0 = pd.read_parquet('../your_parqet0.parquet')\nparq0['timestamp'] = pd.to_datetime(parq0['timestamp'])\nparq0 = parq0.sort_values(by=['client', 'timestamp'])\nparq0 = parq0.merge(df[['session_id', 'client_pin', 'multi_class_target']], left_on=['client', 'session_id'], right_on=['client_pin', 'session_id'], how='left')\nparq0.drop(['client_pin'], axis=1, inplace=True)", "_____no_output_____" ], [ "parq0['session_id'].loc[parq0['multi_class_target'].isna()] = np.nan", "/opt/conda/lib/python3.7/site-packages/pandas/core/indexing.py:670: SettingWithCopyWarning: \nA value is trying to be set on a copy of a slice from a DataFrame\n\nSee the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n iloc._setitem_with_indexer(indexer, value)\n" ], [ "parq0['session_id'] = parq0.groupby('client')['session_id'].ffill()", "_____no_output_____" ], [ "parq0['multi_class_target'] = parq0.groupby('client')['multi_class_target'].ffill()", "_____no_output_____" ], [ "parq0['session_id'].dropna(inplace=True)", "_____no_output_____" ], [ "top_event = parq0['event_category'].value_counts(normalize=True)[:60].index", "_____no_output_____" ], [ "concat_list = []\nfor i in range(10):\n print(i)\n parq0 = pd.read_parquet(f'../your_parqet{i}.parquet')\n parq0['timestamp'] = pd.to_datetime(parq0['timestamp'])\n parq0 = parq0.sort_values(by=['client', 'timestamp'])\n parq0 = parq0.merge(df[['session_id', 'client_pin', 'multi_class_target']], left_on=['client', 'session_id'], right_on=['client_pin', 'session_id'], how='left')\n parq0.drop(['client_pin'], axis=1, inplace=True)\n parq0['session_id'].loc[parq0['multi_class_target'].isna()] = np.nan\n parq0['session_id'] = parq0.groupby('client')['session_id'].ffill()\n parq0['multi_class_target'] = parq0.groupby('client')['multi_class_target'].ffill()\n parq0['session_id'].dropna(inplace=True)\n parq0.drop(['device_is_webview', 'page_urlhost', 'page_urlpath_full', 'net_connection_type', 'net_connection_tech', 'application_id'], axis=1, inplace=True)\n for event in top_event:\n parq0[event] = (parq0['event_category'] == event).astype('int16')\n parq0.drop(['timestamp', 'event_type', 'event_category', 'event_name', 'event_label', 'device_screen_name', 'timezone', 'multi_class_target'], axis=1, inplace=True)\n \n df_group = parq0.rename({'client':'client_pin'}, axis=1).groupby(['client_pin', 'session_id']).sum()\n \n concat_list.append(df_group)\n del df_group\n del parq0\n gc.collect()", "0\n" ], [ "df_con = pd.concat(concat_list)", "_____no_output_____" ], [ "df = df.merge(df_con, how='left', on=['client_pin', 'session_id'])", "_____no_output_____" ], [ "df.to_csv('alfa1_train_expend4.csv', index=False)", "_____no_output_____" ] ] ]
[ "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e5b456a7fd7fdb43ea53c276b7680666869d65
99,264
ipynb
Jupyter Notebook
labs/day03_LinearRegression_ExactFormulasForModelTraining.ipynb
ypark12/comp135-20f-assignments
653ac71d59230563ec60276678569b313e744d1e
[ "MIT" ]
5
2020-09-09T21:44:55.000Z
2021-03-06T11:42:58.000Z
labs/day03_LinearRegression_ExactFormulasForModelTraining.ipynb
ypark12/comp135-20f-assignments
653ac71d59230563ec60276678569b313e744d1e
[ "MIT" ]
null
null
null
labs/day03_LinearRegression_ExactFormulasForModelTraining.ipynb
ypark12/comp135-20f-assignments
653ac71d59230563ec60276678569b313e744d1e
[ "MIT" ]
39
2020-09-11T19:16:29.000Z
2022-01-07T19:43:57.000Z
60.489945
23,788
0.78809
[ [ [ "# COMP 135 day03: Training Linear Regression Models via Analytical Formulas", "_____no_output_____" ], [ "# Objectives\n\n* Learn how to apply the standard \"least squares\" formulas for 'training' linear regression in 1 dimension\n* Learn how to apply the standard \"least squares\" formulas for 'training' linear regression in many dimensions (with matrix math)\n* Learn how these formulas minimize *mean squared error*, but maybe not other error metrics", "_____no_output_____" ], [ "\n# Outline\n\n* [Part 1: Simplest Linear Regression](#part1) with 1-dim features, estimate slope only\n* * Exercise 1a: When does the formula fail?\n* * Exercise 1b: Can you show graphically the formula minimizes mean squared error?\n* * Exercise 1c: What would be optimal weight to minimize mean absolute error?\n* [Part 2: Simple Linear Regression](#part2) with 1-dim features, slope and intercept\n* [Part 3: General case of linear regression with F features](#part3)\n* [Part 4: What is a matrix inverse?](#part4)\n* [Part 5: When can we trust numerical computation of the inverse?](#part5)\n* [Part 6: General case of linear regression with F features, using numerically stable formulas](#part6)\n\n", "_____no_output_____" ], [ "# Takeaways\n\n* Exact formulas exist for estimating the weight coefficients $w$ and bias/intercept $b$ for linear regression\n* * When $F=1$, just involves ratios of inner products\n* * When $F>1$, requires matrix multiplication and other operations, solving a linear system with $F+1$ unknowns ($F$ weights and 1 bias)\n* Prefer `np.linalg.solve` over `np.linalg.inv`.\n* * Numerical methods for computing inverses (like `np.linalg.inv`) are unreliable if the matrix $A$ is almost singular.\n* Linear algebra is a very important field of mathematics for understanding when a solution to a linear system of equations exists\n* These formulas minimize *mean squared error*, but likely may not minimize other error metrics\n* * Many ML methods are motivated by what is *mathematically convenient*.\n* * In practice, you should *definitely* consider if another objective is better for your regression task\n* * * Absolute error?", "_____no_output_____" ], [ "# Import libraries", "_____no_output_____" ] ], [ [ "import numpy as np\nimport pandas as pd", "_____no_output_____" ], [ "import sklearn", "_____no_output_____" ], [ "# import plotting libraries\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n%matplotlib inline\nplt.style.use('seaborn') # pretty matplotlib plots\n\nimport seaborn as sns\nsns.set('notebook', style='whitegrid', font_scale=1.25)", "_____no_output_____" ], [ "true_slope = 2.345\n\nN = 7\nx_N = np.linspace(-1, 1, N);\ny_N = true_slope * x_N\n\nprng = np.random.RandomState(33)\nynoise_N = y_N + 0.7 * prng.randn(N)", "_____no_output_____" ], [ "plt.plot(x_N, y_N, 'bs-', label='y')\nplt.plot(x_N, ynoise_N, 'rs-', label='y + noise');\nplt.legend(loc='lower right');", "_____no_output_____" ] ], [ [ "<a id=\"part1\"></a>", "_____no_output_____" ], [ "# Part 1: Simplest Linear Regression with 1-dim features and only slope\n\nEstimate slope only. We assume the bias/intercept is fixed to zero.", "_____no_output_____" ], [ "### Exact formula to estimate \"least squares\" solution w in 1D:\n\n$$\nw^* = \\frac{\\sum_n x_n y_n}{\\sum_n x_n^2} = \\frac{ \\mathbf{x}^T \\mathbf{y} }{ \\mathbf{x}^T \\mathbf{x} }\n$$", "_____no_output_____" ], [ "### Estimate w using the 'true', noise-free y value", "_____no_output_____" ] ], [ [ "w_est = np.inner(x_N, y_N) / np.inner(x_N, x_N)\nprint(w_est)", "2.3449999999999998\n" ] ], [ [ "### Estimate w using the noisy y values", "_____no_output_____" ] ], [ [ "w_est = np.inner(x_N, ynoise_N) / np.inner(x_N, x_N)\nprint(w_est)", "2.7606807490017067\n" ] ], [ [ "# Exercise 1a: What if all examples had $x_n = 0$?\n\nWhat would happen? What does the algebra of the formula suggest?", "_____no_output_____" ], [ "# Exercise 1b: Can you show graphically that this minimizes *mean squared error*?", "_____no_output_____" ] ], [ [ "def predict_1d(x_N, w):\n # TODO fix me\n return 0.0", "_____no_output_____" ], [ "def calc_mean_squared_error(yhat_N, y_N):\n # TODO fix me\n return 0.0", "_____no_output_____" ], [ "G = 30\nw_candidates_G = np.linspace(-3, 6, G)\nerror_G = np.zeros(G)\nfor gg, w in enumerate(w_candidates_G):\n yhat_N = predict_1d(x_N, w)\n error_G[gg] = calc_mean_squared_error(yhat_N, ynoise_N)\nplt.plot(w_candidates_G, error_G, 'r.-', label='objective function');\nplt.plot(w_est * np.ones(2), np.asarray([0, 1]), 'b:', label='optimal weight value');\nplt.xlabel('w');\nplt.ylabel('mean squared error');\nplt.legend()", "_____no_output_____" ] ], [ [ "# Exercise 1c: What about *mean absolute error*?\n\nDoes the least-squares estimate of $w$ minimize mean absolute error for this example?", "_____no_output_____" ] ], [ [ "def calc_mean_abs_error(yhat_N, y_N):\n # TODO fixme\n return 0.0\n ", "_____no_output_____" ], [ "G = 100\nw_candidates_G = np.linspace(1, 4, G)\nerror_G = np.zeros(G)\nfor gg, w in enumerate(w_candidates_G):\n yhat_N = predict_1d(x_N, w)\n error_G[gg] = calc_mean_abs_error(yhat_N, ynoise_N)\nplt.plot(w_candidates_G, error_G, 'r.-', label='objective function');\nplt.plot(w_est * np.ones(2), np.asarray([0, 1]), 'b:', label='optimal weight value');\n\nplt.xlabel('w');\nplt.ylabel('mean absolute error');", "_____no_output_____" ] ], [ [ "<a id=\"part2\"></a>", "_____no_output_____" ], [ "# Part 2: Simpler Linear Regression with slope and bias\n\nGoal: estimate slope $w$ and bias $b$", "_____no_output_____" ], [ "Then the best estimates of the slope and intercept are given by:\n\n$$\nw^* = \\frac{ \\sum_{n=1}^N (x_n - \\bar{x}) (y_n - \\bar{y}) }{\\sum_{n=1}^N (x_n - \\bar{x})^2 }\n$$\n\nand\n\n$$\nb^* = \\bar{y} - w^* \\bar{x}\n$$\n", "_____no_output_____" ], [ "### Using the 'true', noise-free y value\n\nSanity check : we should recover the true-slope, with zero intercept", "_____no_output_____" ] ], [ [ "xbar = np.mean(x_N)\nybar = np.mean(y_N)\nw_est = np.inner(x_N - xbar, y_N - ybar) / np.inner(x_N - xbar, x_N - xbar)\nprint(w_est)\n\nb_est = ybar - w_est * xbar\nprint(b_est)", "2.3449999999999998\n-1.7938032012157886e-16\n" ] ], [ [ "### Using the noisy y value", "_____no_output_____" ] ], [ [ "xbar = np.mean(x_N)\nybar = np.mean(ynoise_N)\n\nw_est = np.inner(x_N - xbar, ynoise_N - ybar) / np.inner(x_N - xbar, x_N - xbar)\nb_est = ybar - w_est * xbar\n\nprint(\"Estimated slope: \" + str(w_est))\nprint(\"Estimated bias: \" + str(b_est))", "Estimated slope: 2.7606807490017067\nEstimated bias: -0.4138756764186623\n" ] ], [ [ "<a id=\"part3\"></a>", "_____no_output_____" ], [ "# Part 3: General case of Linear Regression\n\nGoal:\n* estimate the vector $w \\in \\mathbb{R}^F$ of weight coefficients\n* estimate the bias scalar $b$ (aka intercept)", "_____no_output_____" ], [ "Given a dataset of $N$ examples and $F$ feature dimensions, where\n\n* $\\tilde{\\mathbf{X}}$ is an $N \\times F +1$ matrix of feature vectors, where we'll assume the last column is all ones\n* $\\mathbf{y}$ is an $N \\times 1$ column vector of outputs\n\nRemember that the formula is:\n \n$$\n\\theta^* = (\\tilde{\\mathbf{X}}^T \\tilde{\\mathbf{X}} )^{-1} \\tilde{\\mathbf{X}}^T \\mathbf{y}\n\\\\\n~\\\\\nw^* = [\\theta^*_1 ~ \\theta^*_2 \\ldots \\theta^*_F ]^T\n\\\\\n~\\\\\nb^* = \\theta^*_{F+1}\n$$\n\nWe need to compute a *matrix inverse* to do this.\n\nLet's try this out. Step by step.\n\nFirst, print out the $\\tilde{X}$ array", "_____no_output_____" ] ], [ [ "x_N1 = x_N[:,np.newaxis]", "_____no_output_____" ], [ "xtilde_N2 = np.hstack([x_N1, np.ones((x_N.size, 1))])\nprint(xtilde_N2)", "[[-1. 1. ]\n [-0.66666667 1. ]\n [-0.33333333 1. ]\n [ 0. 1. ]\n [ 0.33333333 1. ]\n [ 0.66666667 1. ]\n [ 1. 1. ]]\n" ] ], [ [ "Next, print out the $y$ array", "_____no_output_____" ] ], [ [ "print(ynoise_N)", "[-2.56819745 -2.68541972 -1.85631918 -0.39928063 0.62995686 1.74174534\n 2.24038504]\n" ] ], [ [ "Next, lets compute the matrix product $\\tilde{X}^T \\tilde{X}$, which is a $2 \\times 2$ matrix", "_____no_output_____" ] ], [ [ "xTx_22 = np.dot(xtilde_N2.T, xtilde_N2)\nprint(xTx_22)", "[[ 3.11111111e+00 -2.22044605e-16]\n [-2.22044605e-16 7.00000000e+00]]\n" ] ], [ [ "Next, lets compute the INVERSE of $\\tilde{X}^T \\tilde{X}$, which is again a $2 \\times 2$ matrix", "_____no_output_____" ] ], [ [ "inv_xTx_22 = np.linalg.inv(xTx_22) # compute the inverse!\nprint(inv_xTx_22)", "[[3.21428571e-01 1.01959257e-17]\n [1.01959257e-17 1.42857143e-01]]\n" ] ], [ [ "Next, let's compute the optimal $\\theta$ vector according to our formula above", "_____no_output_____" ] ], [ [ "theta_G = np.dot(inv_xTx_22, np.dot(xtilde_N2.T, ynoise_N[:,np.newaxis])) # compute theta vector\nprint(theta_G)", "[[ 2.76068075]\n [-0.41387568]]\n" ], [ "print(\"Estimated slope: \" + str(theta_G[0]))\nprint(\"Estimated bias: \" + str(theta_G[1]))", "Estimated slope: [2.76068075]\nEstimated bias: [-0.41387568]\n" ] ], [ [ "We should get the SAME results as in our simpler LR case in Part 2. \n\nSo this formula for the general case looks super easy, right?", "_____no_output_____" ], [ "Not so fast...\n\nLet's take a minute and review just what the heck an *inverse* is, before we just blindly implement this formula...", "_____no_output_____" ], [ "<a id=\"part4\"></a>", "_____no_output_____" ], [ "# Part 4: Linear Algebra Review: What is the inverse of a matrix?", "_____no_output_____" ], [ "Let $A$ be a square matrix with shape $(D, D)$.\n\nWe say that matrix $A^{-1}$ is the *inverse* of $A$ if the product of $A$ and $A^{-1}$ yields the $D \\times D$ *identity* matrix:\n\n$$\nA A^{-1} = I\n$$\n\nIf $A^{-1}$ exists, it will also be a $D\\times D $ square matrix.\n\nIn Python, we can compute the inverse of a matrix using `np.linalg.inv`", "_____no_output_____" ] ], [ [ "# Define a square matrix with shape(3,3)\nA = np.diag(np.asarray([1., -2., 3.]))\nprint(A)", "[[ 1. 0. 0.]\n [ 0. -2. 0.]\n [ 0. 0. 3.]]\n" ], [ "# Compute its inverse\ninvA = np.linalg.inv(A)\nprint(invA)", "[[ 1. 0. 0. ]\n [-0. -0.5 -0. ]\n [ 0. 0. 0.33333333]]\n" ], [ "np.dot(A, invA) # should equal identity", "_____no_output_____" ] ], [ [ "Remember, in 1 dimensions, the inverse of $a$ is just $1/a$, since $a \\cdot \\frac{1}{a} = 1.0$", "_____no_output_____" ] ], [ [ "A = np.asarray([[2]])\nprint(A)", "[[2]]\n" ], [ "invA = np.linalg.inv(A)\nprint(invA)", "[[0.5]]\n" ] ], [ [ "## Does the inverse always exist?\n\nNo! Remember:\n\n* Even when $D=1$, if $A=0$, then the inverse does not exist ($\\frac{1}{A}$ is undefined)\n* When $D \\geq 2$, there are *infinitely many* square matrices $A$ that do not have an inverse\n\n", "_____no_output_____" ] ], [ [ "# Example 1:\nA = np.asarray([[0, 0], [0, 1.337]])\nprint(A)\ntry:\n np.linalg.inv(A)\nexcept Exception as e:\n print(str(type(e)) + \": \" + str(e))", "[[0. 0. ]\n [0. 1.337]]\n<class 'numpy.linalg.LinAlgError'>: Singular matrix\n" ], [ "# Example 2:\nA = np.asarray([[3.4, 3.4], [3.4, 3.4]])\nprint(A)\ntry:\n np.linalg.inv(A)\nexcept Exception as e:\n print(str(type(e)) + \": \" + str(e))", "[[3.4 3.4]\n [3.4 3.4]]\n<class 'numpy.linalg.LinAlgError'>: Singular matrix\n" ], [ "# Example 3:\nA = np.asarray([[-1.2, 4.7], [-2.4, 9.4]])\nprint(A)\ntry:\n np.linalg.inv(A)\nexcept Exception as e:\n print(str(type(e)) + \": \" + str(e))", "[[-1.2 4.7]\n [-2.4 9.4]]\n<class 'numpy.linalg.LinAlgError'>: Singular matrix\n" ] ], [ [ "What do these examples have in common???\n\nThe columns of $A$ are not linearly independent!\n\nIn other words, $A$ is not invertible whenever we can exactly construct one column of $A$ by a linear combination of other columns\n\n$$\nA_{:,D} = c_1 A_{:,1} + c_2 A_{:,2} + \\ldots c_{D-1} A_{:,D-1}\n$$\n\nwhere $c_1$, $c_2$, $\\ldots c_{D-1}$ are scalar weights.", "_____no_output_____" ] ], [ [ "# Look, here's the first column:\nA[:, 0]", "_____no_output_____" ], [ "# And here's it being perfectly reconstructed by a scalar times the second column\nA[:, 1] * -1.2/4.7", "_____no_output_____" ], [ "# Example 3:\nA = np.asarray([[1.0, 2.0, -3.0], [2, 4, -6.0], [1.0, 1.0, 1.0]])\nprint(A)\ntry:\n np.linalg.inv(A)\nexcept Exception as e:\n print(str(type(e)) + \": \" + str(e))", "[[ 1. 2. -3.]\n [ 2. 4. -6.]\n [ 1. 1. 1.]]\n<class 'numpy.linalg.LinAlgError'>: Singular matrix\n" ] ], [ [ "### Important result from linear algebra: Invertible Matrix Theorem\n\n\nGiven a specific matrix $A$, the following statements are either *all* true or *all* false:\n\n* $A$ has an inverse (e.g. a matrix $A^{-1}$ exists s.t. $A A^{-1} = I$)\n* All $D$ columns of $A$ are linearly independent\n* The columns of $A$ span the space $\\mathbb{R}^D$\n* $A$ has a non-zero determinant\n\nFor more implications, see the *Invertible Matrix Theorem*:\n\n<https://en.wikipedia.org/wiki/Invertible_matrix#Properties>", "_____no_output_____" ], [ "<a id=\"part5\"></a>", "_____no_output_____" ], [ "# Part 5: Is the numerical inverse reliable?\n\nCan we always trust the results of `np.linalg.inv`?\n\nNot really. Taking inverses is very tricky if the input matrix is not *very* well conditioned.", "_____no_output_____" ], [ "### A \"good\" example, where inverse works", "_____no_output_____" ] ], [ [ "# 3 indep rows of size 3.\nx_NF = np.random.randn(3, 3)\nxTx_FF = np.dot(x_NF.T, x_NF)", "_____no_output_____" ], [ "np.linalg.inv(np.dot(x_NF.T, x_NF))", "_____no_output_____" ], [ "# First, verify the `inv` function computes *something* of the right shape\n\ninv_xTx_FF = np.linalg.inv(xTx_FF)\nprint(inv_xTx_FF)", "[[ 5.43270945 12.90282235 -3.07602264]\n [12.90282235 32.54599487 -8.12515637]\n [-3.07602264 -8.12515637 2.41904465]]\n" ], [ "# Next, verify the `inv` function result is ACTUALLY the inverse\n\nans_FF = np.dot(xTx_FF, inv_xTx_FF)\n\nprint(ans_FF)\nprint(\"\\nis this close enough to identity matrix? \" + str(\n np.allclose(ans_FF, np.eye(3))))", "[[ 1.00000000e+00 -4.33114505e-16 3.73409184e-16]\n [ 3.94146478e-16 1.00000000e+00 -4.54028728e-16]\n [ 1.59364741e-16 8.07877021e-16 1.00000000e+00]]\n\nis this close enough to identity matrix? True\n" ] ], [ [ "### A *bad* example, where `np.linalg.inv` may be unreliable", "_____no_output_____" ] ], [ [ "# Only 2 indep rows of size 3. should NOT be invertible \n# verify: determinant is close to zero \nx_NF = np.random.randn(2, 3) \nxTx_FF = np.dot(x_NF.T, x_NF)", "_____no_output_____" ], [ "xTx_FF", "_____no_output_____" ], [ "# First, verify the `inv` function computes *something* of the right shape\n\ninv_xTx_FF = np.linalg.inv(xTx_FF)\nprint(inv_xTx_FF)", "[[5.11537121e+15 4.40955766e+15 8.69419178e+15]\n [4.40955766e+15 3.80113152e+15 7.49457632e+15]\n [8.69419178e+15 7.49457632e+15 1.47768300e+16]]\n" ], [ "# Next, verify the `inv` function result is ACTUALLY the inverse\n\nans_FF = np.dot(xTx_FF, inv_xTx_FF)\n\nprint(ans_FF)\nprint(\"\\nis this close enough to identity matrix? \" + str(\n np.allclose(ans_FF, np.eye(3))))", "[[ 1.4520932 0.49807897 -0.24114104]\n [-0.20159063 -0.27703514 -1.15131685]\n [-1.53776313 -0.71804165 -0.59193815]]\n\nis this close enough to identity matrix? False\n" ] ], [ [ "### What just happened?\n\nWe just asked for an inverse.\n\nNumPy gave us a result that WAS NOT AN INVERSE, but we received NO WARNINGS OR ERRORS!\n\nSo what should we do? Avoid naively calling `np.linalg.inv` and trusting the result. \n\nA better thing to do is use `np.linalg.solve`, as this will be more *stable* (trustworthy).\n\n<https://numpy.org/doc/stable/reference/generated/numpy.linalg.solve.html>", "_____no_output_____" ], [ "What `np.linalg.solve(A, b)` does is that it uses DIFFERENT algorithm to directly return an answer to the question\n\nWhat vector $\\theta$ would be a valid solution to the equation\n\n$$\nA \\theta = b\n$$\n\nfor some matrix $A$ and vector $b$\n\nSo for our case, we are requesting a solution (a specific vector $\\theta$) to the equation\n\n$$\n\\tilde{X}^T \\tilde{X} \\theta = \\tilde{X}^T y\n$$", "_____no_output_____" ], [ "<a id=\"part6\"></a>", "_____no_output_____" ], [ "# Part 6: Returning to general case linear regression\n\nConstruct a simple case with $N=2$ examples and $F=2$ features.\n\nFor general linear regression, this is an UNDER-determined system (we have 3 unknowns, but only 2 examples).\n\n", "_____no_output_____" ] ], [ [ "true_w_F1 = np.asarray([1.0, 1.0])[:,np.newaxis]\ntrue_b = np.asarray([0.0])", "_____no_output_____" ], [ "x_NF = np.asarray([[1.0, 2.0], [1.0, 1.0]]) + np.random.randn(2,2) * 0.001\nprint(x_NF)", "[[1.00145395 1.99803269]\n [1.00010652 0.99984927]]\n" ], [ "y_N1 = np.dot(x_NF, true_w_F1) + true_b\nprint(y_N1)", "[[2.99948664]\n [1.9999558 ]]\n" ] ], [ [ "Punchline: there should be INFINITELY many weights $w$ and bias values $b$ that can reconstruct our $y$ **perfectly**\n\nQuestion: Can various estimation strategies find such weights?", "_____no_output_____" ], [ "### Try out sklearn\n", "_____no_output_____" ] ], [ [ "import sklearn.linear_model", "_____no_output_____" ], [ "lr = sklearn.linear_model.LinearRegression()", "_____no_output_____" ], [ "lr.fit(x_NF, y_N1)", "_____no_output_____" ] ], [ [ "Print the estimated weights $w$ and intercept $b$", "_____no_output_____" ] ], [ [ "print(lr.coef_)\nprint(lr.intercept_)", "[[0.0013517 1.00134805]]\n[0.99740683]\n" ] ], [ [ "Print the predicted values for $y$, alongside the *true* ones", "_____no_output_____" ] ], [ [ "print(\"Results for sklearn\")\nprint(\"Predicted y: \" + str(np.squeeze(lr.predict(x_NF))))\nprint(\"True y: \" + str(np.squeeze(y_N1)))", "Results for sklearn\nPredicted y: [2.99948664 1.9999558 ]\nTrue y: [2.99948664 1.9999558 ]\n" ] ], [ [ "### Prep for our formulas: make the $\\tilde{\\mathbf{X}}$ array\n\nWill have shape $N \\times (F+1)$\n\nLet's define $G = F+1$", "_____no_output_____" ] ], [ [ "xtilde_NG = np.hstack([x_NF, np.ones((2, 1))])\nprint(xtilde_NG)", "[[1.00145395 1.99803269 1. ]\n [1.00010652 0.99984927 1. ]]\n" ], [ "xTx_GG = np.dot(xtilde_NG.T, xtilde_NG)", "_____no_output_____" ] ], [ [ "### Try out using our least-squares formula, as implemented with `np.linalg.inv`", "_____no_output_____" ] ], [ [ "inv_xTx_GG = np.linalg.inv(xTx_GG)\ntheta_G1 = np.dot(inv_xTx_GG, np.dot(xtilde_NG.T, y_N1))", "_____no_output_____" ] ], [ [ "Best estimate of the weights and bias (after \"unpacking\" the vector $\\theta$):", "_____no_output_____" ] ], [ [ "w_F = theta_G1[:-1, 0]\nb = theta_G1[-1]\nprint(w_F)\nprint(b)", "[0. 1.]\n[0.]\n" ], [ "yhat_N1 = np.dot(xtilde_NG, theta_G1)", "_____no_output_____" ], [ "print(\"Results for using naive np.linalg.inv\")\nprint(\"Predicted y: \" + str(yhat_N1[:,0]))\nprint(\"True y: \" + str(y_N1[:,0]))", "Results for using naive np.linalg.inv\nPredicted y: [1.99803269 0.99984927]\nTrue y: [2.99948664 1.9999558 ]\n" ] ], [ [ "Expected result: you should see that predictions might be *quite far* from true y values!", "_____no_output_____" ], [ "### Try out using our formulas, as implemented with `np.linalg.solve`\n\nWhat should happen: We can find estimated parameters $w, b$ that perfectly predict the $y$", "_____no_output_____" ] ], [ [ "theta_G1 = np.linalg.solve(xTx_GG, np.dot(xtilde_NG.T, y_N1))", "_____no_output_____" ], [ "w_F = theta_G1[:-1,0]\nb = theta_G1[-1,0]\nprint(w_F)\nprint(b)", "[0.51859823 1.00064983]\n0.48080331139358556\n" ], [ "yhat_N1 = np.dot(xtilde_NG, theta_G1)", "_____no_output_____" ], [ "print(\"Results for using more stable formula implementation with np.linalg.solve\")\nprint(\"Predicted y: \" + str(yhat_N1[:,0]))\nprint(\"True y: \" + str(y_N1[:,0]))", "Results for using more stable formula implementation with np.linalg.solve\nPredicted y: [2.99948664 1.9999558 ]\nTrue y: [2.99948664 1.9999558 ]\n" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code" ] ]
e7e5bbdcebc6cf9803c0c800c7701fbf0ec8a056
219,408
ipynb
Jupyter Notebook
Intro_Debugging.ipynb
doscac/ReducingCode
be8aed0a207813b4a62aca4e629f3ce3c028e383
[ "MIT" ]
null
null
null
Intro_Debugging.ipynb
doscac/ReducingCode
be8aed0a207813b4a62aca4e629f3ce3c028e383
[ "MIT" ]
null
null
null
Intro_Debugging.ipynb
doscac/ReducingCode
be8aed0a207813b4a62aca4e629f3ce3c028e383
[ "MIT" ]
null
null
null
39.271165
672
0.528773
[ [ [ "# Introduction to Debugging\n\nIn this book, we want to explore _debugging_ - the art and science of fixing bugs in computer software. In particular, we want to explore techniques that _automatically_ answer questions like: Where is the bug? When does it occur? And how can we repair it? But before we start automating the debugging process, we first need to understand what this process is.\n\nIn this chapter, we introduce basic concepts of systematic software debugging and the debugging process, and at the same time get acquainted with Python and interactive notebooks.", "_____no_output_____" ] ], [ [ "from bookutils import YouTubeVideo, quiz\nYouTubeVideo(\"bCHRCehDOq0\")", "_____no_output_____" ] ], [ [ "**Prerequisites**\n\n* The book is meant to be a standalone reference; however, a number of _great books on debugging_ are listed at the end,\n* Knowing a bit of _Python_ is helpful for understanding the code examples in the book.", "_____no_output_____" ], [ "## Synopsis\n<!-- Automatically generated. Do not edit. -->\n\nTo [use the code provided in this chapter](Importing.ipynb), write\n\n```python\n>>> from debuggingbook.Intro_Debugging import <identifier>\n```\n\nand then make use of the following features.\n\n\nIn this chapter, we introduce some basics of how failures come to be as well as a general process for debugging.\n\n", "_____no_output_____" ], [ "## A Simple Function\n\n### Your Task: Remove HTML Markup\n\nLet us start with a simple example. You may have heard of how documents on the Web are made out of text and HTML markup. HTML markup consists of _tags_ in angle brackets that surround the text, providing additional information on how the text should be interpreted. For instance, in the HTML text\n\n```html\nThis is <em>emphasized</em>.\n```\n\nthe word \"emphasized\" is enclosed in the HTML tags `<em>` (start) and `</em>` (end), meaning that it should be interpreted (and rendered) in an emphasized way – typically in italics. In your environment, the HTML text gets rendered as\n\n> This is <em>emphasized</em>.\n\nThere's HTML tags for pretty much everything – text markup (<strong>bold</strong> text, <s>strikethrough</s> text), text structure (titles, lists), references (links) to other documents, and many more. These HTML tags shape the Web as we know it.", "_____no_output_____" ], [ "However, within all the HTML markup, it may become difficult to actually access the _text_ that lies within. We'd like to implement a simple function that removes _HTML markup_ and converts it into text. If our input is\n\n```html\nHere's some <strong>strong argument</strong>.\n```\nthe output should be\n\n> Here's some strong argument.", "_____no_output_____" ], [ "Here's a Python function which does exactly this. It takes a (HTML) string and returns the text without markup.", "_____no_output_____" ] ], [ [ "def remove_html_markup(s):\n tag = False\n out = \"\"\n\n for c in s:\n if c == '<': # start of markup\n tag = True\n elif c == '>': # end of markup\n tag = False\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "This function works, but not always. Before we start debugging things, let us first explore its code and how it works.", "_____no_output_____" ], [ "### Understanding Python Programs\n\nIf you're new to Python, you might first have to understand what the above code does. We very much recommend the [Python tutorial](https://docs.python.org/3/tutorial/) to get an idea on how Python works. The most important things for you to understand the above code are these three:\n\n1. Python structures programs through _indentation_, so the function and `for` bodies are defined by being indented;\n2. Python is _dynamically typed_, meaning that the type of variables like `c`, `tag`, or `out` is determined at run-time.\n3. Most of Python's syntactic features are inspired by other common languages, such as control structures (`while`, `if`, `for`), assignments (`=`), or comparisons (`==`, `!=`, `<`).\n\nWith that, you can already understand what the above code does: `remove_html_markup()` takes a (HTML) string `s` and then iterates over the individual characters (`for c in s`). By default, these characters are added to the return string `out`. However, if `remove_html_markup()` finds a `<` character, it sets the `tag` flag, meaning that all further characters are ignored until a `>` character is found.\n\nIn contrast to other languages, Python makes no difference between strings and characters – there's only strings. As in HTML, strings can be enclosed in single quotes (`'a'`) and in double quotes (`\"a\"`). This is useful if you want to specify a string that contains quotes, as in `'She said \"hello\", and then left'` or `\"The first character is a 'c'\"`", "_____no_output_____" ], [ "### Running a Function\n\nTo find out whether `remove_html_markup()` works correctly, we can *test* it with a few values. For the string\n\n```html\nHere's some <strong>strong argument</strong>.\n```\n\nfor instance, it produces the correct value:", "_____no_output_____" ] ], [ [ "remove_html_markup(\"Here's some <strong>strong argument</strong>.\")", "_____no_output_____" ] ], [ [ "### Interacting with Notebooks\n\nIf you are reading this in the interactive notebook, you can try out `remove_html_markup()` with other values as well. Click on the above cells with the invocation of `remove_html_markup()` and change the value – say, to `remove_html_markup(\"<em>foo</em>\")`. Press <kbd>Shift</kbd>+<kbd>Enter</kbd> (or click on the play symbol) to execute it and see the result. If you get an error message, go to the above cell with the definition of `remove_html_markup()` and execute this first. You can also run _all_ cells at once; see the Notebook menu for details. (You can actually also change the text by clicking on it, and corect mistaks such as in this sentence.)", "_____no_output_____" ], [ "Executing a single cell does not execute other cells, so if your cell builds on a definition in another cell that you have not executed yet, you will get an error. You can select `Run all cells above` from the menu to ensure all definitions are set.", "_____no_output_____" ], [ "Also keep in mind that, unless overwritten, all definitions are kept across executions. Occasionally, it thus helps to _restart the kernel_ (i.e. start the Python interpreter from scratch) to get rid of older, superfluous definitions.", "_____no_output_____" ], [ "### Testing a Function", "_____no_output_____" ], [ "Since one can change not only invocations, but also definitions, we want to ensure that our function works properly now and in the future. To this end, we introduce tests through _assertions_ – a statement that fails if the given _check_ is false. The following assertion, for instance, checks that the above call to `remove_html_markup()` returns the correct value:", "_____no_output_____" ] ], [ [ "assert remove_html_markup(\"Here's some <strong>strong argument</strong>.\") == \\\n \"Here's some strong argument.\"", "_____no_output_____" ] ], [ [ "If you change the code of `remove_html_markup()` such that the above assertion fails, you will have introduced a bug.", "_____no_output_____" ], [ "## Oops! A Bug!", "_____no_output_____" ], [ "As nice and simple as `remove_html_markup()` is, it is buggy. Some HTML markup is not properly stripped away. Consider this HTML tag, which would render as an input field in a form:\n\n```html\n<input type=\"text\" value=\"<your name>\">\n```\nIf we feed this string into `remove_html_markup()`, we would expect an empty string as the result. Instead, this is what we get:", "_____no_output_____" ] ], [ [ "remove_html_markup('<input type=\"text\" value=\"<your name>\">')", "_____no_output_____" ] ], [ [ "Every time we encounter a bug, this means that our earlier tests have failed. We thus need to introduce another test that documents not only how the bug came to be, but also the result we actually expected.", "_____no_output_____" ], [ "The assertion we write now fails with an error message. (The `ExpectError` magic ensures we see the error message, but the rest of the notebook is still executed.)", "_____no_output_____" ] ], [ [ "from ExpectError import ExpectError", "_____no_output_____" ], [ "with ExpectError():\n assert remove_html_markup('<input type=\"text\" value=\"<your name>\">') == \"\"", "Traceback (most recent call last):\n File \"<ipython-input-7-c7b482ebf524>\", line 2, in <module>\n assert remove_html_markup('<input type=\"text\" value=\"<your name>\">') == \"\"\nAssertionError (expected)\n" ] ], [ [ "With this, we now have our task: _Fix the failure as above._", "_____no_output_____" ], [ "## Visualizing Code\n\nTo properly understand what is going on here, it helps drawing a diagram on how `remove_html_markup()` works. Technically, `remove_html_markup()` implements a _state machine_ with two states `tag` and `¬ tag`. We change between these states depending on the characters we process. This is visualized in the following diagram:", "_____no_output_____" ] ], [ [ "from graphviz import Digraph, nohtml", "_____no_output_____" ], [ "from IPython.display import display", "_____no_output_____" ], [ "# ignore\nPASS = \"✔\"\nFAIL = \"✘\"\n\nPASS_COLOR = 'darkgreen' # '#006400' # darkgreen\nFAIL_COLOR = 'red4' # '#8B0000' # darkred\n\nSTEP_COLOR = 'peachpuff'\nFONT_NAME = 'Raleway'", "_____no_output_____" ], [ "# ignore\ndef graph(comment=\"default\"):\n return Digraph(name='', comment=comment, graph_attr={'rankdir': 'LR'},\n node_attr={'style': 'filled',\n 'fillcolor': STEP_COLOR,\n 'fontname': FONT_NAME},\n edge_attr={'fontname': FONT_NAME})", "_____no_output_____" ], [ "# ignore\nstate_machine = graph()\nstate_machine.node('Start', )\nstate_machine.edge('Start', '¬ tag')\nstate_machine.edge('¬ tag', '¬ tag', label=\" ¬ '<'\\nadd character\")\nstate_machine.edge('¬ tag', 'tag', label=\"'<'\")\nstate_machine.edge('tag', '¬ tag', label=\"'>'\")\nstate_machine.edge('tag', 'tag', label=\"¬ '>'\")", "_____no_output_____" ], [ "# ignore\ndisplay(state_machine)", "_____no_output_____" ] ], [ [ "You see that we start in the non-tag state (`¬ tag`). Here, for every character that is not `'<'`, we add the character and stay in the same state. When we read a `'<'`, though, we end in the tag state (`tag`) and stay in that state (skipping characters) until we find a closing `'>'` character.", "_____no_output_____" ], [ "## A First Fix\n\nLet us now look at the above state machine, and process through our input:\n\n```html\n<input type=\"text\" value=\"<your name>\">\n```", "_____no_output_____" ], [ "So what you can see is: We are interpreting the `'>'` of `\"<your name>\"` as the closing of the tag. However, this is a quoted string, so the `'>'` should be interpreted as a regular character, not as markup. This is an example of _missing functionality:_ We do not handle quoted characters correctly. We haven't claimed yet to take care of all functionality, so we still need to extend our code.", "_____no_output_____" ], [ "So we extend the whole thing. We set up a special \"quote\" state which processes quoted inputs in tags until the end of the quoted string is reached. This is how the state machine looks like:", "_____no_output_____" ] ], [ [ "# ignore\nstate_machine = graph()\nstate_machine.node('Start')\nstate_machine.edge('Start', '¬ quote\\n¬ tag')\nstate_machine.edge('¬ quote\\n¬ tag', '¬ quote\\n¬ tag',\n label=\"¬ '<'\\nadd character\")\nstate_machine.edge('¬ quote\\n¬ tag', '¬ quote\\ntag', label=\"'<'\")\nstate_machine.edge('¬ quote\\ntag', 'quote\\ntag', label=\"'\\\"'\")\nstate_machine.edge('¬ quote\\ntag', '¬ quote\\ntag', label=\"¬ '\\\"' ∧ ¬ '>'\")\nstate_machine.edge('quote\\ntag', 'quote\\ntag', label=\"¬ '\\\"'\")\nstate_machine.edge('quote\\ntag', '¬ quote\\ntag', label=\"'\\\"'\")\nstate_machine.edge('¬ quote\\ntag', '¬ quote\\n¬ tag', label=\"'>'\")", "_____no_output_____" ], [ "# ignore\ndisplay(state_machine)", "_____no_output_____" ] ], [ [ "This is a bit more complex already. Proceeding from left to right, we first have the state `¬ quote ∧ ¬ tag`, which is our \"standard\" state for text. If we encounter a `'<'`, we again switch to the \"tagged\" state `¬ quote ∧ tag`. In this state, however (and only in this state), if we encounter a quotation mark, we switch to the \"quotation\" state `quote ∧ tag`, in which we remain until we see another quotation mark indicating the end of the string – and then continue in the \"tagged\" state `¬ quote ∧ tag` until we see the end of the string.", "_____no_output_____" ], [ "Things get even more complicated as HTML allows both single and double quotation characters. Here's a revised implementation of `remove_html_markup()` that takes the above states into account:", "_____no_output_____" ] ], [ [ "def remove_html_markup(s):\n tag = False\n quote = False\n out = \"\"\n\n for c in s:\n if c == '<' and not quote:\n tag = True\n elif c == '>' and not quote:\n tag = False\n elif c == '\"' or c == \"'\" and tag:\n quote = not quote\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "Now, our previous input works well:", "_____no_output_____" ] ], [ [ "remove_html_markup('<input type=\"text\" value=\"<your name>\">')", "_____no_output_____" ] ], [ [ "and our earlier tests also pass:", "_____no_output_____" ] ], [ [ "assert remove_html_markup(\"Here's some <strong>strong argument</strong>.\") == \\\n \"Here's some strong argument.\"", "_____no_output_____" ], [ "assert remove_html_markup('<input type=\"text\" value=\"<your name>\">') == \"\"", "_____no_output_____" ] ], [ [ "However, the above code still has a bug. In two of these inputs, HTML markup is still not properly stripped:\n\n```html\n<b>foo</b>\n<b>\"foo\"</b>\n\"<b>foo</b>\"\n<\"b\">foo</\"b\">\n```\n\nCan you guess which ones these are?", "_____no_output_____" ], [ "Again, a simple assertion will reveal the culprits:", "_____no_output_____" ] ], [ [ "with ExpectError():\n assert remove_html_markup('<b>foo</b>') == 'foo'", "_____no_output_____" ], [ "with ExpectError():\n assert remove_html_markup('<b>\"foo\"</b>') == '\"foo\"'", "Traceback (most recent call last):\n File \"<ipython-input-21-ebb80f5cdc78>\", line 2, in <module>\n assert remove_html_markup('<b>\"foo\"</b>') == '\"foo\"'\nAssertionError (expected)\n" ], [ "with ExpectError():\n assert remove_html_markup('\"<b>foo</b>\"') == '\"foo\"'", "Traceback (most recent call last):\n File \"<ipython-input-22-1f9c40f6f95d>\", line 2, in <module>\n assert remove_html_markup('\"<b>foo</b>\"') == '\"foo\"'\nAssertionError (expected)\n" ], [ "with ExpectError():\n assert remove_html_markup('<\"b\">foo</\"b\">') == 'foo'", "_____no_output_____" ] ], [ [ "So, unfortunately, we're not done yet – our function still has errors.", "_____no_output_____" ], [ "## The Devil's Guide to Debugging\n\nLet us now discuss a couple of methods that do _not_ work well for debugging. (These \"devil's suggestions\" are adapted from the 1993 book \"Code Complete\" from Steve McConnell.)", "_____no_output_____" ], [ "### Printf Debugging\n\nWhen I was a student, never got any formal training in debugging, so I had to figure this out for myself. What I learned was how to use _debugging output_; in Python, this would be the `print()` function. For instance, I would go and scatter `print()` calls everywhere:", "_____no_output_____" ] ], [ [ "def remove_html_markup_with_print(s):\n tag = False\n quote = False\n out = \"\"\n\n for c in s:\n print(\"c =\", repr(c), \"tag =\", tag, \"quote =\", quote)\n\n if c == '<' and not quote:\n tag = True\n elif c == '>' and not quote:\n tag = False\n elif c == '\"' or c == \"'\" and tag:\n quote = not quote\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "This way of inspecting executions is commonly called \"Printf debugging\", after the C `printf()` function. Then, running this would allow me to see what's going on in my code:", "_____no_output_____" ] ], [ [ "remove_html_markup_with_print('<b>\"foo\"</b>')", "c = '<' tag = False quote = False\nc = 'b' tag = True quote = False\nc = '>' tag = True quote = False\nc = '\"' tag = False quote = False\nc = 'f' tag = False quote = True\nc = 'o' tag = False quote = True\nc = 'o' tag = False quote = True\nc = '\"' tag = False quote = True\nc = '<' tag = False quote = False\nc = '/' tag = True quote = False\nc = 'b' tag = True quote = False\nc = '>' tag = True quote = False\n" ] ], [ [ "Yes, one sees what is going on – but this is horribly inefficient! Think of a 1,000-character input – you'd have to go through 2,000 lines of logs. It may help you, but it's a total time waster. Plus, you have to enter these statements, remove them again... it's a maintenance nightmare.", "_____no_output_____" ], [ "(You may even forget printf's in your code, creating a security problem: Mac OS X versions 10.7 to 10.7.3 would log the password in clear because someone had forgotten to turn off debugging output.)", "_____no_output_____" ], [ "### Debugging into Existence", "_____no_output_____" ], [ "I would also try to _debug the program into existence._ Just change things until they work. Let me see: If I remove the conditions \"and not quote\" from the program, it would actually work again:", "_____no_output_____" ] ], [ [ "def remove_html_markup_without_quotes(s):\n tag = False\n quote = False\n out = \"\"\n\n for c in s:\n if c == '<': # and not quote:\n tag = True\n elif c == '>': # and not quote:\n tag = False\n elif c == '\"' or c == \"'\" and tag:\n quote = not quote\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ], [ "assert remove_html_markup_without_quotes('<\"b\">foo</\"b\">') == 'foo'", "_____no_output_____" ] ], [ [ "Cool! Unfortunately, the function still fails on the other input:", "_____no_output_____" ] ], [ [ "with ExpectError():\n assert remove_html_markup_without_quotes('<b>\"foo\"</b>') == '\"foo\"'", "Traceback (most recent call last):\n File \"<ipython-input-28-1d8954a52bcf>\", line 2, in <module>\n assert remove_html_markup_without_quotes('<b>\"foo\"</b>') == '\"foo\"'\nAssertionError (expected)\n" ] ], [ [ "So, maybe we can change things again, such that both work? And maybe the other tests we had earlier won't fail? Let's just continue to change things randomly again and again and again.", "_____no_output_____" ], [ "Oh, and of course, I would never back up earlier versions such that I would be able to keep track of what has changed and when.", "_____no_output_____" ], [ "### Use the Most Obvious Fix", "_____no_output_____" ], [ "My favorite: Use the most obvious fix. This means that you're fixing the symptom, not the problem. In our case, this would be something like:", "_____no_output_____" ] ], [ [ "def remove_html_markup_fixed(s):\n if s == '<b>\"foo\"</b>':\n return '\"foo\"'\n ...", "_____no_output_____" ] ], [ [ "Miracle! Our earlier failing assertion now works! Now we can do the same for the other failing test, too, and we're done.\n(Rumor has it that some programmers use this technique to get their tests to pass...)", "_____no_output_____" ], [ "### Things to do Instead\n\nAs with any devil's guide, you get an idea of how to do things by doing the _opposite._ What this means is:\n\n1. Understand the code\n2. Fix the problem, not the symptom\n3. Proceed systematically\n\nwhich is what we will apply for the rest of this chapter.", "_____no_output_____" ], [ "## From Defect to Failure\n\nTo understand how to systematically debug a program, we first have to understand how failures come to be. The typical debugging situation looks like this. We have a program (execution), taking some input and producing some output. The output is in *error* (✘), meaning an unwanted and unintended deviation from what is correct, right, or true.\nThe input, in contrast, is assumed to be correct (✔). (Otherwise, we wouldn't search for the bug in our program, but in whatever produced its input.)", "_____no_output_____" ] ], [ [ "# ignore\ndef execution_diagram(show_steps=True, variables=[],\n steps=3, error_step=666,\n until=666, fault_path=[]):\n dot = graph()\n\n dot.node('input', shape='none', fillcolor='white', label=f\"Input {PASS}\",\n fontcolor=PASS_COLOR)\n last_outgoing_states = ['input']\n\n for step in range(1, min(steps + 1, until)):\n\n if step == error_step:\n step_label = f'Step {step} {FAIL}'\n step_color = FAIL_COLOR\n else:\n step_label = f'Step {step}'\n step_color = None\n\n if step >= error_step:\n state_label = f'State {step} {FAIL}'\n state_color = FAIL_COLOR\n else:\n state_label = f'State {step} {PASS}'\n state_color = PASS_COLOR\n\n state_name = f's{step}'\n outgoing_states = []\n incoming_states = []\n\n if not variables:\n dot.node(name=state_name, shape='box',\n label=state_label, color=state_color,\n fontcolor=state_color)\n else:\n var_labels = []\n for v in variables:\n vpath = f's{step}:{v}'\n if vpath in fault_path:\n var_label = f'<{v}>{v} ✘'\n outgoing_states.append(vpath)\n incoming_states.append(vpath)\n else:\n var_label = f'<{v}>{v}'\n var_labels.append(var_label)\n record_string = \" | \".join(var_labels)\n dot.node(name=state_name, shape='record',\n label=nohtml(record_string), color=state_color,\n fontcolor=state_color)\n\n if not outgoing_states:\n outgoing_states = [state_name]\n if not incoming_states:\n incoming_states = [state_name]\n\n for outgoing_state in last_outgoing_states:\n for incoming_state in incoming_states:\n if show_steps:\n dot.edge(outgoing_state, incoming_state,\n label=step_label, fontcolor=step_color)\n else:\n dot.edge(outgoing_state, incoming_state)\n\n last_outgoing_states = outgoing_states\n\n if until > steps + 1:\n # Show output\n if error_step > steps:\n dot.node('output', shape='none', fillcolor='white',\n label=f\"Output {PASS}\", fontcolor=PASS_COLOR)\n else:\n dot.node('output', shape='none', fillcolor='white',\n label=f\"Output {FAIL}\", fontcolor=FAIL_COLOR)\n\n for outgoing_state in last_outgoing_states:\n label = \"Execution\" if steps == 0 else None\n dot.edge(outgoing_state, 'output', label=label)\n\n display(dot)", "_____no_output_____" ], [ "# ignore\nexecution_diagram(show_steps=False, steps=0, error_step=0)", "_____no_output_____" ] ], [ [ "This situation we see above is what we call a *failure*: An externally visible _error_ in the program behavior, with the error again being an unwanted and unintended deviation from what is correct, right, or true.", "_____no_output_____" ], [ "How does this failure come to be? The execution we see above breaks down into several program _states_, one after the other.", "_____no_output_____" ] ], [ [ "# ignore\nfor until in range(1, 6):\n execution_diagram(show_steps=False, until=until, error_step=2)", "_____no_output_____" ] ], [ [ "Initially, the program state is still correct (✔). However, at some point in the execution, the state gets an _error_, also known as a *fault*. This fault – again an unwanted and unintended deviation from what is correct, right, or true – then propagates along the execution, until it becomes externally visible as a _failure_.\n(In reality, there are many, many more states than just this, but these would not fit in a diagram.)", "_____no_output_____" ], [ "How does a fault come to be? Each of these program states is produced by a _step_ in the program code. These steps take a state as input and produce another state as output. Technically speaking, the program inputs and outputs are also parts of the program state, so the input flows into the first step, and the output is the state produced by the last step.", "_____no_output_____" ] ], [ [ "# ignore\nfor until in range(1, 6):\n execution_diagram(show_steps=True, until=until, error_step=2)", "_____no_output_____" ] ], [ [ "Now, in the diagram above, Step 2 gets a _correct_ state as input and produces a _faulty_ state as output. The produced fault then propagates across more steps to finally become visible as a _failure_.", "_____no_output_____" ], [ "The goal of debugging thus is to _search_ for the step in which the state first becomes faulty. The _code_ associated with this step is again an error – an unwanted and unintended deviation from what is correct, right, or true – and is called a _defect_. This is what we have to find – and to fix.", "_____no_output_____" ], [ "Sounds easy, right? Unfortunately, things are not that easy, and that has something to do with the program state. Let us assume our state consists of three variables, `v1` to `v3`, and that Step 2 produces a fault in `v2`. This fault then propagates to the output:", "_____no_output_____" ] ], [ [ "# ignore\nfor until in range(1, 6):\n execution_diagram(show_steps=True, variables=['v1', 'v2', 'v3'],\n error_step=2,\n until=until, fault_path=['s2:v2', 's3:v2'])", "_____no_output_____" ] ], [ [ "The way these faults propagate is called a *cause-effect chain*:\n\n* The _defect_ in the code _causes_ a fault in the state when executed.\n* This _fault_ in the state then _propagates_ through further execution steps...\n* ... until it becomes visible as a _failure_.", "_____no_output_____" ], [ "Since the code was originally written by a human, any defect can be related to some original _mistake_ the programmer made. This gives us a number of terms that all are more precise than the general \"error\" or the colloquial \"bug\":\n\n* A _mistake_ is a human act or decision resulting in an error.\n* A _defect_ is an error in the program code. Also called *bug*.\n* A _fault_ is an error in the program state. Also called *infection*.\n* A _failure_ is an externally visible error in the program behavior. Also called *malfunction*.\n\nThe cause-effect chain of events is thus\n\n* Mistake → Defect → Fault → ... → Fault → Failure\n\nNote that not every defect also causes a failure, which is despite all testing, there can still be defects in the code looming around until the right conditions are met to trigger them. On the other hand, though, _every failure can be traced back to the defect that causes it_. Our job is to break the cause-effect chain.", "_____no_output_____" ], [ "## From Failure to Defect\n\nTo find a defect from a failure, we _trace back_ the faults along their _propagation_ – that is, we find out which faults in the earlier state have caused the later faults. We start from the very end of the execution and then gradually progress backwards in time, examining fault after fault until we find a _transition_ from a correct state to a faulty state – that is, a\nstep in which a correct state comes in and a faulty state comes out. At this point, we have found the origin of the failure – and the defect that causes it.", "_____no_output_____" ], [ "What sounds like a straight-forward strategy, unfortunately, doesn't always work this way in practice. That is because of the following problems of debugging:\n\n* First, program states are actually _large_, encompassing dozens to thousands of variables, possibly even more. If you have to search all of these manually and check them for faults, you will spend a lot of time for a single state.\n\n* Second, you do not always know _whether a state is correct or not._ While most programs have some form of specification for their inputs and outputs, these do not necessarily exist for intermediate results. If one had a specification that could check each state for correctness (possibly even automatically), debugging would be trivial. Unfortunately, it is not, and that's partly due to the lack of specifications.\n\n* Third, executions typically do not come in a handful of steps, as in the diagrams above; instead, they can easily encompass _thousands to millions of steps._ This means that you will have to examine not just one state, but several, making the problem much worse.\n\nTo make your search efficient, you thus have to _focus_ your search – starting with most likely causes and gradually progressing to the less probable causes. This is what we call a _debugging strategy_.", "_____no_output_____" ], [ "## The Scientific Method\n\nNow that we know how failures come to be, let's look into how to systematically find their causes. What we need is a _strategy_ that helps us search for how and when the failure comes to be. For this, we use a process called the *scientific method*.", "_____no_output_____" ], [ "When we are debugging a program, we are trying to find the causes of a given effect – very much like natural scientists try to understand why things in nature are as they are and how they come to be. Over thousands of years, scientists have conducted _observations_ and _experiments_ to come to an understanding of how our world works. The process by which experimental scientists operate has been coined \"The scientific method\". This is how it works:", "_____no_output_____" ], [ "1. Formulate a _question_, as in \"Why does this apple fall down?\".\n2. Invent a _hypothesis_ based on knowledge obtained while formulating the question, that may explain the observed behavior. \n3. Determining the logical consequences of the hypothesis, formulate a _prediction_ that can _support_ or _refute_ the hypothesis. Ideally, the prediction would distinguish the hypothesis from likely alternatives.\n4. _Test_ the prediction (and thus the hypothesis) in an _experiment_. If the prediction holds, confidence in the hypothesis increases; otherwise, it decreases.\n5. Repeat Steps 2–4 until there are no discrepancies between hypothesis and predictions and/or observations.", "_____no_output_____" ], [ "At this point, your hypothesis may be named a *theory* – that is, a predictive and comprehensive description of some aspect of the natural world. The gravitational theory, for instance, predicts very well how the moon revolves around the earth, and how the earth revolves around the sun. Our debugging problems are of a slightly lesser scale – we'd like a theory of how our failure came to be – but the process is pretty much the same.", "_____no_output_____" ] ], [ [ "# ignore\ndot = graph()\n\ndot.node('Hypothesis')\ndot.node('Observation')\ndot.node('Prediction')\ndot.node('Experiment')\n\ndot.edge('Hypothesis', 'Observation',\n label=\"<Hypothesis<BR/>is <I>supported:</I><BR/>Refine it>\",\n dir='back')\ndot.edge('Hypothesis', 'Prediction')\n\ndot.node('Problem Report', shape='none', fillcolor='white')\ndot.edge('Problem Report', 'Hypothesis')\n\ndot.node('Code', shape='none', fillcolor='white')\ndot.edge('Code', 'Hypothesis')\n\ndot.node('Runs', shape='none', fillcolor='white')\ndot.edge('Runs', 'Hypothesis')\n\ndot.node('More Runs', shape='none', fillcolor='white')\ndot.edge('More Runs', 'Hypothesis')\n\ndot.edge('Prediction', 'Experiment')\ndot.edge('Experiment', 'Observation')\ndot.edge('Observation', 'Hypothesis',\n label=\"<Hypothesis<BR/>is <I>rejected:</I><BR/>Seek alternative>\")", "_____no_output_____" ], [ "# ignore\ndisplay(dot)", "_____no_output_____" ] ], [ [ "In debugging, we proceed the very same way – indeed, we are treating bugs as if they were natural phenomena. This analogy may sound far-fetched, as programs are anything but natural. Nature, by definition, is not under our control. But bugs are _out of our control just as well._ Hence, the analogy is not that far-fetched – and we can apply the same techniques for debugging.", "_____no_output_____" ], [ "### Finding a Hypothesis", "_____no_output_____" ], [ "Let us apply the scientific method to our Python program which removes HTML tags. First of all, let us recall the problem – `remove_html_markup()` works for some inputs, but fails on others.", "_____no_output_____" ] ], [ [ "for i, html in enumerate(['<b>foo</b>',\n '<b>\"foo\"</b>',\n '\"<b>foo</b>\"',\n '<\"b\">foo</\"b\">']):\n result = remove_html_markup(html)\n print(\"%-2d %-15s %s\" % (i + 1, html, result))", "1 <b>foo</b> foo\n2 <b>\"foo\"</b> foo\n3 \"<b>foo</b>\" <b>foo</b>\n4 <\"b\">foo</\"b\"> foo\n" ] ], [ [ "Input #1 and #4 work as expected, the others do not. We can write these down in a table, such that we can always look back at our previous results:\n\n|Input|Expectation|Output|Outcome|\n|-----|-----------|------|-------|\n|`<b>foo</b>`|`foo`|`foo`|✔|\n|`<b>\"foo\"</b>`|`\"foo\"`|`foo`|✘|\n|`\"<b>foo</b>\"`|`\"foo\"`|`<b>foo</b>`|✘|\n|`<\"b\">foo</\"b\">`|`foo`|`foo`|✔|\n", "_____no_output_____" ] ], [ [ "quiz(\"From the difference between success and failure,\"\n \" we can already devise some observations about \"\n \" what's wrong with the output.\"\n \" Which of these can we turn into general hypotheses?\",\n [\"Double quotes are stripped from the tagged input.\",\n \"Tags in double quotes are not stripped.\",\n \"The tag '&lt;b&gt;' is always stripped from the input.\",\n \"Four-letter words are stripped.\"], [298 % 33, 1234 % 616])", "_____no_output_____" ] ], [ [ "### Testing a Hypothesis\n\nThe hypotheses that remain are:\n\n1. Double quotes are stripped from the tagged input.\n2. Tags in double quotes are not stripped.", "_____no_output_____" ], [ "These may be two separate issues, but chances are they are tied to each other. Let's focus on 1., because it is simpler. Does it hold for all inputs, even untagged ones? Our hypothesis becomes\n\n1. Double quotes are stripped from the ~~tagged~~ input.", "_____no_output_____" ], [ "Let's devise an experiment to validate this. If we feed the string\n```html\n\"foo\"\n```\n(including the double quotes) into `remove_html_markup()`, we should obtain\n```html\n\"foo\"\n```\nas result – that is, the output should be the unchanged input. However, if our hypothesis 1. is correct, we should obtain\n```html\nfoo\n```\nas result – that is, \"Double quotes are stripped from the input\" as predicted by the hypothesis.", "_____no_output_____" ], [ "We can very easily test this hypothesis:", "_____no_output_____" ] ], [ [ "remove_html_markup('\"foo\"')", "_____no_output_____" ] ], [ [ "Our hypothesis is confirmed! We can add this to our list of observations.", "_____no_output_____" ], [ "|Input|Expectation|Output|Outcome|\n|-----|-----------|------|-------|\n|`<b>foo</b>`|`foo`|`foo`|✔|\n|`<b>\"foo\"</b>`|`\"foo\"`|`foo`|✘|\n|`\"<b>foo</b>\"`|`\"foo\"`|`<b>foo</b>`|✘|\n|`<\"b\">foo</\"b\">`|`foo`|`foo`|✔|\n|`\"foo\"`|`\"foo\"`|`foo`|✘|\n", "_____no_output_____" ], [ "You can try out the hypothesis with more inputs – and it remains valid. Any non-markup input that contains double quotes will have these stripped.", "_____no_output_____" ], [ "Where does that quote-stripping come from? This is where we need to explore the cause-effect chain. The only place in `remove_html_markup()` where quotes are handled is this line:\n\n```python\nelif c == '\"' or c == \"'\" and tag:\n quote = not quote\n```\n\nSo, quotes should be removed only if `tag` is set. However, `tag` can be set only if the input contains a markup tag, which is not the case for a simple input like `\"foo\"`. Hence, what we observe is actually _impossible._ Yet, it happens.", "_____no_output_____" ], [ "### Refining a Hypothesis\n\nDebugging is a game of falsifying assumptions. You assume the code works – it doesn't. You assume the `tag` flag cannot be set – yet it may be. What do we do? Again, we create a hypothesis:\n\n1. The error is due to `tag` being set.", "_____no_output_____" ], [ "How do we know whether tag is being set? Let me introduce one of the most powerful debugging tools ever invented, the `assert` statement. The statement\n```python\nassert cond\n```\nevaluates the given condition `cond` and\n\n* if it holds: proceed as usual\n* if `cond` does not hold: throw an exception\n\nAn `assert` statement _encodes our assumptions_ and as such, should never fail. If it does, well, then something is wrong.", "_____no_output_____" ], [ "Using `assert`, we can check the value of `tag` all through the loop:", "_____no_output_____" ] ], [ [ "def remove_html_markup_with_tag_assert(s):\n tag = False\n quote = False\n out = \"\"\n\n for c in s:\n assert not tag # <=== Just added\n\n if c == '<' and not quote:\n tag = True\n elif c == '>' and not quote:\n tag = False\n elif c == '\"' or c == \"'\" and tag:\n quote = not quote\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "Our expectation is that this assertion would fail. So, do we actually get an exception? Try it out for yourself by uncommenting the following line:", "_____no_output_____" ] ], [ [ "# remove_html_markup_with_tag_assert('\"foo\"')", "_____no_output_____" ], [ "quiz(\"What happens after inserting the above assertion?\",\n [\"The program raises an exception. (i.e., tag is set)\",\n \"The output is as before, i.e., foo without quotes.\"\n \" (which means that tag is not set)\"],\n 2)", "_____no_output_____" ] ], [ [ "Here's the solution:", "_____no_output_____" ] ], [ [ "with ExpectError():\n result = remove_html_markup_with_tag_assert('\"foo\"')\nresult", "_____no_output_____" ] ], [ [ "### Refuting a Hypothesis\n\nWe did not get an exception, hence we reject our hypothesis:\n\n1. ~~The error is due to `tag` being set.~~\n", "_____no_output_____" ], [ "Again, let's go back to the only place in our code where quotes are handled:\n\n```python\nelif c == '\"' or c == \"'\" and tag:\n quote = not quote\n```\n\nBecause of the assertion, we already know that `tag` is always False. Hence, this condition should never hold either.", "_____no_output_____" ], [ "But maybe there's something wrong with the condition such that it holds? Here's our hypothesis:\n\n1. The error is due to the quote condition evaluating to true\n", "_____no_output_____" ], [ "If the condition evaluates to true, then `quote` should be set. We could now go and assert that `quote` is false; but we only care about the condition. So we insert an assertion that assumes that setting the code setting the `quote` flag is never reached:", "_____no_output_____" ] ], [ [ "def remove_html_markup_with_quote_assert(s):\n tag = False\n quote = False\n out = \"\"\n\n for c in s:\n if c == '<' and not quote:\n tag = True\n elif c == '>' and not quote:\n tag = False\n elif c == '\"' or c == \"'\" and tag:\n assert False # <=== Just added\n quote = not quote\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "Our expectation this time again is that the assertion fails. So, do we get an exception this time? Try it out for yourself by uncommenting the following line:", "_____no_output_____" ] ], [ [ "# remove_html_markup_with_quote_assert('\"foo\"')", "_____no_output_____" ], [ "quiz(\"What happens after inserting the 'assert' tag?\",\n[\"The program raises an exception (i.e., the quote condition holds)\",\n \"The output is still foo (i.e., the quote condition does not hold)\"], 29 % 7)", "_____no_output_____" ] ], [ [ "Here's what happens now that we have the `assert` tag:", "_____no_output_____" ] ], [ [ "with ExpectError():\n result = remove_html_markup_with_quote_assert('\"foo\"')", "Traceback (most recent call last):\n File \"<ipython-input-47-9ce255289291>\", line 2, in <module>\n result = remove_html_markup_with_quote_assert('\"foo\"')\n File \"<ipython-input-44-9c8a53a91780>\", line 12, in remove_html_markup_with_quote_assert\n assert False # <=== Just added\nAssertionError (expected)\n" ] ], [ [ "From this observation, we can deduce that our hypothesis is _confirmed_:\n\n1. The error is due to the quote condition evaluating to true (CONFIRMED)\n\nand the _condition is actually faulty._ It evaluates to True although `tag` is always False:\n```python\nelif c == '\"' or c == \"'\" and tag:\n quote = not quote\n```\nBut this condition holds for single and double quotes. Is there a difference?", "_____no_output_____" ], [ "Let us see whether our observations generalize towards general quotes:\n\n1. ~~Double~~ quotes are stripped from the input.\n", "_____no_output_____" ], [ "We can verify these hypotheses with an additional experiment. We go back to our original implementation (without any asserts), and then check it:", "_____no_output_____" ] ], [ [ "remove_html_markup(\"'foo'\")", "_____no_output_____" ] ], [ [ "Surprise: Our hypothesis is rejected and we can add another observation to our table:\n\n|Input|Expectation|Output|Outcome|\n|-----|-----------|------|-------|\n|`'foo'`|`'foo'`|`'foo'`|✔|\n\nSo, the condition\n\n* becomes True when a double quote is seen\n* becomes False (as it should) with single quotes", "_____no_output_____" ], [ "At this point, you should have enough material to solve the problem. How do we have to fix the condition? Here are four alternatives:\n\n```python\nc == \"\" or c == '' and tag # Choice 1\nc == '\"' or c == \"'\" and not tag # Choice 2\n(c == '\"' or c == \"'\") and tag # Choice 3\n... # Something else\n```", "_____no_output_____" ] ], [ [ "quiz(\"How should the condition read?\",\n [\"Choice 1\", \"Choice 2\", \"Choice 3\", \"Something else\"],\n 399 % 4)", "_____no_output_____" ] ], [ [ "## Fixing the Bug", "_____no_output_____" ], [ "So, you have spotted the defect: In Python (and most other languages), `and` takes precedence over `or`, which is why the condition is wrong. It should read:\n\n```python\n(c == '\"' or c == \"'\") and tag\n```\n\n(Actually, good programmers rarely depend on precedence; it is considered good style to use parentheses lavishly.)", "_____no_output_____" ], [ "So, our hypothesis now has become\n\n1. The error is due to the `quote` condition evaluating to True\n", "_____no_output_____" ], [ "Is this our final hypothesis? We can check our earlier examples whether they should now work well:\n\n\n|Input|Expectation|Output|Outcome|\n|-----|-----------|------|-------|\n|`<b>foo</b>`|`foo`|`foo`|✔|\n|`<b>\"foo\"</b>`|`\"foo\"`|`foo`|✘|\n|`\"<b>foo</b>\"`|`\"foo\"`|`<b>foo</b>`|✘|\n|`<\"b\">foo</\"b\">`|`foo`|`foo`|✔|\n|`\"foo\"`|`'foo'`|`foo`|✘|\n|`'foo'`|`'foo'`|`'foo'`|✔|\n\nIn all of these examples, the `quote` flag should now be set outside of tags; hence, everything should work as expected.", "_____no_output_____" ], [ "In terms of the scientific process, we now have a *theory* – a hypothesis that\n\n* is consistent with all earlier observations\n* predicts future observations (in our case: correct behavior)\n\nFor debugging, our problems are usually too small for a big word like theory, so we use the word *diagnosis* instead. So is our diagnosis sufficient to fix the bug? Let us check.", "_____no_output_____" ], [ "### Checking Diagnoses\n\nIn debugging, you should start to fix your code if and only if you have a diagnosis that shows two things:\n\n1. **Causality.** Your diagnosis should explain why and how the failure came to be. Hence, it induces a _fix_ that, when applied, should make the failure disappear.\n2. **Incorrectness.** Your diagnosis should explain why and how the code is _incorrect_ (which in turn suggests how to _correct_ the code). Hence, the fix it induces not only applies to the given failure, but also to all related failures.", "_____no_output_____" ], [ "Showing both these aspects requirements – _causality_ and _incorrectness_ – are crucial for a debugging diagnosis:\n\n* If you find that you can change some location to make the failure go away, but are not sure why this location is wrong, then your \"fix\" may apply only to the symptom rather than the source. Your diagnosis explains _causality_, but not _incorrectness_.\n* If you find that there is a defect in some code location, but do not verify whether this defect is related to the failure in question, then your \"fix\" may not address the failure. Your diagnosis addresses _incorrectness_, but not _causality_.", "_____no_output_____" ], [ "When you do have a diagnosis that explains both causality (how the failure came to be), and incorrectness (how to correct the code accordingly), then (and only then!) is it time to actually _fix_ the code accordingly. After applying the fix, the failure should be gone, and no other failure should occur. If the failure persists, this should come as a surprise. Obviously, there is some other aspect that you haven't considered yet, so you have to go back to the drawing board and add another failing test case to the set of observations.", "_____no_output_____" ], [ "### Fixing the Code", "_____no_output_____" ], [ "All these things considered, let us go and fix `remove_html_markup()`. We know how the defect _causes_ the failure (by erroneously setting `quote` outside of tags). We know that the line in question is _incorrect_ (as single and double of quotes should be treated similarly). So, our diagnosis shows both causality and incorrectness, and we can go and fix the code accordingly:", "_____no_output_____" ] ], [ [ "def remove_html_markup(s):\n tag = False\n quote = False\n out = \"\"\n\n for c in s:\n if c == '<' and not quote:\n tag = True\n elif c == '>' and not quote:\n tag = False\n elif (c == '\"' or c == \"'\") and tag: # <-- FIX\n quote = not quote\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "We verify that the fix was successful by running our earlier tests. Not only should the previously failing tests now pass, the previously passing tests also should not be affected. Fortunately, all tests now pass:", "_____no_output_____" ] ], [ [ "assert remove_html_markup(\"Here's some <strong>strong argument</strong>.\") == \\\n \"Here's some strong argument.\"\nassert remove_html_markup(\n '<input type=\"text\" value=\"<your name>\">') == \"\"\nassert remove_html_markup('<b>foo</b>') == 'foo'\nassert remove_html_markup('<b>\"foo\"</b>') == '\"foo\"'\nassert remove_html_markup('\"<b>foo</b>\"') == '\"foo\"'\nassert remove_html_markup('<\"b\">foo</\"b\">') == 'foo'", "_____no_output_____" ] ], [ [ "So, our hypothesis _was_ a theory, and our diagnosis was correct. Success!", "_____no_output_____" ], [ "### Alternate Paths\n\nA defect may have more than one hypothesis, and each diagnosis can be obtained by many ways. We could also have started with our other hypothesis\n\n2. Tags in double quotes are not stripped\n\nand by reasoning and experiments, we would have reached the same conclusion that the condition is faulty:\n\n* To strip tags, the `tag` flag must be set (but it is not).\n* To set the `tag` flag, the `quote` variable must not be set (but it is).\n* The `quote` flag is set under the given condition (which thus must be faulty).\n\nThis gets us to the same diagnosis as above – and, of course, the same fix.", "_____no_output_____" ], [ "## Homework after the Fix", "_____no_output_____" ], [ "After having successfully validated the fix, we still have some homework to make.", "_____no_output_____" ], [ "### Check for further Defect Occurrences", "_____no_output_____" ], [ "First, we may want to check that the underlying mistake was not made elsewhere, too.\n\nFor an error as with `remove_html_markup()`, it may be wise to check other parts of the code (possibly written by the same programmer) whether Boolean formulas show proper precendence. Consider setting up a static program checker or style checker to catch similar mistakes.", "_____no_output_____" ], [ "### Check your Tests\n\nIf the defect was not found through testing, now is a good time to make sure it will be found the next time. If you use automated tests, add a test that catches the bug (as well as similar ones), such that you can prevent regressions.", "_____no_output_____" ], [ "### Add Assertions\n\n", "_____no_output_____" ], [ "To be 100% sure, we could add an assertion to `remove_html_markup()` that checks the final result for correctness. Unfortunately, writing such an assertion is just as complex as writing the function itself.\n\nThere is one assertion, though, which could be placed in the loop body to catch this kind of errors, and which could remain in the code. Which is it?", "_____no_output_____" ] ], [ [ "quiz(\"Which assertion would have caught the problem?\",\n [\"assert quote and not tag\",\n \"assert quote or not tag\",\n \"assert tag or not quote\",\n \"assert tag and not quote\"],\n 3270 - 3267)", "_____no_output_____" ] ], [ [ "Indeed, the statement\n\n```python\nassert tag or not quote\n```\nis correct. This excludes the situation of ¬`tag` ∧ `quote` – that is, the `tag` flag is not set, but the `quote` flag is. If you remember our state machine from above, this is actually a state that should never exist:", "_____no_output_____" ] ], [ [ "# ignore\ndisplay(state_machine)", "_____no_output_____" ] ], [ [ "Here's our function in its \"final\" state. As software goes, software is never final – and this may also hold for our function, as there is still room for improvement. For this chapter though, we leave it be.", "_____no_output_____" ] ], [ [ "def remove_html_markup(s):\n tag = False\n quote = False\n out = \"\"\n\n for c in s:\n assert tag or not quote\n\n if c == '<' and not quote:\n tag = True\n elif c == '>' and not quote:\n tag = False\n elif (c == '\"' or c == \"'\") and tag:\n quote = not quote\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "### Commit the Fix", "_____no_output_____" ], [ "It may sound obvious, but your fix is worth nothing if it doesn't go into production. Be sure to commit your change to the code repository, together with your diagnosis. If your fix has to be approved by a third party, a good diagnosis on why and what happened is immensely helpful.", "_____no_output_____" ], [ "### Close the Bug Report\n\nIf you [systematically track bugs](Tracking.ipynb), and your bug is properly tracked, now is the time to mark the issue as \"resolved\". Check for duplicates of the issue and check whether they are resolved, too. And now, you are finally done:\n\n![](https://media.giphy.com/media/nbJUuYFI6s0w0/giphy.gif)\n\nTime to relax – and look for the next bug!", "_____no_output_____" ], [ "## Become a Better Debugger\n\nWe have now systematically fixed a bug. In this book, we will explore a number of techniques to make debugging easier – coming up with automated diagnoses, explanations, even automatic repairs, including for our example above. But there are also number of things _you_ can do to become a better debugger.\n\n\n### Follow the Process\n\nIf you're an experienced programmer, you may have spotted the problem in `remove_html_markup()` immediately, and start fixing the code right away. But this is dangerous and risky.\n\nWhy is this so? Well, because you should first\n\n* try to understand the problem, and \n* have a full diagnosis before starting to fix away.\n\nYou _can_ skip these steps, and jump right to your interactive debugger the very moment you see a failure, happily stepping through their program. This may even work well for simple problems, including this one. The risk, however, is that this narrows your view to just this one execution, which limits your ability to understand _all_ the circumstances of the problem. Even worse: If you start \"fixing\" the bug without exactly understanding the problem, you may end up with an incomplete solution – as illustrated in \"The Devil's Guide to Debugging\", above.", "_____no_output_____" ], [ "### Keep a Log\n\nA second risk of starting debugging too soon is that it lets you easily deviate from a systematic process. Remember how we wrote down every experiment in a table? How we numbered every hypothesis? This is not just for teaching. Writing these things down explicitly allow you to keep track of all your observations and hypotheses over time.\n\n|Input|Expectation|Output|Outcome|\n|-----|-----------|------|-------|\n|`<b>foo</b>`|`foo`|`foo`|✔|\n\nEvery time you come up with a new hypothesis, you can immediately check it against your earlier observations, which will help you eliminating unlikely ones from the start. This is a bit like in the classic \"Mastermind\" board game, in which you have to guess some secret combination of pins, and in which you opponent gives you hints on whether and how your guesses are correct. At any time, you can see your previous guesses (experiments) and the results (observations) you got; any new guess (hypothesis) as to be consistent with the previous observations and experiments.", "_____no_output_____" ], [ "![Master Mind Board Grame](https://upload.wikimedia.org/wikipedia/commons/2/2d/Mastermind.jpg)", "_____no_output_____" ], [ "Keeping such a log also allows you to interrupt your debugging session at any time. You can be home in time, sleep over the problem, and resume the next morning with a refreshed mind. You can even hand over the log to someone else, stating your findings so far.\n\nThe alternative to having a log is to _keep all in memory_. This only works for short amounts of time, as puts a higher and higher cognitive load on your memory as you debug along. After some time, you will forget earlier observations, which leads to mistakes. Worst of all, any interruption will break your concentration and make you forget things, so you can't stop debugging until you're done.\n\nSure, if you are a real master, you can stay glued to the screen all night. But I'd rather be home in time, thank you.", "_____no_output_____" ], [ "### Rubberducking\n\nA great technique to revisit your observations and to come up with new hypotheses is to _explain the problem to someone else_. In this process, the \"someone else\" is important, but even more important is that _you are explaining the problem to yourself_! As Kernighan and Pike \\cite{Kernighan1999} put it:\n\n> Sometimes it takes no more than a few sentences, followed by an embarrassed \"Never mind. I see what's wrong. Sorry to bother you.\"\n\nThe reason why this works is that teaching someone else forces you to take different perspectives, and these help you resolving the inconsistency between what you assume and what you actually observe.\n\nSince that \"someone else\" can be totally passive, you can even replace her with an inanimate object to talk to – even a rubber duck. This technique is called *rubber duck debugging* or *rubberducking* – the idea is that you explain your problem to a rubber duck first before interrupting one of your co-workers with the problem. Some programmers, when asked for advice, explicitly request that you \"explain your problem to the duck first\", knowing that this resolves a good fraction of problems.", "_____no_output_____" ], [ "![Rubber duck debugging](https://upload.wikimedia.org/wikipedia/commons/d/d5/Rubber_duck_assisting_with_debugging.jpg)", "_____no_output_____" ], [ "## The Cost of Debugging\n\n\\todo{add recent stuff on how much time debugging takes}\n\nAnd it's not only that debugging takes time – the worst thing is that it is a search process, which can take anything between a few minutes and several hours, sometimes even days and weeks. But even if you never know how much time a bug will take, it's a bit of blessing to use a process which gradually gets you towards its cause.", "_____no_output_____" ], [ "## History of Debugging\n\nEngineers and programmers have long used the term \"bug\" for faults in their systems – as if it were something that crept into an otherwise flawless program to cause the effects that none could explain. And from a psychological standpoint, it is far easier to blame some \"bug\" rather than taking responsibility ourselves. In the end, though, we have to face the fact: We made the bugs, and they are ours to fix.\n\nHaving said that, there has been one recorded instance where a real bug has crept into a system. That was on September 9, 1947, when a moth got stuck in the relay of a Harvard Mark II machine. This event was logged, and the log book is now on display at the Smithsonian Natural Museum of American History, as \"First actual case of bug being found.\"", "_____no_output_____" ], [ "![First actual case of bug being found](https://upload.wikimedia.org/wikipedia/commons/f/ff/First_Computer_Bug%2C_1945.jpg)", "_____no_output_____" ], [ "The actual term \"bug\", however, is much older. What do you think is its origin?", "_____no_output_____" ] ], [ [ "import hashlib\n\nbughash = hashlib.md5(b\"debug\").hexdigest()", "_____no_output_____" ], [ "quiz('Where has the name \"bug\" been used to denote disruptive events?',\n [\n 'In the early days of Morse telegraphy, referring to a special key '\n 'that would send a string of dots',\n 'Among radio technicians to describe a device that '\n 'converts electromagnetic field variations into acoustic signals',\n \"In Shakespeare's \" '\"Henry VI\", referring to a walking spectre',\n 'In Middle English, where the word \"bugge\" is the basis for terms '\n 'like \"bugbear\" and \"bugaboo\"'\n ],\n [bughash.index(i) for i in \"d42f\"]\n )", "_____no_output_____" ] ], [ [ "(Source: \\cite{jargon}, \\cite{wikipedia:debugging})", "_____no_output_____" ], [ "## Synopsis", "_____no_output_____" ], [ "In this chapter, we introduce some basics of how failures come to be as well as a general process for debugging.", "_____no_output_____" ], [ "## Lessons Learned\n\n1. An _error_ is a deviation from what is correct, right, or true. Specifically,\n * A _mistake_ is a human act or decision resulting in an error.\n * A _defect_ is an error in the program code. Also called *bug*.\n * A _fault_ is an error in the program state. Also called *infection*.\n * A _failure_ is an externally visible error in the program behavior. Also called *malfunction*.\n2. In a failing program execution, a mistake by the programmer results in a defect in the code, which creates a fault in the state, which propagates until it results in a failure. Tracing back fault propagation allows to identify the defect that causes the failure.\n3. In debugging, the _scientific method_ allows to systematically identify failure causes by gradually refining and refuting hypotheses based on experiments and observations.\n4. Before fixing the defect, have a complete _diagnosis_ that \n * shows _causality_ (how the defect causes the failure)\n * shows _incorrectness_ (how the defect is wrong)\n5. You can become a better debugger by\n * Following a systematic process like the scientific method\n * Keeping a log of your observations and hypotheses\n * Making your observations and conclusions explicit by telling them somebody (or something).", "_____no_output_____" ], [ "## Next Steps\n\nIn the next chapters, we will learn how to\n\n* [trace and observe executions](Tracer.ipynb)\n* [build your own interactive debugger](Debugger.ipynb)\n* [locate defects automatically by correlating failures and code coverage](StatisticalDebugger.ipynb)\n* [identify and simplify failure-inducing inputs](Reducer.ipynb)\n\nEnjoy!", "_____no_output_____" ], [ "## Background\n\nThere are several good books on debugging, but these three are especially recommended:\n\n* _Debugging_ by Agans \\cite{agans2006-debugging} takes a pragmatic approach to debugging, highlighting systematic approaches that help for all kinds of application-specific problems;\n* _Why Programs Fail_ by Zeller \\cite{zeller2009-why-programs-fail} takes a more academic approach, creating theories of how failures come to be and systematic debugging processes;\n* _Effective Debugging_ by Spinellis \\cite{spinellis2016-effective-debugging} aims for a middle ground between the two, creating general recipes and recommendations that easily instantiate towards specific problems.\n\nAll these books focus on _manual_ debugging and the debugging process, just like this chapter; for _automated_ debugging, simply read on :-)", "_____no_output_____" ], [ "## Exercises", "_____no_output_____" ], [ "### Exercise 1: Get Acquainted with Notebooks and Python\n\nYour first exercise in this book is to get acquainted with notebooks and Python, such that you can run the code examples in the book – and try out your own. Here are a few tasks to get you started.", "_____no_output_____" ], [ "#### Beginner Level: Run Notebooks in Your Browser\n\nThe easiest way to get access to the code is to run them in your browser.\n\n1. From the [Web Page](__CHAPTER_HTML__), check out the menu at the top. Select `Resources` $\\rightarrow$ `Edit as Notebook`.\n2. After a short waiting time, this will open a Jupyter Notebook right within your browser, containing the current chapter as a notebook.\n3. You can again scroll through the material, but you click on any code example to edit and run its code (by entering <kbd>Shift</kbd> + <kbd>Return</kbd>). You can edit the examples as you please.\n4. Note that code examples typically depend on earlier code, so be sure to run the preceding code first.\n5. Any changes you make will not be saved (unless you save your notebook to disk).\n\nFor help on Jupyter Notebooks, from the [Web Page](__CHAPTER_HTML__), check out the `Help` menu.", "_____no_output_____" ], [ "#### Advanced Level: Run Python Code on Your Machine\n\nThis is useful if you want to make greater changes, but do not want to work with Jupyter.\n\n1. From the [Web Page](__CHAPTER_HTML__), check out the menu at the top. Select `Resources` $\\rightarrow$ `Download Code`. \n2. This will download the Python code of the chapter as a single Python .py file, which you can save to your computer.\n3. You can then open the file, edit it, and run it in your favorite Python environment to re-run the examples.\n4. Most importantly, you can [import it](Importing.ipynb) into your own code and reuse functions, classes, and other resources.\n\nFor help on Python, from the [Web Page](__CHAPTER_HTML__), check out the `Help` menu.", "_____no_output_____" ], [ "#### Pro Level: Run Notebooks on Your Machine\n\nThis is useful if you want to work with Jupyter on your machine. This will allow you to also run more complex examples, such as those with graphical output.\n\n\n1. From the [Web Page](__CHAPTER_HTML__), check out the menu at the top. Select `Resources` $\\rightarrow$ `All Notebooks`. \n2. This will download all Jupyter Notebooks as a collection of .ipynb files, which you can save to your computer.\n3. You can then open the notebooks in Jupyter Notebook or Jupyter Lab, edit them, and run them. To navigate across notebooks, open the notebook [`00_Table_of_Contents.ipynb`](00_Table_of_Contents.ipynb).\n4. You can also download individual notebooks using Select `Resources` $\\rightarrow$ `Download Notebook`. Running these, however, will require that you have the other notebooks downloaded already.\n\nFor help on Jupyter Notebooks, from the [Web Page](__CHAPTER_HTML__), check out the `Help` menu.", "_____no_output_____" ], [ "#### Boss Level: Contribute!\n\nThis is useful if you want to contribute to the book with patches or other material. It also gives you access to the very latest version of the book.\n\n1. From the [Web Page](__CHAPTER_HTML__), check out the menu at the top. Select `Resources` $\\rightarrow$ `Project Page`. \n2. This will get you to the GitHub repository which contains all sources of the book, including the latest notebooks.\n3. You can then _clone_ this repository to your disk, such that you get the latest and greatest.\n4. You can report issues and suggest pull requests on the GitHub page.\n5. Updating the repository with `git pull` will get you updated.\n\nIf you want to contribute code or text, check out the [Guide for Authors](Guide_for_Authors.ipynb).", "_____no_output_____" ], [ "### Exercise 2: More Bugs!\n\nYou may have noticed that our `remove_html_markup()` function is still not working perfectly under all circumstances. The error has something to do with different quotes occurring in the input.", "_____no_output_____" ], [ "#### Part 1: Find the Problem\n\nWhat does the problem look like? Set up a test case that demonstrates the problem.", "_____no_output_____" ] ], [ [ "assert(...)", "_____no_output_____" ] ], [ [ "Set up additional test cases as useful.", "_____no_output_____" ], [ "**Solution.** The remaining problem stems from the fact that in `remove_html_markup()`, we do not differentiate between single and double quotes. Hence, if we have a _quote within a quoted text_, the function may get confused. Notably, a string that begins with a double quote may be interpreted as ending when a single quote is seen, and vice versa. Here's an example of such a string:\n\n```html\n<b title=\"<Shakespeare's play>\">foo</b>\n```", "_____no_output_____" ], [ "When we remove the HTML markup, the `>` in the string is interpreted as _unquoted_. Hence, it is interpreted as ending the tag, such that the rest of the tag is not removed.", "_____no_output_____" ] ], [ [ "s = '<b title=\"<Shakespeare' + \"'s play>\" + '\">foo</b>'\ns", "_____no_output_____" ], [ "remove_html_markup(s)", "_____no_output_____" ], [ "with ExpectError():\n assert(remove_html_markup(s) == \"foo\")", "Traceback (most recent call last):\n File \"<ipython-input-60-00bc84e50798>\", line 2, in <module>\n assert(remove_html_markup(s) == \"foo\")\nAssertionError (expected)\n" ] ], [ [ "#### Part 2: Identify Extent and Cause\n\nUsing the scientific method, identify the extent and cause of the problem. Write down your hypotheses and log your observations, as in\n\n|Input|Expectation|Output|Outcome|\n|-----|-----------|------|-------|\n|(input)|(expectation)|(output)|(outcome)|\n", "_____no_output_____" ], [ "**Solution.** The first step is obviously\n\n|Input|Expectation|Output|Outcome|\n|-----|-----------|------|-------|\n|<b title=\"<Shakespeare's play>\">foo</b>|foo|\"foo|✘|\n", "_____no_output_____" ], [ "#### Part 3: Fix the Problem\n\nDesign a fix for the problem. Show that it satisfies the earlier tests and does not violate any existing test.", "_____no_output_____" ], [ "**Solution**. Here's an improved implementation that actually tracks the opening and closing quote by storing the quoting character in the `quote` variable. (If `quote` is `''`, we are not in a string.)", "_____no_output_____" ] ], [ [ "def remove_html_markup_with_proper_quotes(s):\n tag = False\n quote = ''\n out = \"\"\n\n for c in s:\n assert tag or quote == ''\n\n if c == '<' and quote == '':\n tag = True\n elif c == '>' and quote == '':\n tag = False\n elif (c == '\"' or c == \"'\") and tag and quote == '':\n # beginning of string\n quote = c\n elif c == quote:\n # end of string\n quote = ''\n elif not tag:\n out = out + c\n\n return out", "_____no_output_____" ] ], [ [ "Python enthusiasts may note that we could also write `not quote` instead of `quote == ''`, leaving most of the original code untouched. We stick to classic Boolean comparisons here.", "_____no_output_____" ], [ "The function now satisfies the earlier failing test:", "_____no_output_____" ] ], [ [ "assert(remove_html_markup_with_proper_quotes(s) == \"foo\")", "_____no_output_____" ] ], [ [ "as well as all our earlier tests:", "_____no_output_____" ] ], [ [ "assert remove_html_markup_with_proper_quotes(\n \"Here's some <strong>strong argument</strong>.\") == \\\n \"Here's some strong argument.\"\nassert remove_html_markup_with_proper_quotes(\n '<input type=\"text\" value=\"<your name>\">') == \"\"\nassert remove_html_markup_with_proper_quotes('<b>foo</b>') == 'foo'\nassert remove_html_markup_with_proper_quotes('<b>\"foo\"</b>') == '\"foo\"'\nassert remove_html_markup_with_proper_quotes('\"<b>foo</b>\"') == '\"foo\"'\nassert remove_html_markup_with_proper_quotes('<\"b\">foo</\"b\">') == 'foo'", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e5c019d14421fa1eed315ba97ac2803c4b3929
403,092
ipynb
Jupyter Notebook
dl/google-ml-crashcourse/exercises/01_first_steps_with_tensor_flow.ipynb
AtmaMani/pyChakras
e58a4e244d65858049914cf98dcb454ef009362a
[ "MIT" ]
null
null
null
dl/google-ml-crashcourse/exercises/01_first_steps_with_tensor_flow.ipynb
AtmaMani/pyChakras
e58a4e244d65858049914cf98dcb454ef009362a
[ "MIT" ]
1
2022-03-12T01:01:42.000Z
2022-03-12T01:01:42.000Z
dl/google-ml-crashcourse/exercises/01_first_steps_with_tensor_flow.ipynb
AtmaMani/pyChakras
e58a4e244d65858049914cf98dcb454ef009362a
[ "MIT" ]
2
2020-03-09T02:11:45.000Z
2022-03-24T19:34:32.000Z
190.227466
116,856
0.852624
[ [ [ "#### Copyright 2017 Google LLC.", "_____no_output_____" ] ], [ [ "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.", "_____no_output_____" ] ], [ [ "# First Steps with TensorFlow", "_____no_output_____" ], [ "**Learning Objectives:**\n * Learn fundamental TensorFlow concepts\n * Use the `LinearRegressor` class in TensorFlow to predict median housing price, at the granularity of city blocks, based on one input feature\n * Evaluate the accuracy of a model's predictions using Root Mean Squared Error (RMSE)\n * Improve the accuracy of a model by tuning its hyperparameters", "_____no_output_____" ], [ "The [data](https://developers.google.com/machine-learning/crash-course/california-housing-data-description) is based on 1990 census data from California.", "_____no_output_____" ], [ "## Setup\nIn this first cell, we'll load the necessary libraries.", "_____no_output_____" ] ], [ [ "from __future__ import print_function\n\nimport math\n\nfrom IPython import display\nfrom matplotlib import cm\nfrom matplotlib import gridspec\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom sklearn import metrics\nimport tensorflow as tf\nfrom tensorflow.python.data import Dataset\n\ntf.logging.set_verbosity(tf.logging.ERROR)\npd.options.display.max_rows = 10\npd.options.display.float_format = '{:.1f}'.format", "_____no_output_____" ] ], [ [ "Next, we'll load our data set.", "_____no_output_____" ] ], [ [ "california_housing_dataframe = pd.read_csv(\"https://download.mlcc.google.com/mledu-datasets/california_housing_train.csv\", sep=\",\")\ncalifornia_housing_dataframe.head()", "_____no_output_____" ], [ "california_housing_dataframe.shape", "_____no_output_____" ] ], [ [ "We'll randomize the data, just to be sure not to get any pathological ordering effects that might harm the performance of Stochastic Gradient Descent. Additionally, we'll scale `median_house_value` to be in units of thousands, so it can be learned a little more easily with learning rates in a range that we usually use.", "_____no_output_____" ] ], [ [ "california_housing_dataframe = california_housing_dataframe.reindex(\n np.random.permutation(california_housing_dataframe.index))\ncalifornia_housing_dataframe[\"median_house_value\"] /= 1000.0\ncalifornia_housing_dataframe", "_____no_output_____" ] ], [ [ "## Examine the Data\n\nIt's a good idea to get to know your data a little bit before you work with it.\n\nWe'll print out a quick summary of a few useful statistics on each column: count of examples, mean, standard deviation, max, min, and various quantiles.", "_____no_output_____" ] ], [ [ "california_housing_dataframe.describe()", "_____no_output_____" ] ], [ [ "## Build the First Model\n\nIn this exercise, we'll try to predict `median_house_value`, which will be our label (sometimes also called a target). We'll use `total_rooms` as our input feature.\n\n**NOTE:** Our data is at the city block level, so this feature represents the total number of rooms in that block.\n\nTo train our model, we'll use the [LinearRegressor](https://www.tensorflow.org/api_docs/python/tf/estimator/LinearRegressor) interface provided by the TensorFlow [Estimator](https://www.tensorflow.org/get_started/estimator) API. This API takes care of a lot of the low-level model plumbing, and exposes convenient methods for performing model training, evaluation, and inference.", "_____no_output_____" ], [ "### Step 1: Define Features and Configure Feature Columns", "_____no_output_____" ], [ "In order to import our training data into TensorFlow, we need to specify what type of data each feature contains. There are two main types of data we'll use in this and future exercises:\n\n* **Categorical Data**: Data that is textual. In this exercise, our housing data set does not contain any categorical features, but examples you might see would be the home style, the words in a real-estate ad.\n\n* **Numerical Data**: Data that is a number (integer or float) and that you want to treat as a number. As we will discuss more later sometimes you might want to treat numerical data (e.g., a postal code) as if it were categorical.\n\nIn TensorFlow, we indicate a feature's data type using a construct called a **feature column**. Feature columns store only a description of the feature data; they do not contain the feature data itself.\n\nTo start, we're going to use just one numeric input feature, `total_rooms`. The following code pulls the `total_rooms` data from our `california_housing_dataframe` and defines the feature column using `numeric_column`, which specifies its data is numeric:", "_____no_output_____" ] ], [ [ "# Define the input feature: total_rooms.\nmy_feature = california_housing_dataframe[[\"total_rooms\"]]\nmy_feature\n\n# Configure a numeric feature column for total_rooms.\nfeature_columns = [tf.feature_column.numeric_column(\"total_rooms\")]", "_____no_output_____" ] ], [ [ "**NOTE:** The shape of our `total_rooms` data is a one-dimensional array (a list of the total number of rooms for each block). This is the default shape for `numeric_column`, so we don't have to pass it as an argument.", "_____no_output_____" ] ], [ [ "print(type(feature_columns[0]))\nfeature_columns", "<class 'tensorflow.python.feature_column.feature_column_v2.NumericColumn'>\n" ] ], [ [ "### Step 2: Define the Target", "_____no_output_____" ], [ "Next, we'll define our target, which is `median_house_value`. Again, we can pull it from our `california_housing_dataframe`:", "_____no_output_____" ] ], [ [ "# Define the label.\ntargets = california_housing_dataframe[\"median_house_value\"]", "_____no_output_____" ] ], [ [ "### Step 3: Configure the LinearRegressor", "_____no_output_____" ], [ "Next, we'll configure a linear regression model using LinearRegressor. We'll train this model using the `GradientDescentOptimizer`, which implements Mini-Batch Stochastic Gradient Descent (SGD). The `learning_rate` argument controls the size of the gradient step.\n\n**NOTE:** To be safe, we also apply [gradient clipping](https://developers.google.com/machine-learning/glossary/#gradient_clipping) to our optimizer via `clip_gradients_by_norm`. Gradient clipping ensures the magnitude of the gradients do not become too large during training, which can cause gradient descent to fail. ", "_____no_output_____" ] ], [ [ "# Use gradient descent as the optimizer for training the model.\nmy_optimizer=tf.train.GradientDescentOptimizer(learning_rate=0.0000001)\nmy_optimizer = tf.contrib.estimator.clip_gradients_by_norm(my_optimizer, 5.0)\n\n# Configure the linear regression model with our feature columns and optimizer.\n# Set a learning rate of 0.0000001 for Gradient Descent.\nlinear_regressor = tf.estimator.LinearRegressor(\n feature_columns=feature_columns,\n optimizer=my_optimizer\n)", "_____no_output_____" ], [ "my_optimizer = tf.train.GradientDescentOptimizer(learning_rate= 0.0000001)\nmy_optimizer = tf.contrib.estimator.clip_gradients_by_norm(optimizer=my_optimizer, clip_norm=5.0)", "_____no_output_____" ], [ "linear_regressor = tf.estimator.LinearRegressor(feature_columns = feature_columns, optimizer=my_optimizer)\nlinear_regressor", "_____no_output_____" ] ], [ [ "### Step 4: Define the Input Function", "_____no_output_____" ], [ "To import our California housing data into our `LinearRegressor`, we need to define an input function, which instructs TensorFlow how to preprocess\nthe data, as well as how to batch, shuffle, and repeat it during model training.\n\nFirst, we'll convert our *pandas* feature data into a dict of NumPy arrays. We can then use the TensorFlow [Dataset API](https://www.tensorflow.org/programmers_guide/datasets) to construct a dataset object from our data, and then break\nour data into batches of `batch_size`, to be repeated for the specified number of epochs (num_epochs). \n\n**NOTE:** When the default value of `num_epochs=None` is passed to `repeat()`, the input data will be repeated indefinitely.\n\nNext, if `shuffle` is set to `True`, we'll shuffle the data so that it's passed to the model randomly during training. The `buffer_size` argument specifies\nthe size of the dataset from which `shuffle` will randomly sample.\n\nFinally, our input function constructs an iterator for the dataset and returns the next batch of data to the LinearRegressor.", "_____no_output_____" ] ], [ [ "def my_input_fn(features, targets, batch_size=1, shuffle=True, num_epochs=None):\n \"\"\"Trains a linear regression model of one feature.\n \n Args:\n features: pandas DataFrame of features\n targets: pandas DataFrame of targets\n batch_size: Size of batches to be passed to the model\n shuffle: True or False. Whether to shuffle the data.\n num_epochs: Number of epochs for which data should be repeated. None = repeat indefinitely\n Returns:\n Tuple of (features, labels) for next data batch\n \"\"\"\n \n # Convert pandas data into a dict of np arrays.\n features = {key:np.array(value) for key,value in dict(features).items()} \n \n # Construct a dataset, and configure batching/repeating.\n ds = Dataset.from_tensor_slices((features,targets)) # warning: 2GB limit\n ds = ds.batch(batch_size).repeat(num_epochs)\n \n # Shuffle the data, if specified.\n if shuffle:\n ds = ds.shuffle(buffer_size=10000)\n \n # Return the next batch of data.\n features, labels = ds.make_one_shot_iterator().get_next()\n return features, labels", "_____no_output_____" ] ], [ [ "**NOTE:** We'll continue to use this same input function in later exercises. For more\ndetailed documentation of input functions and the `Dataset` API, see the [TensorFlow Programmer's Guide](https://www.tensorflow.org/programmers_guide/datasets).", "_____no_output_____" ], [ "### Step 5: Train the Model", "_____no_output_____" ], [ "We can now call `train()` on our `linear_regressor` to train the model. We'll wrap `my_input_fn` in a `lambda`\nso we can pass in `my_feature` and `targets` as arguments (see this [TensorFlow input function tutorial](https://www.tensorflow.org/get_started/input_fn#passing_input_fn_data_to_your_model) for more details), and to start, we'll\ntrain for 100 steps.", "_____no_output_____" ] ], [ [ "_ = linear_regressor.train(\n input_fn = lambda:my_input_fn(my_feature, targets),\n steps=100\n)", "_____no_output_____" ] ], [ [ "### Step 6: Evaluate the Model", "_____no_output_____" ] ], [ [ "_", "_____no_output_____" ] ], [ [ "Let's make predictions on that training data, to see how well our model fit it during training.\n\n**NOTE:** Training error measures how well your model fits the training data, but it **_does not_** measure how well your model **_generalizes to new data_**. In later exercises, you'll explore how to split your data to evaluate your model's ability to generalize.\n", "_____no_output_____" ] ], [ [ "# Create an input function for predictions.\n# Note: Since we're making just one prediction for each example, we don't \n# need to repeat or shuffle the data here.\nprediction_input_fn =lambda: my_input_fn(my_feature, targets, num_epochs=1, shuffle=False)\n\n# Call predict() on the linear_regressor to make predictions.\npredictions = linear_regressor.predict(input_fn=prediction_input_fn)\n\n# Format predictions as a NumPy array, so we can calculate error metrics.\npredictions = np.array([item['predictions'][0] for item in predictions])\n\n# Print Mean Squared Error and Root Mean Squared Error.\nmean_squared_error = metrics.mean_squared_error(predictions, targets)\nroot_mean_squared_error = math.sqrt(mean_squared_error)\nprint(\"Mean Squared Error (on training data): %0.3f\" % mean_squared_error)\nprint(\"Root Mean Squared Error (on training data): %0.3f\" % root_mean_squared_error)", "Mean Squared Error (on training data): 56367.025\nRoot Mean Squared Error (on training data): 237.417\n" ] ], [ [ "Is this a good model? How would you judge how large this error is?\n\nMean Squared Error (MSE) can be hard to interpret, so we often look at Root Mean Squared Error (RMSE)\ninstead. A nice property of RMSE is that it can be interpreted on the same scale as the original targets.\n\nLet's compare the RMSE to the difference of the min and max of our targets:", "_____no_output_____" ] ], [ [ "min_house_value = california_housing_dataframe[\"median_house_value\"].min()\nmax_house_value = california_housing_dataframe[\"median_house_value\"].max()\nmin_max_difference = max_house_value - min_house_value\n\nprint(\"Min. Median House Value: %0.3f\" % min_house_value)\nprint(\"Max. Median House Value: %0.3f\" % max_house_value)\nprint(\"Difference between Min. and Max.: %0.3f\" % min_max_difference)\nprint(\"Root Mean Squared Error: %0.3f\" % root_mean_squared_error)", "Min. Median House Value: 14.999\nMax. Median House Value: 500.001\nDifference between Min. and Max.: 485.002\nRoot Mean Squared Error: 237.417\n" ] ], [ [ "Our error spans nearly half the range of the target values. Can we do better?\n\nThis is the question that nags at every model developer. Let's develop some basic strategies to reduce model error.\n\nThe first thing we can do is take a look at how well our predictions match our targets, in terms of overall summary statistics.", "_____no_output_____" ] ], [ [ "calibration_data = pd.DataFrame()\ncalibration_data[\"predictions\"] = pd.Series(predictions)\ncalibration_data[\"targets\"] = pd.Series(targets)\ncalibration_data.describe()", "_____no_output_____" ] ], [ [ "Okay, maybe this information is helpful. How does the mean value compare to the model's RMSE? How about the various quantiles?\n\nWe can also visualize the data and the line we've learned. Recall that linear regression on a single feature can be drawn as a line mapping input *x* to output *y*.\n\nFirst, we'll get a uniform random sample of the data so we can make a readable scatter plot.", "_____no_output_____" ] ], [ [ "sample = california_housing_dataframe.sample(n=300)", "_____no_output_____" ] ], [ [ "Next, we'll plot the line we've learned, drawing from the model's bias term and feature weight, together with the scatter plot. The line will show up red.", "_____no_output_____" ] ], [ [ "# Get the min and max total_rooms values.\nx_0 = sample[\"total_rooms\"].min()\nx_1 = sample[\"total_rooms\"].max()\n\n# Retrieve the final weight and bias generated during training.\nweight = linear_regressor.get_variable_value('linear/linear_model/total_rooms/weights')[0]\nbias = linear_regressor.get_variable_value('linear/linear_model/bias_weights')\n\n# Get the predicted median_house_values for the min and max total_rooms values.\ny_0 = weight * x_0 + bias \ny_1 = weight * x_1 + bias\n\n# Plot our regression line from (x_0, y_0) to (x_1, y_1).\nplt.plot([x_0, x_1], [y_0, y_1], c='r')\n\n# Label the graph axes.\nplt.ylabel(\"median_house_value\")\nplt.xlabel(\"total_rooms\")\n\n# Plot a scatter plot from our data sample.\nplt.scatter(sample[\"total_rooms\"], sample[\"median_house_value\"])\n\n# Display graph.\nplt.show()", "_____no_output_____" ] ], [ [ "This initial line looks way off. See if you can look back at the summary stats and see the same information encoded there.\n\nTogether, these initial sanity checks suggest we may be able to find a much better line.", "_____no_output_____" ], [ "## Tweak the Model Hyperparameters\nFor this exercise, we've put all the above code in a single function for convenience. You can call the function with different parameters to see the effect.\n\nIn this function, we'll proceed in 10 evenly divided periods so that we can observe the model improvement at each period.\n\nFor each period, we'll compute and graph training loss. This may help you judge when a model is converged, or if it needs more iterations.\n\nWe'll also plot the feature weight and bias term values learned by the model over time. This is another way to see how things converge.", "_____no_output_____" ] ], [ [ "def train_model(learning_rate, steps, batch_size, input_feature=\"total_rooms\"):\n \"\"\"Trains a linear regression model of one feature.\n \n Args:\n learning_rate: A `float`, the learning rate.\n steps: A non-zero `int`, the total number of training steps. A training step\n consists of a forward and backward pass using a single batch.\n batch_size: A non-zero `int`, the batch size.\n input_feature: A `string` specifying a column from `california_housing_dataframe`\n to use as input feature.\n \"\"\"\n \n periods = 10\n steps_per_period = steps / periods\n\n my_feature = input_feature\n my_feature_data = california_housing_dataframe[[my_feature]]\n my_label = \"median_house_value\"\n targets = california_housing_dataframe[my_label]\n\n # Create feature columns.\n feature_columns = [tf.feature_column.numeric_column(my_feature)]\n \n # Create input functions.\n training_input_fn = lambda:my_input_fn(my_feature_data, targets, batch_size=batch_size)\n prediction_input_fn = lambda: my_input_fn(my_feature_data, targets, num_epochs=1, shuffle=False)\n \n # Create a linear regressor object.\n my_optimizer = tf.train.GradientDescentOptimizer(learning_rate=learning_rate)\n my_optimizer = tf.contrib.estimator.clip_gradients_by_norm(my_optimizer, 5.0)\n linear_regressor = tf.estimator.LinearRegressor(\n feature_columns=feature_columns,\n optimizer=my_optimizer\n )\n\n # Set up to plot the state of our model's line each period.\n plt.figure(figsize=(15, 6))\n plt.subplot(1, 2, 1)\n plt.title(\"Learned Line by Period\")\n plt.ylabel(my_label)\n plt.xlabel(my_feature)\n sample = california_housing_dataframe.sample(n=300)\n plt.scatter(sample[my_feature], sample[my_label])\n colors = [cm.coolwarm(x) for x in np.linspace(-1, 1, periods)]\n\n # Train the model, but do so inside a loop so that we can periodically assess\n # loss metrics.\n print(\"Training model...\")\n print(\"RMSE (on training data):\")\n root_mean_squared_errors = []\n for period in range (0, periods):\n # Train the model, starting from the prior state.\n linear_regressor.train(\n input_fn=training_input_fn,\n steps=steps_per_period\n )\n # Take a break and compute predictions.\n predictions = linear_regressor.predict(input_fn=prediction_input_fn)\n predictions = np.array([item['predictions'][0] for item in predictions])\n \n # Compute loss.\n root_mean_squared_error = math.sqrt(\n metrics.mean_squared_error(predictions, targets))\n # Occasionally print the current loss.\n print(\" period %02d : %0.2f\" % (period, root_mean_squared_error))\n # Add the loss metrics from this period to our list.\n root_mean_squared_errors.append(root_mean_squared_error)\n # Finally, track the weights and biases over time.\n # Apply some math to ensure that the data and line are plotted neatly.\n y_extents = np.array([0, sample[my_label].max()])\n \n weight = linear_regressor.get_variable_value('linear/linear_model/%s/weights' % input_feature)[0]\n bias = linear_regressor.get_variable_value('linear/linear_model/bias_weights')\n\n x_extents = (y_extents - bias) / weight\n x_extents = np.maximum(np.minimum(x_extents,\n sample[my_feature].max()),\n sample[my_feature].min())\n y_extents = weight * x_extents + bias\n plt.plot(x_extents, y_extents, color=colors[period]) \n print(\"Model training finished.\")\n\n # Output a graph of loss metrics over periods.\n plt.subplot(1, 2, 2)\n plt.ylabel('RMSE')\n plt.xlabel('Periods')\n plt.title(\"Root Mean Squared Error vs. Periods\")\n plt.tight_layout()\n plt.plot(root_mean_squared_errors)\n\n # Output a table with calibration data.\n calibration_data = pd.DataFrame()\n calibration_data[\"predictions\"] = pd.Series(predictions)\n calibration_data[\"targets\"] = pd.Series(targets)\n display.display(calibration_data.describe())\n\n print(\"Final RMSE (on training data): %0.2f\" % root_mean_squared_error)", "_____no_output_____" ] ], [ [ "## Task 1: Achieve an RMSE of 180 or Below\n\nTweak the model hyperparameters to improve loss and better match the target distribution.\nIf, after 5 minutes or so, you're having trouble beating a RMSE of 180, check the solution for a possible combination.", "_____no_output_____" ] ], [ [ "train_model(\n learning_rate=0.0001,\n steps=500,\n batch_size=100\n)", "Training model...\nRMSE (on training data):\n period 00 : 186.29\n period 01 : 167.02\n period 02 : 166.39\n period 03 : 166.39\n period 04 : 166.39\n period 05 : 166.73\n period 06 : 166.73\n period 07 : 166.39\n period 08 : 166.39\n period 09 : 166.73\nModel training finished.\n" ] ], [ [ "### Solution\n\nClick below for one possible solution.", "_____no_output_____" ] ], [ [ "train_model(\n learning_rate=0.00002,\n steps=500,\n batch_size=5\n)", "Training model...\nRMSE (on training data):\n period 00 : 225.63\n period 01 : 214.42\n period 02 : 204.04\n period 03 : 194.62\n period 04 : 186.92\n period 05 : 180.00\n period 06 : 174.79\n period 07 : 171.23\n period 08 : 169.08\n period 09 : 167.89\nModel training finished.\n" ] ], [ [ "This is just one possible configuration; there may be other combinations of settings that also give good results. Note that in general, this exercise isn't about finding the *one best* setting, but to help build your intutions about how tweaking the model configuration affects prediction quality.", "_____no_output_____" ], [ "### Is There a Standard Heuristic for Model Tuning?\n\nThis is a commonly asked question. The short answer is that the effects of different hyperparameters are data dependent. So there are no hard-and-fast rules; you'll need to test on your data.\n\nThat said, here are a few rules of thumb that may help guide you:\n\n * Training error should steadily decrease, steeply at first, and should eventually plateau as training converges.\n * If the training has not converged, try running it for longer.\n * If the training error decreases too slowly, increasing the learning rate may help it decrease faster.\n * But sometimes the exact opposite may happen if the learning rate is too high.\n * If the training error varies wildly, try decreasing the learning rate.\n * Lower learning rate plus larger number of steps or larger batch size is often a good combination.\n * Very small batch sizes can also cause instability. First try larger values like 100 or 1000, and decrease until you see degradation.\n\nAgain, never go strictly by these rules of thumb, because the effects are data dependent. Always experiment and verify.", "_____no_output_____" ], [ "## Task 2: Try a Different Feature\n\nSee if you can do any better by replacing the `total_rooms` feature with the `population` feature.\n\nDon't take more than 5 minutes on this portion.", "_____no_output_____" ] ], [ [ "# YOUR CODE HERE", "_____no_output_____" ] ], [ [ "### Solution\n\nClick below for one possible solution.", "_____no_output_____" ] ], [ [ "train_model(\n learning_rate=0.00002,\n steps=1000,\n batch_size=5,\n input_feature=\"population\"\n)", "Training model...\nRMSE (on training data):\n period 00 : 225.63\n period 01 : 214.62\n period 02 : 204.86\n period 03 : 196.75\n period 04 : 190.21\n period 05 : 185.13\n period 06 : 181.19\n period 07 : 178.67\n period 08 : 177.16\n period 09 : 176.26\nModel training finished.\n" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e5c1ffa4a06407b1da2eb6720ffa98d9526b66
378,774
ipynb
Jupyter Notebook
practice4/FullyConnectedNets_plus_bonus.ipynb
enliktjioe/nn2020
930ef4168ffbddbb5e81a782ba1328077a4f2525
[ "MIT" ]
null
null
null
practice4/FullyConnectedNets_plus_bonus.ipynb
enliktjioe/nn2020
930ef4168ffbddbb5e81a782ba1328077a4f2525
[ "MIT" ]
null
null
null
practice4/FullyConnectedNets_plus_bonus.ipynb
enliktjioe/nn2020
930ef4168ffbddbb5e81a782ba1328077a4f2525
[ "MIT" ]
null
null
null
238.672968
138,932
0.89823
[ [ [ "# Homework 4\n\nThe homework consists of two parts: theoretical part (5 pts) and coding part (25 pts).\n - All theoretical questions must be answered in your own words, do not copy-paste text from the internet. Points can be deducted for terrible formatting or incomprehensible English.\n - Code must be commented. If you use code you found online, you have to add the link to the source you used. There is no penalty for using outside sources as long as you convince us you understand the code.\n\n**You can earn up to 5 bonus points by completing the additional notebook about dropout.**\n\n*Once completed zip the entire directory containing this exercise and upload it to https://courses.cs.ut.ee/2020/nn/spring/Main/Practices.*", "_____no_output_____" ], [ "If you did this homework together with course mates, please write here their names (answers still have to be your own!).\n\n**Name(s):** fill this in if applicable", "_____no_output_____" ], [ "## Part 1: Lecture Materials (5 pts)\nThese theoretical questions are about the material covered in the lecture about \"Optimization and regularization\".\n\n### Optimization methods\n\n**Task 1.1: Optimization methods (3pt)**\n\nIn the coding task you will be asked to implement multiple improvements to the naive approach to the stochastic gradient descent (SGD). You can find the descriptions of the optimization methods at http://cs231n.github.io/neural-networks-3. Please find the following update rules from the document and explain in 1-2 sentences:\n* SGD with momentum. Explain what is $v$. Why might it be useful to use $v$ instead of $dx$ when updating the values of $x$.\n* RMSprop optimizer. Explain what the cache variable represents.\n* Adam optimizer, simplified form. Explain what is the difference with RMSProp", "_____no_output_____" ], [ "**Your Answer:**\n\n- 𝑣 means *velocity*. It might be useful compare to $dx$, because using only $dx$ can be pointed to inaccurate result or too large a step\n- The cache variable represent the accumulation of history of the squared gradients.\n- Adam can be looked as the combination of RMSProp and SGD with momentum. Using the squared gradients to scale the learning rate like RMSprop and also takes advantage of momentum by using moving average of the gradient.\n\n[Reference](https://towardsdatascience.com/adam-latest-trends-in-deep-learning-optimization-6be9a291375c)", "_____no_output_____" ], [ "**Task 1.2: Dropout basics (2pt)**\n\nWe are training a model with one hidden layer containing 10 hidden nodes. We use dropout on the nodes of that hidden layer, such that at each training step we drop out exactly 2 random nodes of that layer.\n* over many (millions) training steps how many different models do we use (how many different ways of dropping out exactly two nodes there is)? Notice that the order of dropping nodes does not matter!\n* When using this model at testing phase, with what constant do we need to multiply/divide the weights going out from this layer?", "_____no_output_____" ], [ "**Your Answer:**\n\n- USing this formula to calculate the combinations of the hiddens layer, $C(n,k)=\\frac{n!}{(n-k!)*k!}=\\frac{10!}{(10-8!)*8!}=45$\n- Weights need to be multiplied with the constant value of the proabibility of the nodes kept, `8/10 = 0.8`", "_____no_output_____" ], [ "# Part 2: practical tasks\n\n## Fully-Connected Neural Nets\n\nIn the previous homework you implemented a fully-connected two-layer neural network on CIFAR-10. The implementation was simple but not very modular since the loss and gradient were computed in a single monolithic function. This is manageable for a simple two-layer network, but would become impractical as we move to bigger models. Ideally we want to build networks using a more modular design so that we can implement different layer types in isolation and then snap them together into models with different architectures.\n\nIn this exercise we will implement fully-connected networks using a more modular approach. For each layer we will implement a `forward` and a `backward` function. The `forward` function will receive inputs, weights, and other parameters and will return both an output and a `cache` object storing data needed for the backward pass, like this:\n\n```python\ndef layer_forward(x, w):\n \"\"\" Receive inputs x and weights w \"\"\"\n # Do some computations ...\n z = # ... some intermediate value\n # Do some more computations ...\n out = # the output\n \n cache = (x, w, z, out) # Values we need to compute gradients\n \n return out, cache\n```\n\nThe backward pass will receive upstream derivatives and the `cache` object, and will return gradients with respect to the inputs and weights, like this:\n\n```python\ndef layer_backward(dout, cache):\n \"\"\"\n Receive derivative of loss with respect to outputs and cache,\n and compute derivative with respect to inputs.\n \"\"\"\n # Unpack cache values\n x, w, z, out = cache\n \n # Use values in cache to compute derivatives\n dx = # Derivative of loss with respect to x\n dw = # Derivative of loss with respect to w\n \n return dx, dw\n```\n\nAfter implementing a bunch of layers this way, we will be able to easily combine them to build classifiers with different architectures.\n\nFor additional background reading see http://cs231n.github.io/neural-networks-1/, http://cs231n.github.io/neural-networks-2/ and http://cs231n.github.io/neural-networks-3/.\n", "_____no_output_____" ] ], [ [ "# As usual, a bit of setup\nfrom __future__ import print_function\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom fc_net import *\nfrom data_utils import get_CIFAR10_data\nfrom gradient_check import eval_numerical_gradient, eval_numerical_gradient_array\nfrom solver import Solver\n\n%matplotlib inline\nplt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots\nplt.rcParams['image.interpolation'] = 'nearest'\nplt.rcParams['image.cmap'] = 'gray'\n\n# for auto-reloading external modules\n# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython\n%load_ext autoreload\n%autoreload 2\n\ndef rel_error(x, y):\n \"\"\" returns relative error \"\"\"\n return np.max(np.abs(x - y) / (np.maximum(1e-8, np.abs(x) + np.abs(y))))", "_____no_output_____" ], [ "# Load the (preprocessed) CIFAR10 data.\ndata = get_CIFAR10_data('../datasets/cifar-10-batches-py')\nfor k, v in list(data.items()):\n print(('%s: ' % k, v.shape))", "('X_train: ', (49000, 3, 32, 32))\n('y_train: ', (49000,))\n('X_val: ', (1000, 3, 32, 32))\n('y_val: ', (1000,))\n('X_test: ', (1000, 3, 32, 32))\n('y_test: ', (1000,))\n" ] ], [ [ "## Affine layer: foward\n\n**Task 2.1.1 (1pt):**\nOpen the file `layers.py` and implement the `affine_forward` function. Once you are done you can test your implementaion by running the following:", "_____no_output_____" ] ], [ [ "# Test the affine_forward function\n\nnum_inputs = 2\ninput_shape = (4, 5, 6)\noutput_dim = 3\n\ninput_size = num_inputs * np.prod(input_shape)\nweight_size = output_dim * np.prod(input_shape)\n\nx = np.linspace(-0.1, 0.5, num=input_size).reshape(num_inputs, *input_shape)\nw = np.linspace(-0.2, 0.3, num=weight_size).reshape(np.prod(input_shape), output_dim)\nb = np.linspace(-0.3, 0.1, num=output_dim)\n\nout, _ = affine_forward(x, w, b)\ncorrect_out = np.array([[ 1.49834967, 1.70660132, 1.91485297],\n [ 3.25553199, 3.5141327, 3.77273342]])\n\n# Compare your output with ours. The error should be around 1e-9.\nprint('Testing affine_forward function:')\nprint('difference: ', rel_error(out, correct_out))", "Testing affine_forward function:\ndifference: 9.7698500479884e-10\n" ] ], [ [ "## Affine layer: backward\n**Task 2.1.2 (1pt):**\nNow implement the `affine_backward` function and test your implementation using numeric gradient checking.", "_____no_output_____" ] ], [ [ "# Test the affine_backward function\nnp.random.seed(231)\nx = np.random.randn(10, 2, 3)\nw = np.random.randn(6, 5)\nb = np.random.randn(5)\ndout = np.random.randn(10, 5)\n\ndx_num = eval_numerical_gradient_array(lambda x: affine_forward(x, w, b)[0], x, dout)\ndw_num = eval_numerical_gradient_array(lambda w: affine_forward(x, w, b)[0], w, dout)\ndb_num = eval_numerical_gradient_array(lambda b: affine_forward(x, w, b)[0], b, dout)\n\n_, cache = affine_forward(x, w, b)\ndx, dw, db = affine_backward(dout, cache)\n\n# The error should be around 1e-10\nprint('Testing affine_backward function:')\nprint('dx error: ', rel_error(dx_num, dx))\nprint('dw error: ', rel_error(dw_num, dw))\nprint('db error: ', rel_error(db_num, db))", "Testing affine_backward function:\ndx error: 1.0908199508708189e-10\ndw error: 2.1752635504596857e-10\ndb error: 7.736978834487815e-12\n" ] ], [ [ "## ReLU layer: forward\n**Taks 2.1.3 (1pt):** Implement the forward pass for the ReLU activation function in the `relu_forward` function and test your implementation using the following:", "_____no_output_____" ] ], [ [ "# Test the relu_forward function\n\nx = np.linspace(-0.5, 0.5, num=12).reshape(3, 4)\n\nout, _ = relu_forward(x)\ncorrect_out = np.array([[ 0., 0., 0., 0., ],\n [ 0., 0., 0.04545455, 0.13636364,],\n [ 0.22727273, 0.31818182, 0.40909091, 0.5, ]])\n\n# Compare your output with ours. The error should be around 5e-8\nprint('Testing relu_forward function:')\nprint('difference: ', rel_error(out, correct_out))", "Testing relu_forward function:\ndifference: 4.999999798022158e-08\n" ] ], [ [ "## ReLU layer: backward\n**Task 2.1.4 (1pt):** Now implement the backward pass for the ReLU activation function in the `relu_backward` function and test your implementation using numeric gradient checking:", "_____no_output_____" ] ], [ [ "np.random.seed(231)\nx = np.random.randn(10, 10)\ndout = np.random.randn(*x.shape)\n\ndx_num = eval_numerical_gradient_array(lambda x: relu_forward(x)[0], x, dout)\n\n_, cache = relu_forward(x)\ndx = relu_backward(dout, cache)\n\n# The error should be around 3e-12\nprint('Testing relu_backward function:')\nprint('dx error: ', rel_error(dx_num, dx))", "Testing relu_backward function:\ndx error: 3.2756349136310288e-12\n" ] ], [ [ "## \"Sandwich\" layers\nThere are some common patterns of layers that are frequently used in neural nets. For example, affine layers are frequently followed by a ReLU nonlinearity. To make these common patterns easy, we define several convenience layers in the file `layer_utils.py`.\n\nFor now take a look at the `affine_relu_forward` and `affine_relu_backward` functions, and run the following to numerically gradient check the backward pass:", "_____no_output_____" ] ], [ [ "from layer_utils import affine_relu_forward, affine_relu_backward\nnp.random.seed(231)\nx = np.random.randn(2, 3, 4)\nw = np.random.randn(12, 10)\nb = np.random.randn(10)\ndout = np.random.randn(2, 10)\n\nout, cache = affine_relu_forward(x, w, b)\ndx, dw, db = affine_relu_backward(dout, cache)\n\ndx_num = eval_numerical_gradient_array(lambda x: affine_relu_forward(x, w, b)[0], x, dout)\ndw_num = eval_numerical_gradient_array(lambda w: affine_relu_forward(x, w, b)[0], w, dout)\ndb_num = eval_numerical_gradient_array(lambda b: affine_relu_forward(x, w, b)[0], b, dout)\n\nprint('Testing affine_relu_forward:')\nprint('dx error: ', rel_error(dx_num, dx))\nprint('dw error: ', rel_error(dw_num, dw))\nprint('db error: ', rel_error(db_num, db))", "Testing affine_relu_forward:\ndx error: 6.395535042049294e-11\ndw error: 8.162011105764925e-11\ndb error: 7.826724021458994e-12\n" ] ], [ [ "## Softmax loss layer\n\nYou implemented this loss function in the last assignment, so we'll give it to you for free here. You should still make sure you understand how they work by looking at the implementation in `layers.py`.\n\nYou can make sure that the implementations are correct by running the following:", "_____no_output_____" ] ], [ [ "np.random.seed(231)\nnum_classes, num_inputs = 10, 50\nx = 0.001 * np.random.randn(num_inputs, num_classes)\ny = np.random.randint(num_classes, size=num_inputs)\n\ndx_num = eval_numerical_gradient(lambda x: softmax_loss(x, y)[0], x, verbose=False)\nloss, dx = softmax_loss(x, y)\n\n# Test softmax_loss function. Loss should be 2.3 and dx error should be 1e-8\nprint('Testing softmax_loss:')\nprint('loss: ', loss)\nprint('dx error: ', rel_error(dx_num, dx))", "Testing softmax_loss:\nloss: 2.302545844500738\ndx error: 9.384673161989355e-09\n" ] ], [ [ "## Two-layer network\nIn the previous assignment you implemented a two-layer neural network in a single monolithic class. Now that you have implemented modular versions of the necessary layers, you will reimplement the two layer network using these modular implementations.\n\n**Task 2.2 (3pts):** Open the file `fc_net.py` and complete the implementation of the `TwoLayerNet` class. This class will serve as a model for the other networks you will implement in this assignment, so read through it to make sure you understand the API. You can run the cell below to test your implementation.", "_____no_output_____" ] ], [ [ "np.random.seed(231)\nN, D, H, C = 3, 5, 50, 7\nX = np.random.randn(N, D)\ny = np.random.randint(C, size=N)\n\nstd = 1e-3\nmodel = TwoLayerNet(input_dim=D, hidden_dim=H, num_classes=C, weight_scale=std)\n\nprint('Testing initialization ... ')\nW1_std = abs(model.params['W1'].std() - std)\nb1 = model.params['b1']\nW2_std = abs(model.params['W2'].std() - std)\nb2 = model.params['b2']\nassert W1_std < std / 10, 'First layer weights do not seem right'\nassert np.all(b1 == 0), 'First layer biases do not seem right'\nassert W2_std < std / 10, 'Second layer weights do not seem right'\nassert np.all(b2 == 0), 'Second layer biases do not seem right'\n\nprint('Testing test-time forward pass ... ')\nmodel.params['W1'] = np.linspace(-0.7, 0.3, num=D*H).reshape(D, H)\nmodel.params['b1'] = np.linspace(-0.1, 0.9, num=H)\nmodel.params['W2'] = np.linspace(-0.3, 0.4, num=H*C).reshape(H, C)\nmodel.params['b2'] = np.linspace(-0.9, 0.1, num=C)\nX = np.linspace(-5.5, 4.5, num=N*D).reshape(D, N).T\nscores = model.loss(X)\ncorrect_scores = np.asarray(\n [[11.53165108, 12.2917344, 13.05181771, 13.81190102, 14.57198434, 15.33206765, 16.09215096],\n [12.05769098, 12.74614105, 13.43459113, 14.1230412, 14.81149128, 15.49994135, 16.18839143],\n [12.58373087, 13.20054771, 13.81736455, 14.43418138, 15.05099822, 15.66781506, 16.2846319 ]])\nscores_diff = np.abs(scores - correct_scores).sum()\nassert scores_diff < 1e-6, 'Problem with test-time forward pass'\n\nprint('Testing training loss (no regularization)')\ny = np.asarray([0, 5, 1])\nloss, grads = model.loss(X, y)\ncorrect_loss = 3.4702243556\nassert abs(loss - correct_loss) < 1e-10, 'Problem with training-time loss'\n\nmodel.reg = 1.0\nloss, grads = model.loss(X, y)\ncorrect_loss = 26.5948426952\nassert abs(loss - correct_loss) < 1e-10, 'Problem with regularization loss'\n\nfor reg in [0.0, 0.7]:\n print('Running numeric gradient check with reg = ', reg)\n model.reg = reg\n loss, grads = model.loss(X, y)\n for name in sorted(grads):\n f = lambda _: model.loss(X, y)[0]\n grad_num = eval_numerical_gradient(f, model.params[name], verbose=False)\n print('%s relative error: %.2e' % (name, rel_error(grad_num, grads[name])))\n assert rel_error(grad_num, grads[name]) < 0.6, \"Error with gradient for \" + name", "Testing initialization ... \nTesting test-time forward pass ... \nTesting training loss (no regularization)\nRunning numeric gradient check with reg = 0.0\nW1 relative error: 1.22e-08\nW2 relative error: 3.17e-10\nb1 relative error: 6.19e-09\nb2 relative error: 4.33e-10\nRunning numeric gradient check with reg = 0.7\nW1 relative error: 2.53e-07\nW2 relative error: 1.37e-07\nb1 relative error: 1.56e-08\nb2 relative error: 9.09e-10\n" ] ], [ [ "## Solver\nIn the previous assignment, the logic for training models was coupled to the models themselves. Following a more modular design, for this assignment we have split the logic for training models into a separate class.\n\n**Task 2.3 (1pt):** Open the file `solver.py` and read through it to familiarize yourself with the API. After doing so, use a `Solver` instance to train a `TwoLayerNet` that achieves at least `50%` accuracy on the validation set.", "_____no_output_____" ] ], [ [ "model = TwoLayerNet()\nsolver = None\n\n##############################################################################\n# TODO: Use a Solver instance to train a TwoLayerNet that achieves at least #\n# 50% accuracy on the validation set. #\n##############################################################################\n# Use Solver instance with learning rate = 0.001, 20 epochs, and \n# batch size of 400 which gave the best accuracy\nsolver = Solver(model, data, update_rule = 'sgd',\n optim_config = {\n 'learning_rate': 1e-3,\n },\n lr_decay = 0.95,\n num_epochs = 20,\n batch_size = 400,\n print_every = 100\n )\n\nsolver.train()\n##############################################################################\n# END OF YOUR CODE #\n##############################################################################", "(Iteration 1 / 2440) loss: 2.304953\n(Epoch 0 / 20) train acc: 0.113000; val_acc: 0.081000\n(Iteration 101 / 2440) loss: 1.769195\n(Epoch 1 / 20) train acc: 0.375000; val_acc: 0.375000\n(Iteration 201 / 2440) loss: 1.669165\n(Epoch 2 / 20) train acc: 0.468000; val_acc: 0.455000\n(Iteration 301 / 2440) loss: 1.670013\n(Epoch 3 / 20) train acc: 0.453000; val_acc: 0.472000\n(Iteration 401 / 2440) loss: 1.558850\n(Epoch 4 / 20) train acc: 0.473000; val_acc: 0.479000\n(Iteration 501 / 2440) loss: 1.489412\n(Iteration 601 / 2440) loss: 1.365843\n(Epoch 5 / 20) train acc: 0.482000; val_acc: 0.483000\n(Iteration 701 / 2440) loss: 1.411090\n(Epoch 6 / 20) train acc: 0.543000; val_acc: 0.479000\n(Iteration 801 / 2440) loss: 1.260651\n(Epoch 7 / 20) train acc: 0.521000; val_acc: 0.491000\n(Iteration 901 / 2440) loss: 1.318146\n(Epoch 8 / 20) train acc: 0.547000; val_acc: 0.492000\n(Iteration 1001 / 2440) loss: 1.344013\n(Epoch 9 / 20) train acc: 0.528000; val_acc: 0.502000\n(Iteration 1101 / 2440) loss: 1.342403\n(Iteration 1201 / 2440) loss: 1.257451\n(Epoch 10 / 20) train acc: 0.552000; val_acc: 0.519000\n(Iteration 1301 / 2440) loss: 1.314607\n(Epoch 11 / 20) train acc: 0.554000; val_acc: 0.513000\n(Iteration 1401 / 2440) loss: 1.260950\n(Epoch 12 / 20) train acc: 0.569000; val_acc: 0.528000\n(Iteration 1501 / 2440) loss: 1.294013\n(Epoch 13 / 20) train acc: 0.581000; val_acc: 0.516000\n(Iteration 1601 / 2440) loss: 1.206977\n(Iteration 1701 / 2440) loss: 1.250007\n(Epoch 14 / 20) train acc: 0.584000; val_acc: 0.515000\n(Iteration 1801 / 2440) loss: 1.285593\n(Epoch 15 / 20) train acc: 0.585000; val_acc: 0.528000\n(Iteration 1901 / 2440) loss: 1.309243\n(Epoch 16 / 20) train acc: 0.587000; val_acc: 0.523000\n(Iteration 2001 / 2440) loss: 1.150673\n(Epoch 17 / 20) train acc: 0.571000; val_acc: 0.528000\n(Iteration 2101 / 2440) loss: 1.183055\n(Epoch 18 / 20) train acc: 0.575000; val_acc: 0.539000\n(Iteration 2201 / 2440) loss: 1.144189\n(Iteration 2301 / 2440) loss: 1.186106\n(Epoch 19 / 20) train acc: 0.594000; val_acc: 0.524000\n(Iteration 2401 / 2440) loss: 1.162940\n(Epoch 20 / 20) train acc: 0.608000; val_acc: 0.528000\n" ], [ "# Run this cell to visualize training loss and train / val accuracy\n\nplt.subplot(2, 1, 1)\nplt.title('Training loss')\nplt.plot(solver.loss_history, 'o')\nplt.xlabel('Iteration')\n\nplt.subplot(2, 1, 2)\nplt.title('Accuracy')\nplt.plot(solver.train_acc_history, '-o', label='train')\nplt.plot(solver.val_acc_history, '-o', label='val')\nplt.plot([0.5] * len(solver.val_acc_history), 'k--')\nplt.xlabel('Epoch')\nplt.legend(loc='lower right')\nplt.gcf().set_size_inches(15, 12)\nplt.show()", "_____no_output_____" ] ], [ [ "## Multilayer network\nNext you will implement a fully-connected network with an arbitrary number of hidden layers. Read through the `FullyConnectedNet` class in the file `fc_net.py`.\n\n**Task 2.4.1 (6pts):** Implement the initialization, the forward pass, and the backward pass. For the moment don't worry about implementing dropout or batch normalization; we will add those features soon.", "_____no_output_____" ], [ "### Initial loss and gradient check", "_____no_output_____" ], [ "As a sanity check, run the following to check the initial loss and to gradient check the network both with and without regularization. Do the initial losses seem reasonable?\n\nFor gradient checking, you should expect to see errors around 1e-6 or less.", "_____no_output_____" ] ], [ [ "np.random.seed(231)\nN, D, H1, H2, C = 2, 15, 20, 30, 10\nX = np.random.randn(N, D)\ny = np.random.randint(C, size=(N,))\n\nfor reg in [0, 3.14]:\n print('Running check with reg = ', reg)\n model = FullyConnectedNet([H1, H2], input_dim=D, num_classes=C,\n reg=reg, weight_scale=5e-2, dtype=np.float64)\n\n loss, grads = model.loss(X, y)\n print('Initial loss: ', loss)\n\n for name in sorted(grads):\n f = lambda _: model.loss(X, y)[0]\n grad_num = eval_numerical_gradient(f, model.params[name], verbose=False, h=1e-5)\n print('%s relative error: %.2e' % (name, rel_error(grad_num, grads[name])))\n assert rel_error(grad_num, grads[name]) < 1e-4", "Running check with reg = 0\nInitial loss: 2.3004790897684924\nW1 relative error: 1.48e-07\nW2 relative error: 2.21e-05\nW3 relative error: 3.53e-07\nb1 relative error: 5.38e-09\nb2 relative error: 2.09e-09\nb3 relative error: 5.80e-11\nRunning check with reg = 3.14\nInitial loss: 7.052114776533016\nW1 relative error: 6.86e-09\nW2 relative error: 3.52e-08\nW3 relative error: 1.32e-08\nb1 relative error: 1.48e-08\nb2 relative error: 1.72e-09\nb3 relative error: 1.80e-10\n" ] ], [ [ "**Task 2.4.2 (1pt):** As another sanity check, make sure you can overfit a small dataset of 50 images. First we will try a three-layer network with 100 units in each hidden layer. You will need to tweak the learning rate and initialization scale, but you should be able to overfit and achieve 100% training accuracy within 20 epochs.", "_____no_output_____" ] ], [ [ "# TODO: Use a three-layer Net to overfit 50 training examples.\n\nnum_train = 50\nsmall_data = {\n 'X_train': data['X_train'][:num_train],\n 'y_train': data['y_train'][:num_train],\n 'X_val': data['X_val'],\n 'y_val': data['y_val'],\n}\n\n# weight_scale = 1e-2\n# learning_rate = 1e-4\n\n# after several test with many values, this value give the best combination to be able to overfit the data \n# and achieve 100% training accuracy\nweight_scale = 1e-1\nlearning_rate = 1e-3\nmodel = FullyConnectedNet([100, 100],\n weight_scale=weight_scale, dtype=np.float64)\nsolver = Solver(model, small_data,\n print_every=10, num_epochs=20, batch_size=25,\n update_rule='sgd',\n optim_config={\n 'learning_rate': learning_rate,\n }\n )\nsolver.train()\n\nplt.plot(solver.loss_history, 'o')\nplt.title('Training loss history')\nplt.xlabel('Iteration')\nplt.ylabel('Training loss')\nplt.show()", "(Iteration 1 / 40) loss: 357.428290\n(Epoch 0 / 20) train acc: 0.220000; val_acc: 0.111000\n(Epoch 1 / 20) train acc: 0.380000; val_acc: 0.141000\n(Epoch 2 / 20) train acc: 0.520000; val_acc: 0.138000\n(Epoch 3 / 20) train acc: 0.740000; val_acc: 0.130000\n(Epoch 4 / 20) train acc: 0.820000; val_acc: 0.153000\n(Epoch 5 / 20) train acc: 0.860000; val_acc: 0.175000\n(Iteration 11 / 40) loss: 6.726589\n(Epoch 6 / 20) train acc: 0.940000; val_acc: 0.163000\n(Epoch 7 / 20) train acc: 0.960000; val_acc: 0.166000\n(Epoch 8 / 20) train acc: 0.960000; val_acc: 0.164000\n(Epoch 9 / 20) train acc: 0.980000; val_acc: 0.162000\n(Epoch 10 / 20) train acc: 0.980000; val_acc: 0.162000\n(Iteration 21 / 40) loss: 0.800243\n(Epoch 11 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 12 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 13 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 14 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 15 / 20) train acc: 1.000000; val_acc: 0.158000\n(Iteration 31 / 40) loss: 0.000000\n(Epoch 16 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 17 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 18 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 19 / 20) train acc: 1.000000; val_acc: 0.158000\n(Epoch 20 / 20) train acc: 1.000000; val_acc: 0.158000\n" ] ], [ [ "**Task 2.4.2 (1pt):** Now try to use a five-layer network with 100 units on each layer to overfit 50 training examples. Again you will have to adjust the learning rate and weight initialization, but you should be able to achieve 100% training accuracy within 20 epochs.", "_____no_output_____" ] ], [ [ "# TODO: Use a five-layer Net to overfit 50 training examples.\n\nnum_train = 50\nsmall_data = {\n 'X_train': data['X_train'][:num_train],\n 'y_train': data['y_train'][:num_train],\n 'X_val': data['X_val'],\n 'y_val': data['y_val'],\n}\n\n# learning_rate = 1e-3\n# weight_scale = 1e-5\n\n# Found the best combination learning rate and weight scale to achieve 100$ training accuracy (overfit)\nlearning_rate = 1e-3 \nweight_scale = 1e-1\nmodel = FullyConnectedNet([100, 100, 100, 100],\n weight_scale=weight_scale, dtype=np.float64)\nsolver = Solver(model, small_data,\n print_every=10, num_epochs=20, batch_size=25,\n update_rule='sgd',\n optim_config={\n 'learning_rate': learning_rate,\n }\n )\nsolver.train()\n\nplt.plot(solver.loss_history, 'o')\nplt.title('Training loss history')\nplt.xlabel('Iteration')\nplt.ylabel('Training loss')\nplt.show()", "(Iteration 1 / 40) loss: 166.501707\n(Epoch 0 / 20) train acc: 0.220000; val_acc: 0.116000\n(Epoch 1 / 20) train acc: 0.240000; val_acc: 0.083000\n(Epoch 2 / 20) train acc: 0.160000; val_acc: 0.104000\n(Epoch 3 / 20) train acc: 0.520000; val_acc: 0.106000\n(Epoch 4 / 20) train acc: 0.700000; val_acc: 0.131000\n(Epoch 5 / 20) train acc: 0.700000; val_acc: 0.116000\n(Iteration 11 / 40) loss: 4.414592\n(Epoch 6 / 20) train acc: 0.840000; val_acc: 0.114000\n(Epoch 7 / 20) train acc: 0.880000; val_acc: 0.108000\n(Epoch 8 / 20) train acc: 0.900000; val_acc: 0.109000\n(Epoch 9 / 20) train acc: 0.960000; val_acc: 0.114000\n(Epoch 10 / 20) train acc: 0.980000; val_acc: 0.127000\n(Iteration 21 / 40) loss: 0.261098\n(Epoch 11 / 20) train acc: 1.000000; val_acc: 0.126000\n(Epoch 12 / 20) train acc: 1.000000; val_acc: 0.124000\n(Epoch 13 / 20) train acc: 1.000000; val_acc: 0.124000\n(Epoch 14 / 20) train acc: 1.000000; val_acc: 0.124000\n(Epoch 15 / 20) train acc: 1.000000; val_acc: 0.125000\n(Iteration 31 / 40) loss: 0.000594\n(Epoch 16 / 20) train acc: 1.000000; val_acc: 0.125000\n(Epoch 17 / 20) train acc: 1.000000; val_acc: 0.125000\n(Epoch 18 / 20) train acc: 1.000000; val_acc: 0.125000\n(Epoch 19 / 20) train acc: 1.000000; val_acc: 0.125000\n(Epoch 20 / 20) train acc: 1.000000; val_acc: 0.125000\n" ] ], [ [ "**Task 2.4.2 (2pt):** Did you notice anything about the comparative difficulty of training the three-layer net vs training the five layer net?\n\n**Your Answer:** \n\n- Five-layer network is more sensitive to small changes in comparison with three-layer network\n- With the same weight scale and learning rate, the process of overfitting data using five-layer network is slower compare to three-layer network.", "_____no_output_____" ], [ "# Update rules\nSo far we have used vanilla stochastic gradient descent (SGD) as our update rule. More sophisticated update rules can make it easier to train deep networks. We will implement a few of the most commonly used update rules and compare them to vanilla SGD.\n\nNotice that in the **theory homework**, the first question is also about update rules. You might find it useful to complete the theory in parallel.", "_____no_output_____" ], [ "## SGD+Momentum\nStochastic gradient descent with momentum is a widely used update rule that tends to make deep networks converge faster than vanilla stochstic gradient descent.\n\n**Task 2.5.1 (1pt):** Open the file `optim.py` and read the documentation at the top of the file to make sure you understand the API. Implement the SGD+momentum update rule in the function `sgd_momentum` and run the following to check your implementation. You should see errors less than 1e-8.", "_____no_output_____" ] ], [ [ "from optim import sgd_momentum\n\nN, D = 4, 5\nw = np.linspace(-0.4, 0.6, num=N*D).reshape(N, D)\ndw = np.linspace(-0.6, 0.4, num=N*D).reshape(N, D)\nv = np.linspace(0.6, 0.9, num=N*D).reshape(N, D)\n\nconfig = {'learning_rate': 1e-3, 'velocity': v}\nnext_w, _ = sgd_momentum(w, dw, config=config)\n\nexpected_next_w = np.asarray([\n [ 0.1406, 0.20738947, 0.27417895, 0.34096842, 0.40775789],\n [ 0.47454737, 0.54133684, 0.60812632, 0.67491579, 0.74170526],\n [ 0.80849474, 0.87528421, 0.94207368, 1.00886316, 1.07565263],\n [ 1.14244211, 1.20923158, 1.27602105, 1.34281053, 1.4096 ]])\nexpected_velocity = np.asarray([\n [ 0.5406, 0.55475789, 0.56891579, 0.58307368, 0.59723158],\n [ 0.61138947, 0.62554737, 0.63970526, 0.65386316, 0.66802105],\n [ 0.68217895, 0.69633684, 0.71049474, 0.72465263, 0.73881053],\n [ 0.75296842, 0.76712632, 0.78128421, 0.79544211, 0.8096 ]])\n\nprint('next_w error: ', rel_error(next_w, expected_next_w))\nprint('velocity error: ', rel_error(expected_velocity, config['velocity']))", "next_w error: 8.882347033505819e-09\nvelocity error: 4.269287743278663e-09\n" ] ], [ [ "Once you have done so, run the following to train a six-layer network with both SGD and SGD+momentum. You should see the SGD+momentum update rule converge faster.", "_____no_output_____" ] ], [ [ "num_train = 4000\nsmall_data = {\n 'X_train': data['X_train'][:num_train],\n 'y_train': data['y_train'][:num_train],\n 'X_val': data['X_val'],\n 'y_val': data['y_val'],\n}\n\nsolvers = {}\n\nfor update_rule in ['sgd', 'sgd_momentum']:\n print('running with ', update_rule)\n model = FullyConnectedNet([100, 100, 100, 100, 100], weight_scale=5e-2)\n\n solver = Solver(model, small_data,\n num_epochs=5, batch_size=100,\n update_rule=update_rule,\n optim_config={'learning_rate': 1e-2,},\n verbose=True)\n solvers[update_rule] = solver\n solver.train()\n print()\n\nplt.subplot(3, 1, 1)\nplt.title('Training loss')\nplt.xlabel('Iteration')\n\nplt.subplot(3, 1, 2)\nplt.title('Training accuracy')\nplt.xlabel('Epoch')\n\nplt.subplot(3, 1, 3)\nplt.title('Validation accuracy')\nplt.xlabel('Epoch')\n\nfor update_rule, solver in list(solvers.items()):\n plt.subplot(3, 1, 1)\n plt.plot(solver.loss_history, 'o', label=update_rule)\n \n plt.subplot(3, 1, 2)\n plt.plot(solver.train_acc_history, '-o', label=update_rule)\n\n plt.subplot(3, 1, 3)\n plt.plot(solver.val_acc_history, '-o', label=update_rule)\n\nfor i in [1, 2, 3]:\n plt.subplot(3, 1, i)\n plt.legend(loc='upper center', ncol=4)\n\nplt.gcf().set_size_inches(15, 15)\nplt.show()", "running with sgd\n(Iteration 1 / 200) loss: 2.559978\n(Epoch 0 / 5) train acc: 0.103000; val_acc: 0.108000\n(Iteration 11 / 200) loss: 2.291086\n(Iteration 21 / 200) loss: 2.153591\n(Iteration 31 / 200) loss: 2.082693\n(Epoch 1 / 5) train acc: 0.277000; val_acc: 0.242000\n(Iteration 41 / 200) loss: 2.004171\n(Iteration 51 / 200) loss: 2.010409\n(Iteration 61 / 200) loss: 2.023753\n(Iteration 71 / 200) loss: 2.026621\n(Epoch 2 / 5) train acc: 0.352000; val_acc: 0.312000\n(Iteration 81 / 200) loss: 1.807163\n(Iteration 91 / 200) loss: 1.914256\n(Iteration 101 / 200) loss: 1.917177\n(Iteration 111 / 200) loss: 1.706193\n(Epoch 3 / 5) train acc: 0.405000; val_acc: 0.322000\n(Iteration 121 / 200) loss: 1.697994\n(Iteration 131 / 200) loss: 1.768837\n(Iteration 141 / 200) loss: 1.784967\n(Iteration 151 / 200) loss: 1.823291\n(Epoch 4 / 5) train acc: 0.431000; val_acc: 0.324000\n(Iteration 161 / 200) loss: 1.626499\n(Iteration 171 / 200) loss: 1.901366\n(Iteration 181 / 200) loss: 1.549513\n(Iteration 191 / 200) loss: 1.712569\n(Epoch 5 / 5) train acc: 0.431000; val_acc: 0.330000\n\nrunning with sgd_momentum\n(Iteration 1 / 200) loss: 3.153778\n(Epoch 0 / 5) train acc: 0.105000; val_acc: 0.093000\n(Iteration 11 / 200) loss: 2.145874\n(Iteration 21 / 200) loss: 2.032563\n(Iteration 31 / 200) loss: 1.985848\n(Epoch 1 / 5) train acc: 0.311000; val_acc: 0.281000\n(Iteration 41 / 200) loss: 1.882354\n(Iteration 51 / 200) loss: 1.855372\n(Iteration 61 / 200) loss: 1.649133\n(Iteration 71 / 200) loss: 1.806432\n(Epoch 2 / 5) train acc: 0.415000; val_acc: 0.324000\n(Iteration 81 / 200) loss: 1.907840\n(Iteration 91 / 200) loss: 1.510681\n(Iteration 101 / 200) loss: 1.546872\n(Iteration 111 / 200) loss: 1.512047\n(Epoch 3 / 5) train acc: 0.434000; val_acc: 0.321000\n(Iteration 121 / 200) loss: 1.677301\n(Iteration 131 / 200) loss: 1.504686\n(Iteration 141 / 200) loss: 1.633253\n(Iteration 151 / 200) loss: 1.745081\n(Epoch 4 / 5) train acc: 0.460000; val_acc: 0.353000\n(Iteration 161 / 200) loss: 1.485411\n(Iteration 171 / 200) loss: 1.610416\n(Iteration 181 / 200) loss: 1.528331\n(Iteration 191 / 200) loss: 1.447239\n(Epoch 5 / 5) train acc: 0.515000; val_acc: 0.384000\n\n" ] ], [ [ "## RMSProp and Adam\nRMSProp [1] and Adam [2] are update rules that set per-parameter learning rates by using a running average of the second moments of gradients.\n\n**Task 2.5.2 (4pts):** In the file `optim.py`, implement the RMSProp update rule in the `rmsprop` function and implement the Adam update rule in the `adam` function, and check your implementations using the tests below.\n\n[1] Tijmen Tieleman and Geoffrey Hinton. \"Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude.\" COURSERA: Neural Networks for Machine Learning 4 (2012).\n\n[2] Diederik Kingma and Jimmy Ba, \"Adam: A Method for Stochastic Optimization\", ICLR 2015.", "_____no_output_____" ] ], [ [ "# Test RMSProp implementation; you should see errors less than 1e-7\nfrom optim import rmsprop\n\nN, D = 4, 5\nw = np.linspace(-0.4, 0.6, num=N*D).reshape(N, D)\ndw = np.linspace(-0.6, 0.4, num=N*D).reshape(N, D)\ncache = np.linspace(0.6, 0.9, num=N*D).reshape(N, D)\n\nconfig = {'learning_rate': 1e-2, 'cache': cache}\nnext_w, _ = rmsprop(w, dw, config=config)\n\nexpected_next_w = np.asarray([\n [-0.39223849, -0.34037513, -0.28849239, -0.23659121, -0.18467247],\n [-0.132737, -0.08078555, -0.02881884, 0.02316247, 0.07515774],\n [ 0.12716641, 0.17918792, 0.23122175, 0.28326742, 0.33532447],\n [ 0.38739248, 0.43947102, 0.49155973, 0.54365823, 0.59576619]])\nexpected_cache = np.asarray([\n [ 0.5976, 0.6126277, 0.6277108, 0.64284931, 0.65804321],\n [ 0.67329252, 0.68859723, 0.70395734, 0.71937285, 0.73484377],\n [ 0.75037008, 0.7659518, 0.78158892, 0.79728144, 0.81302936],\n [ 0.82883269, 0.84469141, 0.86060554, 0.87657507, 0.8926 ]])\n\nprint('next_w error: ', rel_error(expected_next_w, next_w))\nprint('cache error: ', rel_error(expected_cache, config['cache']))", "next_w error: 9.524687511038133e-08\ncache error: 2.6477955807156126e-09\n" ], [ "# Test Adam implementation; you should see errors around 1e-7 or less\nfrom optim import adam\n\nN, D = 4, 5\nw = np.linspace(-0.4, 0.6, num=N*D).reshape(N, D)\ndw = np.linspace(-0.6, 0.4, num=N*D).reshape(N, D)\nm = np.linspace(0.6, 0.9, num=N*D).reshape(N, D)\nv = np.linspace(0.7, 0.5, num=N*D).reshape(N, D)\n\nconfig = {'learning_rate': 1e-2, 'm': m, 'v': v, 't': 5}\nnext_w, _ = adam(w, dw, config=config)\n#print(next_w)\n#print(config)\nexpected_next_w = np.asarray([\n [-0.40094747, -0.34836187, -0.29577703, -0.24319299, -0.19060977],\n [-0.1380274, -0.08544591, -0.03286534, 0.01971428, 0.0722929],\n [ 0.1248705, 0.17744702, 0.23002243, 0.28259667, 0.33516969],\n [ 0.38774145, 0.44031188, 0.49288093, 0.54544852, 0.59801459]])\nexpected_v = np.asarray([\n [ 0.69966, 0.68908382, 0.67851319, 0.66794809, 0.65738853,],\n [ 0.64683452, 0.63628604, 0.6257431, 0.61520571, 0.60467385,],\n [ 0.59414753, 0.58362676, 0.57311152, 0.56260183, 0.55209767,],\n [ 0.54159906, 0.53110598, 0.52061845, 0.51013645, 0.49966, ]])\nexpected_m = np.asarray([\n [ 0.48, 0.49947368, 0.51894737, 0.53842105, 0.55789474],\n [ 0.57736842, 0.59684211, 0.61631579, 0.63578947, 0.65526316],\n [ 0.67473684, 0.69421053, 0.71368421, 0.73315789, 0.75263158],\n [ 0.77210526, 0.79157895, 0.81105263, 0.83052632, 0.85 ]])\n\nprint('next_w error: ', rel_error(expected_next_w, next_w))\nprint('v error: ', rel_error(expected_v, config['v']))\nprint('m error: ', rel_error(expected_m, config['m']))", "next_w error: 1.1395691798535431e-07\nv error: 4.208314038113071e-09\nm error: 4.214963193114416e-09\n" ] ], [ [ "Once you have debugged your RMSProp and Adam implementations, run the following to train a pair of deep networks using these new update rules:", "_____no_output_____" ] ], [ [ "learning_rates = {'rmsprop': 1e-4, 'adam': 1e-3}\nfor update_rule in ['adam', 'rmsprop']:\n print('running with ', update_rule)\n model = FullyConnectedNet([100, 100, 100, 100, 100], weight_scale=5e-2)\n\n solver = Solver(model, small_data,\n num_epochs=5, batch_size=100,\n update_rule=update_rule,\n optim_config={'learning_rate': learning_rates[update_rule]},\n verbose=True)\n solvers[update_rule] = solver\n solver.train()\n print()\n\nplt.subplot(3, 1, 1)\nplt.title('Training loss')\nplt.xlabel('Iteration')\n\nplt.subplot(3, 1, 2)\nplt.title('Training accuracy')\nplt.xlabel('Epoch')\n\nplt.subplot(3, 1, 3)\nplt.title('Validation accuracy')\nplt.xlabel('Epoch')\n\nfor update_rule, solver in list(solvers.items()):\n plt.subplot(3, 1, 1)\n plt.plot(solver.loss_history, 'o', label=update_rule)\n \n plt.subplot(3, 1, 2)\n plt.plot(solver.train_acc_history, '-o', label=update_rule)\n\n plt.subplot(3, 1, 3)\n plt.plot(solver.val_acc_history, '-o', label=update_rule)\n\nfor i in [1, 2, 3]:\n plt.subplot(3, 1, i)\n plt.legend(loc='upper center', ncol=4)\n\nplt.gcf().set_size_inches(15, 15)\nplt.show()", "running with adam\n(Iteration 1 / 200) loss: 3.476928\n(Epoch 0 / 5) train acc: 0.143000; val_acc: 0.114000\n(Iteration 11 / 200) loss: 2.089203\n(Iteration 21 / 200) loss: 2.211850\n(Iteration 31 / 200) loss: 1.786014\n(Epoch 1 / 5) train acc: 0.393000; val_acc: 0.340000\n(Iteration 41 / 200) loss: 1.743813\n(Iteration 51 / 200) loss: 1.752164\n(Iteration 61 / 200) loss: 2.095686\n(Iteration 71 / 200) loss: 1.489003\n(Epoch 2 / 5) train acc: 0.411000; val_acc: 0.357000\n(Iteration 81 / 200) loss: 1.546641\n(Iteration 91 / 200) loss: 1.412224\n(Iteration 101 / 200) loss: 1.401821\n(Iteration 111 / 200) loss: 1.521807\n(Epoch 3 / 5) train acc: 0.494000; val_acc: 0.368000\n(Iteration 121 / 200) loss: 1.237183\n(Iteration 131 / 200) loss: 1.466022\n(Iteration 141 / 200) loss: 1.284994\n(Iteration 151 / 200) loss: 1.466689\n(Epoch 4 / 5) train acc: 0.529000; val_acc: 0.383000\n(Iteration 161 / 200) loss: 1.405442\n(Iteration 171 / 200) loss: 1.270982\n(Iteration 181 / 200) loss: 1.276394\n(Iteration 191 / 200) loss: 1.170272\n(Epoch 5 / 5) train acc: 0.582000; val_acc: 0.375000\n\nrunning with rmsprop\n(Iteration 1 / 200) loss: 2.589166\n(Epoch 0 / 5) train acc: 0.119000; val_acc: 0.146000\n(Iteration 11 / 200) loss: 2.039570\n(Iteration 21 / 200) loss: 1.897350\n(Iteration 31 / 200) loss: 1.763338\n(Epoch 1 / 5) train acc: 0.382000; val_acc: 0.326000\n(Iteration 41 / 200) loss: 1.893851\n(Iteration 51 / 200) loss: 1.715673\n(Iteration 61 / 200) loss: 1.473092\n(Iteration 71 / 200) loss: 1.602196\n(Epoch 2 / 5) train acc: 0.434000; val_acc: 0.341000\n(Iteration 81 / 200) loss: 1.501205\n(Iteration 91 / 200) loss: 1.629006\n(Iteration 101 / 200) loss: 1.516101\n(Iteration 111 / 200) loss: 1.555156\n(Epoch 3 / 5) train acc: 0.469000; val_acc: 0.362000\n(Iteration 121 / 200) loss: 1.508093\n(Iteration 131 / 200) loss: 1.543763\n(Iteration 141 / 200) loss: 1.537697\n(Iteration 151 / 200) loss: 1.698558\n(Epoch 4 / 5) train acc: 0.518000; val_acc: 0.367000\n(Iteration 161 / 200) loss: 1.596201\n(Iteration 171 / 200) loss: 1.451059\n(Iteration 181 / 200) loss: 1.526125\n(Iteration 191 / 200) loss: 1.354783\n(Epoch 5 / 5) train acc: 0.523000; val_acc: 0.370000\n\n" ] ], [ [ "## Train a good model!\n\n**Task 2.6 (2pts):** Train the best fully-connected model that you can on CIFAR-10, storing your best model in the `best_model` variable. We require you to get at least 50% accuracy on the validation set using a fully-connected net.\n\nIf you are careful it should be possible to get accuracies above 55%, but we don't require it for this part and won't assign extra credit for doing so. Later in the assignment we will ask you to train the best convolutional network that you can on CIFAR-10, and we would prefer that you spend your effort working on convolutional nets rather than fully-connected nets.\n\n**Bonus points:** You might find it useful to complete the `Dropout.ipynb` notebook before completing this part, since this technique can help you train powerful models.", "_____no_output_____" ] ], [ [ "best_model = None\n################################################################################\n# TODO: Train the best FullyConnectedNet that you can on CIFAR-10. You might #\n# batch normalization and dropout useful. Store your best model in the #\n# best_model variable. #\n################################################################################\nresults={}\nbest_val=-1\n\nlearning_rate=[3e-4]#[1e-2,1e-3,1e-4]#[2e-2,2e-3,2e-4]#[3e-2,3e-3,3e-4] \nweight_scale= [2.5e-2] #[1e-3,1e-2,1e-3]#[2e-2,2e-3,2e-4]\ndropouts=[0.9]#[0.5,0.6,0.7]#[0.7,0.8,0.9]\n#Loop through different learning rates\nfor i in learning_rate:\n #Loop through different weight_scales\n for j in weight_scale:\n #Loop through different dropout probabilites\n for k in dropouts:\n print('Running: Learning rate: %e Weight scale: %e Dropout: %e'%(i,j,k) )\n #Set up the model accordingly\n model = FullyConnectedNet([100, 100, 100, 100, 100],dropout=k,weight_scale=j,reg=1e-2)\n # Configure the solver\n solver = Solver(model, data,lr_decay=0.9,\n num_epochs=10, batch_size=30,\n update_rule='adam',\n optim_config={'learning_rate': i,},\n verbose=True,print_every=400)\n # Train the model\n solver.train()\n #Fetch last training & validation accuracy\n validation_accuracy=solver.val_acc_history[-1]\n training_accuracy=solver.train_acc_history[-1]\n #Store results in a container\n results[(i,j,k)]=training_accuracy,validation_accuracy\n # Once validation accuracy is higher than current bes\n if best_val <validation_accuracy:\n # Update best validatioin accuracy\n best_val = validation_accuracy\n # Update best network\n best_model=model \n print('Done. Training Accuracy: %f, Validation Accuracy: %f'%(training_accuracy,validation_accuracy))\n \n#Loop to print out the results of above loop\nfor i,j,k in sorted(results):\n train_accuracy,val_accuracy=results[(i,j,k)]\n print ('Learning rate: %e Weight scale: %e Dropout: %e Train accuracy: %f, Validation accuracy: %f' % (i, j, k, train_accuracy, val_accuracy))\n\n################################################################################\n# END OF YOUR CODE #\n################################################################################", "Running: Learning rate: 3.000000e-04 Weight scale: 2.500000e-02 Dropout: 9.000000e-01\n(Iteration 1 / 16330) loss: 3.387063\n(Epoch 0 / 10) train acc: 0.080000; val_acc: 0.112000\n(Iteration 401 / 16330) loss: 2.038029\n(Iteration 801 / 16330) loss: 1.914008\n(Iteration 1201 / 16330) loss: 1.880346\n(Iteration 1601 / 16330) loss: 1.596147\n(Epoch 1 / 10) train acc: 0.400000; val_acc: 0.423000\n(Iteration 2001 / 16330) loss: 1.896053\n(Iteration 2401 / 16330) loss: 1.877945\n(Iteration 2801 / 16330) loss: 1.560352\n(Iteration 3201 / 16330) loss: 2.113439\n(Epoch 2 / 10) train acc: 0.408000; val_acc: 0.442000\n(Iteration 3601 / 16330) loss: 1.822949\n(Iteration 4001 / 16330) loss: 1.929417\n(Iteration 4401 / 16330) loss: 1.643511\n(Iteration 4801 / 16330) loss: 1.736321\n(Epoch 3 / 10) train acc: 0.452000; val_acc: 0.463000\n(Iteration 5201 / 16330) loss: 2.089003\n(Iteration 5601 / 16330) loss: 1.506891\n(Iteration 6001 / 16330) loss: 1.577858\n(Iteration 6401 / 16330) loss: 1.657605\n(Epoch 4 / 10) train acc: 0.485000; val_acc: 0.483000\n(Iteration 6801 / 16330) loss: 1.571448\n(Iteration 7201 / 16330) loss: 1.704583\n(Iteration 7601 / 16330) loss: 1.844080\n(Iteration 8001 / 16330) loss: 1.733486\n(Epoch 5 / 10) train acc: 0.494000; val_acc: 0.480000\n(Iteration 8401 / 16330) loss: 1.687219\n(Iteration 8801 / 16330) loss: 1.390158\n(Iteration 9201 / 16330) loss: 1.390699\n(Iteration 9601 / 16330) loss: 1.415803\n(Epoch 6 / 10) train acc: 0.494000; val_acc: 0.505000\n(Iteration 10001 / 16330) loss: 1.792690\n(Iteration 10401 / 16330) loss: 1.637958\n(Iteration 10801 / 16330) loss: 1.797944\n(Iteration 11201 / 16330) loss: 1.634449\n(Epoch 7 / 10) train acc: 0.502000; val_acc: 0.484000\n(Iteration 11601 / 16330) loss: 1.628916\n(Iteration 12001 / 16330) loss: 1.255021\n(Iteration 12401 / 16330) loss: 1.501996\n(Iteration 12801 / 16330) loss: 1.493511\n(Epoch 8 / 10) train acc: 0.528000; val_acc: 0.487000\n(Iteration 13201 / 16330) loss: 1.707115\n(Iteration 13601 / 16330) loss: 1.516169\n(Iteration 14001 / 16330) loss: 1.760193\n(Iteration 14401 / 16330) loss: 1.548953\n(Epoch 9 / 10) train acc: 0.525000; val_acc: 0.501000\n(Iteration 14801 / 16330) loss: 1.240440\n(Iteration 15201 / 16330) loss: 1.240159\n(Iteration 15601 / 16330) loss: 1.385997\n(Iteration 16001 / 16330) loss: 1.736534\n(Epoch 10 / 10) train acc: 0.571000; val_acc: 0.507000\nDone. Training Accuracy: 0.571000, Validation Accuracy: 0.507000\nLearning rate: 3.000000e-04 Weight scale: 2.500000e-02 Dropout: 9.000000e-01 Train accuracy: 0.571000, Validation accuracy: 0.507000\n" ] ], [ [ "## Test your model\nRun your best model on the validation and test sets. You should achieve above 50% accuracy on the validation set.", "_____no_output_____" ] ], [ [ "y_test_pred = np.argmax(best_model.loss(data['X_test']), axis=1)\ny_val_pred = np.argmax(best_model.loss(data['X_val']), axis=1)\nprint('Validation set accuracy: ', (y_val_pred == data['y_val']).mean())\nprint('Test set accuracy: ', (y_test_pred == data['y_test']).mean())", "Validation set accuracy: 0.507\nTest set accuracy: 0.516\n" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e5c477b66f64273e6924d22e259421b99c5893
396,041
ipynb
Jupyter Notebook
tutorials/Certification_Trainings/Healthcare/16.Adverse_Drug_Event_ADE_NER_and_Classifier.ipynb
ewbolme/spark-nlp-workshop
421e9b8b3941c825262e46fdf09243996e757992
[ "Apache-2.0" ]
1
2020-12-14T06:07:12.000Z
2020-12-14T06:07:12.000Z
tutorials/Certification_Trainings/Healthcare/16.Adverse_Drug_Event_ADE_NER_and_Classifier.ipynb
ewbolme/spark-nlp-workshop
421e9b8b3941c825262e46fdf09243996e757992
[ "Apache-2.0" ]
null
null
null
tutorials/Certification_Trainings/Healthcare/16.Adverse_Drug_Event_ADE_NER_and_Classifier.ipynb
ewbolme/spark-nlp-workshop
421e9b8b3941c825262e46fdf09243996e757992
[ "Apache-2.0" ]
null
null
null
182.844414
106,738
0.850404
[ [ [ "![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png)", "_____no_output_____" ], [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Healthcare/16.Adverse_Drug_Event_ADE_NER_and_Classifier.ipynb)", "_____no_output_____" ], [ "# Adverse Drug Event (ADE) Pretrained NER and Classifier Models", "_____no_output_____" ], [ "`ADE NER`: Extracts ADE and DRUG entities from clinical texts.\n\n`ADE Classifier`: CLassify if a sentence is ADE-related (`True`) or not (`False`)\n\nWe use several datasets to train these models:\n\n- Twitter dataset, which is used in paper \"`Deep learning for pharmacovigilance: recurrent neural network architectures for labeling adverse drug reactions in Twitter posts`\" (https://pubmed.ncbi.nlm.nih.gov/28339747/)\n- ADE-Corpus-V2, which is used in paper \"`An Attentive Sequence Model for Adverse Drug Event Extraction from Biomedical Text`\" (https://arxiv.org/abs/1801.00625) and availe online: https://sites.google.com/site/adecorpus/home/document.\n- CADEC dataset, which is sued in paper `Cadec: A corpus of adverse drug event annotations` (https://pubmed.ncbi.nlm.nih.gov/25817970)", "_____no_output_____" ] ], [ [ "import json\n\nfrom google.colab import files\n\nlicense_keys = files.upload()\n\nwith open(list(license_keys.keys())[0]) as f:\n license_keys = json.load(f)\n\nlicense_keys.keys()", "_____no_output_____" ], [ "import os\n\n# Install java\n! apt-get update -qq\n! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null\n\nos.environ[\"JAVA_HOME\"] = \"/usr/lib/jvm/java-8-openjdk-amd64\"\nos.environ[\"PATH\"] = os.environ[\"JAVA_HOME\"] + \"/bin:\" + os.environ[\"PATH\"]\n! java -version\n\nsecret = license_keys['SECRET']\n\nos.environ['SPARK_NLP_LICENSE'] = license_keys['SPARK_NLP_LICENSE']\nos.environ['AWS_ACCESS_KEY_ID']= license_keys['AWS_ACCESS_KEY_ID']\nos.environ['AWS_SECRET_ACCESS_KEY'] = license_keys['AWS_SECRET_ACCESS_KEY']\nversion = license_keys['PUBLIC_VERSION']\njsl_version = license_keys['JSL_VERSION']\n\n! pip install --ignore-installed -q pyspark==2.4.4\n\n! python -m pip install --upgrade spark-nlp-jsl==$jsl_version --extra-index-url https://pypi.johnsnowlabs.com/$secret\n\n! pip install --ignore-installed -q spark-nlp==$version\n\nimport sparknlp\n\nprint (sparknlp.version())\n\nimport json\nimport os\nfrom pyspark.ml import Pipeline\nfrom pyspark.sql import SparkSession\n\nfrom sparknlp.annotator import *\nfrom sparknlp_jsl.annotator import *\nfrom sparknlp.base import *\nimport sparknlp_jsl\n\nspark = sparknlp_jsl.start(secret)", "_____no_output_____" ], [ "print (sparknlp.version())", "2.6.2\n" ] ], [ [ "## ADE Classifier Pipeline (with a pretrained model)\n\n`True` : The sentence is talking about a possible ADE\n\n`False` : The sentences doesn't have any information about an ADE.\n\n", "_____no_output_____" ], [ "### ADE Classifier with BioBert", "_____no_output_____" ], [ "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaIAAAEECAYAAADal0MeAAAgAElEQVR4Aeyd2ascxfv//Qe89corL7zwwgtBEEQQQUREREQRURSDkkgUjRg1uMR9ySbGRI0mYiIq7pqQIFncImoSg0uiEjXGuGUxbolxi/aPV39+T39r6vTMmTk5J5nT51Uwp3u6q6qrXk93z+l3Pf3UIYVJAhKQgAQk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KgtM3ny5Ja8aX8uuuiiAWWoJ82Tr3/++ecDynz88ce1/aCd27ZtG5CfDYjjF1xwQXHooYdWx1u9enVt3tiI2Jm3h+8I353Szz//XJx11lkDyr7xxhudihUPPfRQVWbFihVt8yLqp/2gTeeff36BkF2XEGsPO+ywqu7o0/jx49sK2EPpe6/tQkA//PDDB7TrwgsvrB204Bq5/PLLB+Snb4jsdWkodq+rx20SkIAEJCABCUhAAhKQgAQkIAEJSEACEjiYBIZNiH744YdLge3II48sPXDvuuuu8juC465du4alj2effXZZJ0LyY489VkyaNKkS9d5+++3aY5x77rllntNPP7146aWXSjEXIfOEE06ozX/ZZZeV+RFiEZ7jc/HFF5fe1HkhxHHqO+KII6q8Ueaaa66p9QwmL2VOOumk0uP4ySefLI455phy22mnnZYfovyOJzBljj322PJYrL/11lu1edmIZy55+Nx5553F+++/X3rthgDcTij+8ssvq/pp3wsvvFCwDc/fTunHH39sEZfxPK9LeJyHqHzttdcWzz//fNkn2nnLLbcMKPL1119X/Zg4cWIp2E6fPr2qA2/tPA2l7722C4/v6Mell15acP7hcX700UeX7b355pvzZhVxjWB/POHXrFlTxMAHdqkbhOjV7gMO6gYJSEACEpCABCQgAQlIQAISkIAEJCABCfQBgWERovH0RIBGTMTbN1IIxYhp+5sIsxDCahqOI4S6U045ZcAhQiTGa5XQDiS8bkP0JYxInkKIJixFNymOgUjabUKszD2A8caN/rULaRIew1deeWWZt5MQjahLfXgNp+nWW28tt9PPunTGGWeU++nPYOEy0vLBLTx+2wnRhGyhXeecc05VnBAmbEOM/euvv6rtrGzfvr3cN3fu3JbtjzzySLmdQYk8DaXvvbbrtddeK4+PqJyGVMGzmb6wPU8nn3xyuQ/BOk0nnnhiuZ0QKnWpF7vXlXebBCQgAQlIQAISkIAEJCABCUhAAhKQgAQONoFhEaLDAxWBN03EMkaUw4t3fxOiK3Xlx9iyZUu5nX15XOIQqfG8TdP9999flpkyZUq6uVwPQXUkhWi8ixHv8xQetnDrlLoRoukzTIilnSbETr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CABCUhAAhKQgAQkIAEJSEACEpCABPqGgEJ035jChkhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISaCYBhehm2tVeSUACEpCABCQgAQlIQAISkIAEJCABCUhAAhLoGwIK0X1jChsiAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSKCZBBSim2lXeyUBCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIoG8IKET3jSkOfkNeeOGF4oILLqg+F110UfH1118f/IbZgtIOCxcuLObPn198/vnnI0LkvffeK+bOnVssWLCg2LBhQ9fH+Oeff4o5c+YUzz77bPH77793Ve77778vli1bVsyYMaOYN29e8euvv9aW+/vvv4tXX321mDlzZln/d999V5uvqRu5/vrN7tiEc2X27NnFY4891tX5uGnTpuKZZ54p7f3yyy8Xv/32W1uTbd26tdi4cWPtZ6TO/baNOUg7mmL3L774ojx/H3jggeKdd94pOHc6pf/++6948803iwcffLCgzMqVK4t///23UxH3DZHA2rVri4ceeqj48MMPO9awa9eu4vnnny+vXe7F7e7VVIKtvvzyy9pr96effup4HMquX7++/I3bvXt3x7zulIAEJCABCUhAAhKQgARGLwGF6D633c8//1w88cQTxeOPP97x8/TTTxd//PHHfvXmsssuKw455JCWz2uvvbZfdVp4/wk899xzLTbBRgg1w5UQkseNGzfgGFdffXWxb9++QQ+DmBHnzYoVKzrm53w+66yzqvxR7o033hhQDtH5uOOOG5CXc30spH60+8MPPzzAHthw2rRptSb58ccfCwa0ws6xPOyww0phMi/EAEXkabfcvHlzXqxR35tgdwxSd66cdNJJRTtBEsHzxBNPHGD/Y489tvjmm28aZeOD3RkGDA8//PCS9fHHH9+2OW+//XbBtZpei3xvJ16/9NJLLXnzcnUH+uyzz8rB70MPPbQqu3r16rqsbpOABCQgAQlIQAISkIAEGkBAIbrPjfjUU09VD2fpQ13d+mAiYDddxWNtz549xU033VQeVyG6G2ojl4cH/rA1nsMMSMQD+6pVq4blwHgzcwzqvfvuu0vv4xAf+N4pITRGe6hj+fLlbbPjKXfEEUeUx0KQwgO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mEVCIbpY97Y0EJCABCYxSApdffnkpyD300ENVD15++eVyG16sw5EQkxEXEYsjffDBB+U2xOnffvstNpdLvKGjzMcff1ztmzRpUlmGsAt5CiGaEAvdJkRLjmMaOQJnnHFGabOJEye29X6Po3PecT68/fbbsalcnnfeeWUdiNJ16f777y/3H3fccUW7MCxpuT179lQDIYbiSMm4LgEJSEACEpCABCQggWYSUIjO7EpMw3vuuac455xziqOPPrp8EGN5ww03FLt3785y/+8rZW688cbihBNOKPPzMM3DGq8Tn3zyyaV3T15w5cqV5TF4+OZhD8+xe++9t7j++utL77HIj6fQmWeeWfAAyevOkRAq2MbnggsuaPEcIvYjx4/9xBklURfeRocffnjZt0WLFkV15XIk+87DLEJKtIn2bd68uTwur3efffbZ1T4eko0J2mIav0hAAg0nQHxcfgsQiVMBD6/Q2N7Jq7QbPH///XdZP8fI6wqv6OXLl7dUFSI1oTPStH79+rKuY489Nt1critED0By0De89dZbpb34n4PzoJv0+++/D8iGlz7nD/+X5InzNs7VbmOb33HHHWV9/G9ikoAEJCABCUhAAhKQgASaT0AhOrPxtddeWz4U8aDFA1V4gvEdcTpPeIjFAzx56j633nprS7H09da6/Gz766+/yjJ4m0UeBNpI4ZUU+9IJhHgNNm0TQnVdvEb6l6aR7PvTTz9dPaDSZtqHkEEKz6voC3EifSU3tYzrEpBA0wkw+R/3QAY+83T66aeX+1KP5DxPN98Ru+M+m9aVit2PPPJIS1UR75kY0mmKuvLfEfKEEE2YjfHjxxe0n9+9XORO64tB2dtvv738rT333HPLwdlUlE/zu94bgUsvvbS0PfGdN23aVE4IuGbNmq5F6Tga/09wDtXF7Y5wHueff37BJIevvPJKGVKGQe52CbtTH+fjunXryokwmbTSJAEJSEACEpCABCQgAQk0k4BCdGbX999/v4yTyUNReOXyUBQP73gbRyKuYkyug+czk+2QeHBmxvcoc/PNN0eRAkE2thN3848//ih4oCc2aNTF/jRmY3ikpUJ0VMiDPvm//vrr2FQtf/jhh+pY5LnwwgtL8ffHH38s8JJGA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6A+JXCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISGF4CCtHDy9PaJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIICOgEJ0B8asE+pHA119/XSxcuLCYP39+8fnnn49IEzdu3Fg8/vjjxYwZM4qXX365+O2339oe57vvvivIn3++/fbbtmXYQbnnnnuumDlzZrFkyZLi77//7pg/dv77779lv5999tli2rRpxVNPPRW7Gr3sN7unsP/8889i/fr1xWOPPVbaZNWqVenucn3v3r3FJ598MuA8ifPmp59+GlCGDZwXr776anmeYHPOm7GURrvdw1acI2+++WYxa9asYvny5cXvv/8euwZdvvDCC+U9b6zZflAww5Th+++/L5YtW1be7+fNm1f8+uuvtTVv27atvFfzu8B995tvvqnNV7eROlevXl088MAD5Tnw2Wef1WWrto3V+3wFwBUJSEACEpCABCQgAQmMAQIK0WPAyHZxdBNAuD3kkENaPg8++OCwdeq///4rLr/88pb6Od5hhx1WvP766wOOs2PHjgFucjQuAAAgAElEQVR50/bVCeWISccff/yAckcddVSxdevWAcdIN3z66acF+dJjHHrooW2Fk7TsaF7vN7unLBcvXlxgg9QmJ598cpqlXK87r9Iy48aNG1CGc+W4445rqZsyTz/99IC8TdzQBLtjl927dw+45rmOuX8Mlj766KPK/jfffPNg2d3fA4Gff/65OOussyq+cT2+8cYbLbX8888/xd133z0gH/kfffTRlrz5l3379hW33XbbgLJ33nlnnrX6Plbv8xUAVyQgAQlIQAISkIAEJDBGCChEjxFD283RSeDDDz+sHubxWsNjOQTAOg/UofTy4YcfLo9xxBFHFAsWLCjWrFlTTJ48udzGsfCISxNCIWIE+S+66KKWzzXXXFPr9XjPPfeUZU4//fSyD08++WRxzDHHlNtOOeWUtPqW9aVLl5Z5OB6iJWIJwjUiSZNTP9o9eN9yyy2lTTg3EAnxis7Pkch72mmnlefrlVdeWaQfzgNsOnXq1MhaLc8+++xyH6Il3taTJk2qzoG33367ytfElabYHduce+65pd2w9UsvvVRccMEF5fcTTjiho+kYGDvxxBMrm994440d87uzew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gpASoMZzWAKW+NhejGqp26Ej1z/UooIACCiiggAIKKKCAAgoooIACCiigQHcFTER319OldSBATeJe1afsoBtOqoACCiiggAIKKKCAAgoooIACCiiggAI9FjAR3WNgF6+AAgoooIACCiiggAIKKKCAAgoooIACCvS7gInoft8CfP8KKKCAAgoooIACCiiggAIKKKCAAgoooECPBUxE9xjYxSuggAIKKKCAAgoooIACCiiggAIKKKCAAv0uYCK637cA378CCiiggAIKKKCAAgoooIACCiiggAIKKNBjgcomojdv3pytWrXKi931eANx8QoooIACCiiggAIKKKCAAgoooIACCiigwHAFKpuIPvroo7OjjjoqW7t27XAN8vn/+eefbPz48dkll1ySXXXVVdlvv/3WleX2aiG//vprNnbs2Ly/9HnFihW9WpXLPQIEvv7662zevHnZU089lX3++ec96dGaNWuyWbNmZXPnzs0GBgaGXAefmY8++iibOXNmtmjRomzXrl0t5/nxxx+zjRs3lt4+/fTT7Pfffz9k3m3btpVOz3J6ZXBIJ/7jJ6oe97///jvbsmVLaRx/+umnUt1ffvklY5sobi8sh22uH1rV416M0Z49e7LVq1dnjz76aDZ9+vTss88+K06SGfdDSHr6xHfffZctW7Yse+ihh7LZs2dnxKis7dixI1uyZEk+3XPPPZd98803ZZOVPtdO3NMZ+b7gu33hwoXZ1KlTM9ZnU0ABBRRQQAEFFFBAgXoJVDIRTTKCJDQ3RkV3o5F4PuaYYxrLZSet3fbnn39mN910U76j3e48w51u+/btWSTjcbj99tuHu0jnP0IFSPLG9h73jz32WNd6y/Z7xRVXHLKOG2+8Mfvrr79K18Nn8Prrrz9kHpLZZe34448/ZNp4L9zPnz+/aTY+f+nrZY+3bt3aNE/d/qhD3F955ZWWceT7tqyddNJJLed5+umny2ap1XN1iHsEhO+Pu+6665B43nvvvTFJ477f496A6PGDn3/+OTv//PMPiclbb73VtGZ+F+6///5DpuO7+Mknn2yatvhHJ3GPeTdt2pSdcMIJTevjf5xWCfKYz3sFFFBAAQUUUEABBRSolkAlE9EQk5C45557ur6TcsEFF+Q7Q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u6qAAgoooIACCiiggAIKKKCAAgoooIACClRRwER0FaNmnxVQQAEFFFBAAQUUUEABBRRQQAEFFFBAgQoJmIiuULDsqgIKKKCAAgoooIACCiiggAIKKKCAAgooUEUBE9FVjJp9VkABBRRQQAEFFFBAAQUUUEABBRRQQAEFKiRgIrpCwbKrCiiggAIKKKCAAgoooIACCiiggAIKKKBAFQVMRFcxavZZAQUUUEABBRRQQAEFFFBAAQUUUEABBRSokICJ6AoFy64qoIACCiiggAIKKKCAAgoooIACCiiggAJVFDARXcWo2WcFFFBAAQUUUEABBRRQQAEFFFBAAQUUUKBCAiaiKxQsu6qAAgoooIACCiiggAIKKKCAAgoooIACClRRwER0FaNmnxVQQAEFFFBAAQUUUEABBRRQQAEFFFBAgQoJmIiuULDsqgIKKKCAAgoooIACCiiggAIKKKCAAgooUEUBE9FVjJp9VkABBRRQQAEFFFBAAQUUUEABBRRQQAEFKiRgIrpCwbKrCiiggAIKKKCAAgoooIACCiiggAIKKKBAFQVMRFcxavZZAQUUUEABBRRQQAEFFFBAAQUUUEABBRSokICJ6AoFy64qoIACCiiggAIKKKCAAgoooIACCiiggAJVFDARXcWo2WcFFFBAAQUUUEABBRRQQAEFFFBAAQUUUKBCAiaiKxQsu6qAAgoooIACCiiggAIKKKCAAgoooIACClRRwER0FaNmnxVQQAEFFFBAAQUUUEABBRRQQAEFFFBAgQoJmIiuULDsqgIKKKCAAgoooIACCiiggAIKKKCAAgooUEUBE9FVjJp9VkABBRRQQAEFFFBAAQUUUEABBRRQQAEFKiTwf/I200pxvxo+AAAAAElFTkSuQmCC)", "_____no_output_____" ] ], [ [ "# Annotator that transforms a text column from dataframe into an Annotation ready for NLP\ndocumentAssembler = DocumentAssembler()\\\n .setInputCol(\"text\")\\\n .setOutputCol(\"sentence\")\n\n# Tokenizer splits words in a relevant format for NLP\ntokenizer = Tokenizer()\\\n .setInputCols([\"sentence\"])\\\n .setOutputCol(\"token\")\n\nbert_embeddings = BertEmbeddings.pretrained(\"biobert_pubmed_base_cased\")\\\n .setInputCols([\"sentence\", \"token\"])\\\n .setOutputCol(\"embeddings\")\\\n .setMaxSentenceLength(512)\n\nembeddingsSentence = SentenceEmbeddings() \\\n .setInputCols([\"sentence\", \"embeddings\"]) \\\n .setOutputCol(\"sentence_embeddings\") \\\n .setPoolingStrategy(\"AVERAGE\")\\\n .setStorageRef('biobert_pubmed_base_cased')\n\nclasssifierdl = ClassifierDLModel.pretrained(\"classifierdl_ade_biobert\", \"en\", \"clinical/models\")\\\n .setInputCols([\"sentence\", \"sentence_embeddings\"]) \\\n .setOutputCol(\"class\")\n\nade_clf_pipeline = Pipeline(\n stages=[documentAssembler, \n tokenizer,\n bert_embeddings,\n embeddingsSentence,\n classsifierdl])\n\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nade_clf_model = ade_clf_pipeline.fit(empty_data)\n\nade_lp_pipeline = LightPipeline(ade_clf_model)", "biobert_pubmed_base_cased download started this may take some time.\nApproximate size to download 386.4 MB\n[OK!]\nclassifierdl_ade_biobert download started this may take some time.\nApproximate size to download 22 MB\n[OK!]\n" ], [ "text = \"I feel a bit drowsy & have a little blurred vision after taking an insulin\"\n\nade_lp_pipeline.annotate(text)['class'][0]", "_____no_output_____" ], [ "text=\"I just took an Advil and have no gastric problems so far.\"\n\nade_lp_pipeline.annotate(text)['class'][0]", "_____no_output_____" ] ], [ [ "as you see `gastric problems` is not detected as `ADE` as it is in a negative context. So, classifier did a good job detecting that.", "_____no_output_____" ] ], [ [ "text=\"I just took a Metformin and started to feel dizzy.\"\n\nade_lp_pipeline.annotate(text)['class'][0]", "_____no_output_____" ], [ "t='''\nAlways tired, and possible blood clots. I was on Voltaren for about 4 years and all of the sudden had a minor stroke and had blood clots that traveled to my eye. I had every test in the book done at the hospital, and they couldnt find anything. I was completley healthy! I am thinking it was from the voltaren. I have been off of the drug for 8 months now, and have never felt better. I started eating healthy and working out and that has help alot. I can now sleep all thru the night. I wont take this again. If I have the back pain, I will pop a tylonol instead.\n'''\n\nade_lp_pipeline.annotate(t)['class'][0]\n", "_____no_output_____" ], [ "texts = [\"I feel a bit drowsy & have a little blurred vision, after taking a pill.\",\n\"I've been on Arthrotec 50 for over 10 years on and off, only taking it when I needed it.\",\n\"Due to my arthritis getting progressively worse, to the point where I am in tears with the agony, gp's started me on 75 twice a day and I have to take it every day for the next month to see how I get on, here goes.\",\n\"So far its been very good, pains almost gone, but I feel a bit weird, didn't have that when on 50.\"]\n\nfor text in texts:\n\n result = ade_lp_pipeline.annotate(text)\n\n print (result['class'][0])\n", "True\nFalse\nTrue\nFalse\n" ] ], [ [ "### ADE Classifier trained with conversational (short) sentences", "_____no_output_____" ], [ "This model is trained on short, conversational sentences related to ADE and is supposed to do better on the text that is short and used in a daily context.", "_____no_output_____" ], [ "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABc4AAAESCAYAAADEw0ZmAAAgAElEQVR4Aeyd2Y8U1fuH/Qe89corL7zwwgsTExNjYkyMMcYYYyCGaDQaDBI1IAGVuOCOX1mMuygYwYhxRSUQIyBuQRaJKFtQEXBDNgXcULR+ec7Ptz1dU93TPTM9zEw/bzKp6lNnqfO8VdXTn3PqPccVmgQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAjUCx9X23JGABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSKBQOPcikIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlkBBTOMxjuSkACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQUzr0GJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAIZAYXzDIa7EpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAGFc68BCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkEBGQOE8g+GuBCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEDh3GtAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJJARUDjPYLgrAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEjimwvk///xTbNiwoXjssceKV155pdi7d++Ae4Q23n///eKJJ54oHn300WL58uXF33//3bSdH374oXjppZeKBx98sFi4cGGxa9euhvn3799fbNq0qfJv8+bNxZEjRyrL/vbbb8XixYuL2bNnF3Pnzi0+/fTTynx5Iu0899xzxcyZM4s33nijOHToUH64x/4vv/xSrFy5MvX7mWeeSax7ZColtNN3ih49erRYu3ZtMW/evOKRRx5pie/u3btT3+kHfL/55pvSWfT8uHr16uLxxx9P7WzcuLFnhoqUnTt3FvPnz098v/jii4oc9Unbtm1Lfm+Fb1/9TrlXX301+fDtt98uDh48WH8STT59//33xdKlS1PZOXPmNCzLNb9169bEintr1apVTWr1kAQkIAEJSEACEpCABCQgAQlIQAISkIAEJFAmcMyEc8S9iRMnFscdd1zdHwLpQBki5dlnn11XP+2dfvrpDcVahOnyOfEZUbjKTj755Mr8UceCBQt6FENoPvHEE3uUu+KKK4o///yzR35YXX/99T3yn3DCCUkY71GgKJKwzvE4j9iOGzcuid1VZdrt++eff16cccYZPdo488wzC8Txsv3111/F9OnTe+Tn3BD2q4wyV199dY8ykyZNatgP6mEgJvocWwZPqmzfvn3FlVde2SM//BqJzn3x+0cffVSUfcJnBo+a2U8//VRccsklPc7vvffe61GMNqqurVGjRlVeWz0qMEECEpCABCQgAQlIQAISkIAEJCABCUhAAhIojplw/tRTTyUhEAGS2d33339/+nz88ccXCN4DYaNHj051nnPOOWmG8zvvvFNcdNFFKQ1xt2zM+g6R9b777is++eSTNCOccyJ92bJl5SIp/ZRTTikmTJhQ93fqqaemY8xwz+3XX3+tiafXXHNNgdDJrOvIf8cdd+TZ036wOumkk9Is4jVr1hRTpkxJ9XNuZZGamdbRj+uuuy6J6zNmzKi1y4zqsvWl75wP7cCXmdAvvPBCcdppp6W0Cy64oNxE6mec16xZswqE33zw5OOPP+5RhhnTlKGfiO6UC/GZz1WGEB3tMDObAYHw4YoVK3oUYTCB/AjO+IKZ4BdffHFKoy2E67KRvx2/M/s/zhs2t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AEJCABCUhAAhKQgAQkIAEJSGAYEVA4H0bO8lQl0EkCv/32W/H2228XX3zxRcea+eeff4pVq1alv441YsUSkIAEJCABCUhAAhKQgAQkIAEJSEACEugnAYXzfgK0uARGCoHHHnusOO6444oLLrigY13asGFDaoN2jh492rF2rHh4EuD6uOqqq4rLL7+89rds2bKmnbnnnntqeSl33XXXFX///XfTMoN9kMGo6dOnp3O77LLLiokTJxbbt29veBr79+8vFi1aVKxcubJhHg9IQAISkIAEJCABCUhAAhKQgAQk0FkCCued5WvtEhg2BGbNmpVE7bPOOqtj57x27dqacP777793rB0rHp4Enn/++dr1weAKf3feeWfTzpx88sk9yhw5cqRpmcE8+Prrr/c4P/p15ZVX9jiNmTNnFqeffnot/7nnntsjjwkS6HYCc+bMKebNm9ftGOy/BCQgAQlIQAISkIAEJDAIBBTOBwGyTUhgOBDYtm1bMXXq1OKdd97p2On++uuvxbRp04qnnnqqY21Y8fAm8NdffxW//PJLChvUinBObwkzRBkGfSgzVIRz+hLCPjPOP/vss+Lzzz8vli5dWnz//fd1jvrzzz+L448/Pv2dd955qR/nnHNOXR4/SEACRXHCCScUJ510kigkIAEJSEACEpCABCQgAQl0nIDCeccR24AEJCABCbRL4IMPPkjicW8zzvN6EZqHknD+6aefpvM55ZRT8tNsuB/hi3788UeF84aUPNDtBBDO+dMkIAEJSEACEpCABCQgAQl0moDCeacJW/+IIsBs0VGjRhUXXXRR8cADDxQHDhwoHnnkkeKKK65IcZZnzJhRfPvtt3V9ZkHM66+/PpWh3IQJE9Jx4jlPnjy5QFQ78cQTiylTptSV48NHH31UjB49ujZr9bTTTituuOGGYvfu3T3ykoDwxmvs559/fhIWEBfYX7BgQTrvRx99tK4c50Z9nFf8LVy4sC5P+QN9vvvuuwvOhRmytEFICWI3M7v2u+++KxdJ5xT1s73lllt65CknrFixItV56qmnpjbOPvvs4qabbir27NlTl5WZu7RNvZMmTSrgeskll6QynA+z6JmRPFLtmWeeqfmOaxP/wOjee+8tYIaP4EF6bjt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qn7//fffi3fffbdYuHBhy2T2799fLFq0qFi5cmWvZf75559i69at6Vrk2lq1alWvZUZShqHo9927dxeLFy8uZs6cmfz+zTffNET+22+/FZs3b668d7mnDxw40KOs93sPJAOa8Mcff6R7qvxM3bJlS/Hnn382bIv79tVXX01+f/vtt4uDBw82zBsHtm3bVrz00kupzBtvvFEcOnQoDlVuaZ+6Z82alb5Hvvvuu8p8JkpAAhKQgAQkIAEJSEACEugvAYXz/hIcYuV/+umn4vnnny+ee+65pn8vvvhigZjVHxs/fnxx3HHH1f0hjmnHlsArr7xS5xN89MQTTwzYSSF8X3311T3amDRpUnH06NFe20EAj+tm2bJlveZHXD/xxBNTmTPPPLMy//fff1+rM+oub7dv315ZdqQkDkW/I5yef/75db7p7RpBaD399NNrZc4999ymLvroo49q10fu81GjRjUV+JpWOowODjW/83yYPn16zX+5T5555plKstdff31l/ijL8yY37/ecRmf2p0yZ0tAnDJJXGffiCSecUFeOz40GPPft21dQV/g5tpRpNPiFSH7GGWf0KMP/NJoEJCABCUhAAhKQgAQkIIGBJqBwPtBEj3F9zOiMH5+9bVsRLXvrDjO/fvnll+L2229P7Sqc90ass8cRKMLvc+bMSYMnxx9/fEpbsWLFgDTOjF7aoF4EMmb9hVjC52aGUBLnQx3vvPNOs+zp2J133lnrE4JJla1ZsyblOe+884oJEybU/UV7hw8frio6ItKGqt8vueSSml/iumwmnPM8wV/84UvKnHPOOU19FPmuueaaNEN99uzZtevxgQceaFp2uB8cin7Pv4N4Nrz33nvFxIkTa/fwxx9/3AP7BRdckHxevncvvPDCVG7atGl1Zbr9fq+D0aEPMTDOPYy4HX9XXXVV5XOb/wPiewB/ch3E/c/9XDXzfNy4ccm/DIySn1nkF198cUqjLiYClI0BMZ4Lp5xySvHss88WN954Y/pMGsK9JgEJSEACEpCABCQgAQlIYCAJKJwPJM0hUBevvL///vu1H5+IjkuWLKn7mzx5cvqhSfpA2b333pvqVDgfKKJ9qydmbjKrO4xX3xEVEDEGwk4++eRUH6/Wh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3RKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJDDsCCicDzuXecISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCTQSQIK552ka90SkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQw7AgonA87l3nCEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQk0EkCCuedpGvdEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkMOwIKJwPO5d5whKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJNBJAgrnnaRr3RKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJDDsCCicDzuXecISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCTQSQIK552ka90SkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQw7AgonA87l3nCEuidwM6dO4v58+cXc+fOLb744oveC7SRY//+/cWmTZsq/zZv3lwcOXKksrZ//vmn2LBhQ/HYY48Vr7zySrF3797KfFWJBw8eLD788MPi0UcfLWbPnl1s3bq1KltBGxybN29eamfVqlWV+UZqYif9Hszw/XPPPVfMnDmzeOONN4pDhw7FocptX/z+xx9/FO+//37y9TvvvFP8+uuvlXXniX///Xexfv36dM0fPnw4PzTi9zvp977c7999913l8+Hbb79t6ot2/d7t93tTmAN48Ouvvy4WLFjQ63dJX/3+ww8/FC+99FLx4IMPFgsXLix27drV69l38/3eKxwzSEACEpCABCQgAQlIQAIDRkDhfMBQDt+KEDMRwnr7++ijj4ZvJ7vozBGljzvuuLq/J554YsAInHzyyXV1l9tCYCkbAtfEiRN7lFu9enU5a93no0ePFnfffXePcvfdd19dPj5wfZ544ok98o4aNar4888/e+QfaQmd9js+vP7663vwPeGEE4qVK1dW4uyL3xG9zzzzzLp2TjnllGLPnj2VbTBQcvnllxfHH398rQyDLN1infZ7u/c7fio/E/LPjQby2vV7t9/vnb6+Gay88cYbi5NOOqnmz6rnbpxHX/3O/x359RH7jzzySFRdt+32+70Ohh8kIAEJSEACEpCABCQggY4TUDjvOOKh30BZpIofruUtoqQ2tAkwCBJ+mzNnThoMCUFxxYoVA3Ly1I+QOWHChLq/U089NbW9fPnyHu089dRT6RgiHDML77///vSZc2NGa5Ux+/T8889P+RBvEP8RTX766aeq7MV5552X8l5zzTXFokWL0mxlRF3O94EHHqgsM1ISB8Pv4UN8wYz+NWvWFFOmTKn5cffu3T1wRpl2/H7ppZemOi+88MLkR0RxfHjWWWf1qJ8E3kLg+Omnn14T+T744IPKvCMtcTD83u79zqxjynCdXHnllXV/kydPbvj2QLt+7+b7fTCu408++aTmR+4tfHrvvfc2bLovfv/0009TvdSNKE+bvFEU31nLli3r0V433+89YJggAQlIQAISkIAEJCABCXScgMJ5xxEP/QYQQfmhumTJkvR30003pR+zV199dS0NEYQ82tAmEDOCn3zyydqJEk4DYeKSSy6ppfVn55lnnikQPMp2zjnnpGukHKqFWccxa/Xzzz+vFWM2I+eFEFJlDz/8cDp+xhlnFAcOHKjKUpfG6/779u2rS2PwgDbOPvvsuvSR9mEw/H7uuecmloRSyA22MGZAJLe++D3ENwbpfvnll1TdX3/9VZx22mmpDYTiKiMPxmAO59Itwvlg+L3d+z18eN1111W5qjItyrTj926+3yshdiAx7qvXXnst3VetCOft+P3OO+9M9Y4bN67u7O+6666UPn78+Lr0+BDn1W33e/TfrQQkIAEJSEACEpCABCQweAQUzgeP9ZBtCVE8n02OAIb4hHAZFrPS4zOvyV988cXFRRddlP4+/vjjgh+zzDAlHZEdIXXdunWpCDN+I++WLVtSGsIaP7Ij/Z577onq67a0NXr06Jr4ioh2ww03FFUzXOsKdtkHYr7GTL1caMYvkd5otnZ/Ue3YsSNdM2PHju1RVcwqxG+5EY+a64zZjGXj/OOcG4V2KJep+kycbNpg9vJItcHye4jX+C037mEYE3Iht774PWaTMniXWwyiTJ06NU/usd9NQtpg+b0H5KIomt3vIYK3I6D21+9xjt1wv0dfB3PbKeE8BulnzZpV1534H4Q3FppZN93vzTh4TAISkIAEJCABCUhAAhLoHAGF886xHTY1E86CGcFh8aM1F87jtXjEboxZpyFsIp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ARGPgGF85HvY3soAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACbRBQOG8DllklIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhg5BNQOB/5PraHEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQk0AYBhfM2YJlVAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAERj4BhfOR72N7KAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAm0QUDhvA5ZZJTBcCOzcubOYP39+MXfu3OKLL77oyGlv2rSpeO6554qZM2cWb7zxRnHo0KGm7ezevbtYvHhxyr9w4cLim2++aZj/jz/+KLZu3VrQRv63ZcuW4s8//6ws9/PPPxebN2+uy0/Zr776qvjnn38qy4y0xKHm9++++66HP/DJt99+W4n+77//Tv7KfR77Bw4cqCyza9euyjYo16lrv/JEjmHiUPM7KLhPV69eXTzyyCPFs88+25Ivvvzyy/TcevTRR4tVq1Y1vNdz1IPR97y9btnfv39/w/uK5+yRI0d6oGj3fs8roL1FixYVK1euzJMb7uv3hmg8IAEJSEACEpCABCQgAQkMIAGF8wGEaVUSGAoEXnnlleK4446r+3viiScG7NQQoa+//vq6+mnvhBNOqBQ9/vrrr2L69Ok98lPmmWeeqTyvKVOmVOanzJVXXllZ5rTTTmtYBuFupNtQ8/uePXsa+gM/VonaCGccq/rj+irb999/X5k3L799+/ZysRH1eaj5HbhPPfVUpV8efPDBhuyrypxzzjlFowETKup03xuebBccOPnkkyt9GPfWggUL6ij05X6nAgZeTz/99Fpb5557bl29VR/0exUV0yQgAQlIQAISkIAEJCCBThBQOO8EVeuUwDEisGHDhpoAMWfOnDQj/Pjjj09pK1asGJCzCoHrpJNOKubNm1esWbOmCKGbtphZnhuzy0NsmTVrVvHee+8VEydOrKV9/PHHefa0P378+HT8kksuSUI5Yjl/V111VfHOO+/0yE8C50M7kTe21157baVIW1nJME0cin5n9in+wC/hi9hOnjy5+PXXX3vQfumll1KZM888s0cZZi6XjWuPNs4777xiwoQJdX9x3R8+fLhcbMR8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KKKCAAgoooIACCtRPwMB5/drENVJAAQUUUEABBRRQQAEFFFBAAQUUUEABBRSoUMDAeYX4Vq2AAgoooIACCiiggAIKKKCAAgoooIACCihQPwED5/VrE9dIAQUUUEABBRRQQAEFFFBAAQUUUEABBRRQoEIBA+cV4lu1AgoooIACCiiggAIKKKCAAgoooIACCiigQP0EDJzXr01cIwUUUEABBRRQQAEFFFBAAQUUUEABBRRQQIEKBQycV4hv1QoooIACCiiggAIKKKCAAgoooIACCiiggAL1EzBwXr82cY0UUEABBRRQQAEFFFBAAQUUUEABBRRQQAEFKhQwcF4hvlUroIACCiiggAIKKKCAAgoooIACCiiggAIK1E/AwHn92sQ1UkABBRRQQAEFFFBAAQUUUEABBRRQQAEFFKhQwMB5hfhWrYACCiiggAIKKKCAAgoooIACCiiggAIKKFA/AQPn9WsT10gBBRRQQAEFFFBAAQUUUEABBRRQQAEFFFCgQgED5xXiW7UCCiiggAIKKKCAAgoooIACCiiggAIKKKBA/QQMnNevTVwjBRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAgQoFDJxXiG/VCiiggAIKKKCAAgoooIACCiiggAIKKKCAAvUTMHBevzZxjRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUqFDBwXiG+VSuggAIKKKCAAgoooIACCiiggAIKKKCAAgrUT8DAef3axDVSQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUqFDAwHmF+FatgAIKKKCAAgoooIACCiiggAIKKKCAAgooUD8BA+f1axPXSAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUUKBCAQPnFeJbtQIKKKCAAgoooIACCiiggAIKKKCAAgoooED9BAyc169NXCMFFFBAAQUUUEABBRRQQAEFFFBAAQUUUECBCgX+D5LAOH+kXBeGAAAAAElFTkSuQmCC)", "_____no_output_____" ] ], [ [ "\nconv_classsifierdl = ClassifierDLModel.pretrained(\"classifierdl_ade_conversational_biobert\", \"en\", \"clinical/models\")\\\n .setInputCols([\"sentence\", \"sentence_embeddings\"]) \\\n .setOutputCol(\"class\")\n\nconv_ade_clf_pipeline = Pipeline(\n stages=[documentAssembler, \n tokenizer,\n bert_embeddings,\n embeddingsSentence,\n conv_classsifierdl])\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nconv_ade_clf_model = conv_ade_clf_pipeline.fit(empty_data)\n\nconv_ade_lp_pipeline = LightPipeline(conv_ade_clf_model)", "classifierdl_ade_conversational_biobert download started this may take some time.\nApproximate size to download 22 MB\n[OK!]\n" ], [ "text = \"after taking a pill, he denies any pain\"\n\nconv_ade_lp_pipeline.annotate(text)['class'][0]", "_____no_output_____" ] ], [ [ "## ADE NER\n\nExtracts `ADE` and `DRUG` entities from text.", "_____no_output_____" ], [ "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACAwAAAEMCAYAAABKwbYWAAAgAElEQVR4Aeydd7cURfe23w/yM2cwYUIFUdFHQYIBDKgIBlABFUQxICqgIj4ogiIIAipBERBFUARJCgYwgAFUEAUDiDk9/9a7rmLtsaZP95zuPnPgzMzNWmd1T3dVddWuq6ub3nft+n8u4d+XX37p+Pvf//6nP9lADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxECVMfD/EvQCXiwgwYDEEhKMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEQHUyIMFAlSlAdKNW542qflW/igExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExUG4GJBiQYEBhQ8SAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYqAGGZBgoAY7vdyqE5UnJZMYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANioPIYkGBAggEphcSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYqAGGWh0wcA///zjon+NoSzhGo1RblhmtB32O0yj/cpTzcT12Z9//ulWr17tFi9e7NavW+927NjR6HzF1aNcx3766Se3ZMkSt2L5Crdhwwb366+/VnR7ymUXlVMd96v6MX0/aixIbytxJVuJATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxEAtMNCogoHRo0e7vf5vrzp/5Xbuj3hghL/GuHHjGtUJ2u2SbnXacsH5FzTqNWsBwqbUxs8++8xdfNHF7uCDDi7qa/q+KdUzbV1emf+Ka9+uvdt3n32L2sO9mbYMpdPDUAxUPgNZx4LffvvNzZ0z182aNcvt2F7ZginxW/n8qg/Vh2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiIHGY6BRBQMLFixwffv2LfyZ07JSBQNjx4wttOWySy/zDthaFQx8+umnbtiwYd6ZVC036Lat29xJJ57k+/WqK69ykyZNclOnTnWDBg1yQ+8dWnEO9pUrV7oD9j/A7b/f/u72225306dPd4hq+vXr556b+VzFtadaOFM7Gu+BJtvG2zbrWLB82XLXunXrgsjo/fff13hRgyGodD/F30+yi+wiBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxEC1MdCogoGosWzWdqUKBsL2rFmzpqYFAwsXLvTt7927d9U4knr16uXbVInigJBN9v/++2/X4ugWbp+993EId6Ln9VsPMzFQGwxkGQu2b9/u+t/U34+De++1dyHSigQDtcGKxgT1sxgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYqA2GZBgIOesQQkGqk8w0OywZj50/86dOyvewY6Dj+VAOpzToeLboodTbT6c1O/l6fcsY8GFXS/048bxxx3vli5d6s479zz/W4KB8vSFmJYdxYAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2KgKTJQ1YKBP//80/3111+pHaa//vqrI0+ajpJgoOGCAdbITmPr3ZHmp59+8o6x4449LnedmlJ7iCqAYKBPnz652/P777/nztuYfZb1vg7r8vPPP6dqU5axICz/l19+ceWOoBKWXyn7zGrHhmnqy72X1WaUj63TlF/rabKMBQNvHuiefvppZ2OZBAN6ca31+0ft1z0gBsSAGBADY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HXe655973m3bui0xz55Sk5S67j///ONmzpzpevfu7dq3a++u7X2tG//EePfHH3+kbse8ebvYiGNhyZIldfrH+incvvvuu0XX27p1q5s0aZLrc30fb+OOHTq6/v37u2efedZR51JtqqZzsDh48GDXtWtXb4chQ4a4qK3C9q5ft949NPIhd83V1zhs1qVLF8/mG2+8EWuzNP3z+eefx+YNr1ur+6tWrXI33XiT69Sxk7v8ssvdgw8+6L7++us69vrwww9T3QcLFiwo5GUsCe+RuP358+cX0tdqHyS1+6OPPnKjRo1y3S7p5i679DI3evRolzTmJ5WR5jj9MmDAAH+/9e3b102dOjXx2ROW99tvv7m5c+b6Pt6xfUeqfsySJ+tYENZt8euL3YgHRrhLLr7EnXfueb59Y8eMdd9//31iPdPULQ3Txvmvv/6aeK2wrk1h//fff/fP0ZsH3OzHgkG3DvL9+tdff5W1Dby73HXXXf5Z0OOKHm7s2LEl34+wDc/SJ5980vXq1cudf975btiwYf79qD67ffPNN27y5Ml+fDun/TmuZ8+ebujQoe7VV18tatNPP/3keI5wf1115VWuXbt2rkePHm7wnYPdxx9/XJQ2es1ffvnFPfLII+6K7le4Dud0cNjvxbkvxuZJ86yCnVLPR7gmzaeffhp7jWj9murv1xe97u695153budz3XXXXueemvSU++6778raJvrm8ccf9++EPN9uv+12P17Vx3SeuqV9job9kScP+eEaBpI4I01Dx6m8dQvbp33NQBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYyMtAowsGmjdr7vb6v73q/O2z9z7eofn33383+GPlczOfq1O+XfO0U0/zAoKogSZMmJCYZ++99vYfraMfOHGmUu5jjz0WW2ecOJzHERi9Hk4RnOtWr2NaHONat2rt9t1n35JlRstpCr///PNPd9GFF/l6Y6tjjzm20C6EEDt21O/EmvbstEKe9evX17FX586dC+fNZnFbHAVmk5EjRzrqQ7rDDj3MnX7a6e7ggw4ulHNlzysdH7MtfbVuEeVYu4884kh3wP4HeBuwnT17dp32Iyow2x591NGOe8a4xJ4PP/xwnTw4HCxP0haRRrXauCHtw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o0a5bpd0s1ddullbvTo0e6TTz6JTWs2oTzq1rFDR9e3b183depUt3379pJ5LG81bRe/vtiNeGCE76Pzzj3P22TsmLHu+++/r2ML+vTxxx931/a+1nXq2Mndftvtvo//+uuvOmnNRuvXrXcPjXzIXXP1Nd7WXbp0cXfecad74403EvNY3lrebtq0yffL5Zdd7rpc0MU9cP8D7s0338xks3nzdo2rP/74Y2I+xsG77rrLXXD+Ba7HFT3c2LFj6x3farlfrO15xhzLm2a7ZMmSesdDxrC459fmzZvd4MGDXdeuXX2/DhkyJDYd9WCcnDFjhr+XO3fq7FljPJz81GT3559/JnJD3izXCdv822+/+XGD+u/YviP2Gv/880+q9lMG9wrlp83z888/x14zrGNT2v/999/dzJkz3c0Dbvbj7qBbB3nblBp3s9T/ww8/TGVr3mvCcnfHM74h7wXUlbYxpvH8Oaf9Oe766653I0eO9O8MYVu2bt3qXnrpJXff8PvcxRdd7J9VvXr18ml/+OGHonaH+divtncJ3k/vveded27nc911117nnpr0lPvuu+9K2iBqk6Tfae/R8L6mrDTj4eeff16oI/fG22+/7SZOnOhu6HeDa9+uvX8/5B567bXXCunCeqatW9L48euvv3oWBt852HXu3Nlf747b7/D2C68T7qfN09C6ffPNN27y5Mnuphtv8vdBz5493dChQ92rr74aa4uwjtrXxwQxIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIgZCBRhcMNG/W3O31f3uV/Js+fXpZP2y1bNnSX++s/5yVWO5zM59LrNNpp57mEBCEhrL9Vie3SsxHO9u1axebz/JX+hYn9EEHHuRtcMD+B7jWrVq7Fke3KNgE24Ufd2kvDuT6GDj+uOPr2G3RokXuwAMO9HkPb364449yDjn4ELdixYo66XGeXnXlVT7N3nvt7eir/fbdz/8+o+0ZsY7ySu+PuPrjDOzfv79vN/Zq0aKFO+nEk9y+++zrj/GxPcyHY7Ht6W39uf3329+dfNLJhbw4GP/++++i9OTFYWl9evRRRzv63crH9g8//HCdPOE1a3V/wSsLnI2JzZs3932DHbHZlClTUtls2rPTCr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EgBsSAGBADYkAMiAExIAbEgBgQA2JADJRiQIIBCQakFBIDYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiIEaZECCgRrs9FIKEp2TwkgMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExUBsMSDAgwYCUQmJADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMVCDDEgwUIOdLjVQbaiB1M/qZzEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBkoxIMGABANSCokBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxEANMiDBQA12eikFic5JYSQGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYqA0GJBiQYEBKITEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGKhBBhpdMDDvxXlu1qxZJf+++OKLBsH35ZdfFpU/Z84ct3zZcrdhw4bEcjkXrddLL73kli1b5rZv3x6b76233vJ5Pvnkk9jzmzdv9ufffvvt2POocN577z13y8Bb3AXnX+A6d+rs7rzjTvf8c8+7bVu3JeZpSuod6hm1W/T3/Pnz67Tll19+cXPnzHUDBgxwl1x8iWt3djvXu3dv98gjj7idO3fWSR+2+cMPP3Rjx45111x9jTun/Tnu+uuudyNHjnQfffRRUb4lS5bUWzfq+u677xblC69VTfu//fabtzlt3rF9R71tfn3R6+7ee+5153Y+11137XXuqUlPue+++67efItfX+xGPDDC9+t5557n+3jsmLHu+++/T8ybtW7V0C9p7h27l3799dci2zH23HXXXX7c6HFFD38/JI1v3C9WTqntggULiq5RDTYuRxsYV0aNGuW6XdLNXXbpZW706NEuacxvyPUYExn/ruh+hetwTgd384Cb3YtzX4ztE64/Y8YMd/ttt/vnRpcLuri+ffu6yU9Ndn/++WdsHuq2ft1699DIh/zY2bFDR9elS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YEANiQAyIATEgBsRAY2eg5oKBhQsWurlz5/q/efPmuaVLl7pVq1a5n3/+uWYKldWrV/v81q1bl5rH119/HZWL8lG291a857Zs2ZIah85esmRJQTyrmx3fWvZW0fiNHRjK//vvv7v58+a7oUOHul6X9XKdzuvk+vXr5x5//HH3yy+/JNY/T5ywrZa/tdy3+xdffJGYfhh248aNbty4ca53r97uisuvcOPHj3eff/55yXhhGo31/O233y7KJ5x++eWXJduCcUBYxlKptqBvHnrwIc/ChRdc6LmYNHGS27VrV8m4pdJuqvf37t3r23fUyFGue/funtU777jTPTP9mYI2++STT0r2J/3EvGRttXPHzpJxFi1aFIW3eDrue6Gpr/mDOZE58+qrrnZdzu/ihg0d5hbMX1C0X3i+3HvPve6C7he4m268yfPy448/Fo1Dv/7xxx9+zoaVPbv3lAy/fft2N2rUKNezZ0938UUXu7vuussVe56SR544xCt3/vjggw/c4EGDXbeu3dyVV1zpHn74Yffdd9+VrFND5Puf//ynmzNnju976jNi+Ag/dv/9739XpT555o+wnb7//ns3Y8YM397ndz7fXXPNNW706NHujTfeSC1fuXF27Njhnn76aXfDDTe4iy68yN13331uxYoViekT9rXXXnP3j7nfXXbpZa5rl64+3tixY91PP/2UGCesj/HGOCj1LkFe06dPd/1v7u/HAHkNGTLEvTDzBffXX39lyiue9/7+nXf+yFJu2oR2zfK3bdu2Ou2Xdf5gbKxdu9ZNmzbN3TLwFte5U2f//GT+fPPNN+ukS9mzlu23335LjB/W3/6/KPa/AvXjnYj5qcfFPdyDDzzo/+8J09G5PiCIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADDQ0BmouGGjZoqX72//7W52/Aw840Bsk/vOf/5T8QFduo7Vt29bnd+4556am/dKcl+qUycp51plneQFBUr6nnXpaajzid+rUKTXPpPQa2zWMO4cfdrhvg0MPOdS1O62da3V8q6hNaLu4QTpPHGuXr776yhuirW+emvxU0fZdtmyZO+zQw3x5jm55tOOPuEf8/Qi3cuXKonEtz8Z8xJBobZV2xOBRrI4Ys09v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bEgBgQA2KgGTIgwUAz7PRqq06UnpRMYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiIHGx4AEAxIMSCkkBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADzZABCQaaYadL2dP4lD3qM/WZGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBAD1WZAggEJBqQUEgNiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIgWbIgAQDzbDTq606UXpSMokBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGGh8DEgxIMLBflUKff/65e+ONN9yG9Rvczh0792tZNIFVPoH9+uuv7u2333Yr31vptmzZ4vbu3as+bQRzzF9//eXif7UYD5ZHLdIO07R8wmN4X+eVj3W1odpQDIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEQNNgQIKBCox533//vZs7d65bMH9BJqPoBx984AYPGuy6de3mrrziSvfwww+77777LlNcBtzChQt9fj///HOdOBjbKUuxv0WLFtWJR7oY1ebMmeP69evnOnfq7G7sd6Ob8tQU9+effyaGr3Tw//77727AgAHuuGOPc3/7f3+L/g45+JCa5FdpeePxd+zY4V577TV3/5j73WWXXua6dunqbrjhBjd27Fj3008/ZarD8reW+7764osviobf9Okm98jYR1zf6/v6fHr06OFG3jnSvfPOO0XjhWXGcA8Xq1evzhwnjJ/lfPGixZ6dgw48KOpP+nb8+PE1yzNLubKE+fe//+3Wrl3rpk2b5m4ZeIuvR+9evd2wocPcm2++mVp+4r234j33j3/8w1191dWu03md3FVXXuXGjBnjNm/enBpv27Zt7qEHH/JzQI+Le7gHH3jQrVq1KjW81YH5ZsaMGX4OOb/z+e6aa65xo0eP9oIbC5P3yNgLxyLnzE9500uLd+EFF/p8NmzYUPW0Lc81a9bUqQv1oa8sTFM41se4bgrtpDo0jZdV9aP6UQyIAT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sSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxEBTZ0CCAQkGpBQSA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIiBZsiABAPNsNObugpG9ZPSSwyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATFQmgEJBiQYkFJIDIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGmiEDEgw0w06Xkqa0kkZtpDYSA2JADIgBMVD/DHz++efujTfecBvWb3A7d+zUPyd6TxUDYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAzUmIGaCQZ++eUXN3fuXP/373//O7UjP/74Yx/mww8/TA2jD/b1/8Feba42b24M/POf/3Rz5sxxw4YOc926dnMjho8oOX/lbaMPPvjADR402Odz5RVXuocffth99913debAX3/91b399ttu/Pjx7rprr3OdOnVyffr0caNGjnKfffZZnfBWnt9//93NnzffDR061PW6rJfrdF4n169fP/f444875mYLZ8f6ysfyix8XLlzo2/rnn3+uU7Yw7CeffOImTZrk+l7f153f+Xx38003u7Fjx7qNGzcWjRemofPazG1vLXvL3XvPve6C7he4m268yT0z/Rn3448/Vr1fso6deD9///33nrEF8xdkKtPevXt9eMZa9+7dXe9evd2dd9zp6xVP235njcM70dq1a920adPcLQNvcZ07dfbpM/e8+eabieWDfXunKnZcsmRJFD9PHKtLfR+ZswYMGOCOO/Y497f/97fo75CDD4nqEy/T8reW+zb54osvUsPE49T6N3PRuHHjfH9ecfkVfu5GAFHtfLdv3+5GjRrlevbs6S6+6GJ31113uXXr1qXms+nTTe6RsY/4ubNrl66uR48ebuSdI90777yTGide5i1btvj2Xr16ddXj5Jk/so63v/76K9PY+e233xLrlTWfeHvpd22eNWpXtasYEANiQAyIATEgBsSAGBADYkAMiAExIAZqw0DNBAN8wLWPvnzUTevA7t26+3AYttLC6HptOl/tqnYVA/sY+OOPP1zv3r39XHTA3w5wp55yqjvwgAP97+uv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gBsyAGTADk5CBUsHApk2birfffrv4wx/+YDAmIRhWBU0cVZDb0m1pBsyAGTADZsAMmAEzYAbMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsxAjoFSwcC2bduCYODDDz+0YMCCATNgBsyAGTADZsAMmAEzYAbMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGTADE4yBUsHA73//+yAY2LJlS/HHP/7RDT/BGj6nHvE1q4rMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGTADZsAMmAEzYAbMgBkwA5OHgf8P+JFyp48jGB8AAAAASUVORK5CYII=)", "_____no_output_____" ] ], [ [ "documentAssembler = DocumentAssembler()\\\n .setInputCol(\"text\")\\\n .setOutputCol(\"document\")\n\nsentenceDetector = SentenceDetector()\\\n .setInputCols([\"document\"])\\\n .setOutputCol(\"sentence\")\n\ntokenizer = Tokenizer()\\\n .setInputCols([\"sentence\"])\\\n .setOutputCol(\"token\")\n\nword_embeddings = WordEmbeddingsModel.pretrained(\"embeddings_clinical\", \"en\", \"clinical/models\")\\\n .setInputCols([\"sentence\", \"token\"])\\\n .setOutputCol(\"embeddings\")\n\nade_ner = NerDLModel.pretrained(\"ner_ade_clinical\", \"en\", \"clinical/models\") \\\n .setInputCols([\"sentence\", \"token\", \"embeddings\"]) \\\n .setOutputCol(\"ner\")\n\nner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ner_chunk\")\n\nner_pipeline = Pipeline(stages=[\n documentAssembler, \n sentenceDetector,\n tokenizer,\n word_embeddings,\n ade_ner,\n ner_converter])\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nade_ner_model = ner_pipeline.fit(empty_data)\n\nade_ner_lp = LightPipeline(ade_ner_model)", "_____no_output_____" ], [ "light_result = ade_ner_lp.fullAnnotate(\"I feel a bit drowsy & have a little blurred vision, so far no gastric problems. I have been on Arthrotec 50 for over 10 years on and off, only taking it when I needed it. Due to my arthritis getting progressively worse, to the point where I am in tears with the agony, gp's started me on 75 twice a day and I have to take it every day for the next month to see how I get on, here goes. So far its been very good, pains almost gone, but I feel a bit weird, didn't have that when on 50.\")\n\nchunks = []\nentities = []\nbegin =[]\nend = []\n\nfor n in light_result[0]['ner_chunk']:\n\n begin.append(n.begin)\n end.append(n.end)\n chunks.append(n.result)\n entities.append(n.metadata['entity']) \n\nimport pandas as pd\n\ndf = pd.DataFrame({'chunks':chunks, 'entities':entities,\n 'begin': begin, 'end': end})\n\ndf", "_____no_output_____" ] ], [ [ "as you see `gastric problems` is not detected as `ADE` as it is in a negative context. So, NER did a good job ignoring that.", "_____no_output_____" ], [ "#### ADE NER with Bert embeddings", "_____no_output_____" ], [ "![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACCQAAAEKCAYAAADAEhYvAAAgAElEQVR4Aeyd95cURfu33z/ka8SMCROGRRETKqACBkwYABUwIIoBUQETPiiCD4IiJoIgIkpQBCUJJhRBBVR4UDCAGDH9Wu+5inO3Nb3dMz29M8vs7odz9nRPd1e66+rqpu9P3fX/XOzfV1995fj7559/9CcbiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA7kY+H8xPYIXI0iQIDGGBCliQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBhrCgAQJUrLkUrI0BDql1aAlBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGGj+DEiQIEGCBAliQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBirOgAQJgqriUEnJ1PyVTOpj9bEYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEAOlGJAgQYIECRLEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADFScAQkSBFXFoSqlgtF5KaXEgBgQA2JADIgBM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ZEmC3ASJDRckMAa5Vls3RjX/PTTT97xdtSRR+WuUy21h6gICBL69u2buz2///577rTV7LNy7+uwLj///HOmNpUzFoT5//LLL67SEWDC/JvKPrPysWGW+nLvlWsz8sfWWfJv6deUMxYMvHmge+6555yNZRIkVP/lq6XzqfaLMTEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxEDLYaAmBQkLFy50V1xxhWtX184dftjh7sR2J7ounbu4Ll26uEWLFkXOqAcfeNA7X8eOHeuPvfvuu65fv36OGe/777e/GzBgQKrzCsHC448/7o4/7nhHiOpWe7dync7u5JYtWxbln3QjSJCQXZAwaNAg32fr1q3zNn3ppZdcjx493F577uXatGnjnhj7RFFbJ9m/0sc2bdrkGWp/UvuidcERCn8XXXiRvw6n/WOjHnMdO3b0/Jx04knurbfeKppHpeuelN+0F6f59mD7pPN2bMuWLb491117nb9uy+Ytbvjw4f6e23uvvd0F51/gPvjgg6J5WF6V3uIYxdYvv/yyLz/rff3m/Dd9ujFjxvh0zO6+9ZZb3XHHHudtcughh7opU6bUa1PeseCbb75x/fv3j/I/YP8D/DhFmUuWLKlXTqXttCvzGzVqlLc1s+mpx2uvveZYxuXg1gf7+6HtMW3dmjVr6tng+++/d3fecac75OBDfJ+0Pqi169mzp+M+LNaeyZMn+/JY/ofx+oTjT3BXXnGle+ihh8oSnxUro7mdyzoWJLVbgoSW8xKY1P86pv4XA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiIFKMlBzggQcXczw5u+INke4bt26uboT6nxIfY7NfHlm5LgKBQmLFy12++6zr8OZioBhj9338HlceMGF0fWh4e64/Q5/npnxCBd69+7t0+65x57u1VdfTUxD+pYoSPj444/dWWee5f/q6uq83XA82jHbXnrJpQV2M6fWypUrvfOe/kMscmzbY30e/H7kkUcK0oR9VM392267zdf/1FNO9XWBHWuHbXGMWx1wWlNfnM7M1O95eU//mxDn5lyFuaVLl0ZpLG1jbBHTUG9zviPksXbYln6wuvzvf//z9UdIgZP45PYne0fv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hp06a5gdcMdOeec64784wz3bBhw9wzM57xht2k+NR9/Pjx7pKLL3FnnH6GGzF8RCI/GPYrcfPFF18UtRkCj1mzZrkbb7jR9ejew/U8t6dv6+lPTHf//ve/i8ImlTHP9Vfnv+p52/Pvexb6k76dMGFCzfLMU864OP/5z3/ce++956ZOneqGDB7i69G3T1/fN2+88UbZ8m/atMndd+997qILL/I3S8g1AAAgAElEQVRtfe8997p33nmnbBzKwFinb0ffPNr16NHDkd9NN97knpj2RGzcxozruDpHrzH2wrHI+f333x9blmjcLL/PPutsn8/q1aurnraVY+XKlSV1oT5LlyytWZ6Wd1MeEfzA0IoVK1pUvZqyDZWXXqLFgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMNB0DNRckYOy788473ffff9/sjScYBzHwHnjAgd7wxTEJVozKUUNf0u9vv/3Wp3PP3fekitPh+A5F+WJwPq/3eT7uHn/bwx15xJGFdDCa79ixoyi8lfnXX3/1htG/7/F3H/7SSy+NDWfhG3PE+IsxnjY4/bTT3cMTHvYCijF3jHEXX3RxzfJtTJmjcceOHetoX+pA35/Y+UT3j/3+UWjry/pd5hAeRONhvD76qKN9uP323c8dcvAhhTijR48uETKc1eOswv0kZhBAhPlYn++z9z6u4wkdXfuj2zvr1xM6nFCT8YeAhfwwaiOEePbZZ92kSZPc4MGD3XOznysqX1jWejnf+PnGQjvTn11O7OIOP+zwwrUrLr+ipG8o+4JXF7g2B7Xx4dq0aePatm3rz2HjySefTKw3YhbYtz49/rjjfVzi0Y7Rdsk7rqPplPs97NphXriCUKjbqd182ZqrIGHjxo2FulCfdke28/VpSYIEBC2MZxi68sorS5gp19e613QvVmprtbUYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIiBvxiouSChW7ddRi5WcDfnhv/000/9imYMQfv/Y39vEConSCA8K+fL/WHM3neffQsr2F955ZWy4a+84kqfb+9evYvaktXZlOvyyy53X375pb/3wQcfeMM01zESR9seLwtmJLf61FKQwApwyoJAwjxCRM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AxUnQEJEgRV1aGS+qg+1UfqF/WLGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADTcmABAkSJEiQIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2Kg6gxIkCCoqg5VUypqlJcUXGJADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIiB+mRAggQJEiRIEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATFQdQYkSBBUVYdK6qP6VB+pX9QvYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMNCUDEiRIkCBBghgQA2JADIgBMSAGxIAYEANiQAyIATEgBsSAGBADYkAMiAExIAbEgBgQA2JADIiBqjMgQYKgqjpUTamoUV5ScIkBMSAGxIAYaH0M/Pvf/3YrV650ixYtcuvWrnM7duzQ+4zeacWAGBADYkAMiAExIAbEgBgQA2JADIgBMSAGxIAYEAN1yEDVBQk///yza2ho8H//+c9/Ejv9448/9mHef//9xDAyMLQ+A4P6XH3e1Az861//crNnz3Yjho9w3c/s7kaNHFVx/spbxnfffdddO/Ran89FF17k7r//fvftt9+WzIG//PKLW7x4sZswYYK7/LLLXbdu3dyll17qRt882n366acl4cuVZ+7cub4+P/30U8V4H330kQ+7fPnyimEtz7RxfvvtN/fySy+74cOHuz7n93HdTu3mBgwY4MaPH+94blh64XHLli1u2rRpbuA1A92555zrzjzjTDds2DD3zIxn3J9//hkbJ4yv89rPJ28ufNPdcfsd7qweZ7mrr7raPTHtCff9999XpW+2btnqebR3inLH33//vSTPtOPNONm0aZO77977HGOz57k93b333OveeeedknQtvB2z5mPx7LhixQpfz88//7xiXhYn7bj+7rvv3PTp0/28c/ppp7t+/fq5MWPGuNdff70or2rOOVbGWh0/++wzd/5557t/7PcP97f/+1vhr2+fvkV1CvNf9OYi38YbNmxIDBOGb4rzNWvWuHHjxj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2AGzIAZMANmwAyYATNgBsyAGTADZsAMmAEzYAbMgBkwA2bADPSdAQsSDFXfobKKaWyrmNy+bl8zYAbMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGTADZsAMmAEzYAbqMGBBggUJFiSYATNgBsyAGTADZsAMmAEzYAbMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGeg7AxYkGKq+Q1VHCeNnrJgyA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGTADZsAMmAEzYAbMgBkwA2bADIxtBixIsCDBggQzYAbMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGTADZsAMmAEzYAbMgBkwA31nwIIEQ9V3qKxiGtsqJrev29cMmAEzYAbMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGTADZsAMmIE6DFiQYEGCBQlmwAyYATNgBsyAGTADZsAMmAEzYAbMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBvrOgAUJhqrvUNVRwvgZK6bMgBkwA2bADJgBM2AGzIAZMANmwAyYATNgBsyAGTADZsAMmAEzYAbMgBkwA2Obgf8H57CCZr5JbcQAAAAASUVORK5CYII=)", "_____no_output_____" ] ], [ [ "documentAssembler = DocumentAssembler()\\\n .setInputCol(\"text\")\\\n .setOutputCol(\"document\")\n\nsentenceDetector = SentenceDetector()\\\n .setInputCols([\"document\"])\\\n .setOutputCol(\"sentence\")\n\ntokenizer = Tokenizer()\\\n .setInputCols([\"sentence\"])\\\n .setOutputCol(\"token\")\n\nbert_embeddings = BertEmbeddings.pretrained(\"biobert_pubmed_base_cased\")\\\n .setInputCols([\"sentence\", \"token\"])\\\n .setOutputCol(\"embeddings\")\n \nade_ner_bert = NerDLModel.pretrained(\"ner_ade_biobert\", \"en\", \"clinical/models\") \\\n .setInputCols([\"sentence\", \"token\", \"embeddings\"]) \\\n .setOutputCol(\"ner\")\n\nner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ner_chunk\")\n\nner_pipeline = Pipeline(stages=[\n documentAssembler, \n sentenceDetector,\n tokenizer,\n bert_embeddings,\n ade_ner_bert,\n ner_converter])\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nade_ner_model_bert = ner_pipeline.fit(empty_data)\n\nade_ner_lp_bert = LightPipeline(ade_ner_model_bert)", "biobert_pubmed_base_cased download started this may take some time.\nApproximate size to download 386.4 MB\n[OK!]\nner_ade_biobert download started this may take some time.\nApproximate size to download 15.3 MB\n[OK!]\n" ], [ "light_result = ade_ner_lp_bert.fullAnnotate(\"I feel a bit drowsy & have a little blurred vision, so far no gastric problems. I have been on Arthrotec 50 for over 10 years on and off, only taking it when I needed it. Due to my arthritis getting progressively worse, to the point where I am in tears with the agony, gp's started me on 75 twice a day and I have to take it every day for the next month to see how I get on, here goes. So far its been very good, pains almost gone, but I feel a bit weird, didn't have that when on 50.\")\n\nchunks = []\nentities = []\nbegin =[]\nend = []\n\nfor n in light_result[0]['ner_chunk']:\n\n begin.append(n.begin)\n end.append(n.end)\n chunks.append(n.result)\n entities.append(n.metadata['entity']) \n\nimport pandas as pd\n\ndf = pd.DataFrame({'chunks':chunks, 'entities':entities,\n 'begin': begin, 'end': end})\n\ndf", "_____no_output_____" ] ], [ [ "Looks like Bert version of NER returns more entities than clinical embeddings version.", "_____no_output_____" ], [ "## NER and Classifier combined with AssertionDL Model", "_____no_output_____" ] ], [ [ "assertion_ner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ass_ner_chunk\")\\\n .setWhiteList(['ADE'])\n\nbiobert_assertion = AssertionDLModel.pretrained(\"assertiondl_biobert\", \"en\", \"clinical/models\") \\\n .setInputCols([\"sentence\", \"ass_ner_chunk\", \"embeddings\"]) \\\n .setOutputCol(\"assertion\")\n\nassertion_ner_pipeline = Pipeline(stages=[\n documentAssembler, \n sentenceDetector,\n tokenizer,\n bert_embeddings,\n ade_ner_bert,\n ner_converter,\n assertion_ner_converter,\n biobert_assertion])\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nade_ass_ner_model_bert = assertion_ner_pipeline.fit(empty_data)\n\nade_ass_ner_model_lp_bert = LightPipeline(ade_ass_ner_model_bert)", "assertiondl_biobert download started this may take some time.\nApproximate size to download 3 MB\n[OK!]\n" ], [ "import pandas as pd\ntext = \"I feel a bit drowsy & have a little blurred vision, so far no gastric problems. I have been on Arthrotec 50 for over 10 years on and off, only taking it when I needed it. Due to my arthritis getting progressively worse, to the point where I am in tears with the agony, gp's started me on 75 twice a day and I have to take it every day for the next month to see how I get on, here goes. So far its been very good, pains almost gone, but I feel a bit weird, didn't have that when on 50.\"\n\nprint (text)\n\nlight_result = ade_ass_ner_model_lp_bert.fullAnnotate(text)[0]\n\nchunks=[]\nentities=[]\nstatus=[]\n\nfor n,m in zip(light_result['ass_ner_chunk'],light_result['assertion']):\n \n chunks.append(n.result)\n entities.append(n.metadata['entity']) \n status.append(m.result)\n \ndf = pd.DataFrame({'chunks':chunks, 'entities':entities, 'assertion':status})\n\ndf", "I feel a bit drowsy & have a little blurred vision, so far no gastric problems. I have been on Arthrotec 50 for over 10 years on and off, only taking it when I needed it. Due to my arthritis getting progressively worse, to the point where I am in tears with the agony, gp's started me on 75 twice a day and I have to take it every day for the next month to see how I get on, here goes. So far its been very good, pains almost gone, but I feel a bit weird, didn't have that when on 50.\n" ] ], [ [ "Looks great ! `gastric problems` is detected as `ADE` and `absent`", "_____no_output_____" ], [ "## ADE models applied to Spark Dataframes", "_____no_output_____" ] ], [ [ "import pyspark.sql.functions as F\n\n! wget -q\thttps://raw.githubusercontent.com/JohnSnowLabs/spark-nlp-workshop/master/tutorials/Certification_Trainings/Healthcare/data/sample_ADE_dataset.csv\n\nade_DF = spark.read\\\n .option(\"header\", \"true\")\\\n .csv(\"./sample_ADE_dataset.csv\")\\\n .filter(F.col(\"label\").isin(['True','False']))\n\nade_DF.show(truncate=50)", "+--------------------------------------------------+-----+\n| text|label|\n+--------------------------------------------------+-----+\n|Do U know what Meds are R for bipolar depressio...|False|\n|# hypercholesterol: Because of elevated CKs (pe...| True|\n|Her weight, respirtory status and I/O should be...|False|\n|* DM - Pt had several episodes of hypoglycemia ...| True|\n|We report the case of a female acromegalic pati...| True|\n|2 . Calcipotriene 0.005% Cream Sig: One (1) App...|False|\n|Always tired, and possible blood clots. I was o...| True|\n|A difference in chemical structure between thes...|False|\n|10 . She was left on prednisone 20mg qd due to ...|False|\n|The authors suggest that risperidone may increa...| True|\n|- Per oral maxillofacial surgery there is no ev...|False|\n|@marionjross Cipro is just as bad! Stay away fr...|False|\n|A young woman with epilepsy had tonic-clonic se...| True|\n|Intravenous methotrexate is an effective adjunc...|False|\n|PURPOSE: To report new indocyanine green angiog...|False|\n|2 . Docusate Sodium 50 mg/5 mL Liquid [**Hospit...|False|\n| consider neupogen.|False|\n|He was treated allopurinol and Rasburicase for ...|False|\n|Toxicity, pharmacokinetics, and in vitro hemodi...| True|\n|# thrombocytopenia: Secondary to chemotherapy a...| True|\n+--------------------------------------------------+-----+\nonly showing top 20 rows\n\n" ] ], [ [ "**With BioBert version of NER** (will be slower but more accurate)", "_____no_output_____" ] ], [ [ "import pyspark.sql.functions as F\n\nner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ner_chunk\")\\\n .setWhiteList(['ADE'])\n\nner_pipeline = Pipeline(stages=[\n documentAssembler, \n sentenceDetector,\n tokenizer,\n bert_embeddings,\n ade_ner_bert,\n ner_converter])\n\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nade_ner_model = ner_pipeline.fit(empty_data)\n\nresult = ade_ner_model.transform(ade_DF)\n\nsample_df = result.select('text','ner_chunk.result')\\\n.toDF('text','ADE_phrases').filter(F.size('ADE_phrases')>0).toPandas()", "_____no_output_____" ], [ "import pandas as pd\npd.set_option('display.max_colwidth', 0)", "_____no_output_____" ], [ "sample_df.sample(20)", "_____no_output_____" ] ], [ [ "**Doing the same with clinical embeddings version** (faster results)", "_____no_output_____" ] ], [ [ "import pyspark.sql.functions as F\n\nner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ner_chunk\")\\\n .setWhiteList(['ADE'])\n\nner_pipeline = Pipeline(stages=[\n documentAssembler, \n sentenceDetector,\n tokenizer,\n word_embeddings,\n ade_ner,\n ner_converter])\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nade_ner_model = ner_pipeline.fit(empty_data)\n\nresult = ade_ner_model.transform(ade_DF)\n\nresult.select('text','ner_chunk.result')\\\n.toDF('text','ADE_phrases').filter(F.size('ADE_phrases')>0)\\\n.show(truncate=70)\n", "+----------------------------------------------------------------------+----------------------------------------------------------------------+\n| text| ADE_phrases|\n+----------------------------------------------------------------------+----------------------------------------------------------------------+\n|# hypercholesterol: Because of elevated CKs (peaked at 819) the pat...| [elevated CKs]|\n|We report the case of a female acromegalic patient in whom multiple...| [multiple hepatic adenomas]|\n|Always tired, and possible blood clots. I was on Voltaren for about...| [blood clots that traveled to my eye, back pain]|\n|The authors suggest that risperidone may increase affect in patient...| [increase affect]|\n|A young woman with epilepsy had tonic-clonic seizures during antine...| [tonic-clonic seizures]|\n|Intravenous methotrexate is an effective adjunct to steroid therapy...| [dermatomyositis-polyositis]|\n|PURPOSE: To report new indocyanine green angiographic (ICGA) findin...| [indocyanine green angiographic (ICGA) findings]|\n|Toxicity, pharmacokinetics, and in vitro hemodialysis clearance of ...| [Toxicity]|\n| # thrombocytopenia: Secondary to chemotherapy and MDS/AML concerns.| [thrombocytopenia]|\n|A fatal massive pulmonary embolus developed in a patient treated wi...| [fatal massive pulmonary embolus]|\n|# Maculopapular rash: over extremities, chest and back, thought [**...| [Maculopapular rash]|\n| Hypokalemia after normal doses of neubulized albuterol (salbutamol).| [Hypokalemia]|\n|A transient tonic pupillary response, denervation supersensitivity,...|[transient tonic pupillary response, denervation supersensitivity, ...|\n|As per above, ID added Atovaquone for PCP [**Name9 (PRE) *] given t...| [BM suppression, liver damage]|\n|Electrocardiographic findings and laboratory data indicated a diagn...| [acute myocardial infarction]|\n| Hepatic reactions to cyclofenil.| [Hepatic reactions]|\n|Therefore, parenteral amiodarone was implicated as the cause of acu...| [acute hepatitis]|\n|Vincristine levels were also assayed and showed a dramatic decline ...| [dramatic decline in postexchange levels]|\n|Eight days after the end of interferon treatment, he showed signs o...| [inability to sit]|\n|2 years with no problems, then toe neuropathy for two years now and...|[toe neuropathy, toe neuropathy, stomach problems, pain, heart woul...|\n+----------------------------------------------------------------------+----------------------------------------------------------------------+\nonly showing top 20 rows\n\n" ] ], [ [ "### creating sentence dataframe (one sentence per row) and getting ADE entities and categories", "_____no_output_____" ] ], [ [ "documentAssembler = DocumentAssembler()\\\n .setInputCol(\"text\")\\\n .setOutputCol(\"document\")\n\nsentenceDetector = SentenceDetector()\\\n .setInputCols([\"document\"])\\\n .setOutputCol(\"sentence\")\\\n .setExplodeSentences(True)\n\ntokenizer = Tokenizer()\\\n .setInputCols([\"sentence\"])\\\n .setOutputCol(\"token\")\n\nbert_embeddings = BertEmbeddings.pretrained(\"biobert_pubmed_base_cased\")\\\n .setInputCols([\"sentence\", \"token\"])\\\n .setOutputCol(\"embeddings\")\n\nembeddingsSentence = SentenceEmbeddings() \\\n .setInputCols([\"sentence\", \"embeddings\"]) \\\n .setOutputCol(\"sentence_embeddings\") \\\n .setPoolingStrategy(\"AVERAGE\")\\\n .setStorageRef('biobert_pubmed_base_cased')\n\nclasssifierdl = ClassifierDLModel.pretrained(\"classifierdl_ade_biobert\", \"en\", \"clinical/models\")\\\n .setInputCols([\"sentence\", \"sentence_embeddings\"]) \\\n .setOutputCol(\"class\")\\\n .setStorageRef('biobert_pubmed_base_cased')\n\nade_ner = NerDLModel.pretrained(\"ner_ade_biobert\", \"en\", \"clinical/models\") \\\n .setInputCols([\"sentence\", \"token\", \"embeddings\"]) \\\n .setOutputCol(\"ner\")\n \nner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ner_chunk\")\\\n .setWhiteList(['ADE'])\n\nner_clf_pipeline = Pipeline(\n stages=[documentAssembler, \n sentenceDetector,\n tokenizer,\n bert_embeddings,\n embeddingsSentence,\n classsifierdl,\n ade_ner,\n ner_converter])\n\nade_Sentences = ner_clf_pipeline.fit(ade_DF)", "biobert_pubmed_base_cased download started this may take some time.\nApproximate size to download 386.4 MB\n[OK!]\nclassifierdl_ade_biobert download started this may take some time.\nApproximate size to download 22 MB\n[OK!]\nner_ade_biobert download started this may take some time.\nApproximate size to download 15.3 MB\n[OK!]\n" ], [ "import pyspark.sql.functions as F\n\nade_Sentences.transform(ade_DF).select('sentence.result','ner_chunk.result','class.result')\\\n.toDF('sentence','ADE_phrases','is_ADE').show(truncate=60)", "+------------------------------------------------------------+---------------------------------------------+-------+\n| sentence| ADE_phrases| is_ADE|\n+------------------------------------------------------------+---------------------------------------------+-------+\n| [Do U know what Meds are R for bipolar depression?]| []|[False]|\n| [Currently #FDA approved #quetiapine AKA #Seroquel]| []|[False]|\n|[# hypercholesterol: Because of elevated CKs (peaked at 8...| [elevated CKs]|[False]|\n|[Her weight, respirtory status and I/O should be monitore...| []|[False]|\n|[* DM - Pt had several episodes of hypoglycemia on lantus...| [hypoglycemia]| [True]|\n|[We report the case of a female acromegalic patient in wh...| [hepatic adenomas]| [True]|\n| [2 .]| []|[False]|\n|[Calcipotriene 0.005% Cream Sig: One (1) Appl Topical [**...| []|[False]|\n| [Always tired, and possible blood clots.]| [tired, blood clots]|[False]|\n|[I was on Voltaren for about 4 years and all of the sudde...|[stroke, blood clots that traveled to my eye]|[False]|\n|[I had every test in the book done at the hospital, and t...| []|[False]|\n| [I was completley healthy!]| [completley healthy]|[False]|\n| [I am thinking it was from the voltaren.]| []|[False]|\n|[I have been off of the drug for 8 months now, and have n...| []|[False]|\n|[I started eating healthy and working out and that has he...| []|[False]|\n| [I can now sleep all thru the night.]| []|[False]|\n| [I wont take this again.]| []|[False]|\n| [If I have the back pain, I will pop a tylonol instead.]| []|[False]|\n|[A difference in chemical structure between these two dru...| []|[False]|\n| [10 .]| []|[False]|\n+------------------------------------------------------------+---------------------------------------------+-------+\nonly showing top 20 rows\n\n" ] ], [ [ "## Creating a pretrained pipeline with ADE NER, Assertion and Classifer", "_____no_output_____" ] ], [ [ "# Annotator that transforms a text column from dataframe into an Annotation ready for NLP\ndocumentAssembler = DocumentAssembler()\\\n .setInputCol(\"text\")\\\n .setOutputCol(\"sentence\")\n\n# Tokenizer splits words in a relevant format for NLP\ntokenizer = Tokenizer()\\\n .setInputCols([\"sentence\"])\\\n .setOutputCol(\"token\")\n\nbert_embeddings = BertEmbeddings.pretrained(\"biobert_pubmed_base_cased\")\\\n .setInputCols([\"sentence\", \"token\"])\\\n .setOutputCol(\"embeddings\")\n\nade_ner = NerDLModel.pretrained(\"ner_ade_biobert\", \"en\", \"clinical/models\") \\\n .setInputCols([\"sentence\", \"token\", \"embeddings\"]) \\\n .setOutputCol(\"ner\")\\\n .setStorageRef('biobert_pubmed_base_cased')\n\nner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ner_chunk\")\n\nassertion_ner_converter = NerConverter() \\\n .setInputCols([\"sentence\", \"token\", \"ner\"]) \\\n .setOutputCol(\"ass_ner_chunk\")\\\n .setWhiteList(['ADE'])\n\nbiobert_assertion = AssertionDLModel.pretrained(\"assertiondl_biobert\", \"en\", \"clinical/models\") \\\n .setInputCols([\"sentence\", \"ass_ner_chunk\", \"embeddings\"]) \\\n .setOutputCol(\"assertion\")\n\nembeddingsSentence = SentenceEmbeddings() \\\n .setInputCols([\"sentence\", \"embeddings\"]) \\\n .setOutputCol(\"sentence_embeddings\") \\\n .setPoolingStrategy(\"AVERAGE\")\\\n .setStorageRef('biobert_pubmed_base_cased')\n\nclasssifierdl = ClassifierDLModel.pretrained(\"classifierdl_ade_conversational_biobert\", \"en\", \"clinical/models\")\\\n .setInputCols([\"sentence\", \"sentence_embeddings\"]) \\\n .setOutputCol(\"class\")\n\nade_clf_pipeline = Pipeline(\n stages=[documentAssembler, \n tokenizer,\n bert_embeddings,\n ade_ner,\n ner_converter,\n assertion_ner_converter,\n biobert_assertion,\n embeddingsSentence,\n classsifierdl])\n\nempty_data = spark.createDataFrame([[\"\"]]).toDF(\"text\")\n\nade_ner_clf_model = ade_clf_pipeline.fit(empty_data)\n\nade_ner_clf_pipeline = LightPipeline(ade_ner_clf_model)", "biobert_pubmed_base_cased download started this may take some time.\nApproximate size to download 386.4 MB\n[OK!]\nner_ade_biobert download started this may take some time.\nApproximate size to download 15.3 MB\n[OK!]\nassertiondl_biobert download started this may take some time.\nApproximate size to download 3 MB\n[OK!]\nclassifierdl_ade_conversational_biobert download started this may take some time.\nApproximate size to download 22 MB\n[OK!]\n" ], [ "classsifierdl.getStorageRef()", "_____no_output_____" ], [ "text = 'Always tired, and possible blood clots. I was on Voltaren for about 4 years and all of the sudden had a minor stroke and had blood clots that traveled to my eye. I had every test in the book done at the hospital, and they couldnt find anything. I was completley healthy! I am thinking it was from the voltaren. I have been off of the drug for 8 months now, and have never felt better. I started eating healthy and working out and that has help alot. I can now sleep all thru the night. I wont take this again. If I have the back pain, I will pop a tylonol instead.'\n\nlight_result = ade_ner_clf_pipeline.fullAnnotate(text)\n\nprint (light_result[0]['class'][0].metadata)\n\nchunks = []\nentities = []\nbegin =[]\nend = []\n\nfor n in light_result[0]['ner_chunk']:\n\n begin.append(n.begin)\n end.append(n.end)\n chunks.append(n.result)\n entities.append(n.metadata['entity']) \n\nimport pandas as pd\n\ndf = pd.DataFrame({'chunks':chunks, 'entities':entities,\n 'begin': begin, 'end': end})\n\ndf", "{'sentence': '0', 'False': '0.0029532122', 'True': '0.99704677'}\n" ], [ "import pandas as pd\n\ntext = 'I have always felt tired, but no blood clots. I was on Voltaren for about 4 years and all of the sudden had a minor stroke and had blood clots that traveled to my eye. I had every test in the book done at the hospital, and they couldnt find anything. I was completley healthy! I am thinking it was from the voltaren. I have been off of the drug for 8 months now, and have never felt better. I started eating healthy and working out and that has help alot. I can now sleep all thru the night. I wont take this again. If I have the back pain, I will pop a tylonol instead.'\n\nprint (text)\n\nlight_result = ade_ass_ner_model_lp_bert.fullAnnotate(text)[0]\n\nchunks=[]\nentities=[]\nstatus=[]\n\nfor n,m in zip(light_result['ass_ner_chunk'],light_result['assertion']):\n \n chunks.append(n.result)\n entities.append(n.metadata['entity']) \n status.append(m.result)\n \ndf = pd.DataFrame({'chunks':chunks, 'entities':entities, 'assertion':status})\n\ndf", "I have always felt tired, but no blood clots. I was on Voltaren for about 4 years and all of the sudden had a minor stroke and had blood clots that traveled to my eye. I had every test in the book done at the hospital, and they couldnt find anything. I was completley healthy! I am thinking it was from the voltaren. I have been off of the drug for 8 months now, and have never felt better. I started eating healthy and working out and that has help alot. I can now sleep all thru the night. I wont take this again. If I have the back pain, I will pop a tylonol instead.\n" ], [ "result = ade_ner_clf_pipeline.annotate('I just took an Advil 100 mg and it made me drowsy')\n\nprint (result['class'])\nprint(list(zip(result['token'],result['ner'])))", "['True']\n[('I', 'O'), ('just', 'O'), ('took', 'O'), ('an', 'O'), ('Advil', 'B-DRUG'), ('100', 'O'), ('mg', 'O'), ('and', 'O'), ('it', 'O'), ('made', 'O'), ('me', 'O'), ('drowsy', 'B-ADE')]\n" ], [ "ade_ner_clf_model.save('ade_pretrained_pipeline')", "_____no_output_____" ], [ "from sparknlp.pretrained import PretrainedPipeline\n\nade_pipeline = PretrainedPipeline.from_disk('ade_pretrained_pipeline')\n\nade_pipeline.annotate('I just took an Advil 100 mg and it made me drowsy')", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code" ] ]
e7e5f6cc7a06bcbd52fde44aed736cc780bfe647
20,988
ipynb
Jupyter Notebook
Notebooks/Probability_100.ipynb
ShepherdCode/Soars2021
ab4f304eaa09e52d260152397a6c53d7a05457da
[ "MIT" ]
1
2021-08-16T14:49:04.000Z
2021-08-16T14:49:04.000Z
Notebooks/Probability_100.ipynb
ShepherdCode/Soars2021
ab4f304eaa09e52d260152397a6c53d7a05457da
[ "MIT" ]
null
null
null
Notebooks/Probability_100.ipynb
ShepherdCode/Soars2021
ab4f304eaa09e52d260152397a6c53d7a05457da
[ "MIT" ]
null
null
null
26.60076
91
0.457928
[ [ [ "def to_string(num,base=2):\n if num==0:\n return '0'\n q = num//base\n r = num%base\n return to_string(q,base) + str(r)\nprint(\"16 in binary:\",to_string(16))\nprint(\"11 base 3:\",to_string(11,3))", "16 in binary: 010000\n11 base 3: 0102\n" ], [ "def has_consec(string,symbol,min):\n consec=symbol*min\n has=0\n for i in range(0,len(string)-min+1):\n if string[i:i+min] == consec:\n has = 1\n print(\"YES! {:>10}\".format(string))\n break\n return has\nprint (\"15 has 3 consecutive ones?\",has_consec(to_string(15),'1',3))\nprint (\"16 has 3 consecutive ones?\",has_consec(to_string(16),'1',3))", "YES! 01111\n15 has 3 consecutive ones? 1\n16 has 3 consecutive ones? 0\n" ], [ "def sum_consec_one(n,m,base):\n symbol='1'\n c = 0\n for i in range(0,base**n):\n s = to_string(i,base)\n c = c + has_consec(s,symbol,m)\n return c\nbase = 2\nn = 8\nm = 7\nc = sum_consec_one(n,m,base)\nprint (\"Count strings with at least %d consec ones in 2^%d bits = %d\"%(m,n,c) )", "YES! 01111111\nYES! 011111110\nYES! 011111111\nCount strings with at least 7 consec ones in 2^8 bits = 3\n" ], [ "base = 2\nn = 8\nfor m in range(8,0,-1):\n c = sum_consec_one(n,m,base)\n print (\"Count strings with at least %d consec ones in 2^%d bits = %d\"%(m,n,c) )", "YES! 011111111\nCount strings with at least 8 consec ones in 2^8 bits = 1\nYES! 01111111\nYES! 011111110\nYES! 011111111\nCount strings with at least 7 consec ones in 2^8 bits = 3\nYES! 0111111\nYES! 01111110\nYES! 01111111\nYES! 010111111\nYES! 011111100\nYES! 011111101\nYES! 011111110\nYES! 011111111\nCount strings with at least 6 consec ones in 2^8 bits = 8\nYES! 011111\nYES! 0111110\nYES! 0111111\nYES! 01011111\nYES! 01111100\nYES! 01111101\nYES! 01111110\nYES! 01111111\nYES! 010011111\nYES! 010111110\nYES! 010111111\nYES! 011011111\nYES! 011111000\nYES! 011111001\nYES! 011111010\nYES! 011111011\nYES! 011111100\nYES! 011111101\nYES! 011111110\nYES! 011111111\nCount strings with at least 5 consec ones in 2^8 bits = 20\nYES! 01111\nYES! 011110\nYES! 011111\nYES! 0101111\nYES! 0111100\nYES! 0111101\nYES! 0111110\nYES! 0111111\nYES! 01001111\nYES! 01011110\nYES! 01011111\nYES! 01101111\nYES! 01111000\nYES! 01111001\nYES! 01111010\nYES! 01111011\nYES! 01111100\nYES! 01111101\nYES! 01111110\nYES! 01111111\nYES! 010001111\nYES! 010011110\nYES! 010011111\nYES! 010101111\nYES! 010111100\nYES! 010111101\nYES! 010111110\nYES! 010111111\nYES! 011001111\nYES! 011011110\nYES! 011011111\nYES! 011101111\nYES! 011110000\nYES! 011110001\nYES! 011110010\nYES! 011110011\nYES! 011110100\nYES! 011110101\nYES! 011110110\nYES! 011110111\nYES! 011111000\nYES! 011111001\nYES! 011111010\nYES! 011111011\nYES! 011111100\nYES! 011111101\nYES! 011111110\nYES! 011111111\nCount strings with at least 4 consec ones in 2^8 bits = 48\nYES! 0111\nYES! 01110\nYES! 01111\nYES! 010111\nYES! 011100\nYES! 011101\nYES! 011110\nYES! 011111\nYES! 0100111\nYES! 0101110\nYES! 0101111\nYES! 0110111\nYES! 0111000\nYES! 0111001\nYES! 0111010\nYES! 0111011\nYES! 0111100\nYES! 0111101\nYES! 0111110\nYES! 0111111\nYES! 01000111\nYES! 01001110\nYES! 01001111\nYES! 01010111\nYES! 01011100\nYES! 01011101\nYES! 01011110\nYES! 01011111\nYES! 01100111\nYES! 01101110\nYES! 01101111\nYES! 01110000\nYES! 01110001\nYES! 01110010\nYES! 01110011\nYES! 01110100\nYES! 01110101\nYES! 01110110\nYES! 01110111\nYES! 01111000\nYES! 01111001\nYES! 01111010\nYES! 01111011\nYES! 01111100\nYES! 01111101\nYES! 01111110\nYES! 01111111\nYES! 010000111\nYES! 010001110\nYES! 010001111\nYES! 010010111\nYES! 010011100\nYES! 010011101\nYES! 010011110\nYES! 010011111\nYES! 010100111\nYES! 010101110\nYES! 010101111\nYES! 010110111\nYES! 010111000\nYES! 010111001\nYES! 010111010\nYES! 010111011\nYES! 010111100\nYES! 010111101\nYES! 010111110\nYES! 010111111\nYES! 011000111\nYES! 011001110\nYES! 011001111\nYES! 011010111\nYES! 011011100\nYES! 011011101\nYES! 011011110\nYES! 011011111\nYES! 011100000\nYES! 011100001\nYES! 011100010\nYES! 011100011\nYES! 011100100\nYES! 011100101\nYES! 011100110\nYES! 011100111\nYES! 011101000\nYES! 011101001\nYES! 011101010\nYES! 011101011\nYES! 011101100\nYES! 011101101\nYES! 011101110\nYES! 011101111\nYES! 011110000\nYES! 011110001\nYES! 011110010\nYES! 011110011\nYES! 011110100\nYES! 011110101\nYES! 011110110\nYES! 011110111\nYES! 011111000\nYES! 011111001\nYES! 011111010\nYES! 011111011\nYES! 011111100\nYES! 011111101\nYES! 011111110\nYES! 011111111\nCount strings with at least 3 consec ones in 2^8 bits = 107\nYES! 011\nYES! 0110\nYES! 0111\nYES! 01011\nYES! 01100\nYES! 01101\nYES! 01110\nYES! 01111\nYES! 010011\nYES! 010110\nYES! 010111\nYES! 011000\nYES! 011001\nYES! 011010\nYES! 011011\nYES! 011100\nYES! 011101\nYES! 011110\nYES! 011111\nYES! 0100011\nYES! 0100110\nYES! 0100111\nYES! 0101011\nYES! 0101100\nYES! 0101101\nYES! 0101110\nYES! 0101111\nYES! 0110000\nYES! 0110001\nYES! 0110010\nYES! 0110011\nYES! 0110100\nYES! 0110101\nYES! 0110110\nYES! 0110111\nYES! 0111000\nYES! 0111001\nYES! 0111010\nYES! 0111011\nYES! 0111100\nYES! 0111101\nYES! 0111110\nYES! 0111111\nYES! 01000011\nYES! 01000110\nYES! 01000111\nYES! 01001011\nYES! 01001100\nYES! 01001101\nYES! 01001110\nYES! 01001111\nYES! 01010011\nYES! 01010110\nYES! 01010111\nYES! 01011000\nYES! 01011001\nYES! 01011010\nYES! 01011011\nYES! 01011100\nYES! 01011101\nYES! 01011110\nYES! 01011111\nYES! 01100000\nYES! 01100001\nYES! 01100010\nYES! 01100011\nYES! 01100100\nYES! 01100101\nYES! 01100110\nYES! 01100111\nYES! 01101000\nYES! 01101001\nYES! 01101010\nYES! 01101011\nYES! 01101100\nYES! 01101101\nYES! 01101110\nYES! 01101111\nYES! 01110000\nYES! 01110001\nYES! 01110010\nYES! 01110011\nYES! 01110100\nYES! 01110101\nYES! 01110110\nYES! 01110111\nYES! 01111000\nYES! 01111001\nYES! 01111010\nYES! 01111011\nYES! 01111100\nYES! 01111101\nYES! 01111110\nYES! 01111111\nYES! 010000011\nYES! 010000110\nYES! 010000111\nYES! 010001011\nYES! 010001100\nYES! 010001101\nYES! 010001110\nYES! 010001111\nYES! 010010011\nYES! 010010110\nYES! 010010111\nYES! 010011000\nYES! 010011001\nYES! 010011010\nYES! 010011011\nYES! 010011100\nYES! 010011101\nYES! 010011110\nYES! 010011111\nYES! 010100011\nYES! 010100110\nYES! 010100111\nYES! 010101011\nYES! 010101100\nYES! 010101101\nYES! 010101110\nYES! 010101111\nYES! 010110000\nYES! 010110001\nYES! 010110010\nYES! 010110011\nYES! 010110100\nYES! 010110101\nYES! 010110110\nYES! 010110111\nYES! 010111000\nYES! 010111001\nYES! 010111010\nYES! 010111011\nYES! 010111100\nYES! 010111101\nYES! 010111110\nYES! 010111111\nYES! 011000000\nYES! 011000001\nYES! 011000010\nYES! 011000011\nYES! 011000100\nYES! 011000101\nYES! 011000110\nYES! 011000111\nYES! 011001000\nYES! 011001001\nYES! 011001010\nYES! 011001011\nYES! 011001100\nYES! 011001101\nYES! 011001110\nYES! 011001111\nYES! 011010000\nYES! 011010001\nYES! 011010010\nYES! 011010011\nYES! 011010100\nYES! 011010101\nYES! 011010110\nYES! 011010111\nYES! 011011000\nYES! 011011001\nYES! 011011010\nYES! 011011011\nYES! 011011100\nYES! 011011101\nYES! 011011110\nYES! 011011111\nYES! 011100000\nYES! 011100001\nYES! 011100010\nYES! 011100011\nYES! 011100100\nYES! 011100101\nYES! 011100110\nYES! 011100111\nYES! 011101000\nYES! 011101001\nYES! 011101010\nYES! 011101011\nYES! 011101100\nYES! 011101101\nYES! 011101110\nYES! 011101111\nYES! 011110000\nYES! 011110001\nYES! 011110010\nYES! 011110011\nYES! 011110100\nYES! 011110101\nYES! 011110110\nYES! 011110111\nYES! 011111000\nYES! 011111001\nYES! 011111010\nYES! 011111011\nYES! 011111100\nYES! 011111101\nYES! 011111110\nYES! 011111111\nCount strings with at least 2 consec ones in 2^8 bits = 201\nYES! 01\nYES! 010\nYES! 011\nYES! 0100\nYES! 0101\nYES! 0110\nYES! 0111\nYES! 01000\nYES! 01001\nYES! 01010\nYES! 01011\nYES! 01100\nYES! 01101\nYES! 01110\nYES! 01111\nYES! 010000\nYES! 010001\nYES! 010010\nYES! 010011\nYES! 010100\nYES! 010101\nYES! 010110\nYES! 010111\nYES! 011000\nYES! 011001\nYES! 011010\nYES! 011011\nYES! 011100\nYES! 011101\nYES! 011110\nYES! 011111\nYES! 0100000\nYES! 0100001\nYES! 0100010\nYES! 0100011\nYES! 0100100\nYES! 0100101\nYES! 0100110\nYES! 0100111\nYES! 0101000\nYES! 0101001\nYES! 0101010\nYES! 0101011\nYES! 0101100\nYES! 0101101\nYES! 0101110\nYES! 0101111\nYES! 0110000\nYES! 0110001\nYES! 0110010\nYES! 0110011\nYES! 0110100\nYES! 0110101\nYES! 0110110\nYES! 0110111\nYES! 0111000\nYES! 0111001\nYES! 0111010\nYES! 0111011\nYES! 0111100\nYES! 0111101\nYES! 0111110\nYES! 0111111\nYES! 01000000\nYES! 01000001\nYES! 01000010\nYES! 01000011\nYES! 01000100\nYES! 01000101\nYES! 01000110\nYES! 01000111\nYES! 01001000\nYES! 01001001\nYES! 01001010\nYES! 01001011\nYES! 01001100\nYES! 01001101\nYES! 01001110\nYES! 01001111\nYES! 01010000\nYES! 01010001\nYES! 01010010\nYES! 01010011\nYES! 01010100\nYES! 01010101\nYES! 01010110\nYES! 01010111\nYES! 01011000\nYES! 01011001\nYES! 01011010\nYES! 01011011\nYES! 01011100\nYES! 01011101\nYES! 01011110\nYES! 01011111\nYES! 01100000\nYES! 01100001\nYES! 01100010\nYES! 01100011\nYES! 01100100\nYES! 01100101\nYES! 01100110\nYES! 01100111\nYES! 01101000\nYES! 01101001\nYES! 01101010\nYES! 01101011\nYES! 01101100\nYES! 01101101\nYES! 01101110\nYES! 01101111\nYES! 01110000\nYES! 01110001\nYES! 01110010\nYES! 01110011\nYES! 01110100\nYES! 01110101\nYES! 01110110\nYES! 01110111\nYES! 01111000\nYES! 01111001\nYES! 01111010\nYES! 01111011\nYES! 01111100\nYES! 01111101\nYES! 01111110\nYES! 01111111\nYES! 010000000\nYES! 010000001\nYES! 010000010\nYES! 010000011\nYES! 010000100\nYES! 010000101\nYES! 010000110\nYES! 010000111\nYES! 010001000\nYES! 010001001\nYES! 010001010\nYES! 010001011\nYES! 010001100\nYES! 010001101\nYES! 010001110\nYES! 010001111\nYES! 010010000\nYES! 010010001\nYES! 010010010\nYES! 010010011\nYES! 010010100\nYES! 010010101\nYES! 010010110\nYES! 010010111\nYES! 010011000\nYES! 010011001\nYES! 010011010\nYES! 010011011\nYES! 010011100\nYES! 010011101\nYES! 010011110\nYES! 010011111\nYES! 010100000\nYES! 010100001\nYES! 010100010\nYES! 010100011\nYES! 010100100\nYES! 010100101\nYES! 010100110\nYES! 010100111\nYES! 010101000\nYES! 010101001\nYES! 010101010\nYES! 010101011\nYES! 010101100\nYES! 010101101\nYES! 010101110\nYES! 010101111\nYES! 010110000\nYES! 010110001\nYES! 010110010\nYES! 010110011\nYES! 010110100\nYES! 010110101\nYES! 010110110\nYES! 010110111\nYES! 010111000\nYES! 010111001\nYES! 010111010\nYES! 010111011\nYES! 010111100\nYES! 010111101\nYES! 010111110\nYES! 010111111\nYES! 011000000\nYES! 011000001\nYES! 011000010\nYES! 011000011\nYES! 011000100\nYES! 011000101\nYES! 011000110\nYES! 011000111\nYES! 011001000\nYES! 011001001\nYES! 011001010\nYES! 011001011\nYES! 011001100\nYES! 011001101\nYES! 011001110\nYES! 011001111\nYES! 011010000\nYES! 011010001\nYES! 011010010\nYES! 011010011\nYES! 011010100\nYES! 011010101\nYES! 011010110\nYES! 011010111\nYES! 011011000\nYES! 011011001\nYES! 011011010\nYES! 011011011\nYES! 011011100\nYES! 011011101\nYES! 011011110\nYES! 011011111\nYES! 011100000\nYES! 011100001\nYES! 011100010\nYES! 011100011\nYES! 011100100\nYES! 011100101\nYES! 011100110\nYES! 011100111\nYES! 011101000\nYES! 011101001\nYES! 011101010\nYES! 011101011\nYES! 011101100\nYES! 011101101\nYES! 011101110\nYES! 011101111\nYES! 011110000\nYES! 011110001\nYES! 011110010\nYES! 011110011\nYES! 011110100\nYES! 011110101\nYES! 011110110\nYES! 011110111\nYES! 011111000\nYES! 011111001\nYES! 011111010\nYES! 011111011\nYES! 011111100\nYES! 011111101\nYES! 011111110\nYES! 011111111\nCount strings with at least 1 consec ones in 2^8 bits = 255\n" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code" ] ]
e7e60bd7a49d4185659ab995e3580961cbbde648
6,339
ipynb
Jupyter Notebook
Complete-Python-3-Bootcamp-master/00-Python Object and Data Structure Basics/Untitled.ipynb
Larkinnjm1/UDEMY_Python_Megacourse
a8fd42e0ee69b0999c7679849bcab48b311f54e3
[ "MIT" ]
null
null
null
Complete-Python-3-Bootcamp-master/00-Python Object and Data Structure Basics/Untitled.ipynb
Larkinnjm1/UDEMY_Python_Megacourse
a8fd42e0ee69b0999c7679849bcab48b311f54e3
[ "MIT" ]
null
null
null
Complete-Python-3-Bootcamp-master/00-Python Object and Data Structure Basics/Untitled.ipynb
Larkinnjm1/UDEMY_Python_Megacourse
a8fd42e0ee69b0999c7679849bcab48b311f54e3
[ "MIT" ]
null
null
null
23.21978
1,123
0.495662
[ [ [ "vert ='{0:8}¦{0:8}\\n{0:8}¦{0:8}\\n{0:8}¦{0:8}'\nhoriz='---'\na=[1,20,3]\nprint(vert.join(a))\nprint(vert.format('X','O','X'))", "_____no_output_____" ], [ "x=input('player input either x or o:')", "player input either x or o:x\n" ], [ "def player_input(val):\n while val =' ':\n \n val=input('player input either X or O')\n if val.lower() != 'x' or val.lower() != 'o':\n val=' '\n else:\n return val", "_____no_output_____" ], [ "'x'=='x'", "_____no_output_____" ], [ "v=input('player input either X or O:')", "player input either X or O:x\n" ], [ "type(v)", "_____no_output_____" ], [ "v=='x'", "_____no_output_____" ], [ "type(' ')", "_____no_output_____" ], [ "a='X'", "_____no_output_____" ], [ "a.lower()", "_____no_output_____" ], [ "import random\n\ndef choose_first():\n a=random.randint(0, 3)\n b=\"P1\"\n c=\"P2\"\n if a==0 or a==2:\n print('player 1 goes first')\n return b\n elif a==1 or a==3:\n print('player 2 goes first')\n return c", "_____no_output_____" ], [ "choose_first()", "player 2 goes first\n" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e60f6dedf69b3c8db1a62a20698af7426a76df
2,970
ipynb
Jupyter Notebook
notebooks/02_numerical_pipeline_ex_01.ipynb
ThomasBourgeois/scikit-learn-mooc
1c4bd0fb9a8466d396dd5daa64ee500546c9d834
[ "CC-BY-4.0" ]
null
null
null
notebooks/02_numerical_pipeline_ex_01.ipynb
ThomasBourgeois/scikit-learn-mooc
1c4bd0fb9a8466d396dd5daa64ee500546c9d834
[ "CC-BY-4.0" ]
null
null
null
notebooks/02_numerical_pipeline_ex_01.ipynb
ThomasBourgeois/scikit-learn-mooc
1c4bd0fb9a8466d396dd5daa64ee500546c9d834
[ "CC-BY-4.0" ]
null
null
null
25.826087
95
0.589562
[ [ [ "# 📝 Exercise M1.03\n\nThe goal of this exercise is to compare the statistical performance of our\nclassifier (81% accuracy) to some baseline classifiers that would ignore the\ninput data and instead make constant predictions.\n\n- What would be the score of a model that always predicts `' >50K'`?\n- What would be the score of a model that always predicts `' <=50K'`?\n- Is 81% or 82% accuracy a good score for this problem?\n\nUse a `DummyClassifier` and do a train-test split to evaluate\nits accuracy on the test set. This\n[link](https://scikit-learn.org/stable/modules/model_evaluation.html#dummy-estimators)\nshows a few examples of how to evaluate the statistical performance of these\nbaseline models.", "_____no_output_____" ] ], [ [ "import pandas as pd\n\nadult_census = pd.read_csv(\"../datasets/adult-census.csv\")", "_____no_output_____" ] ], [ [ "We will first split our dataset to have the target separated from the data\nused to train our predictive model.", "_____no_output_____" ] ], [ [ "target_name = \"class\"\ntarget = adult_census[target_name]\ndata = adult_census.drop(columns=target_name)", "_____no_output_____" ] ], [ [ "We start by selecting only the numerical columns as seen in the previous\nnotebook.", "_____no_output_____" ] ], [ [ "numerical_columns = [\n \"age\", \"capital-gain\", \"capital-loss\", \"hours-per-week\"]\n\ndata_numeric = data[numerical_columns]", "_____no_output_____" ] ], [ [ "Next, let's split the data and target into a train and test set.", "_____no_output_____" ] ], [ [ "from sklearn.model_selection import train_test_split\n\ndata_numeric_train, data_numeric_test, target_train, target_test = \\\n train_test_split(data_numeric, target, random_state=0)", "_____no_output_____" ], [ "from sklearn.model_selection import train_test_split\nfrom sklearn.dummy import DummyClassifier\n\n# Write your code here.", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ] ]
e7e61b941b80d31fe7984d8888eba0ff5eb9f2a2
9,701
ipynb
Jupyter Notebook
VM_Files/Mikrocontroller_1_Prepare.ipynb
stefanwitossek/securec_ws1920
c5355bf36c12f7b7c9e2ac0f4d79156e43494683
[ "MIT" ]
null
null
null
VM_Files/Mikrocontroller_1_Prepare.ipynb
stefanwitossek/securec_ws1920
c5355bf36c12f7b7c9e2ac0f4d79156e43494683
[ "MIT" ]
null
null
null
VM_Files/Mikrocontroller_1_Prepare.ipynb
stefanwitossek/securec_ws1920
c5355bf36c12f7b7c9e2ac0f4d79156e43494683
[ "MIT" ]
null
null
null
38.343874
627
0.605608
[ [ [ "# Attack Password with Timing Analysis (Preparation)\n\nSupported setups:\n\nSCOPES:\n\n* OPENADC\n\nPLATFORMS:\n\n* CWLITEXMEGA", "_____no_output_____" ], [ "Basic setup for Chip-Whisperer Lite", "_____no_output_____" ] ], [ [ "SCOPETYPE = 'OPENADC'\nPLATFORM = 'CWLITEXMEGA'\nCRYPTO_TARGET = 'NONE'", "_____no_output_____" ] ], [ [ "## Firmware", "_____no_output_____" ], [ "Setup our `PLATFORM`, then build the firmware: \n", "_____no_output_____" ] ], [ [ "%%bash -s \"$PLATFORM\" \"$CRYPTO_TARGET\"\ncd ../hardware/victims/firmware/Mikrocontroller_1\nmake PLATFORM=$1 CRYPTO_TARGET=$2", "rm -f -- basic-passwdcheck-CWLITEXMEGA.hex\nrm -f -- basic-passwdcheck-CWLITEXMEGA.eep\nrm -f -- basic-passwdcheck-CWLITEXMEGA.cof\nrm -f -- basic-passwdcheck-CWLITEXMEGA.elf\nrm -f -- basic-passwdcheck-CWLITEXMEGA.map\nrm -f -- basic-passwdcheck-CWLITEXMEGA.sym\nrm -f -- basic-passwdcheck-CWLITEXMEGA.lss\nrm -f -- objdir/*.o\nrm -f -- objdir/*.lst\nrm -f -- basic-passwdcheck.s simpleserial.s XMEGA_AES_driver.s uart.s usart_driver.s xmega_hal.s\nrm -f -- basic-passwdcheck.d simpleserial.d XMEGA_AES_driver.d uart.d usart_driver.d xmega_hal.d\nrm -f -- basic-passwdcheck.i simpleserial.i XMEGA_AES_driver.i uart.i usart_driver.i xmega_hal.i\nmkdir objdir \n.\n-------- begin --------\navr-gcc (GCC) 4.9.2\nCopyright (C) 2014 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n.\nCompiling C: basic-passwdcheck.c\navr-gcc -c -mmcu=atxmega128d3 -I. -fpack-struct -gdwarf-2 -DSS_VER=SS_VER_1_0 -DHAL_TYPE=HAL_xmega -DPLATFORM=CWLITEXMEGA -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/basic-passwdcheck.lst -I.././simpleserial/ -I.././hal -I.././hal/xmega -I.././crypto/ -std=gnu99 -MMD -MP -MF .dep/basic-passwdcheck.o.d basic-passwdcheck.c -o objdir/basic-passwdcheck.o \n.\nCompiling C: .././simpleserial/simpleserial.c\navr-gcc -c -mmcu=atxmega128d3 -I. -fpack-struct -gdwarf-2 -DSS_VER=SS_VER_1_0 -DHAL_TYPE=HAL_xmega -DPLATFORM=CWLITEXMEGA -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/simpleserial.lst -I.././simpleserial/ -I.././hal -I.././hal/xmega -I.././crypto/ -std=gnu99 -MMD -MP -MF .dep/simpleserial.o.d .././simpleserial/simpleserial.c -o objdir/simpleserial.o \n.\nCompiling C: .././hal/xmega/XMEGA_AES_driver.c\navr-gcc -c -mmcu=atxmega128d3 -I. -fpack-struct -gdwarf-2 -DSS_VER=SS_VER_1_0 -DHAL_TYPE=HAL_xmega -DPLATFORM=CWLITEXMEGA -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/XMEGA_AES_driver.lst -I.././simpleserial/ -I.././hal -I.././hal/xmega -I.././crypto/ -std=gnu99 -MMD -MP -MF .dep/XMEGA_AES_driver.o.d .././hal/xmega/XMEGA_AES_driver.c -o objdir/XMEGA_AES_driver.o \n.\nCompiling C: .././hal/xmega/uart.c\navr-gcc -c -mmcu=atxmega128d3 -I. -fpack-struct -gdwarf-2 -DSS_VER=SS_VER_1_0 -DHAL_TYPE=HAL_xmega -DPLATFORM=CWLITEXMEGA -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/uart.lst -I.././simpleserial/ -I.././hal -I.././hal/xmega -I.././crypto/ -std=gnu99 -MMD -MP -MF .dep/uart.o.d .././hal/xmega/uart.c -o objdir/uart.o \n.\nCompiling C: .././hal/xmega/usart_driver.c\navr-gcc -c -mmcu=atxmega128d3 -I. -fpack-struct -gdwarf-2 -DSS_VER=SS_VER_1_0 -DHAL_TYPE=HAL_xmega -DPLATFORM=CWLITEXMEGA -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/usart_driver.lst -I.././simpleserial/ -I.././hal -I.././hal/xmega -I.././crypto/ -std=gnu99 -MMD -MP -MF .dep/usart_driver.o.d .././hal/xmega/usart_driver.c -o objdir/usart_driver.o \n.\nCompiling C: .././hal/xmega/xmega_hal.c\navr-gcc -c -mmcu=atxmega128d3 -I. -fpack-struct -gdwarf-2 -DSS_VER=SS_VER_1_0 -DHAL_TYPE=HAL_xmega -DPLATFORM=CWLITEXMEGA -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/xmega_hal.lst -I.././simpleserial/ -I.././hal -I.././hal/xmega -I.././crypto/ -std=gnu99 -MMD -MP -MF .dep/xmega_hal.o.d .././hal/xmega/xmega_hal.c -o objdir/xmega_hal.o \n.\nLinking: basic-passwdcheck-CWLITEXMEGA.elf\navr-gcc -mmcu=atxmega128d3 -I. -fpack-struct -gdwarf-2 -DSS_VER=SS_VER_1_0 -DHAL_TYPE=HAL_xmega -DPLATFORM=CWLITEXMEGA -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/basic-passwdcheck.o -I.././simpleserial/ -I.././hal -I.././hal/xmega -I.././crypto/ -std=gnu99 -MMD -MP -MF .dep/basic-passwdcheck-CWLITEXMEGA.elf.d objdir/basic-passwdcheck.o objdir/simpleserial.o objdir/XMEGA_AES_driver.o objdir/uart.o objdir/usart_driver.o objdir/xmega_hal.o --output basic-passwdcheck-CWLITEXMEGA.elf -Wl,-Map=basic-passwdcheck-CWLITEXMEGA.map,--cref -lm \n.\nCreating load file for Flash: basic-passwdcheck-CWLITEXMEGA.hex\navr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature basic-passwdcheck-CWLITEXMEGA.elf basic-passwdcheck-CWLITEXMEGA.hex\n.\nCreating load file for EEPROM: basic-passwdcheck-CWLITEXMEGA.eep\navr-objcopy -j .eeprom --set-section-flags=.eeprom=\"alloc,load\" \\\n--change-section-lma .eeprom=0 --no-change-warnings -O ihex basic-passwdcheck-CWLITEXMEGA.elf basic-passwdcheck-CWLITEXMEGA.eep || exit 0\n.\nCreating Extended Listing: basic-passwdcheck-CWLITEXMEGA.lss\navr-objdump -h -S -z basic-passwdcheck-CWLITEXMEGA.elf > basic-passwdcheck-CWLITEXMEGA.lss\n.\nCreating Symbol Table: basic-passwdcheck-CWLITEXMEGA.sym\navr-nm -n basic-passwdcheck-CWLITEXMEGA.elf > basic-passwdcheck-CWLITEXMEGA.sym\nSize after:\n text\t data\t bss\t dec\t hex\tfilename\n 2406\t 304\t 260\t 2970\t b9a\tbasic-passwdcheck-CWLITEXMEGA.elf\n+--------------------------------------------------------\n+ Built for platform CW-Lite XMEGA\n+--------------------------------------------------------\n" ] ], [ [ "## Setup", "_____no_output_____" ], [ "Flash compiled Code to Target", "_____no_output_____" ] ], [ [ "%run \"Helper_Scripts/Setup_Generic.ipynb\"", "_____no_output_____" ], [ "fw_path = '../hardware/victims/firmware/Mikrocontroller_1/basic-passwdcheck-{}.hex'.format(PLATFORM)", "_____no_output_____" ], [ "cw.program_target(scope, prog, fw_path)", "XMEGA Programming flash...\nXMEGA Reading flash...\nVerified flash OK, 2709 bytes\n" ] ], [ [ "Disconnect Scope and Target", "_____no_output_____" ] ], [ [ "scope.dis()\ntarget.dis()", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ] ]
e7e62d6fe9652d27edcdf4a1d0983ae8f0566b99
7,756
ipynb
Jupyter Notebook
annotation_converter.ipynb
AI-Force/aiforce
a64e1d8ea1a6c822cd9742f44371d5402b5e6435
[ "Apache-2.0" ]
1
2021-06-24T04:04:24.000Z
2021-06-24T04:04:24.000Z
annotation_converter.ipynb
AI-Force/aiforce
a64e1d8ea1a6c822cd9742f44371d5402b5e6435
[ "Apache-2.0" ]
null
null
null
annotation_converter.ipynb
AI-Force/aiforce
a64e1d8ea1a6c822cd9742f44371d5402b5e6435
[ "Apache-2.0" ]
null
null
null
30.656126
239
0.596957
[ [ [ "# default_exp annotation_converter", "_____no_output_____" ], [ "# hide\nfrom nbdev.showdoc import *", "_____no_output_____" ], [ "# export\nimport sys\nimport argparse\nimport logging\nfrom aiforce.core import list_subclasses, parse_known_args_with_help\nfrom aiforce import annotation as annotation_package\nfrom aiforce.annotation.core import AnnotationAdapter, SubsetType", "_____no_output_____" ], [ "# hide\n%reload_ext autoreload\n%autoreload 2", "_____no_output_____" ] ], [ [ "# Annotation Converter\n> Converter to covert annotations into different formats.", "_____no_output_____" ], [ "<img src=\"assets/annotation_converter.png\" alt=\"AnnotationConverter\" width=\"800\" caption=\"The Annotation Converter.\" />", "_____no_output_____" ] ], [ [ "# export\ndef convert(input_adapter: AnnotationAdapter, output_adapter: AnnotationAdapter):\n \"\"\"\n Convert input annotations to output annotations.\n `input_adapter`: the input annotation adapter\n `output_adapter`: the output annotation adapter\n \"\"\"\n categories = input_adapter.read_categories()\n annotations = input_adapter.read_annotations(SubsetType.TRAINVAL)\n output_adapter.write_categories(categories)\n output_adapter.write_annotations(annotations, SubsetType.TRAINVAL)", "_____no_output_____" ] ], [ [ "## Helper Methods", "_____no_output_____" ] ], [ [ "# export\ndef configure_logging(logging_level=logging.INFO):\n \"\"\"\n Configures logging for the system.\n\n :param logging_level: The logging level to use.\n \"\"\"\n logging.basicConfig(level=logging_level)", "_____no_output_____" ] ], [ [ "## Run from command line", "_____no_output_____" ], [ "To run the annotation converter from command line, use the following command:\n`python -m mlcore.annotation_converter [parameters]`", "_____no_output_____" ], [ "The following parameters are supported:\n- `-i`, `--input_adapter`: The annotation adapter to the annotations to convert from (e.g.: *VIAAnnotationAdapter*)\n- `-o`, `--output_adapter`: The annotation adapter to the annotations to convert to (e.g.: *MultiCategoryAnnotationAdapter*)", "_____no_output_____" ] ], [ [ "# export\nif __name__ == '__main__' and '__file__' in globals():\n # for direct shell execution\n configure_logging()\n\n # read annotation adapters to use\n adapters = list_subclasses(annotation_package, AnnotationAdapter)\n\n parser = argparse.ArgumentParser()\n parser.add_argument(\"-i\",\n \"--input_adapter\",\n help=\"The annotation adapter to read the annotations.\",\n type=str,\n choices=adapters.keys())\n parser.add_argument(\"-o\",\n \"--output_adapter\",\n help=\"The annotation adapter to write the annotations.\",\n type=str,\n choices=adapters.keys())\n\n argv = sys.argv\n args, argv = parse_known_args_with_help(parser, argv)\n input_adapter_class = adapters[args.input_adapter]\n output_adapter_class = adapters[args.output_adapter]\n\n # parse the input arguments\n input_parser = getattr(input_adapter_class, 'argparse')(prefix='input')\n input_args, argv = parse_known_args_with_help(input_parser, argv)\n\n # parse the output arguments\n output_parser = getattr(output_adapter_class, 'argparse')(prefix='output')\n output_args, argv = parse_known_args_with_help(output_parser, argv)\n\n convert(input_adapter_class(**vars(input_args)), output_adapter_class(**vars(output_args)))", "_____no_output_____" ] ], [ [ "## Example: Image Object Detection to Multi Category Image Classification", "_____no_output_____" ], [ "To convert image object detection annotations to multi category image classifications, run the following command:", "_____no_output_____" ], [ "`python -m mlcore.annotation_converter --input_adapter VIAAnnotationAdapter --input_path data/image_object_detection/my_collection --output_adapter MultiCategoryAnnotationAdapter --output_path data/image_classification/my_collection`", "_____no_output_____" ] ], [ [ "# hide\n\n# for generating scripts from notebook directly\nfrom nbdev.export import notebook2script\nnotebook2script()", "Converted annotation-core.ipynb.\nConverted annotation-folder_category_adapter.ipynb.\nConverted annotation-multi_category_adapter.ipynb.\nConverted annotation-via_adapter.ipynb.\nConverted annotation-yolo_adapter.ipynb.\nConverted annotation_converter.ipynb.\nConverted annotation_viewer.ipynb.\nConverted category_tools.ipynb.\nConverted core.ipynb.\nConverted dataset-core.ipynb.\nConverted dataset-image_classification.ipynb.\nConverted dataset-image_object_detection.ipynb.\nConverted dataset-image_segmentation.ipynb.\nConverted dataset-type.ipynb.\nConverted dataset_generator.ipynb.\nConverted evaluation-core.ipynb.\nConverted geometry.ipynb.\nConverted image-color_palette.ipynb.\nConverted image-inference.ipynb.\nConverted image-opencv_tools.ipynb.\nConverted image-pillow_tools.ipynb.\nConverted image-tools.ipynb.\nConverted index.ipynb.\nConverted io-core.ipynb.\nConverted tensorflow-tflite_converter.ipynb.\nConverted tensorflow-tflite_metadata.ipynb.\nConverted tensorflow-tfrecord_builder.ipynb.\nConverted tools-check_double_images.ipynb.\nConverted tools-downloader.ipynb.\nConverted tools-image_size_calculator.ipynb.\n" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code", "code", "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ] ]
e7e62fb5e4702832255033d7c2df5bdaa05c3b96
29,221
ipynb
Jupyter Notebook
Gym Crowd Analysis/Gym Crowd Analysis with PCA (ToDo Template).ipynb
abhisngh/Data-Science
c7fa9e4d81c427382fb9a9d3b97912ef2b21f3ae
[ "MIT" ]
1
2020-05-29T20:07:49.000Z
2020-05-29T20:07:49.000Z
Gym Crowd Analysis/Gym Crowd Analysis with PCA (ToDo Template).ipynb
abhisngh/Data-Science
c7fa9e4d81c427382fb9a9d3b97912ef2b21f3ae
[ "MIT" ]
null
null
null
Gym Crowd Analysis/Gym Crowd Analysis with PCA (ToDo Template).ipynb
abhisngh/Data-Science
c7fa9e4d81c427382fb9a9d3b97912ef2b21f3ae
[ "MIT" ]
null
null
null
26.516334
603
0.521132
[ [ [ "# Gym Crowdedness Analysis with PCA", "_____no_output_____" ], [ "> # Objective : ", "_____no_output_____" ], [ "To **predict** how crowded a university gym would be at a given time of day (and some other features, including weather)", "_____no_output_____" ], [ "> # Data Decription : ", "_____no_output_____" ], [ "The dataset consists of 26,000 people counts (about every 10 minutes) over one year. The dataset also contains information about the weather and semester-specific information that might affect how crowded it is. The label is the number of people, which has to be predicted given some subset of the features.\n\n**Label**:\n\n- Number of people\n\n**Features**:\n\n 1. date (string; datetime of data)\n 2. timestamp (int; number of seconds since beginning of day)\n 3. dayofweek (int; 0 [monday] - 6 [sunday])\n 4. is_weekend (int; 0 or 1) [boolean, if 1, it's either saturday or sunday, otherwise 0]\n 5. is_holiday (int; 0 or 1) [boolean, if 1 it's a federal holiday, 0 otherwise]\n 6. temperature (float; degrees fahrenheit)\n 7. isstartof_semester (int; 0 or 1) [boolean, if 1 it's the beginning of a school semester, 0 otherwise]\n 8. month (int; 1 [jan] - 12 [dec])\n 9. hour (int; 0 - 23)", "_____no_output_____" ], [ "> # Approach", "_____no_output_____" ], [ "The model would be built and PCA would be implemented in the following way : \n\n- **Data Cleaning and PreProcessing**\n- **Exploratory Data Analysis :**\n \n - Uni-Variate Analysis : Histograms , Distribution Plots\n - Bi-Variate Analysis : Pair Plots\n - Correlation Matrix\n \n- **Processing :**\n \n - OneHotEncoding \n - Feature Scaling : Standard Scaler\n\n- **Splitting Dataset** \n- **Principal Component Analysis**\n- **Modelling : Random Forest**\n\n - Random forest without PCA\n - Random Forest with PCA\n \n- **Conclusion**", "_____no_output_____" ], [ "## `1` Data Cleaning and PreProcessing ", "_____no_output_____" ], [ "**Importing Libraries and loading Dataset**", "_____no_output_____" ] ], [ [ "import numpy as np # linear algebra\nimport pandas as pd \nimport matplotlib.pyplot as plt\nimport seaborn as sns\n%matplotlib inline", "_____no_output_____" ], [ "df=pd.read_csv(r'C:\\Users\\kusht\\OneDrive\\Desktop\\Excel-csv\\PCA analysis.csv') #Replace it with your path where the data file is stored\ndf.head()", "_____no_output_____" ] ], [ [ "**TASK : Print the `info()` of the dataset**", "_____no_output_____" ] ], [ [ "### START CODE HERE (~ 1 Line of code)\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Describe the dataset using `describe()`**", "_____no_output_____" ] ], [ [ "### START CODE HERE (~ 1 Line of code)\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Convert temperature in farenheit into celsius scale using the formula `Celsius=(Fahrenheit-32)* (5/9)`**", "_____no_output_____" ] ], [ [ "### START CODE HERE (~1 Line of code)\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Convert the timestamp into hours in 12 h format as its currently in seconds and drop `date` coulmn**", "_____no_output_____" ] ], [ [ "### START CODE HERE: (~ 1 Line of code)\n\n### END CODE", "_____no_output_____" ] ], [ [ "## `2` Exploratory Data Analysis", "_____no_output_____" ], [ "### `2.1` Uni-Variate and Bi-Variate Analysis", "_____no_output_____" ], [ "- **Pair Plots**", "_____no_output_____" ], [ "**TASK : Use `pairplot()` to make different pair scatter plots of the entire dataframe**", "_____no_output_____" ] ], [ [ "### START CODE HERE :\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK: Now analyse scatter plots between `number_people` and all other attributes using a `for loop` to properly know what are the ideal conditions for people to come to the gym** ", "_____no_output_____" ] ], [ [ "### START CODE HERE \n \n### END CODE", "_____no_output_____" ] ], [ [ "**Analyse the plots and understand :**\n1. **At what time , temperature , week of the day more people come in?**\n \n2. **Whether people like to come to the gym in a holiday or a weekend or they prefer to come to gym during working days?**\n \n3. **Which month is most preferable for people to come to the gym?** ", "_____no_output_____" ], [ "- **Distribution Plots**", "_____no_output_____" ], [ "**TASK : Plot individual `distplot()` for `temperature` and `number_people` to check out the individual distribution of the attributes** ", "_____no_output_____" ] ], [ [ "### START CODE HERE : \n\n### END CODE", "_____no_output_____" ] ], [ [ "### `2.2` Correlation Matrix", "_____no_output_____" ], [ "**TASK : Plot a correlation matrix and make it more understandable using `sns.heatmap`**", "_____no_output_____" ] ], [ [ "### START CODE HERE : \n\n\n### END CODE HERE ", "_____no_output_____" ] ], [ [ "**Analyse the correlation matrix and understand the different dependencies of attributes on each other** ", "_____no_output_____" ], [ "## `3.` Processing : ", "_____no_output_____" ], [ "### `3.1` One hot encoding :\nOne hot encoding certain attributes to not give any ranking/priority to any instance", "_____no_output_____" ], [ "**TASK: One Hot Encode following attributes `month` , `hour` , `day of week`**", "_____no_output_____" ] ], [ [ "## YOU CAN USE EITHER get_dummies() OR OneHotEncoder()\n\n### START CODE HERE : \n\n### END CODE ", "_____no_output_____" ] ], [ [ "### `3.2` Feature Scaling :\nSome attributes ranges are ver different compared to other values and during PCA implementation this might give a problem thus you need to standardise some of the attributes", "_____no_output_____" ], [ "**TASK: Using `StandardScaler()` , standardise `temperature` and `timestamp`**", "_____no_output_____" ] ], [ [ "## You can use two individual scalers one for temperature and other for timestamp\n## you can use an array type data=df.values and standradise data then split data into X and y\nfrom sklearn.preprocessing import StandardScaler\n### START CODE HERE : (Replace places having '#' with the code)\ndata=df.values\nscaler1 = StandardScaler()\nscaler1.fit(#) # for timestamp\ndata[#] = scaler1.transform(#)\n\nscaler2 = StandardScaler()\nscaler2.fit(data[#]) # for temperature\ndata[#] = scaler2.transform(data[#])\n\n### END CODE HERE", "_____no_output_____" ] ], [ [ "## `4.` Splitting the dataset : ", "_____no_output_____" ], [ "**TASK : Split the dataset into dependent and independent variables and name them y and X respectively** ", "_____no_output_____" ] ], [ [ "### START CODE HERE : \n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Split the X ,y into training and test set**", "_____no_output_____" ] ], [ [ "from sklearn.model_selection import train_test_split\n### START CODE HERE : \n\n### END CODE", "_____no_output_____" ] ], [ [ "## `5.` Principal Component Analysis \n\nPrincipal component analysis (PCA) is a technique for reducing the dimensionality of such datasets, increasing interpretability but at the same time minimizing information loss. It does so by creating new uncorrelated variables that successively maximize variance.", "_____no_output_____" ], [ "**How does it work? :**\n\n- First, a matrix is calculated that summarizes how our variables all relate to one another.\n\n- Secondly , The matrix is broken down into two separate components: direction and magnitude. so its easy to understand the “directions” of the data and its “magnitude” (or how “important” each direction is). The photo below, displays the two main directions in this data: the “red direction” and the “green direction.” In this case, the “red direction” is the more important one as given how the dots are arranged, “red direction” comprises most of the data and thus is s more important than the “green direction” (Hint: Think of What would fitting a line of best fit to this data look like?)\n", "_____no_output_____" ], [ "<img src=\"https://miro.medium.com/max/832/1*P8_C9uk3ewpRDtevf9wVxg.png\">", "_____no_output_____" ], [ "- Then the data is transformed to align with these important directions (which are combinations of our original variables). The photo below is the same exact data as above, but transformed so that the x- and y-axes are now the “red direction” and “green direction.” What would the line of best fit look like here?", "_____no_output_____" ], [ "<img src=\"https://miro.medium.com/max/1400/1*V3JWBvxB92Uo116Bpxa3Tw.png\">", "_____no_output_____" ], [ "So PCA tries to find the most important directions in which most of the data is spread and thus reduces it to those components thereby reducing the number of attributes to train and increasing computational speed. A 3D example is given below : ", "_____no_output_____" ], [ "<img src=\"https://miro.medium.com/max/1024/1*vfLvJF8wHaQjDaWv6Mab2w.png\">", "_____no_output_____" ], [ "As you can see above a 3D plot is reduced to a 2d plot still retaining most of the data", "_____no_output_____" ], [ "**Now that you have understood this , lets try to implement it** ", "_____no_output_____" ], [ "**TASK : Print the PCA fit_transform of X(independent variables)**", "_____no_output_____" ] ], [ [ "from sklearn.decomposition import PCA\n\n### START CODE HERE : (Replace spaces having '#' with the code)\npca = PCA()\npca.fit_transform(#)\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Get covariance using `get_covariance()`**", "_____no_output_____" ] ], [ [ "### START CODE HERE (~ 1 line of code) \n\n### END CODE HERE", "_____no_output_____" ] ], [ [ "**TASK : Get explained variance using `explained_variance_ratio`**", "_____no_output_____" ] ], [ [ "### START CODE HERE : \n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Plot a bar graph of `explained variance`**", "_____no_output_____" ] ], [ [ "# you can use plt.bar()\n\n### START CODE HERE : (Replace spaces having '#' with the code)\nwith plt.style.context('dark_background'):\n plt.figure(figsize=(15,12))\n\n plt.bar(range(49), '#', alpha=0.5, align='center',\n label='individual explained variance')\n plt.ylabel('#')\n plt.xlabel('#')\n plt.legend(loc='best')\n plt.tight_layout()\n\n### END CODE", "_____no_output_____" ] ], [ [ "**Analyse the plot and estimate how many componenets you want to keep**", "_____no_output_____" ], [ "**TASK : Make a `PCA()` object with n_components =20 and fit-transform in the dataset (X) and assign to a new variable `X_new`**", "_____no_output_____" ] ], [ [ "### START CODE HERE : \n\n### END CODE", "_____no_output_____" ] ], [ [ "Now , `X_new` is the dataset for PCA", "_____no_output_____" ], [ "**TASK : Get Covariance using `get_covariance`**", "_____no_output_____" ] ], [ [ "### START CODE HERE (~1 Line of code)\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Get the explained variance using `explained_variance_ratio`**", "_____no_output_____" ] ], [ [ "### START CODE HERE :\n\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Plot bar plot of `exlpained variance`**", "_____no_output_____" ] ], [ [ "# You can use plt.bar()\n\n### START CODE HERE: \n \n### END CODE", "_____no_output_____" ] ], [ [ "## `6.` Modelling : Random Forest", "_____no_output_____" ], [ "To understand Random forest classifier , lets first get a brief idea about Decision Trees in general. Decision Trees are very intuitive and at everyone have used this knowingly or unknowingly at some point . Basically the model keeps sorting them into categories forming a large tree by responses of some questons (decisions) and thats why its called decision tree. An image example would help understand it better :", "_____no_output_____" ], [ "<img src=\"https://camo.githubusercontent.com/960e89743476577bd696b3ac16885cf1e1d19ad1/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f313030302f312a4c4d6f4a6d584373516c6369475445796f534e3339672e6a706567\">", "_____no_output_____" ], [ "`Random Forest` : Random forest, like its name implies, consists of a large number of individual decision trees that operate as an [ensemble](https://en.wikipedia.org/wiki/Ensemble_learning) . Each individual tree in the random forest spits out a class prediction and the class with the most votes becomes our model’s prediction.", "_____no_output_____" ], [ "<img src=\"https://camo.githubusercontent.com/30aec690ddc10fa0ae5d3135d0c7a6b745eb5918/68747470733a2f2f6d69726f2e6d656469756d2e636f6d2f6d61782f313030302f312a56484474566144504e657052676c49417637324246672e6a706567\">", "_____no_output_____" ], [ "The fundamental concept is large number of relatively uncorrelated models (trees) operating as a committee will outperform any of the individual constituent models. Since this dataset has very low correlation between attributes , random forest can be a good option.", "_____no_output_____" ], [ "In this section you'll have to make a random forest model and train it on both without PCA dataset and with PCA datset to analyse the differences", "_____no_output_____" ], [ "### `6.1` Random Forest Without PCA\n", "_____no_output_____" ], [ "**TASK : Make a random forest model and train it on without PCA training set**", "_____no_output_____" ] ], [ [ "# Establish model\nfrom sklearn.ensemble import RandomForestRegressor\nmodel = RandomForestRegressor()", "_____no_output_____" ], [ "# Try different numbers of n_estimators and print the scores\n# You can use a variable estimators = np.arrange(10,200,10) and then a for loop to take all the values of estimators\n\n### START CODE HERE : (Replace spaces having '#' with code)\nestimators = np.arange(10, 200, 10)\nscores = []\nfor n in estimators:\n model.set_params(n_estimators='#')\n model.fit('#', '#')\n scores.append(model.score(X_test, y_test))\nprint(scores) \n\n### END CODE HERE", "_____no_output_____" ] ], [ [ "**TASK : Make a plot between `n_estimator` and `scores` to properly get the best number of estimators**", "_____no_output_____" ] ], [ [ "## Use plt.plot\n\n### START CODE HERE : \n\n### END CODE HERE", "_____no_output_____" ] ], [ [ "### `6.2` Random Forest With PCA", "_____no_output_____" ], [ "**TASK : Split the your dataset with PCA into training and testing set using `train_test_split`** ", "_____no_output_____" ] ], [ [ "from sklearn.model_selection import train_test_split\n### START CODE HERE :\n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Make a random forest model called `model_pca` and fit it into the new X_train and y_train and then print out the random forest scores for dataset with PCA applied to it**", "_____no_output_____" ] ], [ [ "# Establish model\nfrom sklearn.ensemble import RandomForestRegressor\nmodel_pca = RandomForestRegressor()", "_____no_output_____" ], [ "# You can use different number of estimators\n# # You can use a variable estimators = np.arrange(10,200,10) and then a for loop to take all the values of estimators\n\n### START CODE HERE : \n\n### END CODE", "_____no_output_____" ] ], [ [ "**TASK : Make a plot between `n_estimator` and `score` and find the best parameter** ", "_____no_output_____" ] ], [ [ "# you can use plt.plot\n### START CODE HERE : \n\n\n### END CODE", "_____no_output_____" ] ], [ [ "This completes modelling and now its time to analyse your models", "_____no_output_____" ], [ "## `7.` Conclusion", "_____no_output_____" ], [ "Analyse the plots and find the best n_estimator. you can also hypertune other parameter using GridSearchCV or Randomised search. Also understand whether using PCA was beneficial or not , if not try to justify it. ", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ] ]
e7e64d11e583fb36e4aee2bd0de981845bb42763
2,812
ipynb
Jupyter Notebook
src/kx4/utils/geometry.ipynb
ksterx/kx4ceps
033fde5d04281c37ae7db4f57b629bc0be3a0acc
[ "MIT" ]
null
null
null
src/kx4/utils/geometry.ipynb
ksterx/kx4ceps
033fde5d04281c37ae7db4f57b629bc0be3a0acc
[ "MIT" ]
null
null
null
src/kx4/utils/geometry.ipynb
ksterx/kx4ceps
033fde5d04281c37ae7db4f57b629bc0be3a0acc
[ "MIT" ]
null
null
null
24.884956
82
0.40256
[ [ [ "import torch\nimport cv2\nimport numpy as np\nimport pandas as pd", "_____no_output_____" ], [ "def sc2deg(sine: torch.tensor, cosine: torch.tensor):\n deg = torch.rad2deg(torch.atan2(sine, cosine))\n return deg", "_____no_output_____" ], [ "def scale180(a: torch.tensor):\n a = torch.where(a > 180, 360-a, a)\n a = torch.where(a < -180, 360+a, a)\n return a", "_____no_output_____" ], [ "def project_onto_plane(p, a_ratio: float, fov, is_batch):\n '''\n Args:\n p: position (x, y, z)\n a_ratio: aspect ratio (height, width)\n fov: field of view [deg]\n\n O +------> x_2d\n |\n |\n v\n y_2d\n\n Returns:\n tuple: (x_2d [0, 1], y_2d [0, 1])\n '''\n assert 0 < a_ratio <= 1\n \n if not is_batch:\n\n if p[2] < 0:\n p *= -1\n x_2d = p[0] / (p[2] * np.tan(fov/2))\n y_2d = (a_ratio * p[1]) / (p[2] * np.tan(fov/2))\n x_2d = (1 + x_2d) / 2\n y_2d = (1 - y_2d) / 2\n ret = torch.tensor([x_2d, y_2d])\n\n else:\n if p[1, 2] < 0:\n p[:, 2] *= -1\n x_2d = p[:, 0] / (p[:, 2] * np.tan(fov/2))\n y_2d = (a_ratio * p[:, 1]) / (a_ratio * p[:, 2] * np.tan(fov/2))\n x_2d = x_2d.view(-1, 1)\n y_2d = y_2d.view(-1, 1)\n x_2d = (1 + x_2d) / 2\n y_2d = (1 - y_2d) / 2\n ret = torch.cat([x_2d, y_2d], dim=1)\n\n return ret", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code" ] ]
e7e651c9612d12574da0fba0b20a7b0431b89b92
72,429
ipynb
Jupyter Notebook
ch08performance/010intro.ipynb
jack89roberts/rsd-engineeringcourse
d0d90be254674f2be46dda7aefc987a238e4e97c
[ "CC-BY-3.0" ]
null
null
null
ch08performance/010intro.ipynb
jack89roberts/rsd-engineeringcourse
d0d90be254674f2be46dda7aefc987a238e4e97c
[ "CC-BY-3.0" ]
null
null
null
ch08performance/010intro.ipynb
jack89roberts/rsd-engineeringcourse
d0d90be254674f2be46dda7aefc987a238e4e97c
[ "CC-BY-3.0" ]
null
null
null
212.40176
32,464
0.922062
[ [ [ "# Performance programming", "_____no_output_____" ], [ "We've spent most of this course looking at how to make code readable and reliable. For research work, it is often also important that code is efficient: that it does what it needs to do *quickly*.", "_____no_output_____" ], [ "It is very hard to work out beforehand whether code will be efficient or not: it is essential to *Profile* code, to measure its performance, to determine what aspects of it are slow.", "_____no_output_____" ], [ "When we looked at Functional programming, we claimed that code which is conceptualised in terms of actions on whole data-sets rather than individual elements is more efficient. Let's measure the performance of some different ways of implementing some code and see how they perform.", "_____no_output_____" ], [ "## Two Mandelbrots", "_____no_output_____" ], [ "You're probably familiar with a famous fractal called the [Mandelbrot Set](https://www.youtube.com/watch?v=ZDU40eUcTj0).", "_____no_output_____" ], [ "For a complex number $c$, $c$ is in the Mandelbrot set if the series $z_{i+1}=z_{i}^2+c$ (With $z_0=c$) stays close to $0$.\nTraditionally, we plot a color showing how many steps are needed for $\\left|z_i\\right|>2$, whereupon we are sure the series will diverge.", "_____no_output_____" ], [ "Here's a trivial python implementation:", "_____no_output_____" ] ], [ [ "def mandel1(position, limit=50):\n \n value = position\n \n while abs(value) < 2:\n limit -= 1 \n value = value**2 + position\n if limit < 0:\n return 0\n \n return limit", "_____no_output_____" ], [ "xmin = -1.5\nymin = -1.0\nxmax = 0.5\nymax = 1.0\nresolution = 300\nxstep = (xmax - xmin) / resolution\nystep = (ymax - ymin) / resolution\nxs = [(xmin + (xmax - xmin) * i / resolution) for i in range(resolution)]\nys = [(ymin + (ymax - ymin) * i / resolution) for i in range(resolution)]", "_____no_output_____" ], [ "%%timeit\ndata = [[mandel1(complex(x, y)) for x in xs] for y in ys]", "500 ms ± 17.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ], [ "data1 = [[mandel1(complex(x, y)) for x in xs] for y in ys]", "_____no_output_____" ], [ "%matplotlib inline\nimport matplotlib.pyplot as plt\nplt.imshow(data1, interpolation='none')", "_____no_output_____" ] ], [ [ "We will learn this lesson how to make a version of this code which works Ten Times faster:", "_____no_output_____" ] ], [ [ "import numpy as np\ndef mandel_numpy(position,limit=50):\n value = position\n diverged_at_count = np.zeros(position.shape)\n while limit > 0:\n limit -= 1\n value = value**2+position\n diverging = value * np.conj(value) > 4\n first_diverged_this_time = np.logical_and(diverging, diverged_at_count == 0)\n diverged_at_count[first_diverged_this_time] = limit\n value[diverging] = 2\n \n return diverged_at_count", "_____no_output_____" ], [ "ymatrix, xmatrix = np.mgrid[ymin:ymax:ystep, xmin:xmax:xstep]", "_____no_output_____" ], [ "values = xmatrix + 1j * ymatrix", "_____no_output_____" ], [ "data_numpy = mandel_numpy(values)", "_____no_output_____" ], [ "%matplotlib inline\nimport matplotlib.pyplot as plt\nplt.imshow(data_numpy, interpolation='none')", "_____no_output_____" ], [ "%%timeit\ndata_numpy = mandel_numpy(values)", "50.9 ms ± 10.8 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] ], [ [ "Note we get the same answer:", "_____no_output_____" ] ], [ [ "sum(sum(abs(data_numpy - data1)))", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code" ] ]
e7e655fc07bb4f1ec19bca1a7b7558bd101013db
43,776
ipynb
Jupyter Notebook
Intermediate_Python_For_Data_Science/Histogram.ipynb
slastrina/datacamp_practice
410cb93ca2f76cc0252ca22fcdd50c111ecb37cd
[ "MIT" ]
null
null
null
Intermediate_Python_For_Data_Science/Histogram.ipynb
slastrina/datacamp_practice
410cb93ca2f76cc0252ca22fcdd50c111ecb37cd
[ "MIT" ]
null
null
null
Intermediate_Python_For_Data_Science/Histogram.ipynb
slastrina/datacamp_practice
410cb93ca2f76cc0252ca22fcdd50c111ecb37cd
[ "MIT" ]
null
null
null
120.595041
6,472
0.792512
[ [ [ "import matplotlib.pyplot as plt\n\nhelp(plt.hist)", "Help on function hist in module matplotlib.pyplot:\n\nhist(x, bins=None, range=None, density=None, weights=None, cumulative=False, bottom=None, histtype=u'bar', align=u'mid', orientation=u'vertical', rwidth=None, log=False, color=None, label=None, stacked=False, normed=None, hold=None, data=None, **kwargs)\n Plot a histogram.\n \n Compute and draw the histogram of *x*. The return value is a\n tuple (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*,\n [*patches0*, *patches1*,...]) if the input contains multiple\n data.\n \n Multiple data can be provided via *x* as a list of datasets\n of potentially different length ([*x0*, *x1*, ...]), or as\n a 2-D ndarray in which each column is a dataset. Note that\n the ndarray form is transposed relative to the list form.\n \n Masked arrays are not supported at present.\n \n Parameters\n ----------\n x : (n,) array or sequence of (n,) arrays\n Input values, this takes either a single array or a sequency of\n arrays which are not required to be of the same length\n \n bins : integer or array_like or 'auto', optional\n If an integer is given, ``bins + 1`` bin edges are returned,\n consistently with :func:`numpy.histogram` for numpy version >=\n 1.3.\n \n Unequally spaced bins are supported if *bins* is a sequence.\n \n If Numpy 1.11 is installed, may also be ``'auto'``.\n \n Default is taken from the rcParam ``hist.bins``.\n \n range : tuple or None, optional\n The lower and upper range of the bins. Lower and upper outliers\n are ignored. If not provided, *range* is ``(x.min(), x.max())``.\n Range has no effect if *bins* is a sequence.\n \n If *bins* is a sequence or *range* is specified, autoscaling\n is based on the specified bin range instead of the\n range of x.\n \n Default is ``None``\n \n density : boolean, optional\n If ``True``, the first element of the return tuple will\n be the counts normalized to form a probability density, i.e.,\n the area (or integral) under the histogram will sum to 1.\n This is achieved by dividing the count by the number of\n observations times the bin width and not dividing by the total\n number of observations. If *stacked* is also ``True``, the sum of\n the histograms is normalized to 1.\n \n Default is ``None`` for both *normed* and *density*. If either is\n set, then that value will be used. If neither are set, then the\n args will be treated as ``False``.\n \n If both *density* and *normed* are set an error is raised.\n \n weights : (n, ) array_like or None, optional\n An array of weights, of the same shape as *x*. Each value in *x*\n only contributes its associated weight towards the bin count\n (instead of 1). If *normed* or *density* is ``True``,\n the weights are normalized, so that the integral of the density\n over the range remains 1.\n \n Default is ``None``\n \n cumulative : boolean, optional\n If ``True``, then a histogram is computed where each bin gives the\n counts in that bin plus all bins for smaller values. The last bin\n gives the total number of datapoints. If *normed* or *density*\n is also ``True`` then the histogram is normalized such that the\n last bin equals 1. If *cumulative* evaluates to less than 0\n (e.g., -1), the direction of accumulation is reversed.\n In this case, if *normed* and/or *density* is also ``True``, then\n the histogram is normalized such that the first bin equals 1.\n \n Default is ``False``\n \n bottom : array_like, scalar, or None\n Location of the bottom baseline of each bin. If a scalar,\n the base line for each bin is shifted by the same amount.\n If an array, each bin is shifted independently and the length\n of bottom must match the number of bins. If None, defaults to 0.\n \n Default is ``None``\n \n histtype : {'bar', 'barstacked', 'step', 'stepfilled'}, optional\n The type of histogram to draw.\n \n - 'bar' is a traditional bar-type histogram. If multiple data\n are given the bars are aranged side by side.\n \n - 'barstacked' is a bar-type histogram where multiple\n data are stacked on top of each other.\n \n - 'step' generates a lineplot that is by default\n unfilled.\n \n - 'stepfilled' generates a lineplot that is by default\n filled.\n \n Default is 'bar'\n \n align : {'left', 'mid', 'right'}, optional\n Controls how the histogram is plotted.\n \n - 'left': bars are centered on the left bin edges.\n \n - 'mid': bars are centered between the bin edges.\n \n - 'right': bars are centered on the right bin edges.\n \n Default is 'mid'\n \n orientation : {'horizontal', 'vertical'}, optional\n If 'horizontal', `~matplotlib.pyplot.barh` will be used for\n bar-type histograms and the *bottom* kwarg will be the left edges.\n \n rwidth : scalar or None, optional\n The relative width of the bars as a fraction of the bin width. If\n ``None``, automatically compute the width.\n \n Ignored if *histtype* is 'step' or 'stepfilled'.\n \n Default is ``None``\n \n log : boolean, optional\n If ``True``, the histogram axis will be set to a log scale. If\n *log* is ``True`` and *x* is a 1D array, empty bins will be\n filtered out and only the non-empty ``(n, bins, patches)``\n will be returned.\n \n Default is ``False``\n \n color : color or array_like of colors or None, optional\n Color spec or sequence of color specs, one per dataset. Default\n (``None``) uses the standard line color sequence.\n \n Default is ``None``\n \n label : string or None, optional\n String, or sequence of strings to match multiple datasets. Bar\n charts yield multiple patches per dataset, but only the first gets\n the label, so that the legend command will work as expected.\n \n default is ``None``\n \n stacked : boolean, optional\n If ``True``, multiple data are stacked on top of each other If\n ``False`` multiple data are aranged side by side if histtype is\n 'bar' or on top of each other if histtype is 'step'\n \n Default is ``False``\n \n Returns\n -------\n n : array or list of arrays\n The values of the histogram bins. See *normed* or *density*\n and *weights* for a description of the possible semantics.\n If input *x* is an array, then this is an array of length\n *nbins*. If input is a sequence arrays\n ``[data1, data2,..]``, then this is a list of arrays with\n the values of the histograms for each of the arrays in the\n same order.\n \n bins : array\n The edges of the bins. Length nbins + 1 (nbins left edges and right\n edge of last bin). Always a single array even when multiple data\n sets are passed in.\n \n patches : list or list of lists\n Silent list of individual patches used to create the histogram\n or list of such list if multiple input datasets.\n \n Other Parameters\n ----------------\n **kwargs : `~matplotlib.patches.Patch` properties\n \n See also\n --------\n hist2d : 2D histograms\n \n Notes\n -----\n Until numpy release 1.5, the underlying numpy histogram function was\n incorrect with ``normed=True`` if bin sizes were unequal. MPL\n inherited that error. It is now corrected within MPL when using\n earlier numpy versions.\n \n .. note::\n In addition to the above described arguments, this function can take a\n **data** keyword argument. If such a **data** argument is given, the\n following arguments are replaced by **data[<arg>]**:\n \n * All arguments with the following names: 'weights', 'x'.\n\n" ], [ "import matplotlib.pyplot as plt\n\nlife_exp = [43.828, 76.423, 72.301, 42.731, 75.32, 81.235, 79.829, 75.635, 64.062, 79.441, 56.728, 65.554, 74.852, 50.728, 72.39, 73.005, 52.295, 49.58, 59.723, 50.43, 80.653, 44.74100000000001, 50.651, 78.553, 72.961, 72.889, 65.152, 46.462, 55.322, 78.782, 48.328, 75.748, 78.273, 76.486, 78.332, 54.791, 72.235, 74.994, 71.33800000000002, 71.878, 51.57899999999999, 58.04, 52.947, 79.313, 80.657, 56.735, 59.448, 79.406, 60.022, 79.483, 70.259, 56.007, 46.38800000000001, 60.916, 70.19800000000001, 82.208, 73.33800000000002, 81.757, 64.69800000000001, 70.65, 70.964, 59.545, 78.885, 80.745, 80.546, 72.567, 82.603, 72.535, 54.11, 67.297, 78.623, 77.58800000000002, 71.993, 42.592, 45.678, 73.952, 59.44300000000001, 48.303, 74.241, 54.467, 64.164, 72.801, 76.195, 66.803, 74.543, 71.164, 42.082, 62.069, 52.90600000000001, 63.785, 79.762, 80.204, 72.899, 56.867, 46.859, 80.196, 75.64, 65.483, 75.53699999999998, 71.752, 71.421, 71.688, 75.563, 78.098, 78.74600000000002, 76.442, 72.476, 46.242, 65.528, 72.777, 63.062, 74.002, 42.56800000000001, 79.972, 74.663, 77.926, 48.159, 49.339, 80.941, 72.396, 58.556, 39.613, 80.884, 81.70100000000002, 74.143, 78.4, 52.517, 70.616, 58.42, 69.819, 73.923, 71.777, 51.542, 79.425, 78.242, 76.384, 73.747, 74.249, 73.422, 62.698, 42.38399999999999, 43.487]\n\nplt.hist(life_exp, bins=5)\n\nplt.show()", "_____no_output_____" ], [ "import matplotlib.pyplot as plt\n\nlife_exp = [43.828, 76.423, 72.301, 42.731, 75.32, 81.235, 79.829, 75.635, 64.062, 79.441, 56.728, 65.554, 74.852, 50.728, 72.39, 73.005, 52.295, 49.58, 59.723, 50.43, 80.653, 44.74100000000001, 50.651, 78.553, 72.961, 72.889, 65.152, 46.462, 55.322, 78.782, 48.328, 75.748, 78.273, 76.486, 78.332, 54.791, 72.235, 74.994, 71.33800000000002, 71.878, 51.57899999999999, 58.04, 52.947, 79.313, 80.657, 56.735, 59.448, 79.406, 60.022, 79.483, 70.259, 56.007, 46.38800000000001, 60.916, 70.19800000000001, 82.208, 73.33800000000002, 81.757, 64.69800000000001, 70.65, 70.964, 59.545, 78.885, 80.745, 80.546, 72.567, 82.603, 72.535, 54.11, 67.297, 78.623, 77.58800000000002, 71.993, 42.592, 45.678, 73.952, 59.44300000000001, 48.303, 74.241, 54.467, 64.164, 72.801, 76.195, 66.803, 74.543, 71.164, 42.082, 62.069, 52.90600000000001, 63.785, 79.762, 80.204, 72.899, 56.867, 46.859, 80.196, 75.64, 65.483, 75.53699999999998, 71.752, 71.421, 71.688, 75.563, 78.098, 78.74600000000002, 76.442, 72.476, 46.242, 65.528, 72.777, 63.062, 74.002, 42.56800000000001, 79.972, 74.663, 77.926, 48.159, 49.339, 80.941, 72.396, 58.556, 39.613, 80.884, 81.70100000000002, 74.143, 78.4, 52.517, 70.616, 58.42, 69.819, 73.923, 71.777, 51.542, 79.425, 78.242, 76.384, 73.747, 74.249, 73.422, 62.698, 42.38399999999999, 43.487]\n\n# Build histogram with 5 bins\nplt.hist(life_exp, bins=5)\n\n# Show and clean up plot\nplt.show()\nplt.clf() # resets plot data\n\n# Build histogram with 20 bins\nplt.hist(life_exp, bins=20)\n\n\n# Show and clean up again\nplt.show()\nplt.clf()", "_____no_output_____" ], [ "import matplotlib.pyplot as plt\n\nlife_exp1950 = [28.8, 55.23, 43.08, 30.02, 62.48, 69.12, 66.8, 50.94, 37.48, 68.0, 38.22, 40.41, 53.82, 47.62, 50.92, 59.6, 31.98, 39.03, 39.42, 38.52, 68.75, 35.46, 38.09, 54.74, 44.0, 50.64, 40.72, 39.14, 42.11, 57.21, 40.48, 61.21, 59.42, 66.87, 70.78, 34.81, 45.93, 48.36, 41.89, 45.26, 34.48, 35.93, 34.08, 66.55, 67.41, 37.0, 30.0, 67.5, 43.15, 65.86, 42.02, 33.61, 32.5, 37.58, 41.91, 60.96, 64.03, 72.49, 37.37, 37.47, 44.87, 45.32, 66.91, 65.39, 65.94, 58.53, 63.03, 43.16, 42.27, 50.06, 47.45, 55.56, 55.93, 42.14, 38.48, 42.72, 36.68, 36.26, 48.46, 33.68, 40.54, 50.99, 50.79, 42.24, 59.16, 42.87, 31.29, 36.32, 41.72, 36.16, 72.13, 69.39, 42.31, 37.44, 36.32, 72.67, 37.58, 43.44, 55.19, 62.65, 43.9, 47.75, 61.31, 59.82, 64.28, 52.72, 61.05, 40.0, 46.47, 39.88, 37.28, 58.0, 30.33, 60.4, 64.36, 65.57, 32.98, 45.01, 64.94, 57.59, 38.64, 41.41, 71.86, 69.62, 45.88, 58.5, 41.22, 50.85, 38.6, 59.1, 44.6, 43.58, 39.98, 69.18, 68.44, 66.07, 55.09, 40.41, 43.16, 32.55, 42.04, 48.45]\n\n# Histogram of life_exp, 15 bins\nplt.hist(life_exp, bins=15)\n\n# Show and clear plot\nplt.show()\nplt.clf()\n\n# Histogram of life_exp1950, 15 bins\nplt.hist(life_exp1950, bins=15)\n\n\n# Show and clear plot again\nplt.show()\nplt.clf()", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code" ] ]
e7e66bed3b8242bedeea2bc6db9cd81af8533c40
27,891
ipynb
Jupyter Notebook
notebooks/Solvers.ipynb
JuliaPackageMirrors/Laplacians.jl
553ea964b95359462ef4b8b6b01383310ab88f41
[ "MIT" ]
null
null
null
notebooks/Solvers.ipynb
JuliaPackageMirrors/Laplacians.jl
553ea964b95359462ef4b8b6b01383310ab88f41
[ "MIT" ]
null
null
null
notebooks/Solvers.ipynb
JuliaPackageMirrors/Laplacians.jl
553ea964b95359462ef4b8b6b01383310ab88f41
[ "MIT" ]
null
null
null
21.129545
176
0.48919
[ [ [ "empty" ] ] ]
[ "empty" ]
[ [ "empty" ] ]
e7e66c01c7cfaa624272b22ce9a0b42775b64a2d
10,764
ipynb
Jupyter Notebook
08. Data Visualization - Matplotlib/.ipynb_checkpoints/8.2 Matplotlib Pt 3-checkpoint.ipynb
CommunityOfCoders/ML_Workshop_Teachers
7673e2960f21a08bed586bfd3ead5a8d82add884
[ "BSD-3-Clause" ]
1
2020-01-25T09:23:53.000Z
2020-01-25T09:23:53.000Z
08. Data Visualization - Matplotlib/8.2 Matplotlib Pt 3.ipynb
shrey-c/ML_Workshop_Teachers
7673e2960f21a08bed586bfd3ead5a8d82add884
[ "BSD-3-Clause" ]
null
null
null
08. Data Visualization - Matplotlib/8.2 Matplotlib Pt 3.ipynb
shrey-c/ML_Workshop_Teachers
7673e2960f21a08bed586bfd3ead5a8d82add884
[ "BSD-3-Clause" ]
6
2020-01-25T06:21:54.000Z
2020-05-31T13:01:52.000Z
28.17801
277
0.539205
[ [ [ "# Matplotlib ( Matplotlib Pt. 3)", "_____no_output_____" ], [ "## Plot Appearence in Matplotlib", "_____no_output_____" ] ], [ [ "import matplotlib.pyplot as plt", "_____no_output_____" ], [ "%matplotlib inline", "_____no_output_____" ], [ "import numpy as np\nx = np.linspace(0,5,11) # We go from 0 to 5 and grab 11 points which are linearly spaced.\ny = x ** 2", "_____no_output_____" ], [ "fig = plt.figure()\n# Add a set of axes to the figure.\nax = fig.add_axes([0,0,1,1])\n# To add color to the plot there are multiple ways like directly typing the common color names or passing the HEX Color values.\nax.plot(x,y,color='aqua') # Common color", "_____no_output_____" ], [ "fig = plt.figure()\nax = fig.add_axes([0,0,1,1])\nax.plot(x,y,color='#008080') # RGB Hex Code for Teal", "_____no_output_____" ], [ "fig, ax = plt.subplots()\n\nax.plot(x, x+1, color=\"blue\", alpha=0.5) # half-transparant\nax.plot(x, x+2, color=\"#8B008B\") # RGB hex code\nax.plot(x, x+3, color=\"#FF8C00\") # RGB hex code ", "_____no_output_____" ] ], [ [ "## Linewidth and Line Style", "_____no_output_____" ] ], [ [ "fig = plt.figure()\nax = fig.add_axes([0,0,1,1])\nax.plot(x,y,color='#008080') # Default Line width", "_____no_output_____" ], [ "# 5 times the linewidth\nfig = plt.figure()\nax = fig.add_axes([0,0,1,1])\nax.plot(x,y,color='#008080',lw=5)#A shorthand is used here for linewidth which is lw\n", "_____no_output_____" ], [ "# To get transparency on the plotted line we can pass the alpha parameter to plot function.\nfig = plt.figure()\nax = fig.add_axes([0,0,1,1])\nax.plot(x,y,color='#008080',lw=3,alpha=0.5)\n# Alpha can be any value between [0.0,1.0] where 0.0 is line being 100% transparent (invisible) and 1 is 0% transparent.", "_____no_output_____" ], [ "fig = plt.figure()\nax = fig.add_axes([0,0,1,1])\n# ax.plot(x,y,color='#008080',lw=3,linestyle='--')\n# Other variants of linestyle include\n# ax.plot(x,y,color='#008080',lw=3,ls='-.')\nax.plot(x,y,color='#008080',lw=3,ls=':')\n# ax.plot(x,y,color='#008080',lw=3,ls='steps') # Steps on dotted --\n# A solid line has linestyle = - by default.\n# ls also works as a shorthand for linestyle, and infact is more used than linestyle.", "_____no_output_____" ] ], [ [ "### Markers\n* Markers are used when we have just a few number of data points. \n", "_____no_output_____" ] ], [ [ "# Say we have x an array of len(x) data points.\nx", "_____no_output_____" ], [ "len(x)", "_____no_output_____" ], [ "# Say if we wanted to mark where those 11 points occured on the plot.\nfig = plt.figure()\nax = fig.add_axes([0,0,1,1])\nax.plot(x,y,color='#008080',lw=3,marker='o',markersize=15,markerfacecolor='yellow',\nmarkeredgewidth=3,markeredgecolor='black')\n", "_____no_output_____" ] ], [ [ "# More examples on line and marker styles", "_____no_output_____" ] ], [ [ "fig, ax = plt.subplots(figsize=(12,6))\n\nax.plot(x, x+1, color=\"red\", linewidth=0.25)\nax.plot(x, x+2, color=\"red\", linewidth=0.50)\nax.plot(x, x+3, color=\"red\", linewidth=1.00)\nax.plot(x, x+4, color=\"red\", linewidth=2.00)\n\n# possible linestype options ‘-‘, ‘–’, ‘-.’, ‘:’, ‘steps’\nax.plot(x, x+5, color=\"green\", lw=3, linestyle='-')\nax.plot(x, x+6, color=\"green\", lw=3, ls='-.')\nax.plot(x, x+7, color=\"green\", lw=3, ls=':')\n\n# custom dash\nline, = ax.plot(x, x+8, color=\"black\", lw=1.50)\nline.set_dashes([5, 10, 15, 10]) # format: line length, space length, ...\n\n# possible marker symbols: marker = '+', 'o', '*', 's', ',', '.', '1', '2', '3', '4', ...\nax.plot(x, x+ 9, color=\"blue\", lw=3, ls='-', marker='+')\nax.plot(x, x+10, color=\"blue\", lw=3, ls='--', marker='o')\nax.plot(x, x+11, color=\"blue\", lw=3, ls='-', marker='s')\nax.plot(x, x+12, color=\"blue\", lw=3, ls='--', marker='1')\n\n# marker size and color\nax.plot(x, x+13, color=\"purple\", lw=1, ls='-', marker='o', markersize=2)\nax.plot(x, x+14, color=\"purple\", lw=1, ls='-', marker='o', markersize=4)\nax.plot(x, x+15, color=\"purple\", lw=1, ls='-', marker='o', markersize=8, markerfacecolor=\"red\")\nax.plot(x, x+16, color=\"purple\", lw=1, ls='-', marker='s', markersize=8, \n markerfacecolor=\"yellow\", markeredgewidth=3, markeredgecolor=\"green\");", "_____no_output_____" ] ], [ [ "### Control over axis appearance\n\n* In this section we will look at controlling axis sizing properties in a matplotlib figure.", "_____no_output_____" ] ], [ [ "# Say we wanted to show the plot between 0 and 1 on the x-axis\nfig = plt.figure()\nax = fig.add_axes([0,0,1,1])\nax.plot(x,y,color='#008080',lw=3,ls='--')", "_____no_output_____" ], [ "# Say we wanted to show the plot between 0 and 1 on the x-axis\nfig = plt.figure()\nax = fig.add_axes([0,0,1,1])\nax.plot(x,y,color='#008080',lw=3,ls='--',\n markeredgewidth=3,markeredgecolor='black')\nax.set_xlim([0,1]) # Call axis and set_xlim and then we pass in a list with an upper and lower bound.\nax.set_ylim([0,2])\n# Compare this with the plot above.\"", "_____no_output_____" ] ], [ [ "## Plot Range\n* We can configure the ranges of the axes using the set_ylim and set_xlim methods in the axis object, or axis('tight') for automatically getting \\\"tightly fitted\\\" axes ranges:", "_____no_output_____" ] ], [ [ "fig, axes = plt.subplots(1, 3, figsize=(12, 4))\n\naxes[0].plot(x, x**2, label = 'X squaraed',color='red')\naxes[0].plot(x, x**3,label='X cube',color='green')\naxes[0].set_title(\"default axes ranges\")\n\n\naxes[1].plot(x, x**2, label = 'X squaraed',color='red')\naxes[1].plot(x, x**3,label='X cube',color='green')\naxes[1].axis('tight')\naxes[1].set_title(\"tight axes\")\n\naxes[2].plot(x, x**2, label = 'X squaraed',color='red')\naxes[2].plot(x, x**3,label='X cube',color='green')\naxes[2].set_ylim([0, 60])\naxes[2].set_xlim([2, 5])\naxes[2].set_title(\"custom axes range\");\naxes[0].legend(loc=0)\naxes[1].legend(loc=0)\naxes[2].legend(loc=0)\n", "_____no_output_____" ] ], [ [ "## Special Plot Types\n* There are many specialized plots we can create, such as barplots, histograms, scatter plots, and much more. Most of these type of plots we will actually create using seaborn, a statistical plotting library for Python. But here are a few examples of these type of plots:", "_____no_output_____" ] ], [ [ "# Scatter plot\nplt.scatter(x,y)", "_____no_output_____" ], [ "# Histrogram\nfrom random import sample\ndata = sample(range(1, 1000), 100)\nplt.hist(data)", "_____no_output_____" ], [ "data = [np.random.normal(0, std, 100) for std in range(1, 4)]\n\n# rectangular box plot\nplt.boxplot(data,vert=True,patch_artist=True);", "_____no_output_____" ] ], [ [ "## Further reading", "_____no_output_____" ], [ "* http://www.matplotlib.org - The project web page for matplotlib.\n* https://github.com/matplotlib/matplotlib - The source code for matplotlib.\n* http://matplotlib.org/gallery.html - A large gallery showcaseing various types of plots matplotlib can create. Highly recommended! \n* http://www.loria.fr/~rougier/teaching/matplotlib - A good matplotlib tutorial.\n* http://scipy-lectures.github.io/matplotlib/matplotlib.html - Another good matplotlib reference.\n", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ] ]
e7e6844baafb7a2f2dcd2fa020f25533eca9e716
28,795
ipynb
Jupyter Notebook
data/Selecting.ipynb
eegdigits/notebooks
e6be85b8ad90da040d34ca423666011a78ad816a
[ "MIT" ]
null
null
null
data/Selecting.ipynb
eegdigits/notebooks
e6be85b8ad90da040d34ca423666011a78ad816a
[ "MIT" ]
null
null
null
data/Selecting.ipynb
eegdigits/notebooks
e6be85b8ad90da040d34ca423666011a78ad816a
[ "MIT" ]
null
null
null
38.859649
4,709
0.373537
[ [ [ "---\n## 2. Select subsets from our dataset\n\n\n---", "_____no_output_____" ] ], [ [ "from digits.data import matimport\nfrom digits.data import select", "_____no_output_____" ], [ "dataroot='../../data/thomas/artcorr/'\nimp = matimport.Importer(dataroot=dataroot)", "_____no_output_____" ] ], [ [ "With `imp.open()` we can use HDF5 references to our samples and targets datasets without using up initial memory. \nThe `samples` and `targets` objects are attached to the `store` attribute.\n\nIn this notebook we will load the samples and targets from the file right away.", "_____no_output_____" ] ], [ [ "imp.open('3131.h5')\nsamples = imp.store.samples\ntargets = imp.store.targets", "_____no_output_____" ], [ "670*16", "_____no_output_____" ], [ "print(select.getsessionnames(samples))\nfor sess in select.getsessionnames(samples):\n print(samples.xs(sess, level='session').shape[0])", "['01', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16']\n632\n650\n652\n652\n683\n687\n669\n658\n610\n672\n609\n" ] ], [ [ "The functions in `digits.data.select` will provide a high level abstraction for subselecting and pruning the large dataset, specific to the studies parameters. For instance:\n\n\n#### column-wise\n\n+ select only sampling points from a time window with `select.fromtimerange(samples, min, max)`\n+ select all sampling points from a named list of channels with `select.fromchannellist(samples, list)`\n+ select all sampling points from a range with `select.fromchannelrange(samples, min, max)`\n\n\n#### row-wise\n\n+ sellect all trials from a list of named session ids with `select.fromtrialid(samples, id-list)`\n+ ...\n\n\nSome helper functions inside the `select` package help to get the names of the index/column labels.\n\n\nThe idea is to incrementally reduce the dataset to the desired size and/or programmatically loop over a number of blocks in the dataset with a sliding window analysis in mind.\n\nExample:", "_____no_output_____" ] ], [ [ "print(select.getchannelnames(samples))\nprint(select.getsessionnames(samples))\nprint(select.getpresentationnames(samples))", "['A1', 'AF3', 'AF4', 'AF7', 'AF8', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'CP1', 'CP2', 'CP3', 'CP4', 'CP5', 'CP6', 'CPz', 'Cz', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'FC1', 'FC2', 'FC3', 'FC4', 'FC5', 'FC6', 'FCz', 'FT7', 'FT8', 'Fp1', 'Fp2', 'Fpz', 'Fz', 'IOL', 'LHEOG', 'O1', 'O2', 'Oz', 'P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'P7', 'P8', 'PO3', 'PO4', 'PO7', 'PO8', 'POz', 'Pz', 'RHEOG', 'T7', 'T8', 'TP7', 'TP8']\n['01', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16']\n['0', '1', '10', '100', '101', '102', '103', '104', '105', '106', '107', '108', '109', '11', '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '12', '120', '121', '122', '123', '124', '125', '126', '127', '128', '129', '13', '130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '14', '140', '141', '142', '143', '144', '145', '146', '147', '148', '149', '15', '150', '151', '152', '153', '154', '155', '156', '157', '158', '159', '16', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169', '17', '170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '18', '180', '181', '182', '183', '184', '185', '186', '187', '188', '189', '19', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '2', '20', '200', '201', '202', '203', '204', '205', '206', '207', '208', '209', '21', '210', '211', '212', '213', '214', '215', '216', '217', '218', '219', '22', '220', '221', '222', '223', '224', '225', '226', '227', '228', '229', '23', '230', '231', '232', '233', '234', '235', '236', '237', '238', '239', '24', '240', '241', '242', '243', '244', '245', '246', '247', '248', '249', '25', '250', '251', '252', '253', '254', '255', '256', '257', '258', '259', '26', '260', '261', '262', '263', '264', '265', '266', '267', '268', '269', '27', '270', '271', '272', '273', '274', '275', '276', '277', '278', '279', '28', '280', '281', '282', '283', '284', '285', '286', '287', '288', '289', '29', '290', '291', '292', '293', '294', '295', '296', '297', '298', '299', '3', '30', '300', '301', '302', '303', '304', '305', '306', '307', '308', '309', '31', '310', '311', '312', '313', '314', '315', '316', '317', '318', '319', '32', '320', '321', '322', '323', '324', '325', '326', '327', '328', '329', '33', '330', '331', '332', '333', '334', '335', '336', '337', '338', '339', '34', '340', '341', '342', '343', '344', '345', '346', '347', '348', '349', '35', '350', '351', '352', '353', '354', '355', '356', '357', '358', '359', '36', '360', '361', '362', '363', '364', '365', '366', '367', '368', '369', '37', '370', '371', '372', '373', '374', '375', '376', '377', '378', '379', '38', '380', '381', '382', '383', '384', '385', '386', '387', '388', '389', '39', '390', '391', '392', '393', '394', '395', '396', '397', '398', '399', '4', '40', '400', '401', '402', '403', '404', '405', '406', '407', '408', '409', '41', '410', '411', '412', '413', '414', '415', '416', '417', '418', '419', '42', '420', '421', '422', '423', '424', '425', '426', '427', '428', '429', '43', '430', '431', '432', '433', '434', '435', '436', '437', '438', '439', '44', '440', '441', '442', '443', '444', '445', '446', '447', '448', '449', '45', '450', '451', '452', '453', '454', '455', '456', '457', '458', '459', '46', '460', '461', '462', '463', '464', '465', '466', '467', '468', '469', '47', '470', '471', '472', '473', '474', '475', '476', '477', '478', '479', '48', '480', '481', '482', '483', '484', '485', '486', '487', '488', '489', '49', '490', '491', '492', '493', '494', '495', '496', '497', '498', '499', '5', '50', '500', '501', '502', '503', '504', '505', '506', '507', '508', '509', '51', '510', '511', '512', '513', '514', '515', '516', '517', '518', '519', '52', '520', '521', '522', '523', '524', '525', '526', '527', '528', '529', '53', '530', '531', '532', '533', '534', '535', '536', '537', '538', '539', '54', '540', '541', '542', '543', '544', '545', '546', '547', '548', '549', '55', '550', '551', '552', '553', '554', '555', '556', '557', '558', '559', '56', '560', '561', '562', '563', '564', '565', '566', '567', '568', '569', '57', '570', '571', '572', '573', '574', '575', '576', '577', '578', '579', '58', '580', '581', '582', '583', '584', '585', '586', '587', '588', '589', '59', '590', '591', '592', '593', '594', '595', '596', '597', '598', '599', '6', '60', '600', '601', '602', '603', '604', '605', '606', '607', '608', '609', '61', '610', '611', '612', '613', '614', '615', '616', '617', '618', '619', '62', '620', '621', '622', '623', '624', '625', '626', '627', '628', '629', '63', '630', '631', '632', '633', '634', '635', '636', '637', '638', '639', '64', '640', '641', '642', '643', '644', '645', '646', '647', '648', '649', '65', '650', '651', '652', '653', '654', '655', '656', '657', '658', '659', '66', '660', '661', '662', '663', '664', '665', '666', '667', '668', '669', '67', '670', '671', '672', '673', '674', '675', '676', '677', '678', '679', '68', '680', '681', '682', '683', '684', '685', '686', '69', '7', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '8', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '9', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99']\n" ], [ "print(select.getsessionnames(samples))", "['01', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16']\n" ] ], [ [ "The level/index names can be display with `head()` quite nicely:", "_____no_output_____" ] ], [ [ "samples.head()", "_____no_output_____" ] ], [ [ "Now for the selection:", "_____no_output_____" ] ], [ [ "print(samples.shape)\nprint(select.getsessionnames(samples))", "(7174, 89664)\n['01', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16']\n" ], [ "samples, targets = select.fromsessionlist(samples, targets, ['14', '15'])\nsamples.shape", "_____no_output_____" ], [ "samples = select.fromchannellist(samples, ['C1', 'C2'])\nprint(samples.shape)", "(1282, 2802)\n" ], [ "samples = select.fromtimerange(samples, 't_0200', 't_0201')\nprint(samples.shape)", "(1282, 4)\n" ], [ "samples, targets = select.frompresentationlist(samples, targets, ['1','2','3','4'])", "_____no_output_____" ], [ "samples.head(10)", "_____no_output_____" ], [ "print(samples.head(10).to_latex())", "\\begin{tabular}{llllrrrr}\n\\toprule\n & & & & C1 & & C2 & \\\\\n & & & & t\\_0200 & t\\_0201 & t\\_0200 & t\\_0201 \\\\\nsubject & session & trial & presentation & & & & \\\\\n\\midrule\n3131 & 14 & 2 & 1 & -7.291202 & -8.348700 & -10.118226 & -11.385602 \\\\\n & & & 2 & 5.475969 & 9.075162 & 9.528195 & 12.702423 \\\\\n & & & 3 & 13.696177 & 14.089633 & 20.607351 & 20.646475 \\\\\n & & & 4 & 3.592678 & 3.019830 & 5.601668 & 5.647057 \\\\\n & 15 & 1 & 1 & -0.402161 & -0.086583 & -2.192876 & -2.454573 \\\\\n & & & 2 & -9.592463 & -10.213227 & -16.365511 & -16.116913 \\\\\n & & 2 & 3 & -4.315301 & -3.262175 & -3.724870 & -2.534175 \\\\\n & & & 4 & 3.713143 & 5.164251 & 7.716980 & 9.143118 \\\\\n\\bottomrule\n\\end{tabular}\n\n" ] ], [ [ "doc: http://pandas.pydata.org/pandas-docs/stable/advanced.html#advanced-xs", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ] ]
e7e6a37592a846c7aeaf9c32721d6554fcfb599f
257,834
ipynb
Jupyter Notebook
Module5/Module5 - Lab3.ipynb
azharmgh/pyrepo
61f5a5cfab6b37c0ca58d3509b162871e5afd34b
[ "MIT" ]
null
null
null
Module5/Module5 - Lab3.ipynb
azharmgh/pyrepo
61f5a5cfab6b37c0ca58d3509b162871e5afd34b
[ "MIT" ]
null
null
null
Module5/Module5 - Lab3.ipynb
azharmgh/pyrepo
61f5a5cfab6b37c0ca58d3509b162871e5afd34b
[ "MIT" ]
null
null
null
57.693891
43,087
0.613542
[ [ [ "# DAT210x - Programming with Python for DS", "_____no_output_____" ], [ "## Module5- Lab3", "_____no_output_____" ] ], [ [ "import pandas as pd\nfrom datetime import timedelta\nimport matplotlib.pyplot as plt\nimport matplotlib\n\nmatplotlib.style.use('ggplot') # Look Pretty", "_____no_output_____" ] ], [ [ "A convenience function for you to use:", "_____no_output_____" ] ], [ [ "def clusterInfo(model):\n print(\"Cluster Analysis Inertia: \", model.inertia_)\n print('------------------------------------------')\n \n for i in range(len(model.cluster_centers_)):\n print(\"\\n Cluster \", i)\n print(\" Centroid \", model.cluster_centers_[i])\n print(\" #Samples \", (model.labels_==i).sum()) # NumPy Power", "_____no_output_____" ], [ "# Find the cluster with the least # attached nodes\ndef clusterWithFewestSamples(model):\n # Ensure there's at least on cluster...\n minSamples = len(model.labels_)\n minCluster = 0\n \n for i in range(len(model.cluster_centers_)):\n if minSamples > (model.labels_==i).sum():\n minCluster = i\n minSamples = (model.labels_==i).sum()\n\n print(\"\\n Cluster With Fewest Samples: \", minCluster)\n return (model.labels_==minCluster)", "_____no_output_____" ] ], [ [ "### CDRs", "_____no_output_____" ], [ "A [call detail record](https://en.wikipedia.org/wiki/Call_detail_record) (CDR) is a data record produced by a telephone exchange or other telecommunications equipment that documents the details of a telephone call or other telecommunications transaction (e.g., text message) that passes through that facility or device.\n\nThe record contains various attributes of the call, such as time, duration, completion status, source number, and destination number. It is the automated equivalent of the paper toll tickets that were written and timed by operators for long-distance calls in a manual telephone exchange.\n\nThe dataset we've curated for you contains call records for 10 people, tracked over the course of 3 years. Your job in this assignment is to find out where each of these people likely live and where they work at!\n\nStart by loading up the dataset and taking a peek at its `head` and `dtypes`. You can convert date-strings to real date-time objects using `pd.to_datetime`, and the times using `pd.to_timedelta`:", "_____no_output_____" ] ], [ [ "df1 = pd.read_csv('Datasets/CDR.csv')\ndf1 = df1.dropna()\ndf1['CallDate'] = pd.to_datetime(df1['CallDate'], 'coerce')\ndf1['CallTime'] = pd.to_timedelta(df1['CallTime'])\ndf1['Duration'] = pd.to_timedelta(df1['Duration'])\ndf1.dtypes", "_____no_output_____" ] ], [ [ "Create a unique list of the phone number values (people) stored in the `In` column of the dataset, and save them in a regular python list called `unique_numbers`. Manually check through `unique_numbers` to ensure the order the numbers appear is the same order they (uniquely) appear in your dataset:", "_____no_output_____" ] ], [ [ "# .. your code here ..\nunique_numbers = df1.In.unique().tolist()\nunique_numbers", "_____no_output_____" ] ], [ [ "Using some domain expertise, your intuition should direct you to know that people are likely to behave differently on weekends vs on weekdays:\n\n#### On Weekends\n1. People probably don't go into work\n1. They probably sleep in late on Saturday\n1. They probably run a bunch of random errands, since they couldn't during the week\n1. They should be home, at least during the very late hours, e.g. 1-4 AM\n\n#### On Weekdays\n1. People probably are at work during normal working hours\n1. They probably are at home in the early morning and during the late night\n1. They probably spend time commuting between work and home everyday", "_____no_output_____" ] ], [ [ "print(\"Examining person: \", unique_numbers[0])", "Examining person: 4638472273\n" ] ], [ [ "Create a slice called `user1` that filters to only include dataset records where the `In` feature (user phone number) is equal to the first number on your unique list above:", "_____no_output_____" ] ], [ [ "# .. your code here ..\nuser1 = df1[df1['In'] == unique_numbers[0]]\nuser1", "_____no_output_____" ] ], [ [ "Alter your slice so that it includes only Weekday (Mon-Fri) values:", "_____no_output_____" ] ], [ [ "# .. your code here ..\npm5 = pd.to_timedelta('17:00:00')\nam730 = pd.to_timedelta('07:30:00')\n#user2 = user1[(((user1['DOW'] == 'Sat') | (user1['DOW'] == 'Sun')) & ((user1['CallTime'] > am1) & (user1['CallTime'] < am4)))]\nuser2 = user1\nuser1 = user1[(((user1['DOW'] == 'Mon') | (user1['DOW'] == 'Tue') | (user1['DOW'] == 'Wed') | (user1['DOW'] == 'Thu') \n | (user1['DOW'] == 'Fri')) & ( (user1['CallTime'] < pm5 ) & (user1['CallTime'] > am730 ) ) ) ]\nuser1", "_____no_output_____" ] ], [ [ "The idea is that the call was placed before 5pm. From Midnight-730a, the user is probably sleeping and won't call / wake up to take a call. There should be a brief time in the morning during their commute to work, then they'll spend the entire day at work. So the assumption is that most of the time is spent either at work, or in 2nd, at home:", "_____no_output_____" ] ], [ [ "# .. your code here ..", "_____no_output_____" ] ], [ [ "Plot the Cell Towers the user connected to", "_____no_output_____" ] ], [ [ "# .. your code here ..\n%matplotlib notebook\n\nfig = plt.figure()\nax = fig.add_subplot(111)\nax.scatter(user1.TowerLon,user1.TowerLat, c='g', marker='o', alpha=0.2)\nax.set_title('Weedkay Calls (7:30am - 5pm)')\nplt.show()", "_____no_output_____" ], [ "from sklearn.cluster import KMeans\n\ndef doKMeans(data, num_clusters=0):\n # TODO: Be sure to only feed in Lat and Lon coordinates to the KMeans algo, since none of the other\n # data is suitable for your purposes. Since both Lat and Lon are (approximately) on the same scale,\n # no feature scaling is required. Print out the centroid locations and add them onto your scatter\n # plot. Use a distinguishable marker and color.\n #\n # Hint: Make sure you fit ONLY the coordinates, and in the CORRECT order (lat first). This is part\n # of your domain expertise. Also, *YOU* need to create, initialize (and return) the variable named\n # `model` here, which will be a SKLearn K-Means model for this to work:\n \n # .. your code here ..\n \n data = data[['TowerLat', 'TowerLon']]\n model = KMeans(n_clusters=num_clusters)\n model.fit(data)\n \n # Now we can print and plot the centroids:\n centroids = model.cluster_centers_\n print(centroids)\n #ax.scatter(centroids[:,0], centroids[:,1], marker='x', c='red', alpha=0.3)\n return model", "_____no_output_____" ] ], [ [ "Let's tun K-Means with `K=3` or `K=4`. There really should only be a two areas of concentration. If you notice multiple areas that are \"hot\" (multiple areas the user spends a lot of time at that are FAR apart from one another), then increase K=5, with the goal being that all centroids except two will sweep up the annoying outliers and not-home, not-work travel occasions. the other two will zero in on the user's approximate home location and work locations. Or rather the location of the cell tower closest to them.....", "_____no_output_____" ] ], [ [ "model = doKMeans(user1, 4)", "[[ 32.84579692 -96.81976265]\n [ 32.89970164 -96.91026779]\n [ 32.87348968 -96.85115015]\n [ 32.911583 -96.892222 ]]\n" ] ], [ [ "Print out the mean `CallTime` value for the samples belonging to the cluster with the LEAST samples attached to it. If our logic is correct, the cluster with the MOST samples will be work. The cluster with the 2nd most samples will be home. And the `K=3` cluster with the least samples should be somewhere in between the two. What time, on average, is the user in between home and work, between the midnight and 5pm?", "_____no_output_____" ] ], [ [ "midWayClusterIndices = clusterWithFewestSamples(model)\nmidWaySamples = user1[midWayClusterIndices]\nprint(\" Its Waypoint Time: \", midWaySamples.CallTime.mean())", "\n Cluster With Fewest Samples: 3\n Its Waypoint Time: 0 days 07:44:31.892341\n" ] ], [ [ "Let's visualize the results! First draw the X's for the clusters:", "_____no_output_____" ] ], [ [ "fig1 = plt.figure()\nax1 = fig1.add_subplot(111)\nax1.scatter(model.cluster_centers_[:,1], model.cluster_centers_[:,0], s=169, c='r', marker='x', alpha=0.8, linewidths=2)\nax1.set_title('Weekday Calls Centroids')\nplt.show()", "_____no_output_____" ], [ "clusterInfo(model)", "Cluster Analysis Inertia: 0.0499933966513\n------------------------------------------\n\n Cluster 0\n Centroid [ 32.84579692 -96.81976265]\n #Samples 48\n\n Cluster 1\n Centroid [ 32.89970164 -96.91026779]\n #Samples 728\n\n Cluster 2\n Centroid [ 32.87348968 -96.85115015]\n #Samples 81\n\n Cluster 3\n Centroid [ 32.911583 -96.892222]\n #Samples 32\n" ], [ "users_phones = [2068627935,2894365987,1559410755,3688089071]", "_____no_output_____" ], [ "def examineNumber(df, number, num_clusters):\n print(\"Examining person: \", number)\n user = df[df['In'] == number]\n pm5 = pd.to_timedelta('17:00:00')\n am730 = pd.to_timedelta('07:30:00')\n user = user[(((user['DOW'] == 'Mon') | (user['DOW'] == 'Tue') | (user['DOW'] == 'Wed') | (user['DOW'] == 'Thu') \n | (user['DOW'] == 'Fri')) & ( (user['CallTime'] < pm5 ) & (user['CallTime'] > am730 ) ) ) ]\n data = user[['TowerLat', 'TowerLon']]\n model = KMeans(n_clusters=num_clusters)\n model.fit(data)\n # Now we can print and plot the centroids:\n clusterInfo(model)\n return model\n\n", "_____no_output_____" ], [ "examineNumber(df1,users_phones[0],4)", "Examining person: 2068627935\nCluster Analysis Inertia: 0.083671853092\n------------------------------------------\n\n Cluster 0\n Centroid [ 32.72089235 -96.83287671]\n #Samples 1194\n\n Cluster 1\n Centroid [ 32.71215719 -96.75923115]\n #Samples 190\n\n Cluster 2\n Centroid [ 32.72222073 -96.80687153]\n #Samples 112\n\n Cluster 3\n Centroid [ 32.731611 -96.709444]\n #Samples 19\n" ], [ "examineNumber(df1,users_phones[1],4)", "Examining person: 2894365987\nCluster Analysis Inertia: 0.00584613804294\n------------------------------------------\n\n Cluster 0\n Centroid [ 32.717667 -96.875194]\n #Samples 141\n\n Cluster 1\n Centroid [ 32.72174109 -96.89194104]\n #Samples 2705\n\n Cluster 2\n Centroid [ 32.741889 -96.857611]\n #Samples 241\n\n Cluster 3\n Centroid [ 32.698088 -96.92053683]\n #Samples 6\n" ] ], [ [ "2894365987 is the closest so far", "_____no_output_____" ] ], [ [ "examineNumber(df1,users_phones[2],4)", "Examining person: 1559410755\nCluster Analysis Inertia: 0.0278806172308\n------------------------------------------\n\n Cluster 0\n Centroid [ 32.69634229 -96.93521264]\n #Samples 2430\n\n Cluster 1\n Centroid [ 32.72173859 -96.91649201]\n #Samples 189\n\n Cluster 2\n Centroid [ 32.76754224 -96.91641493]\n #Samples 99\n\n Cluster 3\n Centroid [ 32.67086679 -96.93461827]\n #Samples 75\n" ], [ "examineNumber(df1,users_phones[3],4)", "Examining person: 3688089071\nCluster Analysis Inertia: 0.00457446197459\n------------------------------------------\n\n Cluster 0\n Centroid [ 32.80065673 -96.81319445]\n #Samples 22\n\n Cluster 1\n Centroid [ 32.81175517 -96.87019575]\n #Samples 361\n\n Cluster 2\n Centroid [ 32.80733081 -96.83542586]\n #Samples 21\n\n Cluster 3\n Centroid [ 32.79794895 -96.78880445]\n #Samples 20\n" ], [ "def getClusterSamples(df, number, num_clusters):\n print(\"getting cluster for person: \", number)\n user = df[df['In'] == number]\n pm5 = pd.to_timedelta('17:00:00')\n am730 = pd.to_timedelta('07:30:00')\n user = user[(((user['DOW'] == 'Mon') | (user['DOW'] == 'Tue') | (user['DOW'] == 'Wed') | (user['DOW'] == 'Thu') \n | (user['DOW'] == 'Fri')) & ( (user['CallTime'] < pm5 ) & (user['CallTime'] > am730 ) ) ) ]\n data = user[['TowerLat', 'TowerLon']]\n model = KMeans(n_clusters=num_clusters)\n model.fit(data)\n # Now we can print and plot the centroids:\n smallest_cluster_index = clusterWithFewestSamples(model)\n sample = user[smallest_cluster_index]\n print(\" Avg time : \", sample.CallTime.mean())\n return sample\n", "_____no_output_____" ], [ "clusterlist = []\n\nfor i in range(len(unique_numbers)):\n print(\"examining user : \" , unique_numbers[i])\n c = getClusterSamples(df1,unique_numbers[i],3)\n clusterlist.append(c)\n \n", "examining user : 4638472273\ngetting cluster for person: 4638472273\n\n Cluster With Fewest Samples: 1\n Avg time : 0 days 07:44:01.395089\nexamining user : 1559410755\ngetting cluster for person: 1559410755\n\n Cluster With Fewest Samples: 0\n Avg time : 0 days 07:49:46.609049\nexamining user : 4931532174\ngetting cluster for person: 4931532174\n\n Cluster With Fewest Samples: 2\n Avg time : 0 days 10:25:23.941509\nexamining user : 2419930464\ngetting cluster for person: 2419930464\n\n Cluster With Fewest Samples: 2\n Avg time : 0 days 07:47:11.097689\nexamining user : 1884182865\ngetting cluster for person: 1884182865\n\n Cluster With Fewest Samples: 1\n Avg time : 0 days 07:44:52.338718\nexamining user : 3688089071\ngetting cluster for person: 3688089071\n\n Cluster With Fewest Samples: 1\n Avg time : 0 days 07:43:12.171078\nexamining user : 4555003213\ngetting cluster for person: 4555003213\n\n Cluster With Fewest Samples: 1\n Avg time : 0 days 08:04:09.204236\nexamining user : 2068627935\ngetting cluster for person: 2068627935\n\n Cluster With Fewest Samples: 2\n Avg time : 0 days 07:51:24.887866\nexamining user : 2894365987\ngetting cluster for person: 2894365987\n\n Cluster With Fewest Samples: 2\n Avg time : 0 days 07:50:14.382905\nexamining user : 8549533077\ngetting cluster for person: 8549533077\n\n Cluster With Fewest Samples: 2\n Avg time : 0 days 07:53:54.772647\n" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ] ]
e7e6c99cb0f60c3cbb2910fd70eab46e5b57ec11
4,379
ipynb
Jupyter Notebook
notebooks/05.00-Structure-Refinement.ipynb
wrbl96/pyRosetta
63dccca0c7d84a04068f0d981cc0b00b138a7b9b
[ "MIT" ]
226
2019-08-05T17:36:59.000Z
2022-03-27T09:30:21.000Z
notebooks/05.00-Structure-Refinement.ipynb
Paradoxia-crypo/PyRosetta.notebooks
200a6d5489f2108999563ae38c7e3fcdabe8f5fe
[ "MIT" ]
44
2019-08-21T15:47:53.000Z
2022-03-18T03:45:07.000Z
notebooks/05.00-Structure-Refinement.ipynb
Paradoxia-crypo/PyRosetta.notebooks
200a6d5489f2108999563ae38c7e3fcdabe8f5fe
[ "MIT" ]
86
2019-12-23T07:18:27.000Z
2022-03-31T08:33:12.000Z
42.105769
666
0.670244
[ [ [ "<!--NOTEBOOK_HEADER-->\n*This notebook contains material from [PyRosetta](https://RosettaCommons.github.io/PyRosetta.notebooks);\ncontent is available [on Github](https://github.com/RosettaCommons/PyRosetta.notebooks.git).*", "_____no_output_____" ], [ "<!--NAVIGATION-->\n< [Low-Res Scoring and Fragments](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/04.02-Low-Res-Scoring-and-Fragments.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [High-Resolution Movers](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/05.01-High-Res-Movers.ipynb) ><p><a href=\"https://colab.research.google.com/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/05.00-Structure-Refinement.ipynb\"><img align=\"left\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\" title=\"Open in Google Colaboratory\"></a>", "_____no_output_____" ], [ "# Structure Refinement", "_____no_output_____" ], [ "One of the most basic operations in protein structure and design algorithms is manipulation of the protein conformation. In Rosetta, these manipulations are organized into movers. A `Mover` object simply changes the conformation of a given pose. It can be simple, like a single φ or ψ angle change, or complex, like an entire refinement protocol.\n\n## Suggested Reading\n- P. Bradley, K. M. S. Misura & D. Baker, “Toward high-resolution de novo structure prediction for small proteins,” Science 309, 1868-1871 (2005), including Supplementary Material.\n- Z. Li & H. A. Scheraga, “Monte Carlo-minimization approach to the multiple-minima problem in protein folding,” Proc. Natl. Acad. Sci. USA 84, 6611-6615 (1987).\n\n## PyRosetta Workshop 5 Link\nhttps://graylab.jhu.edu/pyrosetta/downloads/documentation/pyrosetta4_online_format/PyRosetta4_Workshop5_StructureRefinement.pdf\n\n## Appendix A Link\nhttps://graylab.jhu.edu/pyrosetta/downloads/documentation/pyrosetta4_online_format/PyRosetta4_Workshops_Appendix_A.pdf", "_____no_output_____" ], [ "**Chapter contributors:**\n\n- Kathy Le (Johns Hopkins University); this chapter was adapted from the [PyRosetta book](https://www.amazon.com/PyRosetta-Interactive-Platform-Structure-Prediction-ebook/dp/B01N21DRY8) (J. J. Gray, S. Chaudhury, S. Lyskov, J. Labonte).", "_____no_output_____" ], [ "<!--NAVIGATION-->\n< [Low-Res Scoring and Fragments](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/04.02-Low-Res-Scoring-and-Fragments.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [High-Resolution Movers](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/05.01-High-Res-Movers.ipynb) ><p><a href=\"https://colab.research.google.com/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/05.00-Structure-Refinement.ipynb\"><img align=\"left\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\" title=\"Open in Google Colaboratory\"></a>", "_____no_output_____" ] ] ]
[ "markdown" ]
[ [ "markdown", "markdown", "markdown", "markdown", "markdown", "markdown" ] ]
e7e6cdf69ca2ebeb29363ac7ccec561eeaf337ec
142,510
ipynb
Jupyter Notebook
matkoy2021-1.ipynb
atcemgil/notes
380d310a87767d9b1fe88229588dfe00a61d2353
[ "MIT" ]
191
2016-01-21T19:44:23.000Z
2022-03-25T20:50:50.000Z
matkoy2021-1.ipynb
atcemgil/notes
380d310a87767d9b1fe88229588dfe00a61d2353
[ "MIT" ]
2
2018-02-18T03:41:04.000Z
2018-11-21T11:08:49.000Z
matkoy2021-1.ipynb
atcemgil/notes
380d310a87767d9b1fe88229588dfe00a61d2353
[ "MIT" ]
138
2015-10-04T21:57:21.000Z
2021-06-15T19:35:55.000Z
100.713781
20,100
0.769749
[ [ [ "Yapay Öğrenmeye Giriş I\n\nAli Taylan Cemgil\n", "_____no_output_____" ], [ "# Parametrik Regresyon, Parametrik Fonksyon Oturtma Problemi (Parametric Regression, Function Fitting)\n\n\nVerilen girdi ve çıktı ikilileri $x, y$ için parametrik bir fonksyon $f$ oturtma problemi. \n\nParametre $w$ değerlerini öyle bir seçelim ki \n$$\ny \\approx f(x; w)\n$$\n\n$x$: Girdi (Input)\n\n$y$: Çıktı (Output)\n\n$w$: Parametre (Weight, ağırlık)\n\n$e$: Hata\n\nÖrnek 1: \n$$\ne = y - f(x)\n$$\n\nÖrnek 2:\n$$\ne = \\frac{y}{f(x)}-1\n$$\n\n$E$, $D$: Hata fonksyonu (Error function), Iraksay (Divergence)\n\n\n\n# Doğrusal Regresyon (Linear Regression)\n\nOturtulacak $f$ fonksyonun **model parametreleri** $w$ cinsinden doğrusal olduğu durum (Girdiler $x$ cinsinden doğrusal olması gerekmez). \n\n## Tanım: Doğrusallık\nBir $g$ fonksyonu doğrusaldır demek, herhangi skalar $a$ ve $b$ içn\n$$\ng(aw_1 + b w_2) = a g(w_1) + b g(w_2)\n$$\nolması demektir.\n\n\n\n\n", "_____no_output_____" ], [ "## Örnek: Doğru oturtmak (Line Fitting)\n\n* Girdi-Çıktı ikilileri\n$$\n(x_i, y_i)\n$$\n$i=1\\dots N$ \n\n* Model\n$$\ny_i \\approx f(x; w_1, w_0) = w_0 + w_1 x \n$$\n\n\n> $x$ : Girdi \n\n> $w_1$: Eğim\n\n> $w_0$: Kesişme\n\n$f_i \\equiv f(x_i; w_1, w_0)$\n\n## Örnek 2: Parabol Oturtma\n\n* Girdi-Çıktı ikilileri\n$$\n(x_i, y_i)\n$$\n$i=1\\dots N$ \n\n* Model\n$$\ny_i \\approx f(x_i; w_2, w_1, w_0) = w_0 + w_1 x_i + w_2 x_i^2\n$$\n\n\n> $x$ : Girdi \n\n> $w_2$: Karesel terimin katsayısı \n\n> $w_1$: Doğrusal terimin katsayısı\n\n> $w_0$: Sabit terim katsayısı\n\n$f_i \\equiv f(x_i; w_2, w_1, w_0)$\n\nBir parabol $x$'in doğrusal fonksyonu değil ama $w_2, w_1, w_0$ parametrelerinin doğrusal fonksyonu.\n", "_____no_output_____" ] ], [ [ "import matplotlib.pyplot as plt\nimport numpy as np\n%matplotlib inline\nfrom __future__ import print_function\nfrom ipywidgets import interact, interactive, fixed\nimport ipywidgets as widgets\nimport matplotlib.pylab as plt\nfrom IPython.display import clear_output, display, HTML\n\nx = np.array([8.0 , 6.1 , 11., 7., 9., 12. , 4., 2., 10, 5, 3])\ny = np.array([6.04, 4.95, 5.58, 6.81, 6.33, 7.96, 5.24, 2.26, 8.84, 2.82, 3.68])\n\ndef plot_fit(w1, w0):\n f = w0 + w1*x\n\n plt.figure(figsize=(4,3))\n plt.plot(x,y,'sk')\n plt.plot(x,f,'o-r')\n #plt.axis('equal')\n plt.xlim((0,15))\n plt.ylim((0,10))\n for i in range(len(x)):\n plt.plot((x[i],x[i]),(f[i],y[i]),'b')\n# plt.show()\n# plt.figure(figsize=(4,1))\n plt.bar(x,(f-y)**2/2)\n plt.title('Toplam kare hata = '+str(np.sum((f-y)**2/2)))\n plt.ylim((0,10))\n plt.xlim((0,15))\n plt.show()\n \nplot_fit(0.0,3.79)", "_____no_output_____" ], [ "interact(plot_fit, w1=(-2, 2, 0.01), w0=(-5, 5, 0.01));", "_____no_output_____" ] ], [ [ "Rasgele Arama", "_____no_output_____" ] ], [ [ "x = np.array([8.0 , 6.1 , 11., 7., 9., 12. , 4., 2., 10, 5, 3])\ny = np.array([6.04, 4.95, 5.58, 6.81, 6.33, 7.96, 5.24, 2.26, 8.84, 2.82, 3.68])\n\n\ndef hata(y, x, w):\n N = len(y)\n f = x*w[1]+w[0]\n e = y-f\n return np.sum(e*e)/2\n\n\nw = np.array([0, 0])\nE = hata(y, x, w)\n\nfor e in range(1000):\n g = 0.1*np.random.randn(2) \n w_temp = w + g\n E_temp = hata(y, x, w_temp)\n if E_temp<E:\n E = E_temp\n w = w_temp\n #print(e, E)\nprint(e, E)\nw", "999 6.88573142353\n" ] ], [ [ "Gerçek veri: Türkiyedeki araç sayıları", "_____no_output_____" ] ], [ [ "%matplotlib inline\n\nimport scipy as sc\nimport numpy as np\nimport pandas as pd\nimport matplotlib as mpl\nimport matplotlib.pylab as plt\n\ndf_arac = pd.read_csv(u'data/arac.csv',sep=';')\ndf_arac[['Year','Car']]\n#df_arac", "_____no_output_____" ], [ "BaseYear = 1995\nx = np.matrix(df_arac.Year[0:]).T-BaseYear\ny = np.matrix(df_arac.Car[0:]).T/1000000.\n\nplt.plot(x+BaseYear, y, 'o-')\nplt.xlabel('Yil')\nplt.ylabel('Araba (Milyon)')\n\nplt.show()", "_____no_output_____" ], [ "%matplotlib inline\nfrom __future__ import print_function\nfrom ipywidgets import interact, interactive, fixed\nimport ipywidgets as widgets\nimport matplotlib.pylab as plt\nfrom IPython.display import clear_output, display, HTML\n\n\nw_0 = 0.27150786\nw_1 = 0.37332256\n\nBaseYear = 1995\nx = np.matrix(df_arac.Year[0:]).T-BaseYear\ny = np.matrix(df_arac.Car[0:]).T/1000000.\n\nfig, ax = plt.subplots()\n\nf = w_1*x + w_0\nplt.plot(x+BaseYear, y, 'o-')\nln, = plt.plot(x+BaseYear, f, 'r')\n\n\nplt.xlabel('Years')\nplt.ylabel('Number of Cars (Millions)')\nax.set_ylim((-2,13))\nplt.close(fig)\n\ndef set_line(w_1, w_0):\n\n f = w_1*x + w_0\n e = y - f\n\n ln.set_ydata(f)\n ax.set_title('Total Error = {} '.format(np.asscalar(e.T*e/2)))\n display(fig)\n\nset_line(0.32,3)", "_____no_output_____" ], [ "interact(set_line, w_1=(-2, 2, 0.01), w_0=(-5, 5, 0.01));", "_____no_output_____" ], [ "w_0 = 0.27150786\nw_1 = 0.37332256\nw_2 = 0.1\n\nBaseYear = 1995\nx = np.array(df_arac.Year[0:]).T-BaseYear\ny = np.array(df_arac.Car[0:]).T/1000000.\n\nfig, ax = plt.subplots()\n\nf = w_2*x**2 + w_1*x + w_0\nplt.plot(x+BaseYear, y, 'o-')\nln, = plt.plot(x+BaseYear, f, 'r')\n\n\nplt.xlabel('Yıl')\nplt.ylabel('Araba Sayısı (Milyon)')\nax.set_ylim((-2,13))\nplt.close(fig)\n\ndef set_line(w_2, w_1, w_0):\n f = w_2*x**2 + w_1*x + w_0\n e = y - f\n ln.set_ydata(f)\n ax.set_title('Ortalama Kare Hata = {} '.format(np.sum(e*e/len(e))))\n display(fig)\n\nset_line(w_2, w_1, w_0)", "_____no_output_____" ], [ "interact(set_line, w_2=(-0.1,0.1,0.001), w_1=(-2, 2, 0.01), w_0=(-5, 5, 0.01))", "_____no_output_____" ] ], [ [ "## Örnek 1, devam: Modeli Öğrenmek\n\n* Öğrenmek: parametre kestirimi $w = [w_0, w_1]$\n\n* Genelde model veriyi hatasız açıklayamayacağı için her veri noktası için bir hata tanımlıyoruz:\n\n$$e_i = y_i - f(x_i; w)$$\n\n* Toplam kare hata \n\n$$\nE(w) = \\frac{1}{2} \\sum_i (y_i - f(x_i; w))^2 = \\frac{1}{2} \\sum_i e_i^2\n$$\n\n* Toplam kare hatayı $w_0$ ve $w_1$ parametrelerini değiştirerek azaltmaya çalışabiliriz.\n\n* Hata yüzeyi ", "_____no_output_____" ] ], [ [ "from itertools import product\n\nBaseYear = 1995\nx = np.matrix(df_arac.Year[0:]).T-BaseYear\ny = np.matrix(df_arac.Car[0:]).T/1000000.\n\n# Setup the vandermonde matrix\nN = len(x)\nA = np.hstack((np.ones((N,1)), x))\n\nleft = -5\nright = 15\nbottom = -4\ntop = 6\nstep = 0.05\nW0 = np.arange(left,right, step)\nW1 = np.arange(bottom,top, step)\n\nErrSurf = np.zeros((len(W1),len(W0)))\n\nfor i,j in product(range(len(W1)), range(len(W0))):\n e = y - A*np.matrix([W0[j], W1[i]]).T\n ErrSurf[i,j] = e.T*e/2\n\nplt.figure(figsize=(7,7))\nplt.imshow(ErrSurf, interpolation='nearest', \n vmin=0, vmax=1000,origin='lower',\n extent=(left,right,bottom,top),cmap='Blues_r')\nplt.xlabel('w0')\nplt.ylabel('w1')\nplt.title('Error Surface')\nplt.colorbar(orientation='horizontal')\nplt.show()", "_____no_output_____" ] ], [ [ "# Modeli Nasıl Kestirebiliriz?\n\n## Fikir: En küçük kare hata \n(Gauss 1795, Legendre 1805)\n\n* Toplam hatanın $w_0$ ve $w_1$'e göre türevini hesapla, sıfıra eşitle ve çıkan denklemleri çöz\n\n\n\n\\begin{eqnarray}\n\\left(\n\\begin{array}{c}\ny_0 \\\\ y_1 \\\\ \\vdots \\\\ y_{N-1} \n\\end{array}\n\\right)\n\\approx\n\\left(\n\\begin{array}{cc}\n1 & x_0 \\\\ 1 & x_1 \\\\ \\vdots \\\\ 1 & x_{N-1} \n\\end{array}\n\\right) \n\\left(\n\\begin{array}{c}\n w_0 \\\\ w_1 \n\\end{array}\n\\right)\n\\end{eqnarray}\n\n\\begin{eqnarray}\ny \\approx A w\n\\end{eqnarray}\n\n> $A = A(x)$: Model Matrisi\n\n> $w$: Model Parametreleri\n\n> $y$: Gözlemler\n\n* Hata vektörü: $$e = y - Aw$$\n\n\\begin{eqnarray}\nE(w) & = & \\frac{1}{2}e^\\top e = \\frac{1}{2}(y - Aw)^\\top (y - Aw)\\\\\n& = & \\frac{1}{2}y^\\top y - \\frac{1}{2} y^\\top Aw - \\frac{1}{2} w^\\top A^\\top y + \\frac{1}{2} w^\\top A^\\top Aw \\\\\n& = & \\frac{1}{2} y^\\top y - y^\\top Aw + \\frac{1}{2} w^\\top A^\\top Aw \\\\\n\\end{eqnarray}\n\n### Gradyan\nhttps://tr.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivative-and-gradient-articles/a/the-gradient\n\n\\begin{eqnarray}\n\\frac{d E}{d w } & = & \\left(\\begin{array}{c}\n \\partial E/\\partial w_0 \\\\ \\partial E/\\partial w_1 \\\\ \\vdots \\\\ \\partial E/\\partial w_{K-1}\n\\end{array}\\right)\n\\end{eqnarray}\n \nToplam hatanın gradyanı\n\\begin{eqnarray}\n\\frac{d}{d w }E(w) & = & \\frac{d}{d w }(\\frac{1}{2} y^\\top y) &+ \\frac{d}{d w }(- y^\\top Aw) &+ \\frac{d}{d w }(\\frac{1}{2} w^\\top A^\\top Aw) \\\\\n& = & 0 &- A^\\top y &+ A^\\top A w \\\\\n& = & - A^\\top (y - Aw) \\\\\n& = & - A^\\top e \\\\\n& \\equiv & \\nabla E(w)\n\\end{eqnarray}\n\n### Yapay zekaya gönül veren herkesin bilmesi gereken eşitlikler\n* Vektör iç çarpımının gradyeni\n\\begin{eqnarray}\n\\frac{d}{d w }(h^\\top w) & = & h\n\\end{eqnarray}\n\n* Karesel bir ifadenin gradyeni\n\\begin{eqnarray}\n\\frac{d}{d w }(w^\\top K w) & = & (K+K^\\top) w\n\\end{eqnarray}\n\n\n### En küçük kare hata çözümü doğrusal modellerde doğrusal denklemlerin çözümü ile bulunabiliyor\n\n\n\\begin{eqnarray}\nw^* & = & \\arg\\min_{w} E(w)\n\\end{eqnarray}\n\n* Eniyileme Şartı (gradyan sıfır olmalı )\n\n\\begin{eqnarray}\n\\nabla E(w^*) & = & 0\n\\end{eqnarray}\n\n\\begin{eqnarray}\n0 & = & - A^\\top y + A^\\top A w^* \\\\\nA^\\top y & = & A^\\top A w^* \\\\\nw^* & = & (A^\\top A)^{-1} A^\\top y \n\\end{eqnarray}\n\n* Geometrik (Projeksyon) yorumu:\n\n\\begin{eqnarray}\nf & = A w^* = A (A^\\top A)^{-1} A^\\top y \n\\end{eqnarray}\n\n", "_____no_output_____" ] ], [ [ "# Solving the Normal Equations\n\n# Setup the Design matrix\nN = len(x)\nA = np.hstack((np.ones((N,1)), x))\n\n#plt.imshow(A, interpolation='nearest')\n# Solve the least squares problem\nw_ls,E,rank,sigma = np.linalg.lstsq(A, y)\n\nprint('Parametreler: \\nw0 = ', w_ls[0],'\\nw1 = ', w_ls[1] )\nprint('Toplam Kare Hata:', E/2)\n\nf = np.asscalar(w_ls[1])*x + np.asscalar(w_ls[0])\nplt.plot(x+BaseYear, y, 'o-')\nplt.plot(x+BaseYear, f, 'r')\n\n\nplt.xlabel('Yıl')\nplt.ylabel('Araba sayısı (Milyon)')\nplt.show()", "Parametreler: \nw0 = [[ 4.13258253]] \nw1 = [[ 0.20987778]]\nToplam Kare Hata: [[ 37.19722385]]\n" ] ], [ [ "## Polinomlar \n\n\n### Parabol\n\\begin{eqnarray}\n\\left(\n\\begin{array}{c}\ny_0 \\\\ y_1 \\\\ \\vdots \\\\ y_{N-1} \n\\end{array}\n\\right)\n\\approx\n\\left(\n\\begin{array}{ccc}\n1 & x_0 & x_0^2 \\\\ 1 & x_1 & x_1^2 \\\\ \\vdots \\\\ 1 & x_{N-1} & x_{N-1}^2 \n\\end{array}\n\\right) \n\\left(\n\\begin{array}{c}\n w_0 \\\\ w_1 \\\\ w_2\n\\end{array}\n\\right)\n\\end{eqnarray}\n\n### $K$ derecesinde polinom\n\\begin{eqnarray}\n\\left(\n\\begin{array}{c}\ny_0 \\\\ y_1 \\\\ \\vdots \\\\ y_{N-1} \n\\end{array}\n\\right)\n\\approx\n\\left(\n\\begin{array}{ccccc}\n1 & x_0 & x_0^2 & \\dots & x_0^K \\\\ 1 & x_1 & x_1^2 & \\dots & x_1^K\\\\ \\vdots \\\\ 1 & x_{N-1} & x_{N-1}^2 & \\dots & x_{N-1}^K \n\\end{array}\n\\right) \n\\left(\n\\begin{array}{c}\n w_0 \\\\ w_1 \\\\ w_2 \\\\ \\vdots \\\\ w_K\n\\end{array}\n\\right)\n\\end{eqnarray}\n\n\n\\begin{eqnarray}\ny \\approx A w\n\\end{eqnarray}\n\n> $A = A(x)$: Model matrisi \n\n> $w$: Model Parametreleri\n\n> $y$: Gözlemler\n\nPolinom oturtmada ortaya çıkan özel yapılı matrislere __Vandermonde__ matrisleri de denmektedir.", "_____no_output_____" ] ], [ [ "x = np.array([10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5])\nN = len(x)\nx = x.reshape((N,1))\ny = np.array([8.04, 6.95, 7.58, 8.81, 8.33, 9.96, 7.24, 4.26, 10.84, 4.82, 5.68]).reshape((N,1))\n#y = np.array([9.14, 8.14, 8.74, 8.77, 9.26, 8.10, 6.13, 3.10, 9.13, 7.26, 4.74]).reshape((N,1))\n#y = np.array([7.46, 6.77, 12.74, 7.11, 7.81, 8.84, 6.08, 5.39, 8.15, 6.42, 5.73]).reshape((N,1))\n\ndef fit_and_plot_poly(degree):\n\n #A = np.hstack((np.power(x,0), np.power(x,1), np.power(x,2)))\n A = np.hstack((np.power(x,i) for i in range(degree+1)))\n # Setup the vandermonde matrix\n xx = np.matrix(np.linspace(np.asscalar(min(x))-1,np.asscalar(max(x))+1,300)).T\n A2 = np.hstack((np.power(xx,i) for i in range(degree+1)))\n\n #plt.imshow(A, interpolation='nearest')\n # Solve the least squares problem\n w_ls,E,rank,sigma = np.linalg.lstsq(A, y)\n f = A2*w_ls\n plt.plot(x, y, 'o')\n plt.plot(xx, f, 'r')\n\n plt.xlabel('x')\n plt.ylabel('y')\n\n plt.gca().set_ylim((0,20))\n #plt.gca().set_xlim((1950,2025))\n \n if E:\n plt.title('Mertebe = '+str(degree)+' Hata='+str(E[0]))\n else:\n plt.title('Mertebe = '+str(degree)+' Hata= 0')\n \n plt.show()\n\nfit_and_plot_poly(0)", "_____no_output_____" ], [ "interact(fit_and_plot_poly, degree=(0,10))", "_____no_output_____" ] ], [ [ "Overfit: Aşırı uyum", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ] ]
e7e6d6e964d6563947d2d32061efba8003083ae7
2,755
ipynb
Jupyter Notebook
2/Activities/01-Ins_Basic_Querying/Unsolved/Ins_Basic_Querying.ipynb
Marciooliver/Advanced-Data-Storage-and-Retrieval
5137bb3eeb74a55a581e39cc0edb6f21594182d0
[ "ADSL" ]
null
null
null
2/Activities/01-Ins_Basic_Querying/Unsolved/Ins_Basic_Querying.ipynb
Marciooliver/Advanced-Data-Storage-and-Retrieval
5137bb3eeb74a55a581e39cc0edb6f21594182d0
[ "ADSL" ]
null
null
null
2/Activities/01-Ins_Basic_Querying/Unsolved/Ins_Basic_Querying.ipynb
Marciooliver/Advanced-Data-Storage-and-Retrieval
5137bb3eeb74a55a581e39cc0edb6f21594182d0
[ "ADSL" ]
null
null
null
22.398374
73
0.554991
[ [ [ "from sqlalchemy import create_engine\nfrom sqlalchemy import Column, Integer, String, Float\n\nfrom sqlalchemy.ext.declarative import declarative_base\nBase = declarative_base()", "_____no_output_____" ], [ "class BaseballPlayer(Base):\n __tablename__ = \"player\"\n player_id = Column(String, primary_key=True)\n birth_year = Column(Integer)\n birth_month = Column(Integer)\n birth_day = Column(Integer)\n birth_country = Column(String)\n birth_state = Column(String)\n birth_city = Column(String)\n name_first = Column(String)\n name_last = Column(String)\n name_given = Column(String)\n weight = Column(Integer)\n height = Column(Integer)\n bats = Column(String)\n throws = Column(String)\n debut = Column(String)\n final_game = Column(String)", "_____no_output_____" ], [ "# Create Database Connection\nengine = create_engine('sqlite:///../Resources/database.sqlite')\nBase.metadata.create_all(engine)", "_____no_output_____" ], [ "from sqlalchemy.orm import Session\nsession = Session(bind=engine)", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code" ] ]
e7e6f9594610e629551d01125a8cfe87170df86a
200,048
ipynb
Jupyter Notebook
{{cookiecutter.project_slug}}/notebooks/02_sj_salse_predict_ml.ipynb
juforg/cookiecutter-ds-py3tkinter
43539aaca6bf7d6914522e75426b53f0dbe9b9b0
[ "MIT" ]
2
2021-06-24T14:02:44.000Z
2022-01-10T14:00:46.000Z
{{cookiecutter.project_slug}}/notebooks/02_sj_salse_predict_ml.ipynb
juforg/cookiecutter-ds-py3tkinter
43539aaca6bf7d6914522e75426b53f0dbe9b9b0
[ "MIT" ]
null
null
null
{{cookiecutter.project_slug}}/notebooks/02_sj_salse_predict_ml.ipynb
juforg/cookiecutter-ds-py3tkinter
43539aaca6bf7d6914522e75426b53f0dbe9b9b0
[ "MIT" ]
null
null
null
148.183704
130,671
0.845392
[ [ [ "## About \nhttps://www.kaggle.com/uladzimirkapeika/feature-engineering-lightgbm-top-1\nhttps://zhuanlan.zhihu.com/p/145969470\n# Version 1.0\n\n# Libraries\n> Check your versions", "_____no_output_____" ] ], [ [ "import pandas as pd\nimport numpy as np\nfrom itertools import product\nimport sklearn\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.neighbors import KNeighborsRegressor\nfrom sklearn.ensemble import RandomForestRegressor\nimport lightgbm as lgb\nimport calendar\nfrom datetime import datetime\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n%matplotlib inline\nfor p in [np, pd, sns, sklearn, lgb]:\n print (p.__name__, p.__version__)", "numpy 1.20.1\npandas 1.2.3\nseaborn 0.11.1\nsklearn 0.24.1\nlightgbm 3.2.0\n" ] ], [ [ "# **Load data**", "_____no_output_____" ] ], [ [ "test = pd.read_csv('../data/0_raw/sales/test.csv.gz')\nsales = pd.read_csv('../data/0_raw/sales/sales_train.csv.gz', encoding='UTF-8')\n# sales = pd.read_csv('https://storage.googleapis.com/kaggle-competitions-data/kaggle-v2/8587/868304/compressed/sales_train.csv.zip?GoogleAccessId=web-data@kaggle-161607.iam.gserviceaccount.com&Expires=1617358534&Signature=Y2MaOnxnEFJEJyHGEcWo8TUoNYmCqt2e7oF%2BeCgx%2B4qcXKBIkTieoXUu5xzSOctQt39ow6zEjHx3v9%2FLrNVokl76laWDQoaTbuu8%2Bojg2QssJdGql3rYDE4xtWfLiZibevNa5fgBHFpkyaau56M5nEbqDUw%2BT8TCNZINMNA6VmAcYIO1nKz%2FBruZP3sMQiePLHFkeD80JawbwgJ4OzQ2fq0t0qXNPwNwfhJ%2FicHwqEF5L4Ll7m%2Bd3d1FMUrURGq5CIiOCcZQNZNdQ1RtBOIR0WTSC%2ByN2Y6269N1KiItBf8R8xNW8mu9PRSkZLk2SCiETuQzCg8c6EjT498K12j6Ig%3D%3D&response-content-disposition=attachment%3B+filename%3Dsales_train.csv.zip')\nshops = pd.read_csv('../data/0_raw/sales/shops.csv')\n# items = pd.read_csv('../data/0_raw/sales/items.csv.gz', encoding='UTF-8')\nitems = pd.read_csv('https://storage.googleapis.com/kaggle-competitions-data/kaggle-v2/8587/868304/compressed/items.csv.zip?GoogleAccessId=web-data@kaggle-161607.iam.gserviceaccount.com&Expires=1617357929&Signature=QFp3crHy5f1oihj2VTtqfgeXhBl2BvxDhWq%2BZhQrb%2BXOBFlbUY7dR9e7Qi4yLf%2FYh%2FLitHpTw1o4J4LNES6X380v9rEkKCE8uZK93qxm1r66%2BoS9Oj1rlDT%2F5ChHQi0gQpS%2BHYwZ%2FZKageqv7lfXUYqMV9%2FiaKgaaBcoRoVxP5PIbXnXE9l9nUl3CnVEnVHDZ%2BPf6lp%2FaeZV%2Fy%2BiaNYAAOQjXfs81Un8dq9GASTn6x4k%2Bx%2BcmWYct2AWpqQmZNqNVlERB1euDhkVI8Y2EMjJ6YyOlS9vvrkV%2FrkGnmaPp07nzUwbLroSP%2F2Z1LmJ8bntmi0dPyngn2cgfcS4ArY5Zg%3D%3D&response-content-disposition=attachment%3B+filename%3Ditems.csv.zip')\nitem_cats = pd.read_csv('../data/0_raw/sales/item_categories.csv', encoding='UTF-8')\nprint(len(test))\nprint(len(sales))\nprint(len(shops))\nprint(len(items))\nprint(len(item_cats))\nprint(items.head())", "214200\n2935849\n60\n22170\n84\n item_name item_id \\\n0 ! ВО ВЛАСТИ НАВАЖДЕНИЯ (ПЛАСТ.) D 0 \n1 !ABBYY FineReader 12 Professional Edition Full... 1 \n2 ***В ЛУЧАХ СЛАВЫ (UNV) D 2 \n3 ***ГОЛУБАЯ ВОЛНА (Univ) D 3 \n4 ***КОРОБКА (СТЕКЛО) D 4 \n\n item_category_id \n0 40 \n1 76 \n2 40 \n3 40 \n4 40 \n" ] ], [ [ "# **Create dataset**", "_____no_output_____" ], [ "Remove outliers", "_____no_output_____" ] ], [ [ "sns.boxplot(x=sales.item_cnt_day)", "_____no_output_____" ], [ "sns.boxplot(x=sales.item_price)", "_____no_output_____" ], [ "train = sales[(sales.item_price < 100000) & (sales.item_price > 0)]\ntrain = train[sales.item_cnt_day < 1001]", "/Users/songjie/.local/share/virtualenvs/snp_mvp-8ex0mMfN/lib/python3.7/site-packages/ipykernel_launcher.py:2: UserWarning: Boolean Series key will be reindexed to match DataFrame index.\n \n" ] ], [ [ "Detect same shops", "_____no_output_____" ] ], [ [ "print(shops[shops.shop_id.isin([0, 57])]['shop_name'])\nprint(shops[shops.shop_id.isin([1, 58])]['shop_name'])\nprint(shops[shops.shop_id.isin([40, 39])]['shop_name'])", "0 !Якутск Орджоникидзе, 56 фран\n57 Якутск Орджоникидзе, 56\nName: shop_name, dtype: object\n1 !Якутск ТЦ \"Центральный\" фран\n58 Якутск ТЦ \"Центральный\"\nName: shop_name, dtype: object\n39 РостовНаДону ТРК \"Мегацентр Горизонт\"\n40 РостовНаДону ТРК \"Мегацентр Горизонт\" Островной\nName: shop_name, dtype: object\n" ], [ "train.loc[train.shop_id == 0, 'shop_id'] = 57\ntest.loc[test.shop_id == 0, 'shop_id'] = 57\n\ntrain.loc[train.shop_id == 1, 'shop_id'] = 58\ntest.loc[test.shop_id == 1, 'shop_id'] = 58\n\ntrain.loc[train.shop_id == 40, 'shop_id'] = 39\ntest.loc[test.shop_id == 40, 'shop_id'] = 39", "_____no_output_____" ] ], [ [ "Simple train dataset", "_____no_output_____" ] ], [ [ "index_cols = ['shop_id', 'item_id', 'date_block_num']\n\ndf = [] \nfor block_num in train['date_block_num'].unique():\n cur_shops = train.loc[sales['date_block_num'] == block_num, 'shop_id'].unique()\n cur_items = train.loc[sales['date_block_num'] == block_num, 'item_id'].unique()\n df.append(np.array(list(product(*[cur_shops, cur_items, [block_num]])),dtype='int32'))\n\ndf = pd.DataFrame(np.vstack(df), columns = index_cols,dtype=np.int32)\n\n#Add month sales\ngroup = train.groupby(['date_block_num','shop_id','item_id']).agg({'item_cnt_day': ['sum']})\ngroup.columns = ['item_cnt_month']\ngroup.reset_index(inplace=True)\n\ndf = pd.merge(df, group, on=index_cols, how='left')\ndf['item_cnt_month'] = (df['item_cnt_month']\n .fillna(0)\n .clip(0,20)\n .astype(np.float16))\ndf.head(5)", "_____no_output_____" ] ], [ [ "Add test", "_____no_output_____" ] ], [ [ "test['date_block_num'] = 34\ntest['date_block_num'] = test['date_block_num'].astype(np.int8)\ntest['shop_id'] = test['shop_id'].astype(np.int8)\ntest['item_id'] = test['item_id'].astype(np.int16)\ndf = pd.concat([df, test], ignore_index=True, sort=False, keys=index_cols)\ndf.fillna(0, inplace=True)", "_____no_output_____" ] ], [ [ "# Feature engineering", "_____no_output_____" ], [ "**Shop features**\n\n* City of a shop\n* City coords\n* Country part (0-4) based on the map ", "_____no_output_____" ] ], [ [ "shops['city'] = shops['shop_name'].apply(lambda x: x.split()[0].lower())\nshops.loc[shops.city == '!якутск', 'city'] = 'якутск'\nshops['city_code'] = LabelEncoder().fit_transform(shops['city'])\n\ncoords = dict()\ncoords['якутск'] = (62.028098, 129.732555, 4)\ncoords['адыгея'] = (44.609764, 40.100516, 3)\ncoords['балашиха'] = (55.8094500, 37.9580600, 1)\ncoords['волжский'] = (53.4305800, 50.1190000, 3)\ncoords['вологда'] = (59.2239000, 39.8839800, 2)\ncoords['воронеж'] = (51.6720400, 39.1843000, 3)\ncoords['выездная'] = (0, 0, 0)\ncoords['жуковский'] = (55.5952800, 38.1202800, 1)\ncoords['интернет-магазин'] = (0, 0, 0)\ncoords['казань'] = (55.7887400, 49.1221400, 4)\ncoords['калуга'] = (54.5293000, 36.2754200, 4)\ncoords['коломна'] = (55.0794400, 38.7783300, 4)\ncoords['красноярск'] = (56.0183900, 92.8671700, 4)\ncoords['курск'] = (51.7373300, 36.1873500, 3)\ncoords['москва'] = (55.7522200, 37.6155600, 1)\ncoords['мытищи'] = (55.9116300, 37.7307600, 1)\ncoords['н.новгород'] = (56.3286700, 44.0020500, 4)\ncoords['новосибирск'] = (55.0415000, 82.9346000, 4)\ncoords['омск'] = (54.9924400, 73.3685900, 4)\ncoords['ростовнадону'] = (47.2313500, 39.7232800, 3)\ncoords['спб'] = (59.9386300, 30.3141300, 2)\ncoords['самара'] = (53.2000700, 50.1500000, 4)\ncoords['сергиев'] = (56.3000000, 38.1333300, 4)\ncoords['сургут'] = (61.2500000, 73.4166700, 4)\ncoords['томск'] = (56.4977100, 84.9743700, 4)\ncoords['тюмень'] = (57.1522200, 65.5272200, 4)\ncoords['уфа'] = (54.7430600, 55.9677900, 4)\ncoords['химки'] = (55.8970400, 37.4296900, 1)\ncoords['цифровой'] = (0, 0, 0)\ncoords['чехов'] = (55.1477000, 37.4772800, 4)\ncoords['ярославль'] = (57.6298700, 39.8736800, 2) \n\nshops['city_coord_1'] = shops['city'].apply(lambda x: coords[x][0])\nshops['city_coord_2'] = shops['city'].apply(lambda x: coords[x][1])\nshops['country_part'] = shops['city'].apply(lambda x: coords[x][2])\n\nshops = shops[['shop_id', 'city_code', 'city_coord_1', 'city_coord_2', 'country_part']]", "_____no_output_____" ], [ "df = pd.merge(df, shops, on=['shop_id'], how='left')", "_____no_output_____" ] ], [ [ "**Item features**\n\n* Item category\n* More common item category", "_____no_output_____" ] ], [ [ "map_dict = {\n 'Чистые носители (штучные)': 'Чистые носители',\n 'Чистые носители (шпиль)' : 'Чистые носители',\n 'PC ': 'Аксессуары',\n 'Служебные': 'Служебные '\n }\n\nitems = pd.merge(items, item_cats, on='item_category_id')\n\nitems['item_category'] = items['item_category_name'].apply(lambda x: x.split('-')[0])\nitems['item_category'] = items['item_category'].apply(lambda x: map_dict[x] if x in map_dict.keys() else x)\nitems['item_category_common'] = LabelEncoder().fit_transform(items['item_category'])\n\nitems['item_category_code'] = LabelEncoder().fit_transform(items['item_category_name'])\nitems = items[['item_id', 'item_category_common', 'item_category_code']]", "_____no_output_____" ], [ "df = pd.merge(df, items, on=['item_id'], how='left')", "_____no_output_____" ] ], [ [ "**Date features**\n\n* Weekends count (4 or 5)\n* Number of days in a month", "_____no_output_____" ] ], [ [ "def count_days(date_block_num):\n year = 2013 + date_block_num // 12\n month = 1 + date_block_num % 12\n weeknd_count = len([1 for i in calendar.monthcalendar(year, month) if i[6] != 0])\n days_in_month = calendar.monthrange(year, month)[1]\n return weeknd_count, days_in_month, month\n\nmap_dict = {i: count_days(i) for i in range(35)}\n\ndf['weeknd_count'] = df['date_block_num'].apply(lambda x: map_dict[x][0])\ndf['days_in_month'] = df['date_block_num'].apply(lambda x: map_dict[x][1])", "_____no_output_____" ] ], [ [ "**Interaction features**\n\n* Item is new\n* Item was bought in this shop before", "_____no_output_____" ] ], [ [ "first_item_block = df.groupby(['item_id'])['date_block_num'].min().reset_index()\nfirst_item_block['item_first_interaction'] = 1\n\nfirst_shop_item_buy_block = df[df['date_block_num'] > 0].groupby(['shop_id', 'item_id'])['date_block_num'].min().reset_index()\nfirst_shop_item_buy_block['first_date_block_num'] = first_shop_item_buy_block['date_block_num']", "_____no_output_____" ], [ "df = pd.merge(df, first_item_block[['item_id', 'date_block_num', 'item_first_interaction']], on=['item_id', 'date_block_num'], how='left')\ndf = pd.merge(df, first_shop_item_buy_block[['item_id', 'shop_id', 'first_date_block_num']], on=['item_id', 'shop_id'], how='left')\n\ndf['first_date_block_num'].fillna(100, inplace=True)\ndf['shop_item_sold_before'] = (df['first_date_block_num'] < df['date_block_num']).astype('int8')\ndf.drop(['first_date_block_num'], axis=1, inplace=True)\n\ndf['item_first_interaction'].fillna(0, inplace=True)\ndf['shop_item_sold_before'].fillna(0, inplace=True)\n \ndf['item_first_interaction'] = df['item_first_interaction'].astype('int8') \ndf['shop_item_sold_before'] = df['shop_item_sold_before'].astype('int8') ", "_____no_output_____" ] ], [ [ "**Basic lag features**", "_____no_output_____" ] ], [ [ "def lag_feature(df, lags, col):\n tmp = df[['date_block_num','shop_id','item_id',col]]\n for i in lags:\n shifted = tmp.copy()\n shifted.columns = ['date_block_num','shop_id','item_id', col+'_lag_'+str(i)]\n shifted['date_block_num'] += i\n df = pd.merge(df, shifted, on=['date_block_num','shop_id','item_id'], how='left')\n df[col+'_lag_'+str(i)] = df[col+'_lag_'+str(i)].astype('float16')\n return df", "_____no_output_____" ], [ "#Add sales lags for last 3 months\ndf = lag_feature(df, [1, 2, 3], 'item_cnt_month')", "_____no_output_____" ], [ "#Add avg shop/item price\n\nindex_cols = ['shop_id', 'item_id', 'date_block_num']\ngroup = train.groupby(index_cols)['item_price'].mean().reset_index().rename(columns={\"item_price\": \"avg_shop_price\"}, errors=\"raise\")\ndf = pd.merge(df, group, on=index_cols, how='left')\n\ndf['avg_shop_price'] = (df['avg_shop_price']\n .fillna(0)\n .astype(np.float16))\n\nindex_cols = ['item_id', 'date_block_num']\ngroup = train.groupby(['date_block_num','item_id'])['item_price'].mean().reset_index().rename(columns={\"item_price\": \"avg_item_price\"}, errors=\"raise\")\n\n\ndf = pd.merge(df, group, on=index_cols, how='left')\ndf['avg_item_price'] = (df['avg_item_price']\n .fillna(0)\n .astype(np.float16))\n\ndf['item_shop_price_avg'] = (df['avg_shop_price'] - df['avg_item_price']) / df['avg_item_price']\ndf['item_shop_price_avg'].fillna(0, inplace=True)\n\ndf = lag_feature(df, [1, 2, 3], 'item_shop_price_avg')\ndf.drop(['avg_shop_price', 'avg_item_price', 'item_shop_price_avg'], axis=1, inplace=True)", "_____no_output_____" ] ], [ [ "**Target encoding**", "_____no_output_____" ] ], [ [ "#Add target encoding for items for last 3 months \nitem_id_target_mean = df.groupby(['date_block_num','item_id'])['item_cnt_month'].mean().reset_index().rename(columns={\"item_cnt_month\": \"item_target_enc\"}, errors=\"raise\")\ndf = pd.merge(df, item_id_target_mean, on=['date_block_num','item_id'], how='left')\n\ndf['item_target_enc'] = (df['item_target_enc']\n .fillna(0)\n .astype(np.float16))\n\ndf = lag_feature(df, [1, 2, 3], 'item_target_enc')\ndf.drop(['item_target_enc'], axis=1, inplace=True)", "_____no_output_____" ], [ "#Add target encoding for item/city for last 3 months \nitem_id_target_mean = df.groupby(['date_block_num','item_id', 'city_code'])['item_cnt_month'].mean().reset_index().rename(columns={\n \"item_cnt_month\": \"item_loc_target_enc\"}, errors=\"raise\")\ndf = pd.merge(df, item_id_target_mean, on=['date_block_num','item_id', 'city_code'], how='left')\n\ndf['item_loc_target_enc'] = (df['item_loc_target_enc']\n .fillna(0)\n .astype(np.float16))\n\ndf = lag_feature(df, [1, 2, 3], 'item_loc_target_enc')\ndf.drop(['item_loc_target_enc'], axis=1, inplace=True)", "_____no_output_____" ], [ "#Add target encoding for item/shop for last 3 months \nitem_id_target_mean = df.groupby(['date_block_num','item_id', 'shop_id'])['item_cnt_month'].mean().reset_index().rename(columns={\n \"item_cnt_month\": \"item_shop_target_enc\"}, errors=\"raise\")\n\ndf = pd.merge(df, item_id_target_mean, on=['date_block_num','item_id', 'shop_id'], how='left')\n\ndf['item_shop_target_enc'] = (df['item_shop_target_enc']\n .fillna(0)\n .astype(np.float16))\n\ndf = lag_feature(df, [1, 2, 3], 'item_shop_target_enc')\ndf.drop(['item_shop_target_enc'], axis=1, inplace=True)", "_____no_output_____" ] ], [ [ "Extra interaction features", "_____no_output_____" ] ], [ [ "#For new items add avg category sales for last 3 months\nitem_id_target_mean = df[df['item_first_interaction'] == 1].groupby(['date_block_num','item_category_code'])['item_cnt_month'].mean().reset_index().rename(columns={\n \"item_cnt_month\": \"new_item_cat_avg\"}, errors=\"raise\")\n\ndf = pd.merge(df, item_id_target_mean, on=['date_block_num','item_category_code'], how='left')\n\ndf['new_item_cat_avg'] = (df['new_item_cat_avg']\n .fillna(0)\n .astype(np.float16))\n\ndf = lag_feature(df, [1, 2, 3], 'new_item_cat_avg')\ndf.drop(['new_item_cat_avg'], axis=1, inplace=True)", "_____no_output_____" ], [ "#For new items add avg category sales in a separate store for last 3 months\nitem_id_target_mean = df[df['item_first_interaction'] == 1].groupby(['date_block_num','item_category_code', 'shop_id'])['item_cnt_month'].mean().reset_index().rename(columns={\n \"item_cnt_month\": \"new_item_shop_cat_avg\"}, errors=\"raise\")\n\ndf = pd.merge(df, item_id_target_mean, on=['date_block_num','item_category_code', 'shop_id'], how='left')\n\ndf['new_item_shop_cat_avg'] = (df['new_item_shop_cat_avg']\n .fillna(0)\n .astype(np.float16))\n\ndf = lag_feature(df, [1, 2, 3], 'new_item_shop_cat_avg')\ndf.drop(['new_item_shop_cat_avg'], axis=1, inplace=True)", "_____no_output_____" ] ], [ [ "Add sales for the last three months for similar item (item with id = item_id - 1;\nkinda tricky feature, but increased the metric significantly)", "_____no_output_____" ] ], [ [ "def lag_feature_adv(df, lags, col):\n tmp = df[['date_block_num','shop_id','item_id',col]]\n for i in lags:\n shifted = tmp.copy()\n shifted.columns = ['date_block_num','shop_id','item_id', col+'_lag_'+str(i)+'_adv']\n shifted['date_block_num'] += i\n shifted['item_id'] -= 1\n df = pd.merge(df, shifted, on=['date_block_num','shop_id','item_id'], how='left')\n df[col+'_lag_'+str(i)+'_adv'] = df[col+'_lag_'+str(i)+'_adv'].astype('float16')\n return df\n\ndf = lag_feature_adv(df, [1, 2, 3], 'item_cnt_month')", "_____no_output_____" ] ], [ [ "Remove data for the first three months", "_____no_output_____" ] ], [ [ "df.fillna(0, inplace=True)\ndf = df[(df['date_block_num'] > 2)]\ndf.head()", "_____no_output_____" ], [ "df.columns", "_____no_output_____" ], [ "#Save dataset\ndf.drop(['ID'], axis=1, inplace=True, errors='ignore')\ndf.to_pickle('../output/models/sales_df.pkl')", "_____no_output_____" ] ], [ [ "# Train model", "_____no_output_____" ] ], [ [ "df = pd.read_pickle('../output/models/sales_df.pkl')\ndf.info()", "<class 'pandas.core.frame.DataFrame'>\nInt64Index: 9933482 entries, 1122795 to 11056276\nData columns (total 38 columns):\n # Column Dtype \n--- ------ ----- \n 0 shop_id int32 \n 1 item_id int32 \n 2 date_block_num int32 \n 3 item_cnt_month float16\n 4 city_code int64 \n 5 city_coord_1 float64\n 6 city_coord_2 float64\n 7 country_part int64 \n 8 item_category_common int64 \n 9 item_category_code int64 \n 10 weeknd_count int64 \n 11 days_in_month int64 \n 12 item_first_interaction int8 \n 13 shop_item_sold_before int8 \n 14 item_cnt_month_lag_1 float16\n 15 item_cnt_month_lag_2 float16\n 16 item_cnt_month_lag_3 float16\n 17 item_shop_price_avg_lag_1 float16\n 18 item_shop_price_avg_lag_2 float16\n 19 item_shop_price_avg_lag_3 float16\n 20 item_target_enc_lag_1 float16\n 21 item_target_enc_lag_2 float16\n 22 item_target_enc_lag_3 float16\n 23 item_loc_target_enc_lag_1 float16\n 24 item_loc_target_enc_lag_2 float16\n 25 item_loc_target_enc_lag_3 float16\n 26 item_shop_target_enc_lag_1 float16\n 27 item_shop_target_enc_lag_2 float16\n 28 item_shop_target_enc_lag_3 float16\n 29 new_item_cat_avg_lag_1 float16\n 30 new_item_cat_avg_lag_2 float16\n 31 new_item_cat_avg_lag_3 float16\n 32 new_item_shop_cat_avg_lag_1 float16\n 33 new_item_shop_cat_avg_lag_2 float16\n 34 new_item_shop_cat_avg_lag_3 float16\n 35 item_cnt_month_lag_1_adv float16\n 36 item_cnt_month_lag_2_adv float16\n 37 item_cnt_month_lag_3_adv float16\ndtypes: float16(25), float64(2), int32(3), int64(6), int8(2)\nmemory usage: 1.3 GB\n" ], [ "X_train = df[df.date_block_num < 33].drop(['item_cnt_month'], axis=1)\nY_train = df[df.date_block_num < 33]['item_cnt_month']\nX_valid = df[df.date_block_num == 33].drop(['item_cnt_month'], axis=1)\nY_valid = df[df.date_block_num == 33]['item_cnt_month']\nX_test = df[df.date_block_num == 34].drop(['item_cnt_month'], axis=1)\ndel df", "_____no_output_____" ], [ "feature_name = X_train.columns.tolist()\n\nparams = {\n 'objective': 'mse',\n 'metric': 'rmse',\n 'num_leaves': 2 ** 7 - 1,\n 'learning_rate': 0.005,\n 'feature_fraction': 0.75,\n 'bagging_fraction': 0.75,\n 'bagging_freq': 5,\n 'seed': 1,\n 'verbose': 1\n}\n\nfeature_name_indexes = [ \n 'country_part', \n 'item_category_common',\n 'item_category_code', \n 'city_code',\n]\n\nlgb_train = lgb.Dataset(X_train[feature_name], Y_train)\nlgb_eval = lgb.Dataset(X_valid[feature_name], Y_valid, reference=lgb_train)\n\nevals_result = {}\ngbm = lgb.train(\n params, \n lgb_train,\n num_boost_round=3000,\n valid_sets=(lgb_train, lgb_eval), \n feature_name = feature_name,\n categorical_feature = feature_name_indexes,\n verbose_eval=5, \n evals_result = evals_result,\n early_stopping_rounds = 100)\n", "/Users/songjie/.local/share/virtualenvs/snp_mvp-8ex0mMfN/lib/python3.7/site-packages/lightgbm/basic.py:1706: UserWarning: categorical_feature in Dataset is overridden.\nNew categorical_feature is ['city_code', 'country_part', 'item_category_code', 'item_category_common']\n 'New categorical_feature is {}'.format(sorted(list(categorical_feature))))\n/Users/songjie/.local/share/virtualenvs/snp_mvp-8ex0mMfN/lib/python3.7/site-packages/lightgbm/basic.py:1433: UserWarning: Overriding the parameters from Reference Dataset.\n _log_warning('Overriding the parameters from Reference Dataset.')\n/Users/songjie/.local/share/virtualenvs/snp_mvp-8ex0mMfN/lib/python3.7/site-packages/lightgbm/basic.py:1245: UserWarning: categorical_column in param dict is overridden.\n _log_warning('{} in param dict is overridden.'.format(cat_alias))\n" ], [ "lgb.plot_importance(\n gbm, \n max_num_features=50, \n importance_type='gain', \n figsize=(12,8));", "_____no_output_____" ] ], [ [ "Stacking didn't work for me. I'd tried 2 approaches:\n\n1. XGBoost + CatBoost + LightGBM at the first level and LinearRegression/LightGBM at the second level\n1. LinearRegression + LightGBM + RandomForest at the first level and LinearRegression/LightGBM at the second level", "_____no_output_____" ] ], [ [ "test = pd.read_csv('../data/0_raw/sales/test.csv.gz')\nY_test = gbm.predict(X_test[feature_name]).clip(0, 20)\n\nsubmission = pd.DataFrame({\n \"ID\": test.index, \n \"item_cnt_month\": Y_test\n})\nsubmission.to_csv('../output/gbm_submission.csv', index=False)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code" ] ]
e7e7248c0cedc4f0a725b6fb040ab80a79245d29
6,226
ipynb
Jupyter Notebook
1-3D-visualization/4-Surfaces.ipynb
NicholasAKovacs/mmtf-workshop
6c98d22f75f4eaf99467dfed0f5302d4daee3148
[ "Apache-2.0" ]
null
null
null
1-3D-visualization/4-Surfaces.ipynb
NicholasAKovacs/mmtf-workshop
6c98d22f75f4eaf99467dfed0f5302d4daee3148
[ "Apache-2.0" ]
null
null
null
1-3D-visualization/4-Surfaces.ipynb
NicholasAKovacs/mmtf-workshop
6c98d22f75f4eaf99467dfed0f5302d4daee3148
[ "Apache-2.0" ]
null
null
null
42.643836
1,784
0.585609
[ [ [ "# Displaying Surfaces\npy3Dmol supports the following surface types:\n\n* VDW - van der Waals surface\n* MS - molecular surface\n* SES - solvent excluded surface\n* SAS - solvent accessible surface", "_____no_output_____" ] ], [ [ "import py3Dmol", "_____no_output_____" ] ], [ [ "# Add surface\nIn the structure below (HLA complex with antigen peptide pVR), we add a solvent excluded surface (SES) to the heavy chain to highlight the binding pocket for the antigen peptide (rendered as spheres).", "_____no_output_____" ] ], [ [ "viewer = py3Dmol.view(query='pdb:5XS3')\n\nheavychain = {'chain':'A'}\nlightchain = {'chain':'B'}\nantigen = {'chain':'C'}\n\nviewer.setStyle(heavychain,{'cartoon':{'color':'blue'}})\nviewer.setStyle(lightchain,{'cartoon':{'color':'yellow'}})\nviewer.setStyle(antigen,{'sphere':{'colorscheme':'orangeCarbon'}})\n\nviewer.addSurface(py3Dmol.SES,{'opacity':0.9,'color':'lightblue'}, heavychain)\nviewer.show()", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e7318349047f818bfc92b59c2c71bdff3a2f70
523,543
ipynb
Jupyter Notebook
StyleGAN2.ipynb
patprem/FaceMorphing
d6aed096fdebb6ae14b62135bae674a3d1ccbeb5
[ "MIT" ]
null
null
null
StyleGAN2.ipynb
patprem/FaceMorphing
d6aed096fdebb6ae14b62135bae674a3d1ccbeb5
[ "MIT" ]
null
null
null
StyleGAN2.ipynb
patprem/FaceMorphing
d6aed096fdebb6ae14b62135bae674a3d1ccbeb5
[ "MIT" ]
null
null
null
167.373082
98,758
0.834111
[ [ [ "<a href=\"https://colab.research.google.com/github/patprem/FaceMorphingTool/blob/main/StyleGAN2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>", "_____no_output_____" ] ], [ [ "NETWORK = \"https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl\"\nSTEPS = 300\nFPS = 30\nFREEZE_STEPS = 30", "_____no_output_____" ] ], [ [ "# Upload Starting Image\n\nChoose your starting image.", "_____no_output_____" ] ], [ [ "import os\nfrom google.colab import files\n\nuploaded = files.upload()\nif len(uploaded) != 1:\n print(\"Upload exactly 1 file for source.\")\nelse:\n for k, v in uploaded.items():\n _, ext = os.path.splitext(k)\n os.remove(k)\n SOURCE_NAME = f\"source{ext}\"\n open(SOURCE_NAME, 'wb').write(v)", "_____no_output_____" ] ], [ [ "Also, choose your ending image.", "_____no_output_____" ] ], [ [ "uploaded = files.upload()\n\nif len(uploaded) != 1:\n print(\"Upload exactly 1 file for target.\")\nelse:\n for k, v in uploaded.items():\n _, ext = os.path.splitext(k)\n os.remove(k)\n TARGET_NAME = f\"target{ext}\"\n open(TARGET_NAME, 'wb').write(v)", "_____no_output_____" ] ], [ [ "# Install Software\n\nSome software must be installed into Colab, for this notebook to work. We are specificially using these technologies:\n\n* [Training Generative Adversarial Networks with Limited Data](https://arxiv.org/abs/2006.06676)\nTero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, Timo Aila\n* [One millisecond face alignment with an ensemble of regression trees](https://www.cv-foundation.org/openaccess/content_cvpr_2014/papers/Kazemi_One_Millisecond_Face_2014_CVPR_paper.pdf) Vahid Kazemi, Josephine Sullivan\n", "_____no_output_____" ] ], [ [ "!wget http://dlib.net/files/shape_predictor_5_face_landmarks.dat.bz2\n!bzip2 -d shape_predictor_5_face_landmarks.dat.bz2", "--2021-12-16 09:38:33-- http://dlib.net/files/shape_predictor_5_face_landmarks.dat.bz2\nResolving dlib.net (dlib.net)... 107.180.26.78\nConnecting to dlib.net (dlib.net)|107.180.26.78|:80... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 5706710 (5.4M)\nSaving to: ‘shape_predictor_5_face_landmarks.dat.bz2’\n\nshape_predictor_5_f 100%[===================>] 5.44M 21.5MB/s in 0.3s \n\n2021-12-16 09:38:33 (21.5 MB/s) - ‘shape_predictor_5_face_landmarks.dat.bz2’ saved [5706710/5706710]\n\nbzip2: Output file shape_predictor_5_face_landmarks.dat already exists.\n" ], [ "import sys\n!git clone https://github.com/NVlabs/stylegan2-ada-pytorch.git\n!pip install ninja\nsys.path.insert(0, \"/content/stylegan2-ada-pytorch\")", "fatal: destination path 'stylegan2-ada-pytorch' already exists and is not an empty directory.\nRequirement already satisfied: ninja in /usr/local/lib/python3.7/dist-packages (1.10.2.3)\n" ] ], [ [ "# Preprocess Images for Best StyleGAN Results\n\nThe following are helper functions for the preprocessing.", "_____no_output_____" ] ], [ [ "import cv2\nimport numpy as np\nfrom PIL import Image\nimport dlib\n\ndetector = dlib.get_frontal_face_detector()\npredictor = dlib.shape_predictor('shape_predictor_5_face_landmarks.dat')\n\ndef find_eyes(img):\n gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n rects = detector(gray, 0)\n \n if len(rects) == 0:\n raise ValueError(\"No faces detected\")\n elif len(rects) > 1:\n raise ValueError(\"Multiple faces detected\")\n\n shape = predictor(gray, rects[0])\n features = []\n\n for i in range(0, 5):\n features.append((i, (shape.part(i).x, shape.part(i).y)))\n\n return (int(features[3][1][0] + features[2][1][0]) // 2, \\\n int(features[3][1][1] + features[2][1][1]) // 2), \\\n (int(features[1][1][0] + features[0][1][0]) // 2, \\\n int(features[1][1][1] + features[0][1][1]) // 2)\n\ndef crop_stylegan(img):\n left_eye, right_eye = find_eyes(img)\n d = abs(right_eye[0] - left_eye[0])\n z = 255/d\n ar = img.shape[0]/img.shape[1]\n w = img.shape[1] * z\n img2 = cv2.resize(img, (int(w), int(w*ar)))\n bordersize = 1024\n img3 = cv2.copyMakeBorder(\n img2,\n top=bordersize,\n bottom=bordersize,\n left=bordersize,\n right=bordersize,\n borderType=cv2.BORDER_REPLICATE)\n\n left_eye2, right_eye2 = find_eyes(img3)\n\n crop1 = left_eye2[0] - 385 \n crop0 = left_eye2[1] - 490\n return img3[crop0:crop0+1024,crop1:crop1+1024]", "_____no_output_____" ] ], [ [ "The following will preprocess and crop your images. If you receive an error indicating multiple faces were found, try to crop your image better or obscure the background. If the program does not see a face, then attempt to obtain a clearer and more high-resolution image.", "_____no_output_____" ] ], [ [ "from matplotlib import pyplot as plt\nimport cv2\n\nimage_source = cv2.imread(SOURCE_NAME)\nif image_source is None:\n raise ValueError(\"Source image not found\")\n\nimage_target = cv2.imread(TARGET_NAME)\nif image_target is None:\n raise ValueError(\"Source image not found\")\n\ncropped_source = crop_stylegan(image_source)\ncropped_target = crop_stylegan(image_target)\n\nimg = cv2.cvtColor(cropped_source, cv2.COLOR_BGR2RGB)\nplt.imshow(img)\nplt.title('source')\nplt.show()\n\nimg = cv2.cvtColor(cropped_target, cv2.COLOR_BGR2RGB)\nplt.imshow(img)\nplt.title('target')\nplt.show()\n\ncv2.imwrite(\"cropped_source.png\", cropped_source)\ncv2.imwrite(\"cropped_target.png\", cropped_target)\n\n#print(find_eyes(cropped_source))\n#print(find_eyes(cropped_target))", "_____no_output_____" ] ], [ [ "# Convert Source to a GAN\n\nFirst, we convert the source to a GAN latent vector. This process will take several minutes.", "_____no_output_____" ] ], [ [ "cmd = f\"python /content/stylegan2-ada-pytorch/projector.py --save-video 0 --num-steps 1000 --outdir=out_source --target=cropped_source.png --network={NETWORK}\"\n!{cmd}", "Loading networks from \"https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl\"...\nComputing W midpoint and stddev using 10000 samples...\nSetting up PyTorch plugin \"bias_act_plugin\"... Done.\nSetting up PyTorch plugin \"upfirdn2d_plugin\"... Done.\nstep 1/1000: dist 0.64 loss 24569.53\nstep 2/1000: dist 0.52 loss 27642.74\nstep 3/1000: dist 0.57 loss 27167.59\nstep 4/1000: dist 0.57 loss 26253.69\nstep 5/1000: dist 0.59 loss 24958.55\nstep 6/1000: dist 0.50 loss 23356.06\nstep 7/1000: dist 0.55 loss 21513.72\nstep 8/1000: dist 0.45 loss 19485.98\nstep 9/1000: dist 0.59 loss 17342.24\nstep 10/1000: dist 0.55 loss 15145.47\nstep 11/1000: dist 0.49 loss 12946.06\nstep 12/1000: dist 0.53 loss 10817.87\nstep 13/1000: dist 0.52 loss 8803.69\nstep 14/1000: dist 0.50 loss 6948.97\nstep 15/1000: dist 0.55 loss 5315.48\nstep 16/1000: dist 0.49 loss 3971.71\nstep 17/1000: dist 0.51 loss 2944.83\nstep 18/1000: dist 0.53 loss 2212.46\nstep 19/1000: dist 0.43 loss 1761.67\nstep 20/1000: dist 0.44 loss 1569.43\nstep 21/1000: dist 0.42 loss 1600.47\nstep 22/1000: dist 0.41 loss 1789.50\nstep 23/1000: dist 0.41 loss 2053.34\nstep 24/1000: dist 0.45 loss 2325.79\nstep 25/1000: dist 0.39 loss 2539.81\nstep 26/1000: dist 0.43 loss 2634.70\nstep 27/1000: dist 0.45 loss 2600.18\nstep 28/1000: dist 0.44 loss 2475.98\nstep 29/1000: dist 0.38 loss 2313.33\nstep 30/1000: dist 0.43 loss 2118.93\nstep 31/1000: dist 0.38 loss 1879.80\nstep 32/1000: dist 0.39 loss 1625.18\nstep 33/1000: dist 0.41 loss 1387.66\nstep 34/1000: dist 0.42 loss 1185.58\nstep 35/1000: dist 0.40 loss 1027.94\nstep 36/1000: dist 0.43 loss 909.22\nstep 37/1000: dist 0.38 loss 829.03\nstep 38/1000: dist 0.38 loss 808.39\nstep 39/1000: dist 0.39 loss 816.71\nstep 40/1000: dist 0.36 loss 828.89\nstep 41/1000: dist 0.37 loss 824.38\nstep 42/1000: dist 0.38 loss 764.19\nstep 43/1000: dist 0.35 loss 660.69\nstep 44/1000: dist 0.34 loss 546.33\nstep 45/1000: dist 0.36 loss 413.25\nstep 46/1000: dist 0.38 loss 317.19\nstep 47/1000: dist 0.37 loss 283.69\nstep 48/1000: dist 0.38 loss 248.79\nstep 49/1000: dist 0.35 loss 281.98\nstep 50/1000: dist 0.35 loss 320.02\nstep 51/1000: dist 0.37 loss 388.44\nstep 52/1000: dist 0.36 loss 405.21\nstep 53/1000: dist 0.32 loss 394.16\nstep 54/1000: dist 0.40 loss 350.83\nstep 55/1000: dist 0.34 loss 276.97\nstep 56/1000: dist 0.34 loss 199.58\nstep 57/1000: dist 0.33 loss 127.22\nstep 58/1000: dist 0.34 loss 80.25\nstep 59/1000: dist 0.34 loss 52.98\nstep 60/1000: dist 0.31 loss 55.57\nstep 61/1000: dist 0.34 loss 60.26\nstep 62/1000: dist 0.37 loss 85.02\nstep 63/1000: dist 0.34 loss 109.96\nstep 64/1000: dist 0.33 loss 128.13\nstep 65/1000: dist 0.34 loss 127.04\nstep 66/1000: dist 0.31 loss 119.92\nstep 67/1000: dist 0.33 loss 96.65\nstep 68/1000: dist 0.34 loss 74.48\nstep 69/1000: dist 0.37 loss 46.98\nstep 70/1000: dist 0.32 loss 28.45\nstep 71/1000: dist 0.38 loss 18.21\nstep 72/1000: dist 0.32 loss 16.81\nstep 73/1000: dist 0.35 loss 18.24\nstep 74/1000: dist 0.31 loss 27.94\nstep 75/1000: dist 0.30 loss 32.35\nstep 76/1000: dist 0.33 loss 35.55\nstep 77/1000: dist 0.35 loss 34.99\nstep 78/1000: dist 0.32 loss 31.92\nstep 79/1000: dist 0.34 loss 26.74\nstep 80/1000: dist 0.33 loss 22.05\nstep 81/1000: dist 0.32 loss 15.75\nstep 82/1000: dist 0.32 loss 14.46\nstep 83/1000: dist 0.30 loss 15.93\nstep 84/1000: dist 0.34 loss 16.64\nstep 85/1000: dist 0.32 loss 14.85\nstep 86/1000: dist 0.31 loss 12.58\nstep 87/1000: dist 0.31 loss 11.42\nstep 88/1000: dist 0.29 loss 10.57\nstep 89/1000: dist 0.34 loss 9.21 \nstep 90/1000: dist 0.32 loss 7.58 \nstep 91/1000: dist 0.32 loss 6.95 \nstep 92/1000: dist 0.32 loss 5.87 \nstep 93/1000: dist 0.32 loss 5.37 \nstep 94/1000: dist 0.31 loss 6.09 \nstep 95/1000: dist 0.31 loss 8.19 \nstep 96/1000: dist 0.33 loss 9.66 \nstep 97/1000: dist 0.30 loss 10.27\nstep 98/1000: dist 0.32 loss 9.74 \nstep 99/1000: dist 0.29 loss 9.90 \nstep 100/1000: dist 0.29 loss 11.77\nstep 101/1000: dist 0.31 loss 14.67\nstep 102/1000: dist 0.29 loss 12.99\nstep 103/1000: dist 0.32 loss 6.41 \nstep 104/1000: dist 0.28 loss 6.58 \nstep 105/1000: dist 0.30 loss 14.45\nstep 106/1000: dist 0.31 loss 16.89\nstep 107/1000: dist 0.30 loss 11.51\nstep 108/1000: dist 0.30 loss 9.70 \nstep 109/1000: dist 0.29 loss 10.27\nstep 110/1000: dist 0.31 loss 7.18 \nstep 111/1000: dist 0.31 loss 6.35 \nstep 112/1000: dist 0.34 loss 9.71 \nstep 113/1000: dist 0.29 loss 8.66 \nstep 114/1000: dist 0.29 loss 6.15 \nstep 115/1000: dist 0.30 loss 9.49 \nstep 116/1000: dist 0.30 loss 12.30\nstep 117/1000: dist 0.31 loss 9.64 \nstep 118/1000: dist 0.28 loss 6.67 \nstep 119/1000: dist 0.29 loss 5.59 \nstep 120/1000: dist 0.28 loss 4.67 \nstep 121/1000: dist 0.30 loss 5.22 \nstep 122/1000: dist 0.30 loss 6.40 \nstep 123/1000: dist 0.28 loss 6.17 \nstep 124/1000: dist 0.28 loss 7.35 \nstep 125/1000: dist 0.32 loss 10.93\nstep 126/1000: dist 0.30 loss 12.18\nstep 127/1000: dist 0.32 loss 8.82 \nstep 128/1000: dist 0.29 loss 4.46 \nstep 129/1000: dist 0.29 loss 3.04 \nstep 130/1000: dist 0.29 loss 4.23 \nstep 131/1000: dist 0.30 loss 5.47 \nstep 132/1000: dist 0.32 loss 4.74 \nstep 133/1000: dist 0.29 loss 3.27 \nstep 134/1000: dist 0.29 loss 3.45 \nstep 135/1000: dist 0.28 loss 4.13 \nstep 136/1000: dist 0.29 loss 3.15 \nstep 137/1000: dist 0.28 loss 1.94 \nstep 138/1000: dist 0.32 loss 2.75 \nstep 139/1000: dist 0.28 loss 3.94 \nstep 140/1000: dist 0.30 loss 3.72 \nstep 141/1000: dist 0.29 loss 4.03 \nstep 142/1000: dist 0.28 loss 7.67 \nstep 143/1000: dist 0.30 loss 13.63\nstep 144/1000: dist 0.31 loss 17.92\nstep 145/1000: dist 0.35 loss 16.38\nstep 146/1000: dist 0.30 loss 9.34 \nstep 147/1000: dist 0.30 loss 4.54 \nstep 148/1000: dist 0.28 loss 5.87 \nstep 149/1000: dist 0.29 loss 8.01 \nstep 150/1000: dist 0.29 loss 6.58 \nstep 151/1000: dist 0.27 loss 6.16 \nstep 152/1000: dist 0.30 loss 10.04\nstep 153/1000: dist 0.27 loss 13.59\nstep 154/1000: dist 0.29 loss 16.03\nstep 155/1000: dist 0.28 loss 20.94\nstep 156/1000: dist 0.28 loss 21.56\nstep 157/1000: dist 0.28 loss 11.10\nstep 158/1000: dist 0.29 loss 2.93 \nstep 159/1000: dist 0.28 loss 7.48 \nstep 160/1000: dist 0.27 loss 12.92\nstep 161/1000: dist 0.29 loss 10.25\nstep 162/1000: dist 0.29 loss 9.80 \nstep 163/1000: dist 0.27 loss 15.27\nstep 164/1000: dist 0.27 loss 16.10\nstep 165/1000: dist 0.28 loss 11.64\nstep 166/1000: dist 0.29 loss 10.11\nstep 167/1000: dist 0.29 loss 9.98 \nstep 168/1000: dist 0.28 loss 7.51 \nstep 169/1000: dist 0.28 loss 6.89 \nstep 170/1000: dist 0.26 loss 7.22 \nstep 171/1000: dist 0.28 loss 4.37 \nstep 172/1000: dist 0.27 loss 3.35 \nstep 173/1000: dist 0.28 loss 6.82 \nstep 174/1000: dist 0.27 loss 7.90 \nstep 175/1000: dist 0.27 loss 5.80 \nstep 176/1000: dist 0.29 loss 7.36 \nstep 177/1000: dist 0.26 loss 11.93\nstep 178/1000: dist 0.27 loss 13.67\nstep 179/1000: dist 0.27 loss 11.41\nstep 180/1000: dist 0.28 loss 7.97 \nstep 181/1000: dist 0.27 loss 6.89 \nstep 182/1000: dist 0.28 loss 10.19\nstep 183/1000: dist 0.27 loss 14.75\nstep 184/1000: dist 0.27 loss 14.63\nstep 185/1000: dist 0.27 loss 9.03 \nstep 186/1000: dist 0.27 loss 4.84 \nstep 187/1000: dist 0.26 loss 6.00 \nstep 188/1000: dist 0.27 loss 9.26 \nstep 189/1000: dist 0.29 loss 10.86\nstep 190/1000: dist 0.28 loss 10.24\nstep 191/1000: dist 0.26 loss 8.39 \nstep 192/1000: dist 0.28 loss 6.99 \nstep 193/1000: dist 0.27 loss 7.95 \nstep 194/1000: dist 0.26 loss 11.12\nstep 195/1000: dist 0.26 loss 13.72\nstep 196/1000: dist 0.27 loss 14.93\nstep 197/1000: dist 0.27 loss 15.84\nstep 198/1000: dist 0.27 loss 14.96\nstep 199/1000: dist 0.26 loss 10.89\nstep 200/1000: dist 0.27 loss 9.39 \nstep 201/1000: dist 0.26 loss 14.98\nstep 202/1000: dist 0.29 loss 21.36\nstep 203/1000: dist 0.27 loss 18.34\nstep 204/1000: dist 0.27 loss 8.61 \nstep 205/1000: dist 0.29 loss 7.13 \nstep 206/1000: dist 0.27 loss 17.44\nstep 207/1000: dist 0.26 loss 29.47\nstep 208/1000: dist 0.27 loss 35.20\nstep 209/1000: dist 0.27 loss 28.47\nstep 210/1000: dist 0.26 loss 14.23\nstep 211/1000: dist 0.28 loss 14.35\nstep 212/1000: dist 0.26 loss 21.21\nstep 213/1000: dist 0.28 loss 12.26\nstep 214/1000: dist 0.26 loss 4.31 \nstep 215/1000: dist 0.25 loss 13.05\nstep 216/1000: dist 0.27 loss 12.83\nstep 217/1000: dist 0.27 loss 4.95 \nstep 218/1000: dist 0.26 loss 10.89\nstep 219/1000: dist 0.25 loss 12.28\nstep 220/1000: dist 0.25 loss 5.34 \nstep 221/1000: dist 0.26 loss 10.46\nstep 222/1000: dist 0.26 loss 14.74\nstep 223/1000: dist 0.25 loss 10.68\nstep 224/1000: dist 0.26 loss 10.15\nstep 225/1000: dist 0.26 loss 7.35 \nstep 226/1000: dist 0.26 loss 4.16 \nstep 227/1000: dist 0.27 loss 7.75 \nstep 228/1000: dist 0.26 loss 8.76 \nstep 229/1000: dist 0.26 loss 7.65 \nstep 230/1000: dist 0.27 loss 7.31 \nstep 231/1000: dist 0.28 loss 2.95 \nstep 232/1000: dist 0.25 loss 1.14 \nstep 233/1000: dist 0.25 loss 3.84 \nstep 234/1000: dist 0.26 loss 3.98 \nstep 235/1000: dist 0.26 loss 3.64 \nstep 236/1000: dist 0.26 loss 3.83 \nstep 237/1000: dist 0.26 loss 3.02 \nstep 238/1000: dist 0.26 loss 4.02 \nstep 239/1000: dist 0.27 loss 5.47 \nstep 240/1000: dist 0.25 loss 6.20 \nstep 241/1000: dist 0.25 loss 8.73 \nstep 242/1000: dist 0.25 loss 11.06\nstep 243/1000: dist 0.27 loss 10.66\nstep 244/1000: dist 0.26 loss 7.53 \nstep 245/1000: dist 0.26 loss 2.97 \nstep 246/1000: dist 0.25 loss 1.28 \nstep 247/1000: dist 0.26 loss 3.80 \nstep 248/1000: dist 0.26 loss 5.61 \nstep 249/1000: dist 0.25 loss 3.95 \nstep 250/1000: dist 0.25 loss 1.53 \nstep 251/1000: dist 0.25 loss 1.28 \nstep 252/1000: dist 0.26 loss 2.98 \nstep 253/1000: dist 0.27 loss 3.58 \nstep 254/1000: dist 0.25 loss 1.83 \nstep 255/1000: dist 0.26 loss 0.80 \nstep 256/1000: dist 0.25 loss 1.72 \nstep 257/1000: dist 0.25 loss 2.22 \nstep 258/1000: dist 0.25 loss 1.33 \nstep 259/1000: dist 0.25 loss 0.77 \nstep 260/1000: dist 0.25 loss 1.49 \nstep 261/1000: dist 0.25 loss 2.48 \nstep 262/1000: dist 0.25 loss 2.85 \nstep 263/1000: dist 0.27 loss 3.60 \nstep 264/1000: dist 0.25 loss 6.46 \nstep 265/1000: dist 0.25 loss 11.65\nstep 266/1000: dist 0.25 loss 17.50\nstep 267/1000: dist 0.25 loss 21.21\nstep 268/1000: dist 0.25 loss 19.16\nstep 269/1000: dist 0.28 loss 13.71\nstep 270/1000: dist 0.25 loss 10.98\nstep 271/1000: dist 0.25 loss 10.90\nstep 272/1000: dist 0.25 loss 8.70 \nstep 273/1000: dist 0.25 loss 4.63 \nstep 274/1000: dist 0.25 loss 4.78 \nstep 275/1000: dist 0.24 loss 8.88 \nstep 276/1000: dist 0.24 loss 8.90 \nstep 277/1000: dist 0.25 loss 5.05 \nstep 278/1000: dist 0.24 loss 6.89 \nstep 279/1000: dist 0.24 loss 15.41\nstep 280/1000: dist 0.24 loss 20.94\nstep 281/1000: dist 0.25 loss 18.48\nstep 282/1000: dist 0.24 loss 11.80\nstep 283/1000: dist 0.24 loss 6.38 \nstep 284/1000: dist 0.24 loss 6.47 \nstep 285/1000: dist 0.24 loss 11.40\nstep 286/1000: dist 0.24 loss 15.73\nstep 287/1000: dist 0.25 loss 16.75\nstep 288/1000: dist 0.24 loss 20.77\nstep 289/1000: dist 0.24 loss 28.41\nstep 290/1000: dist 0.24 loss 28.15\nstep 291/1000: dist 0.24 loss 19.34\nstep 292/1000: dist 0.25 loss 18.30\nstep 293/1000: dist 0.25 loss 26.93\nstep 294/1000: dist 0.25 loss 28.72\nstep 295/1000: dist 0.24 loss 19.25\nstep 296/1000: dist 0.24 loss 11.74\nstep 297/1000: dist 0.24 loss 11.70\nstep 298/1000: dist 0.26 loss 11.16\nstep 299/1000: dist 0.24 loss 8.96 \nstep 300/1000: dist 0.24 loss 10.46\nstep 301/1000: dist 0.26 loss 11.82\nstep 302/1000: dist 0.24 loss 8.48 \nstep 303/1000: dist 0.26 loss 7.42 \nstep 304/1000: dist 0.25 loss 13.78\nstep 305/1000: dist 0.26 loss 20.67\nstep 306/1000: dist 0.26 loss 21.33\nstep 307/1000: dist 0.24 loss 16.80\nstep 308/1000: dist 0.24 loss 10.06\nstep 309/1000: dist 0.24 loss 5.55 \nstep 310/1000: dist 0.26 loss 6.88 \nstep 311/1000: dist 0.25 loss 10.07\nstep 312/1000: dist 0.27 loss 8.14 \nstep 313/1000: dist 0.25 loss 3.85 \nstep 314/1000: dist 0.25 loss 4.87 \nstep 315/1000: dist 0.25 loss 7.51 \nstep 316/1000: dist 0.25 loss 5.37 \nstep 317/1000: dist 0.24 loss 3.86 \nstep 318/1000: dist 0.26 loss 8.04 \nstep 319/1000: dist 0.26 loss 12.12\nstep 320/1000: dist 0.25 loss 14.70\nstep 321/1000: dist 0.25 loss 22.49\nstep 322/1000: dist 0.24 loss 32.50\nstep 323/1000: dist 0.25 loss 33.77\nstep 324/1000: dist 0.26 loss 25.98\nstep 325/1000: dist 0.25 loss 17.55\nstep 326/1000: dist 0.27 loss 12.76\nstep 327/1000: dist 0.25 loss 12.36\nstep 328/1000: dist 0.25 loss 16.27\nstep 329/1000: dist 0.25 loss 20.26\nstep 330/1000: dist 0.25 loss 21.06\nstep 331/1000: dist 0.25 loss 19.85\nstep 332/1000: dist 0.26 loss 16.32\nstep 333/1000: dist 0.25 loss 10.43\nstep 334/1000: dist 0.24 loss 6.92 \nstep 335/1000: dist 0.24 loss 8.13 \nstep 336/1000: dist 0.25 loss 10.03\nstep 337/1000: dist 0.24 loss 8.85 \nstep 338/1000: dist 0.23 loss 6.06 \nstep 339/1000: dist 0.24 loss 5.11 \nstep 340/1000: dist 0.23 loss 6.57 \nstep 341/1000: dist 0.24 loss 8.19 \nstep 342/1000: dist 0.24 loss 8.89 \nstep 343/1000: dist 0.25 loss 11.45\nstep 344/1000: dist 0.24 loss 18.44\nstep 345/1000: dist 0.24 loss 26.13\nstep 346/1000: dist 0.23 loss 26.16\nstep 347/1000: dist 0.25 loss 16.98\nstep 348/1000: dist 0.25 loss 10.33\nstep 349/1000: dist 0.25 loss 13.76\nstep 350/1000: dist 0.25 loss 16.96\nstep 351/1000: dist 0.23 loss 10.23\nstep 352/1000: dist 0.23 loss 2.40 \nstep 353/1000: dist 0.24 loss 4.89 \nstep 354/1000: dist 0.23 loss 9.91 \nstep 355/1000: dist 0.24 loss 7.70 \nstep 356/1000: dist 0.23 loss 5.10 \nstep 357/1000: dist 0.23 loss 7.23 \nstep 358/1000: dist 0.23 loss 7.69 \nstep 359/1000: dist 0.24 loss 7.68 \nstep 360/1000: dist 0.23 loss 14.25\nstep 361/1000: dist 0.23 loss 22.76\nstep 362/1000: dist 0.23 loss 27.02\nstep 363/1000: dist 0.23 loss 27.44\nstep 364/1000: dist 0.23 loss 21.31\nstep 365/1000: dist 0.23 loss 9.12 \nstep 366/1000: dist 0.24 loss 4.08 \nstep 367/1000: dist 0.24 loss 10.17\nstep 368/1000: dist 0.25 loss 14.86\nstep 369/1000: dist 0.24 loss 12.47\nstep 370/1000: dist 0.24 loss 11.04\nstep 371/1000: dist 0.24 loss 15.59\nstep 372/1000: dist 0.24 loss 21.70\nstep 373/1000: dist 0.23 loss 21.08\nstep 374/1000: dist 0.23 loss 11.89\nstep 375/1000: dist 0.23 loss 3.62 \nstep 376/1000: dist 0.24 loss 5.20 \nstep 377/1000: dist 0.24 loss 10.61\nstep 378/1000: dist 0.24 loss 10.26\nstep 379/1000: dist 0.24 loss 5.68 \nstep 380/1000: dist 0.23 loss 4.73 \nstep 381/1000: dist 0.23 loss 8.90 \nstep 382/1000: dist 0.23 loss 13.03\nstep 383/1000: dist 0.22 loss 14.77\nstep 384/1000: dist 0.23 loss 16.90\nstep 385/1000: dist 0.24 loss 18.41\nstep 386/1000: dist 0.23 loss 12.95\nstep 387/1000: dist 0.22 loss 3.64 \nstep 388/1000: dist 0.23 loss 1.90 \nstep 389/1000: dist 0.23 loss 8.10 \nstep 390/1000: dist 0.23 loss 10.58\nstep 391/1000: dist 0.23 loss 5.27 \nstep 392/1000: dist 0.23 loss 1.42 \nstep 393/1000: dist 0.23 loss 3.97 \nstep 394/1000: dist 0.23 loss 6.74 \nstep 395/1000: dist 0.23 loss 5.49 \nstep 396/1000: dist 0.23 loss 4.20 \nstep 397/1000: dist 0.23 loss 7.03 \nstep 398/1000: dist 0.23 loss 12.62\nstep 399/1000: dist 0.23 loss 17.72\nstep 400/1000: dist 0.23 loss 20.13\nstep 401/1000: dist 0.22 loss 16.85\nstep 402/1000: dist 0.22 loss 8.06 \nstep 403/1000: dist 0.22 loss 2.19 \nstep 404/1000: dist 0.22 loss 4.97 \nstep 405/1000: dist 0.22 loss 9.83 \nstep 406/1000: dist 0.23 loss 7.65 \nstep 407/1000: dist 0.22 loss 2.01 \nstep 408/1000: dist 0.22 loss 2.44 \nstep 409/1000: dist 0.23 loss 6.09 \nstep 410/1000: dist 0.22 loss 4.63 \nstep 411/1000: dist 0.22 loss 1.21 \nstep 412/1000: dist 0.22 loss 2.40 \nstep 413/1000: dist 0.22 loss 4.24 \nstep 414/1000: dist 0.22 loss 2.42 \nstep 415/1000: dist 0.22 loss 1.49 \nstep 416/1000: dist 0.21 loss 3.41 \nstep 417/1000: dist 0.22 loss 4.07 \nstep 418/1000: dist 0.23 loss 4.14 \nstep 419/1000: dist 0.22 loss 7.32 \nstep 420/1000: dist 0.22 loss 12.23\nstep 421/1000: dist 0.22 loss 17.08\nstep 422/1000: dist 0.22 loss 22.48\nstep 423/1000: dist 0.22 loss 23.91\nstep 424/1000: dist 0.22 loss 17.03\nstep 425/1000: dist 0.22 loss 7.85 \nstep 426/1000: dist 0.21 loss 4.78 \nstep 427/1000: dist 0.22 loss 6.84 \nstep 428/1000: dist 0.22 loss 8.27 \nstep 429/1000: dist 0.22 loss 7.21 \nstep 430/1000: dist 0.22 loss 5.56 \nstep 431/1000: dist 0.22 loss 4.85 \nstep 432/1000: dist 0.21 loss 4.97 \nstep 433/1000: dist 0.22 loss 5.12 \nstep 434/1000: dist 0.22 loss 5.80 \nstep 435/1000: dist 0.22 loss 7.97 \nstep 436/1000: dist 0.22 loss 10.74\nstep 437/1000: dist 0.22 loss 13.37\nstep 438/1000: dist 0.22 loss 16.01\nstep 439/1000: dist 0.21 loss 15.78\nstep 440/1000: dist 0.22 loss 9.38 \nstep 441/1000: dist 0.22 loss 1.87 \nstep 442/1000: dist 0.22 loss 1.77 \nstep 443/1000: dist 0.21 loss 7.18 \nstep 444/1000: dist 0.22 loss 8.50 \nstep 445/1000: dist 0.21 loss 3.64 \nstep 446/1000: dist 0.21 loss 0.61 \nstep 447/1000: dist 0.21 loss 3.14 \nstep 448/1000: dist 0.21 loss 5.25 \nstep 449/1000: dist 0.22 loss 2.99 \nstep 450/1000: dist 0.21 loss 0.63 \nstep 451/1000: dist 0.22 loss 1.87 \nstep 452/1000: dist 0.21 loss 3.36 \nstep 453/1000: dist 0.22 loss 2.02 \nstep 454/1000: dist 0.22 loss 0.49 \nstep 455/1000: dist 0.21 loss 1.35 \nstep 456/1000: dist 0.22 loss 2.30 \nstep 457/1000: dist 0.22 loss 1.29 \nstep 458/1000: dist 0.21 loss 0.38 \nstep 459/1000: dist 0.21 loss 1.11 \nstep 460/1000: dist 0.21 loss 1.64 \nstep 461/1000: dist 0.21 loss 0.89 \nstep 462/1000: dist 0.21 loss 0.50 \nstep 463/1000: dist 0.21 loss 1.24 \nstep 464/1000: dist 0.21 loss 1.74 \nstep 465/1000: dist 0.21 loss 1.74 \nstep 466/1000: dist 0.21 loss 2.68 \nstep 467/1000: dist 0.21 loss 5.13 \nstep 468/1000: dist 0.22 loss 8.59 \nstep 469/1000: dist 0.21 loss 13.25\nstep 470/1000: dist 0.21 loss 17.97\nstep 471/1000: dist 0.21 loss 18.72\nstep 472/1000: dist 0.21 loss 12.27\nstep 473/1000: dist 0.22 loss 5.68 \nstep 474/1000: dist 0.21 loss 8.15 \nstep 475/1000: dist 0.21 loss 18.08\nstep 476/1000: dist 0.22 loss 25.61\nstep 477/1000: dist 0.21 loss 26.45\nstep 478/1000: dist 0.21 loss 25.22\nstep 479/1000: dist 0.22 loss 24.59\nstep 480/1000: dist 0.22 loss 22.39\nstep 481/1000: dist 0.21 loss 22.72\nstep 482/1000: dist 0.21 loss 28.97\nstep 483/1000: dist 0.22 loss 31.27\nstep 484/1000: dist 0.22 loss 19.48\nstep 485/1000: dist 0.22 loss 8.35 \nstep 486/1000: dist 0.22 loss 13.96\nstep 487/1000: dist 0.21 loss 26.12\nstep 488/1000: dist 0.22 loss 29.77\nstep 489/1000: dist 0.21 loss 31.39\nstep 490/1000: dist 0.21 loss 32.33\nstep 491/1000: dist 0.21 loss 19.30\nstep 492/1000: dist 0.21 loss 4.10 \nstep 493/1000: dist 0.22 loss 10.64\nstep 494/1000: dist 0.21 loss 22.35\nstep 495/1000: dist 0.21 loss 13.20\nstep 496/1000: dist 0.21 loss 2.36 \nstep 497/1000: dist 0.21 loss 11.19\nstep 498/1000: dist 0.21 loss 19.00\nstep 499/1000: dist 0.21 loss 14.68\nstep 500/1000: dist 0.21 loss 19.29\nstep 501/1000: dist 0.21 loss 35.39\nstep 502/1000: dist 0.21 loss 41.24\nstep 503/1000: dist 0.21 loss 30.73\nstep 504/1000: dist 0.21 loss 16.24\nstep 505/1000: dist 0.21 loss 8.37 \nstep 506/1000: dist 0.21 loss 12.74\nstep 507/1000: dist 0.21 loss 22.70\nstep 508/1000: dist 0.21 loss 23.55\nstep 509/1000: dist 0.21 loss 17.83\nstep 510/1000: dist 0.21 loss 21.63\nstep 511/1000: dist 0.21 loss 28.18\nstep 512/1000: dist 0.21 loss 18.78\nstep 513/1000: dist 0.21 loss 3.13 \nstep 514/1000: dist 0.21 loss 4.73 \nstep 515/1000: dist 0.21 loss 15.44\nstep 516/1000: dist 0.20 loss 13.41\nstep 517/1000: dist 0.20 loss 4.28 \nstep 518/1000: dist 0.20 loss 4.65 \nstep 519/1000: dist 0.21 loss 10.01\nstep 520/1000: dist 0.21 loss 9.90 \nstep 521/1000: dist 0.21 loss 8.84 \nstep 522/1000: dist 0.21 loss 13.07\nstep 523/1000: dist 0.21 loss 19.42\nstep 524/1000: dist 0.20 loss 22.70\nstep 525/1000: dist 0.20 loss 19.35\nstep 526/1000: dist 0.21 loss 10.37\nstep 527/1000: dist 0.21 loss 4.25 \nstep 528/1000: dist 0.20 loss 6.68 \nstep 529/1000: dist 0.21 loss 12.51\nstep 530/1000: dist 0.20 loss 14.87\nstep 531/1000: dist 0.20 loss 13.81\nstep 532/1000: dist 0.21 loss 15.03\nstep 533/1000: dist 0.20 loss 19.86\nstep 534/1000: dist 0.21 loss 20.04\nstep 535/1000: dist 0.21 loss 10.33\nstep 536/1000: dist 0.20 loss 1.39 \nstep 537/1000: dist 0.21 loss 4.11 \nstep 538/1000: dist 0.20 loss 10.67\nstep 539/1000: dist 0.20 loss 9.11 \nstep 540/1000: dist 0.20 loss 3.17 \nstep 541/1000: dist 0.21 loss 2.40 \nstep 542/1000: dist 0.21 loss 5.16 \nstep 543/1000: dist 0.21 loss 5.18 \nstep 544/1000: dist 0.21 loss 3.03 \nstep 545/1000: dist 0.20 loss 2.24 \nstep 546/1000: dist 0.20 loss 2.83 \nstep 547/1000: dist 0.20 loss 3.01 \nstep 548/1000: dist 0.20 loss 2.39 \nstep 549/1000: dist 0.20 loss 1.78 \nstep 550/1000: dist 0.20 loss 1.90 \nstep 551/1000: dist 0.20 loss 2.44 \nstep 552/1000: dist 0.20 loss 2.59 \nstep 553/1000: dist 0.20 loss 2.85 \nstep 554/1000: dist 0.20 loss 4.64 \nstep 555/1000: dist 0.20 loss 8.37 \nstep 556/1000: dist 0.20 loss 14.01\nstep 557/1000: dist 0.20 loss 21.97\nstep 558/1000: dist 0.20 loss 29.33\nstep 559/1000: dist 0.20 loss 28.73\nstep 560/1000: dist 0.20 loss 20.77\nstep 561/1000: dist 0.20 loss 18.42\nstep 562/1000: dist 0.20 loss 23.37\nstep 563/1000: dist 0.20 loss 20.45\nstep 564/1000: dist 0.21 loss 7.26 \nstep 565/1000: dist 0.20 loss 3.21 \nstep 566/1000: dist 0.20 loss 13.95\nstep 567/1000: dist 0.20 loss 18.83\nstep 568/1000: dist 0.20 loss 11.43\nstep 569/1000: dist 0.20 loss 11.67\nstep 570/1000: dist 0.21 loss 22.04\nstep 571/1000: dist 0.20 loss 22.34\nstep 572/1000: dist 0.20 loss 11.08\nstep 573/1000: dist 0.20 loss 4.80 \nstep 574/1000: dist 0.20 loss 5.54 \nstep 575/1000: dist 0.20 loss 6.82 \nstep 576/1000: dist 0.20 loss 8.49 \nstep 577/1000: dist 0.20 loss 8.09 \nstep 578/1000: dist 0.20 loss 4.01 \nstep 579/1000: dist 0.21 loss 2.28 \nstep 580/1000: dist 0.20 loss 4.52 \nstep 581/1000: dist 0.20 loss 5.59 \nstep 582/1000: dist 0.20 loss 4.01 \nstep 583/1000: dist 0.20 loss 2.31 \nstep 584/1000: dist 0.20 loss 2.80 \nstep 585/1000: dist 0.20 loss 5.70 \nstep 586/1000: dist 0.20 loss 7.95 \nstep 587/1000: dist 0.20 loss 10.06\nstep 588/1000: dist 0.20 loss 17.79\nstep 589/1000: dist 0.20 loss 29.40\nstep 590/1000: dist 0.20 loss 31.06\nstep 591/1000: dist 0.20 loss 17.57\nstep 592/1000: dist 0.20 loss 3.14 \nstep 593/1000: dist 0.20 loss 4.75 \nstep 594/1000: dist 0.20 loss 14.58\nstep 595/1000: dist 0.20 loss 12.48\nstep 596/1000: dist 0.20 loss 2.05 \nstep 597/1000: dist 0.20 loss 3.60 \nstep 598/1000: dist 0.20 loss 10.30\nstep 599/1000: dist 0.20 loss 5.32 \nstep 600/1000: dist 0.20 loss 0.58 \nstep 601/1000: dist 0.20 loss 5.65 \nstep 602/1000: dist 0.19 loss 5.91 \nstep 603/1000: dist 0.20 loss 1.06 \nstep 604/1000: dist 0.20 loss 3.21 \nstep 605/1000: dist 0.20 loss 5.28 \nstep 606/1000: dist 0.20 loss 2.65 \nstep 607/1000: dist 0.20 loss 4.39 \nstep 608/1000: dist 0.20 loss 8.00 \nstep 609/1000: dist 0.20 loss 9.54 \nstep 610/1000: dist 0.20 loss 15.93\nstep 611/1000: dist 0.20 loss 25.47\nstep 612/1000: dist 0.20 loss 31.15\nstep 613/1000: dist 0.20 loss 30.34\nstep 614/1000: dist 0.20 loss 20.05\nstep 615/1000: dist 0.20 loss 6.91 \nstep 616/1000: dist 0.19 loss 5.53 \nstep 617/1000: dist 0.20 loss 11.91\nstep 618/1000: dist 0.20 loss 12.20\nstep 619/1000: dist 0.20 loss 9.48 \nstep 620/1000: dist 0.20 loss 13.73\nstep 621/1000: dist 0.20 loss 22.44\nstep 622/1000: dist 0.20 loss 28.32\nstep 623/1000: dist 0.19 loss 30.48\nstep 624/1000: dist 0.19 loss 29.10\nstep 625/1000: dist 0.19 loss 21.16\nstep 626/1000: dist 0.19 loss 14.49\nstep 627/1000: dist 0.19 loss 24.16\nstep 628/1000: dist 0.20 loss 44.09\nstep 629/1000: dist 0.19 loss 50.18\nstep 630/1000: dist 0.19 loss 40.78\nstep 631/1000: dist 0.19 loss 35.55\nstep 632/1000: dist 0.19 loss 31.29\nstep 633/1000: dist 0.19 loss 18.04\nstep 634/1000: dist 0.19 loss 12.32\nstep 635/1000: dist 0.19 loss 19.60\nstep 636/1000: dist 0.19 loss 19.46\nstep 637/1000: dist 0.19 loss 9.39 \nstep 638/1000: dist 0.19 loss 8.80 \nstep 639/1000: dist 0.19 loss 13.70\nstep 640/1000: dist 0.19 loss 9.23 \nstep 641/1000: dist 0.19 loss 5.33 \nstep 642/1000: dist 0.19 loss 9.08 \nstep 643/1000: dist 0.20 loss 7.76 \nstep 644/1000: dist 0.19 loss 3.66 \nstep 645/1000: dist 0.20 loss 6.59 \nstep 646/1000: dist 0.20 loss 7.39 \nstep 647/1000: dist 0.19 loss 4.09 \nstep 648/1000: dist 0.19 loss 6.68 \nstep 649/1000: dist 0.19 loss 9.72 \nstep 650/1000: dist 0.20 loss 9.29 \nstep 651/1000: dist 0.19 loss 13.37\nstep 652/1000: dist 0.19 loss 17.01\nstep 653/1000: dist 0.19 loss 14.20\nstep 654/1000: dist 0.19 loss 11.40\nstep 655/1000: dist 0.19 loss 10.01\nstep 656/1000: dist 0.19 loss 10.03\nstep 657/1000: dist 0.19 loss 16.46\nstep 658/1000: dist 0.19 loss 22.85\nstep 659/1000: dist 0.19 loss 22.69\nstep 660/1000: dist 0.19 loss 24.12\nstep 661/1000: dist 0.19 loss 31.11\nstep 662/1000: dist 0.19 loss 36.68\nstep 663/1000: dist 0.19 loss 34.13\nstep 664/1000: dist 0.19 loss 22.20\nstep 665/1000: dist 0.19 loss 12.63\nstep 666/1000: dist 0.19 loss 18.53\nstep 667/1000: dist 0.19 loss 32.65\nstep 668/1000: dist 0.19 loss 36.18\nstep 669/1000: dist 0.19 loss 24.75\nstep 670/1000: dist 0.19 loss 10.51\nstep 671/1000: dist 0.20 loss 7.93 \nstep 672/1000: dist 0.19 loss 14.91\nstep 673/1000: dist 0.19 loss 18.84\nstep 674/1000: dist 0.19 loss 18.05\nstep 675/1000: dist 0.20 loss 20.94\nstep 676/1000: dist 0.19 loss 29.30\nstep 677/1000: dist 0.19 loss 33.39\nstep 678/1000: dist 0.19 loss 24.18\nstep 679/1000: dist 0.19 loss 8.93 \nstep 680/1000: dist 0.19 loss 5.25 \nstep 681/1000: dist 0.19 loss 13.43\nstep 682/1000: dist 0.19 loss 15.88\nstep 683/1000: dist 0.19 loss 7.32 \nstep 684/1000: dist 0.19 loss 3.30 \nstep 685/1000: dist 0.19 loss 8.71 \nstep 686/1000: dist 0.19 loss 9.38 \nstep 687/1000: dist 0.19 loss 3.24 \nstep 688/1000: dist 0.19 loss 3.12 \nstep 689/1000: dist 0.19 loss 6.93 \nstep 690/1000: dist 0.19 loss 4.45 \nstep 691/1000: dist 0.19 loss 1.48 \nstep 692/1000: dist 0.19 loss 3.86 \nstep 693/1000: dist 0.19 loss 4.11 \nstep 694/1000: dist 0.19 loss 1.57 \nstep 695/1000: dist 0.19 loss 2.23 \nstep 696/1000: dist 0.19 loss 2.94 \nstep 697/1000: dist 0.19 loss 1.43 \nstep 698/1000: dist 0.19 loss 1.67 \nstep 699/1000: dist 0.19 loss 2.20 \nstep 700/1000: dist 0.19 loss 0.99 \nstep 701/1000: dist 0.19 loss 1.19 \nstep 702/1000: dist 0.19 loss 1.86 \nstep 703/1000: dist 0.19 loss 0.78 \nstep 704/1000: dist 0.19 loss 0.68 \nstep 705/1000: dist 0.19 loss 1.50 \nstep 706/1000: dist 0.19 loss 0.80 \nstep 707/1000: dist 0.19 loss 0.38 \nstep 708/1000: dist 0.19 loss 1.06 \nstep 709/1000: dist 0.19 loss 0.81 \nstep 710/1000: dist 0.19 loss 0.34 \nstep 711/1000: dist 0.19 loss 0.68 \nstep 712/1000: dist 0.19 loss 0.66 \nstep 713/1000: dist 0.19 loss 0.40 \nstep 714/1000: dist 0.19 loss 0.54 \nstep 715/1000: dist 0.19 loss 0.47 \nstep 716/1000: dist 0.19 loss 0.34 \nstep 717/1000: dist 0.19 loss 0.51 \nstep 718/1000: dist 0.19 loss 0.42 \nstep 719/1000: dist 0.19 loss 0.28 \nstep 720/1000: dist 0.19 loss 0.45 \nstep 721/1000: dist 0.19 loss 0.49 \nstep 722/1000: dist 0.19 loss 0.43 \nstep 723/1000: dist 0.19 loss 0.70 \nstep 724/1000: dist 0.19 loss 1.09 \nstep 725/1000: dist 0.19 loss 1.68 \nstep 726/1000: dist 0.19 loss 3.08 \nstep 727/1000: dist 0.19 loss 5.64 \nstep 728/1000: dist 0.19 loss 9.91 \nstep 729/1000: dist 0.19 loss 16.09\nstep 730/1000: dist 0.19 loss 22.22\nstep 731/1000: dist 0.19 loss 22.00\nstep 732/1000: dist 0.19 loss 12.77\nstep 733/1000: dist 0.19 loss 2.04 \nstep 734/1000: dist 0.19 loss 1.52 \nstep 735/1000: dist 0.19 loss 8.65 \nstep 736/1000: dist 0.19 loss 10.33\nstep 737/1000: dist 0.20 loss 3.74 \nstep 738/1000: dist 0.19 loss 0.40 \nstep 739/1000: dist 0.20 loss 4.81 \nstep 740/1000: dist 0.20 loss 6.79 \nstep 741/1000: dist 0.19 loss 2.75 \nstep 742/1000: dist 0.20 loss 2.11 \nstep 743/1000: dist 0.19 loss 6.83 \nstep 744/1000: dist 0.20 loss 9.30 \nstep 745/1000: dist 0.19 loss 10.75\nstep 746/1000: dist 0.19 loss 17.31\nstep 747/1000: dist 0.20 loss 23.07\nstep 748/1000: dist 0.19 loss 18.51\nstep 749/1000: dist 0.19 loss 7.66 \nstep 750/1000: dist 0.19 loss 2.05 \nstep 751/1000: dist 0.19 loss 4.31 \nstep 752/1000: dist 0.19 loss 9.06 \nstep 753/1000: dist 0.19 loss 9.68 \nstep 754/1000: dist 0.19 loss 4.25 \nstep 755/1000: dist 0.19 loss 0.59 \nstep 756/1000: dist 0.19 loss 4.03 \nstep 757/1000: dist 0.19 loss 6.96 \nstep 758/1000: dist 0.19 loss 3.32 \nstep 759/1000: dist 0.19 loss 0.21 \nstep 760/1000: dist 0.19 loss 2.69 \nstep 761/1000: dist 0.19 loss 4.42 \nstep 762/1000: dist 0.19 loss 1.90 \nstep 763/1000: dist 0.19 loss 0.44 \nstep 764/1000: dist 0.19 loss 2.07 \nstep 765/1000: dist 0.19 loss 2.65 \nstep 766/1000: dist 0.19 loss 1.15 \nstep 767/1000: dist 0.19 loss 0.61 \nstep 768/1000: dist 0.19 loss 1.60 \nstep 769/1000: dist 0.19 loss 1.80 \nstep 770/1000: dist 0.19 loss 0.93 \nstep 771/1000: dist 0.18 loss 0.92 \nstep 772/1000: dist 0.19 loss 1.89 \nstep 773/1000: dist 0.19 loss 2.19 \nstep 774/1000: dist 0.19 loss 2.12 \nstep 775/1000: dist 0.19 loss 3.23 \nstep 776/1000: dist 0.18 loss 4.86 \nstep 777/1000: dist 0.19 loss 5.75 \nstep 778/1000: dist 0.18 loss 6.38 \nstep 779/1000: dist 0.18 loss 6.87 \nstep 780/1000: dist 0.18 loss 5.61 \nstep 781/1000: dist 0.18 loss 2.92 \nstep 782/1000: dist 0.18 loss 0.97 \nstep 783/1000: dist 0.18 loss 0.59 \nstep 784/1000: dist 0.18 loss 1.16 \nstep 785/1000: dist 0.18 loss 2.17 \nstep 786/1000: dist 0.18 loss 2.62 \nstep 787/1000: dist 0.18 loss 1.67 \nstep 788/1000: dist 0.18 loss 0.43 \nstep 789/1000: dist 0.18 loss 0.35 \nstep 790/1000: dist 0.18 loss 1.05 \nstep 791/1000: dist 0.18 loss 1.36 \nstep 792/1000: dist 0.18 loss 1.00 \nstep 793/1000: dist 0.18 loss 0.44 \nstep 794/1000: dist 0.18 loss 0.29 \nstep 795/1000: dist 0.18 loss 0.65 \nstep 796/1000: dist 0.18 loss 0.87 \nstep 797/1000: dist 0.19 loss 0.55 \nstep 798/1000: dist 0.18 loss 0.21 \nstep 799/1000: dist 0.18 loss 0.35 \nstep 800/1000: dist 0.19 loss 0.60 \nstep 801/1000: dist 0.18 loss 0.46 \nstep 802/1000: dist 0.18 loss 0.23 \nstep 803/1000: dist 0.18 loss 0.27 \nstep 804/1000: dist 0.18 loss 0.40 \nstep 805/1000: dist 0.18 loss 0.37 \nstep 806/1000: dist 0.18 loss 0.24 \nstep 807/1000: dist 0.18 loss 0.22 \nstep 808/1000: dist 0.18 loss 0.32 \nstep 809/1000: dist 0.18 loss 0.31 \nstep 810/1000: dist 0.18 loss 0.20 \nstep 811/1000: dist 0.18 loss 0.22 \nstep 812/1000: dist 0.18 loss 0.29 \nstep 813/1000: dist 0.18 loss 0.24 \nstep 814/1000: dist 0.18 loss 0.19 \nstep 815/1000: dist 0.18 loss 0.23 \nstep 816/1000: dist 0.18 loss 0.24 \nstep 817/1000: dist 0.19 loss 0.20 \nstep 818/1000: dist 0.18 loss 0.20 \nstep 819/1000: dist 0.19 loss 0.22 \nstep 820/1000: dist 0.18 loss 0.21 \nstep 821/1000: dist 0.18 loss 0.19 \nstep 822/1000: dist 0.18 loss 0.20 \nstep 823/1000: dist 0.18 loss 0.21 \nstep 824/1000: dist 0.18 loss 0.19 \nstep 825/1000: dist 0.18 loss 0.19 \nstep 826/1000: dist 0.18 loss 0.20 \nstep 827/1000: dist 0.18 loss 0.19 \nstep 828/1000: dist 0.18 loss 0.19 \nstep 829/1000: dist 0.18 loss 0.20 \nstep 830/1000: dist 0.18 loss 0.19 \nstep 831/1000: dist 0.18 loss 0.19 \nstep 832/1000: dist 0.18 loss 0.19 \nstep 833/1000: dist 0.18 loss 0.18 \nstep 834/1000: dist 0.18 loss 0.19 \nstep 835/1000: dist 0.18 loss 0.19 \nstep 836/1000: dist 0.18 loss 0.18 \nstep 837/1000: dist 0.18 loss 0.18 \nstep 838/1000: dist 0.18 loss 0.19 \nstep 839/1000: dist 0.18 loss 0.18 \nstep 840/1000: dist 0.18 loss 0.18 \nstep 841/1000: dist 0.18 loss 0.18 \nstep 842/1000: dist 0.18 loss 0.18 \nstep 843/1000: dist 0.18 loss 0.18 \nstep 844/1000: dist 0.18 loss 0.18 \nstep 845/1000: dist 0.18 loss 0.18 \nstep 846/1000: dist 0.18 loss 0.18 \nstep 847/1000: dist 0.18 loss 0.18 \nstep 848/1000: dist 0.18 loss 0.18 \nstep 849/1000: dist 0.18 loss 0.18 \nstep 850/1000: dist 0.18 loss 0.18 \nstep 851/1000: dist 0.18 loss 0.18 \nstep 852/1000: dist 0.18 loss 0.18 \nstep 853/1000: dist 0.18 loss 0.18 \nstep 854/1000: dist 0.18 loss 0.18 \nstep 855/1000: dist 0.18 loss 0.18 \nstep 856/1000: dist 0.18 loss 0.18 \nstep 857/1000: dist 0.18 loss 0.18 \nstep 858/1000: dist 0.18 loss 0.18 \nstep 859/1000: dist 0.18 loss 0.18 \nstep 860/1000: dist 0.18 loss 0.18 \nstep 861/1000: dist 0.18 loss 0.18 \nstep 862/1000: dist 0.18 loss 0.18 \nstep 863/1000: dist 0.18 loss 0.18 \nstep 864/1000: dist 0.18 loss 0.18 \nstep 865/1000: dist 0.18 loss 0.18 \nstep 866/1000: dist 0.18 loss 0.18 \nstep 867/1000: dist 0.18 loss 0.18 \nstep 868/1000: dist 0.18 loss 0.18 \nstep 869/1000: dist 0.18 loss 0.18 \nstep 870/1000: dist 0.18 loss 0.18 \nstep 871/1000: dist 0.18 loss 0.18 \nstep 872/1000: dist 0.18 loss 0.18 \nstep 873/1000: dist 0.18 loss 0.18 \nstep 874/1000: dist 0.18 loss 0.18 \nstep 875/1000: dist 0.18 loss 0.18 \nstep 876/1000: dist 0.18 loss 0.18 \nstep 877/1000: dist 0.18 loss 0.18 \nstep 878/1000: dist 0.18 loss 0.18 \nstep 879/1000: dist 0.18 loss 0.18 \nstep 880/1000: dist 0.18 loss 0.18 \nstep 881/1000: dist 0.18 loss 0.18 \nstep 882/1000: dist 0.18 loss 0.18 \nstep 883/1000: dist 0.18 loss 0.18 \nstep 884/1000: dist 0.18 loss 0.18 \nstep 885/1000: dist 0.18 loss 0.18 \nstep 886/1000: dist 0.18 loss 0.18 \nstep 887/1000: dist 0.18 loss 0.18 \nstep 888/1000: dist 0.18 loss 0.18 \nstep 889/1000: dist 0.18 loss 0.18 \nstep 890/1000: dist 0.18 loss 0.18 \nstep 891/1000: dist 0.18 loss 0.18 \nstep 892/1000: dist 0.18 loss 0.18 \nstep 893/1000: dist 0.18 loss 0.18 \nstep 894/1000: dist 0.18 loss 0.18 \nstep 895/1000: dist 0.18 loss 0.18 \nstep 896/1000: dist 0.18 loss 0.18 \nstep 897/1000: dist 0.18 loss 0.18 \nstep 898/1000: dist 0.18 loss 0.18 \nstep 899/1000: dist 0.18 loss 0.18 \nstep 900/1000: dist 0.18 loss 0.18 \nstep 901/1000: dist 0.18 loss 0.18 \nstep 902/1000: dist 0.18 loss 0.18 \nstep 903/1000: dist 0.18 loss 0.18 \nstep 904/1000: dist 0.18 loss 0.18 \nstep 905/1000: dist 0.18 loss 0.18 \nstep 906/1000: dist 0.18 loss 0.18 \nstep 907/1000: dist 0.18 loss 0.18 \nstep 908/1000: dist 0.18 loss 0.18 \nstep 909/1000: dist 0.18 loss 0.18 \nstep 910/1000: dist 0.18 loss 0.18 \nstep 911/1000: dist 0.18 loss 0.18 \nstep 912/1000: dist 0.18 loss 0.18 \nstep 913/1000: dist 0.18 loss 0.18 \nstep 914/1000: dist 0.18 loss 0.18 \nstep 915/1000: dist 0.18 loss 0.18 \nstep 916/1000: dist 0.18 loss 0.18 \nstep 917/1000: dist 0.18 loss 0.18 \nstep 918/1000: dist 0.18 loss 0.18 \nstep 919/1000: dist 0.18 loss 0.18 \nstep 920/1000: dist 0.18 loss 0.18 \nstep 921/1000: dist 0.18 loss 0.18 \nstep 922/1000: dist 0.18 loss 0.18 \nstep 923/1000: dist 0.18 loss 0.18 \nstep 924/1000: dist 0.18 loss 0.18 \nstep 925/1000: dist 0.18 loss 0.18 \nstep 926/1000: dist 0.18 loss 0.18 \nstep 927/1000: dist 0.18 loss 0.18 \nstep 928/1000: dist 0.18 loss 0.18 \nstep 929/1000: dist 0.18 loss 0.18 \nstep 930/1000: dist 0.18 loss 0.18 \nstep 931/1000: dist 0.18 loss 0.18 \nstep 932/1000: dist 0.18 loss 0.18 \nstep 933/1000: dist 0.18 loss 0.18 \nstep 934/1000: dist 0.18 loss 0.18 \nstep 935/1000: dist 0.18 loss 0.18 \nstep 936/1000: dist 0.18 loss 0.18 \nstep 937/1000: dist 0.18 loss 0.18 \nstep 938/1000: dist 0.18 loss 0.18 \nstep 939/1000: dist 0.18 loss 0.18 \nstep 940/1000: dist 0.18 loss 0.18 \nstep 941/1000: dist 0.18 loss 0.18 \nstep 942/1000: dist 0.18 loss 0.18 \nstep 943/1000: dist 0.18 loss 0.18 \nstep 944/1000: dist 0.18 loss 0.18 \nstep 945/1000: dist 0.18 loss 0.18 \nstep 946/1000: dist 0.18 loss 0.18 \nstep 947/1000: dist 0.18 loss 0.18 \nstep 948/1000: dist 0.18 loss 0.18 \nstep 949/1000: dist 0.18 loss 0.18 \nstep 950/1000: dist 0.18 loss 0.18 \nstep 951/1000: dist 0.18 loss 0.18 \nstep 952/1000: dist 0.18 loss 0.18 \nstep 953/1000: dist 0.18 loss 0.18 \nstep 954/1000: dist 0.18 loss 0.18 \nstep 955/1000: dist 0.18 loss 0.18 \nstep 956/1000: dist 0.18 loss 0.18 \nstep 957/1000: dist 0.18 loss 0.18 \nstep 958/1000: dist 0.18 loss 0.18 \nstep 959/1000: dist 0.18 loss 0.18 \nstep 960/1000: dist 0.18 loss 0.18 \nstep 961/1000: dist 0.18 loss 0.18 \nstep 962/1000: dist 0.18 loss 0.18 \nstep 963/1000: dist 0.18 loss 0.18 \nstep 964/1000: dist 0.18 loss 0.18 \nstep 965/1000: dist 0.18 loss 0.18 \nstep 966/1000: dist 0.18 loss 0.18 \nstep 967/1000: dist 0.18 loss 0.18 \nstep 968/1000: dist 0.18 loss 0.18 \nstep 969/1000: dist 0.18 loss 0.18 \nstep 970/1000: dist 0.18 loss 0.18 \nstep 971/1000: dist 0.18 loss 0.18 \nstep 972/1000: dist 0.18 loss 0.18 \nstep 973/1000: dist 0.18 loss 0.18 \nstep 974/1000: dist 0.18 loss 0.18 \nstep 975/1000: dist 0.18 loss 0.18 \nstep 976/1000: dist 0.18 loss 0.18 \nstep 977/1000: dist 0.18 loss 0.18 \nstep 978/1000: dist 0.18 loss 0.18 \nstep 979/1000: dist 0.18 loss 0.18 \nstep 980/1000: dist 0.18 loss 0.18 \nstep 981/1000: dist 0.18 loss 0.18 \nstep 982/1000: dist 0.18 loss 0.18 \nstep 983/1000: dist 0.18 loss 0.18 \nstep 984/1000: dist 0.18 loss 0.18 \nstep 985/1000: dist 0.18 loss 0.18 \nstep 986/1000: dist 0.18 loss 0.18 \nstep 987/1000: dist 0.18 loss 0.18 \nstep 988/1000: dist 0.18 loss 0.18 \nstep 989/1000: dist 0.18 loss 0.18 \nstep 990/1000: dist 0.18 loss 0.18 \nstep 991/1000: dist 0.18 loss 0.18 \nstep 992/1000: dist 0.18 loss 0.18 \nstep 993/1000: dist 0.18 loss 0.18 \nstep 994/1000: dist 0.18 loss 0.18 \nstep 995/1000: dist 0.18 loss 0.18 \nstep 996/1000: dist 0.18 loss 0.18 \nstep 997/1000: dist 0.18 loss 0.18 \nstep 998/1000: dist 0.18 loss 0.18 \nstep 999/1000: dist 0.18 loss 0.18 \nstep 1000/1000: dist 0.18 loss 0.18 \nElapsed: 735.9 s\n" ] ], [ [ "# Convert Target to a GAN\n\nNext, we convert the target to a GAN latent vector. This process will also take several minutes.", "_____no_output_____" ] ], [ [ "cmd = f\"python /content/stylegan2-ada-pytorch/projector.py --save-video 0 --num-steps 1000 --outdir=out_target --target=cropped_target.png --network={NETWORK}\"\n!{cmd}", "Loading networks from \"https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl\"...\nComputing W midpoint and stddev using 10000 samples...\nSetting up PyTorch plugin \"bias_act_plugin\"... Done.\nSetting up PyTorch plugin \"upfirdn2d_plugin\"... Done.\nstep 1/1000: dist 0.55 loss 24569.43\nstep 2/1000: dist 0.59 loss 27642.82\nstep 3/1000: dist 0.53 loss 27167.56\nstep 4/1000: dist 0.50 loss 26253.62\nstep 5/1000: dist 0.56 loss 24958.53\nstep 6/1000: dist 0.53 loss 23356.09\nstep 7/1000: dist 0.51 loss 21513.68\nstep 8/1000: dist 0.55 loss 19486.07\nstep 9/1000: dist 0.56 loss 17342.21\nstep 10/1000: dist 0.43 loss 15145.35\nstep 11/1000: dist 0.48 loss 12946.05\nstep 12/1000: dist 0.48 loss 10817.83\nstep 13/1000: dist 0.41 loss 8803.58\nstep 14/1000: dist 0.46 loss 6948.92\nstep 15/1000: dist 0.37 loss 5315.30\nstep 16/1000: dist 0.43 loss 3971.64\nstep 17/1000: dist 0.38 loss 2944.70\nstep 18/1000: dist 0.43 loss 2212.37\nstep 19/1000: dist 0.30 loss 1761.54\nstep 20/1000: dist 0.30 loss 1569.29\nstep 21/1000: dist 0.33 loss 1600.37\nstep 22/1000: dist 0.33 loss 1789.42\nstep 23/1000: dist 0.31 loss 2053.24\nstep 24/1000: dist 0.30 loss 2325.63\nstep 25/1000: dist 0.33 loss 2539.76\nstep 26/1000: dist 0.28 loss 2634.56\nstep 27/1000: dist 0.30 loss 2600.04\nstep 28/1000: dist 0.28 loss 2475.83\nstep 29/1000: dist 0.28 loss 2313.24\nstep 30/1000: dist 0.26 loss 2118.77\nstep 31/1000: dist 0.27 loss 1879.70\nstep 32/1000: dist 0.31 loss 1625.11\nstep 33/1000: dist 0.29 loss 1387.50\nstep 34/1000: dist 0.29 loss 1185.39\nstep 35/1000: dist 0.26 loss 1027.74\nstep 36/1000: dist 0.28 loss 909.05\nstep 37/1000: dist 0.24 loss 828.90\nstep 38/1000: dist 0.27 loss 808.24\nstep 39/1000: dist 0.26 loss 816.58\nstep 40/1000: dist 0.23 loss 828.90\nstep 41/1000: dist 0.24 loss 824.36\nstep 42/1000: dist 0.27 loss 764.10\nstep 43/1000: dist 0.24 loss 660.27\nstep 44/1000: dist 0.25 loss 545.92\nstep 45/1000: dist 0.25 loss 414.40\nstep 46/1000: dist 0.23 loss 316.63\nstep 47/1000: dist 0.23 loss 284.52\nstep 48/1000: dist 0.22 loss 248.88\nstep 49/1000: dist 0.25 loss 281.35\nstep 50/1000: dist 0.23 loss 319.21\nstep 51/1000: dist 0.23 loss 386.35\nstep 52/1000: dist 0.25 loss 403.70\nstep 53/1000: dist 0.22 loss 392.97\nstep 54/1000: dist 0.24 loss 351.73\nstep 55/1000: dist 0.25 loss 276.54\nstep 56/1000: dist 0.25 loss 198.30\nstep 57/1000: dist 0.22 loss 126.93\nstep 58/1000: dist 0.22 loss 80.36\nstep 59/1000: dist 0.21 loss 51.89\nstep 60/1000: dist 0.21 loss 55.98\nstep 61/1000: dist 0.22 loss 60.16\nstep 62/1000: dist 0.22 loss 83.41\nstep 63/1000: dist 0.21 loss 110.58\nstep 64/1000: dist 0.21 loss 128.36\nstep 65/1000: dist 0.22 loss 125.53\nstep 66/1000: dist 0.21 loss 120.70\nstep 67/1000: dist 0.22 loss 96.44\nstep 68/1000: dist 0.21 loss 73.06\nstep 69/1000: dist 0.21 loss 48.13\nstep 70/1000: dist 0.21 loss 28.11\nstep 71/1000: dist 0.21 loss 16.93\nstep 72/1000: dist 0.21 loss 17.87\nstep 73/1000: dist 0.20 loss 17.53\nstep 74/1000: dist 0.21 loss 27.00\nstep 75/1000: dist 0.19 loss 33.26\nstep 76/1000: dist 0.22 loss 34.77\nstep 77/1000: dist 0.22 loss 33.92\nstep 78/1000: dist 0.19 loss 32.56\nstep 79/1000: dist 0.21 loss 26.51\nstep 80/1000: dist 0.19 loss 22.06\nstep 81/1000: dist 0.20 loss 16.45\nstep 82/1000: dist 0.22 loss 13.82\nstep 83/1000: dist 0.19 loss 15.12\nstep 84/1000: dist 0.22 loss 17.31\nstep 85/1000: dist 0.19 loss 15.14\nstep 86/1000: dist 0.20 loss 12.40\nstep 87/1000: dist 0.20 loss 11.58\nstep 88/1000: dist 0.20 loss 10.85\nstep 89/1000: dist 0.22 loss 9.29 \nstep 90/1000: dist 0.20 loss 8.13 \nstep 91/1000: dist 0.21 loss 7.89 \nstep 92/1000: dist 0.18 loss 7.26 \nstep 93/1000: dist 0.20 loss 7.65 \nstep 94/1000: dist 0.18 loss 9.41 \nstep 95/1000: dist 0.19 loss 11.92\nstep 96/1000: dist 0.18 loss 12.47\nstep 97/1000: dist 0.18 loss 11.17\nstep 98/1000: dist 0.21 loss 8.52 \nstep 99/1000: dist 0.18 loss 6.70 \nstep 100/1000: dist 0.19 loss 5.75 \nstep 101/1000: dist 0.18 loss 5.43 \nstep 102/1000: dist 0.18 loss 4.70 \nstep 103/1000: dist 0.20 loss 4.34 \nstep 104/1000: dist 0.18 loss 5.94 \nstep 105/1000: dist 0.19 loss 9.35 \nstep 106/1000: dist 0.19 loss 12.18\nstep 107/1000: dist 0.19 loss 11.78\nstep 108/1000: dist 0.20 loss 8.73 \nstep 109/1000: dist 0.19 loss 5.70 \nstep 110/1000: dist 0.19 loss 5.26 \nstep 111/1000: dist 0.20 loss 6.63 \nstep 112/1000: dist 0.20 loss 7.51 \nstep 113/1000: dist 0.18 loss 6.69 \nstep 114/1000: dist 0.18 loss 6.20 \nstep 115/1000: dist 0.19 loss 8.08 \nstep 116/1000: dist 0.18 loss 10.39\nstep 117/1000: dist 0.19 loss 9.92 \nstep 118/1000: dist 0.17 loss 6.65 \nstep 119/1000: dist 0.20 loss 4.21 \nstep 120/1000: dist 0.18 loss 4.17 \nstep 121/1000: dist 0.19 loss 5.02 \nstep 122/1000: dist 0.17 loss 5.28 \nstep 123/1000: dist 0.17 loss 5.63 \nstep 124/1000: dist 0.18 loss 7.52 \nstep 125/1000: dist 0.21 loss 10.43\nstep 126/1000: dist 0.17 loss 11.60\nstep 127/1000: dist 0.22 loss 8.84 \nstep 128/1000: dist 0.20 loss 4.10 \nstep 129/1000: dist 0.19 loss 2.21 \nstep 130/1000: dist 0.19 loss 3.88 \nstep 131/1000: dist 0.19 loss 5.37 \nstep 132/1000: dist 0.18 loss 4.36 \nstep 133/1000: dist 0.18 loss 2.98 \nstep 134/1000: dist 0.19 loss 3.43 \nstep 135/1000: dist 0.17 loss 4.23 \nstep 136/1000: dist 0.18 loss 3.74 \nstep 137/1000: dist 0.17 loss 3.62 \nstep 138/1000: dist 0.19 loss 6.17 \nstep 139/1000: dist 0.17 loss 10.56\nstep 140/1000: dist 0.18 loss 14.11\nstep 141/1000: dist 0.18 loss 13.07\nstep 142/1000: dist 0.18 loss 6.69 \nstep 143/1000: dist 0.19 loss 3.15 \nstep 144/1000: dist 0.19 loss 7.17 \nstep 145/1000: dist 0.22 loss 10.86\nstep 146/1000: dist 0.17 loss 8.68 \nstep 147/1000: dist 0.17 loss 8.92 \nstep 148/1000: dist 0.18 loss 14.72\nstep 149/1000: dist 0.17 loss 15.07\nstep 150/1000: dist 0.18 loss 8.11 \nstep 151/1000: dist 0.17 loss 6.89 \nstep 152/1000: dist 0.17 loss 12.58\nstep 153/1000: dist 0.18 loss 15.14\nstep 154/1000: dist 0.17 loss 14.59\nstep 155/1000: dist 0.16 loss 16.59\nstep 156/1000: dist 0.18 loss 20.48\nstep 157/1000: dist 0.16 loss 20.98\nstep 158/1000: dist 0.17 loss 13.63\nstep 159/1000: dist 0.18 loss 5.66 \nstep 160/1000: dist 0.17 loss 9.10 \nstep 161/1000: dist 0.17 loss 17.11\nstep 162/1000: dist 0.18 loss 15.17\nstep 163/1000: dist 0.17 loss 10.86\nstep 164/1000: dist 0.17 loss 15.81\nstep 165/1000: dist 0.18 loss 17.92\nstep 166/1000: dist 0.18 loss 10.53\nstep 167/1000: dist 0.17 loss 7.81 \nstep 168/1000: dist 0.17 loss 10.69\nstep 169/1000: dist 0.18 loss 8.86 \nstep 170/1000: dist 0.16 loss 5.30 \nstep 171/1000: dist 0.16 loss 4.86 \nstep 172/1000: dist 0.17 loss 5.41 \nstep 173/1000: dist 0.18 loss 7.24 \nstep 174/1000: dist 0.18 loss 8.55 \nstep 175/1000: dist 0.16 loss 6.34 \nstep 176/1000: dist 0.19 loss 6.69 \nstep 177/1000: dist 0.16 loss 12.38\nstep 178/1000: dist 0.15 loss 15.53\nstep 179/1000: dist 0.16 loss 12.84\nstep 180/1000: dist 0.16 loss 9.40 \nstep 181/1000: dist 0.17 loss 9.07 \nstep 182/1000: dist 0.16 loss 12.29\nstep 183/1000: dist 0.16 loss 15.74\nstep 184/1000: dist 0.18 loss 14.12\nstep 185/1000: dist 0.17 loss 9.99 \nstep 186/1000: dist 0.16 loss 11.96\nstep 187/1000: dist 0.16 loss 17.86\nstep 188/1000: dist 0.15 loss 17.83\nstep 189/1000: dist 0.16 loss 11.73\nstep 190/1000: dist 0.15 loss 8.67 \nstep 191/1000: dist 0.17 loss 11.36\nstep 192/1000: dist 0.18 loss 13.68\nstep 193/1000: dist 0.18 loss 12.41\nstep 194/1000: dist 0.16 loss 11.61\nstep 195/1000: dist 0.16 loss 15.26\nstep 196/1000: dist 0.16 loss 21.39\nstep 197/1000: dist 0.16 loss 25.69\nstep 198/1000: dist 0.18 loss 24.97\nstep 199/1000: dist 0.16 loss 16.93\nstep 200/1000: dist 0.15 loss 7.62 \nstep 201/1000: dist 0.17 loss 6.36 \nstep 202/1000: dist 0.17 loss 11.48\nstep 203/1000: dist 0.16 loss 12.83\nstep 204/1000: dist 0.16 loss 7.99 \nstep 205/1000: dist 0.18 loss 5.61 \nstep 206/1000: dist 0.16 loss 8.06 \nstep 207/1000: dist 0.15 loss 9.08 \nstep 208/1000: dist 0.17 loss 7.99 \nstep 209/1000: dist 0.17 loss 8.99 \nstep 210/1000: dist 0.15 loss 10.22\nstep 211/1000: dist 0.15 loss 8.12 \nstep 212/1000: dist 0.15 loss 5.60 \nstep 213/1000: dist 0.17 loss 5.12 \nstep 214/1000: dist 0.15 loss 3.91 \nstep 215/1000: dist 0.16 loss 2.19 \nstep 216/1000: dist 0.16 loss 3.38 \nstep 217/1000: dist 0.15 loss 5.53 \nstep 218/1000: dist 0.15 loss 4.37 \nstep 219/1000: dist 0.16 loss 1.71 \nstep 220/1000: dist 0.15 loss 1.38 \nstep 221/1000: dist 0.15 loss 2.54 \nstep 222/1000: dist 0.16 loss 2.86 \nstep 223/1000: dist 0.15 loss 2.55 \nstep 224/1000: dist 0.15 loss 2.17 \nstep 225/1000: dist 0.15 loss 1.71 \nstep 226/1000: dist 0.16 loss 1.78 \nstep 227/1000: dist 0.15 loss 2.59 \nstep 228/1000: dist 0.15 loss 3.30 \nstep 229/1000: dist 0.16 loss 3.73 \nstep 230/1000: dist 0.15 loss 4.50 \nstep 231/1000: dist 0.16 loss 5.35 \nstep 232/1000: dist 0.15 loss 5.33 \nstep 233/1000: dist 0.15 loss 4.37 \nstep 234/1000: dist 0.15 loss 3.00 \nstep 235/1000: dist 0.16 loss 1.67 \nstep 236/1000: dist 0.15 loss 0.93 \nstep 237/1000: dist 0.15 loss 1.45 \nstep 238/1000: dist 0.15 loss 2.99 \nstep 239/1000: dist 0.14 loss 4.60 \nstep 240/1000: dist 0.15 loss 6.04 \nstep 241/1000: dist 0.15 loss 8.39 \nstep 242/1000: dist 0.15 loss 12.39\nstep 243/1000: dist 0.17 loss 15.72\nstep 244/1000: dist 0.16 loss 13.30\nstep 245/1000: dist 0.15 loss 5.80 \nstep 246/1000: dist 0.15 loss 2.59 \nstep 247/1000: dist 0.14 loss 7.21 \nstep 248/1000: dist 0.14 loss 11.86\nstep 249/1000: dist 0.15 loss 11.24\nstep 250/1000: dist 0.15 loss 12.73\nstep 251/1000: dist 0.15 loss 22.06\nstep 252/1000: dist 0.15 loss 29.17\nstep 253/1000: dist 0.16 loss 21.62\nstep 254/1000: dist 0.15 loss 7.14 \nstep 255/1000: dist 0.15 loss 3.01 \nstep 256/1000: dist 0.15 loss 8.73 \nstep 257/1000: dist 0.14 loss 11.57\nstep 258/1000: dist 0.15 loss 8.01 \nstep 259/1000: dist 0.15 loss 5.17 \nstep 260/1000: dist 0.15 loss 5.90 \nstep 261/1000: dist 0.14 loss 5.84 \nstep 262/1000: dist 0.14 loss 4.11 \nstep 263/1000: dist 0.15 loss 4.71 \nstep 264/1000: dist 0.14 loss 7.77 \nstep 265/1000: dist 0.15 loss 10.12\nstep 266/1000: dist 0.16 loss 14.50\nstep 267/1000: dist 0.14 loss 24.71\nstep 268/1000: dist 0.14 loss 31.82\nstep 269/1000: dist 0.15 loss 23.23\nstep 270/1000: dist 0.15 loss 14.74\nstep 271/1000: dist 0.15 loss 23.90\nstep 272/1000: dist 0.14 loss 29.04\nstep 273/1000: dist 0.14 loss 12.52\nstep 274/1000: dist 0.14 loss 1.79 \nstep 275/1000: dist 0.15 loss 13.45\nstep 276/1000: dist 0.14 loss 18.36\nstep 277/1000: dist 0.15 loss 8.35 \nstep 278/1000: dist 0.14 loss 9.47 \nstep 279/1000: dist 0.15 loss 19.60\nstep 280/1000: dist 0.14 loss 22.11\nstep 281/1000: dist 0.15 loss 20.92\nstep 282/1000: dist 0.13 loss 15.48\nstep 283/1000: dist 0.15 loss 5.94 \nstep 284/1000: dist 0.14 loss 5.92 \nstep 285/1000: dist 0.14 loss 11.50\nstep 286/1000: dist 0.14 loss 10.44\nstep 287/1000: dist 0.15 loss 6.53 \nstep 288/1000: dist 0.14 loss 5.11 \nstep 289/1000: dist 0.14 loss 6.99 \nstep 290/1000: dist 0.14 loss 10.44\nstep 291/1000: dist 0.14 loss 9.52 \nstep 292/1000: dist 0.14 loss 9.63 \nstep 293/1000: dist 0.15 loss 17.67\nstep 294/1000: dist 0.14 loss 22.30\nstep 295/1000: dist 0.14 loss 18.10\nstep 296/1000: dist 0.15 loss 13.05\nstep 297/1000: dist 0.14 loss 7.73 \nstep 298/1000: dist 0.15 loss 2.60 \nstep 299/1000: dist 0.14 loss 4.98 \nstep 300/1000: dist 0.15 loss 11.35\nstep 301/1000: dist 0.15 loss 11.03\nstep 302/1000: dist 0.13 loss 5.59 \nstep 303/1000: dist 0.15 loss 4.29 \nstep 304/1000: dist 0.15 loss 8.40 \nstep 305/1000: dist 0.15 loss 11.08\nstep 306/1000: dist 0.15 loss 8.84 \nstep 307/1000: dist 0.14 loss 5.68 \nstep 308/1000: dist 0.14 loss 4.41 \nstep 309/1000: dist 0.15 loss 3.65 \nstep 310/1000: dist 0.15 loss 3.24 \nstep 311/1000: dist 0.15 loss 3.76 \nstep 312/1000: dist 0.16 loss 4.91 \nstep 313/1000: dist 0.14 loss 7.30 \nstep 314/1000: dist 0.14 loss 11.59\nstep 315/1000: dist 0.14 loss 18.09\nstep 316/1000: dist 0.15 loss 29.08\nstep 317/1000: dist 0.14 loss 43.69\nstep 318/1000: dist 0.15 loss 49.68\nstep 319/1000: dist 0.16 loss 37.63\nstep 320/1000: dist 0.14 loss 23.03\nstep 321/1000: dist 0.14 loss 23.50\nstep 322/1000: dist 0.13 loss 26.49\nstep 323/1000: dist 0.15 loss 15.28\nstep 324/1000: dist 0.15 loss 4.18 \nstep 325/1000: dist 0.15 loss 12.70\nstep 326/1000: dist 0.15 loss 22.73\nstep 327/1000: dist 0.14 loss 12.47\nstep 328/1000: dist 0.14 loss 0.98 \nstep 329/1000: dist 0.14 loss 7.26 \nstep 330/1000: dist 0.14 loss 13.02\nstep 331/1000: dist 0.15 loss 6.69 \nstep 332/1000: dist 0.15 loss 3.67 \nstep 333/1000: dist 0.14 loss 6.63 \nstep 334/1000: dist 0.14 loss 5.18 \nstep 335/1000: dist 0.14 loss 3.53 \nstep 336/1000: dist 0.15 loss 5.64 \nstep 337/1000: dist 0.13 loss 4.35 \nstep 338/1000: dist 0.13 loss 1.72 \nstep 339/1000: dist 0.13 loss 3.98 \nstep 340/1000: dist 0.14 loss 5.96 \nstep 341/1000: dist 0.15 loss 5.34 \nstep 342/1000: dist 0.14 loss 8.20 \nstep 343/1000: dist 0.14 loss 14.20\nstep 344/1000: dist 0.13 loss 19.26\nstep 345/1000: dist 0.13 loss 21.64\nstep 346/1000: dist 0.13 loss 16.82\nstep 347/1000: dist 0.16 loss 8.17 \nstep 348/1000: dist 0.14 loss 9.32 \nstep 349/1000: dist 0.14 loss 19.43\nstep 350/1000: dist 0.13 loss 22.30\nstep 351/1000: dist 0.14 loss 16.38\nstep 352/1000: dist 0.14 loss 17.08\nstep 353/1000: dist 0.15 loss 27.26\nstep 354/1000: dist 0.13 loss 33.80\nstep 355/1000: dist 0.13 loss 30.23\nstep 356/1000: dist 0.13 loss 20.21\nstep 357/1000: dist 0.14 loss 9.79 \nstep 358/1000: dist 0.13 loss 6.17 \nstep 359/1000: dist 0.13 loss 11.63\nstep 360/1000: dist 0.13 loss 15.69\nstep 361/1000: dist 0.13 loss 9.84 \nstep 362/1000: dist 0.12 loss 4.20 \nstep 363/1000: dist 0.13 loss 7.42 \nstep 364/1000: dist 0.13 loss 10.17\nstep 365/1000: dist 0.14 loss 7.11 \nstep 366/1000: dist 0.13 loss 7.16 \nstep 367/1000: dist 0.13 loss 12.78\nstep 368/1000: dist 0.13 loss 16.70\nstep 369/1000: dist 0.13 loss 17.82\nstep 370/1000: dist 0.13 loss 17.50\nstep 371/1000: dist 0.13 loss 12.72\nstep 372/1000: dist 0.13 loss 7.44 \nstep 373/1000: dist 0.13 loss 10.47\nstep 374/1000: dist 0.13 loss 19.69\nstep 375/1000: dist 0.13 loss 25.22\nstep 376/1000: dist 0.13 loss 24.43\nstep 377/1000: dist 0.14 loss 21.74\nstep 378/1000: dist 0.13 loss 20.66\nstep 379/1000: dist 0.12 loss 19.86\nstep 380/1000: dist 0.13 loss 17.03\nstep 381/1000: dist 0.13 loss 14.10\nstep 382/1000: dist 0.13 loss 14.54\nstep 383/1000: dist 0.13 loss 18.89\nstep 384/1000: dist 0.13 loss 24.17\nstep 385/1000: dist 0.13 loss 23.90\nstep 386/1000: dist 0.13 loss 14.64\nstep 387/1000: dist 0.12 loss 5.09 \nstep 388/1000: dist 0.12 loss 5.66 \nstep 389/1000: dist 0.12 loss 11.82\nstep 390/1000: dist 0.12 loss 11.92\nstep 391/1000: dist 0.13 loss 5.94 \nstep 392/1000: dist 0.12 loss 3.45 \nstep 393/1000: dist 0.13 loss 6.14 \nstep 394/1000: dist 0.12 loss 7.06 \nstep 395/1000: dist 0.13 loss 4.58 \nstep 396/1000: dist 0.13 loss 3.03 \nstep 397/1000: dist 0.13 loss 3.71 \nstep 398/1000: dist 0.12 loss 4.10 \nstep 399/1000: dist 0.12 loss 3.39 \nstep 400/1000: dist 0.13 loss 2.71 \nstep 401/1000: dist 0.13 loss 2.55 \nstep 402/1000: dist 0.12 loss 2.81 \nstep 403/1000: dist 0.12 loss 3.09 \nstep 404/1000: dist 0.12 loss 3.02 \nstep 405/1000: dist 0.13 loss 3.17 \nstep 406/1000: dist 0.13 loss 4.25 \nstep 407/1000: dist 0.13 loss 5.69 \nstep 408/1000: dist 0.12 loss 6.62 \nstep 409/1000: dist 0.13 loss 7.33 \nstep 410/1000: dist 0.12 loss 7.77 \nstep 411/1000: dist 0.13 loss 6.68 \nstep 412/1000: dist 0.13 loss 3.99 \nstep 413/1000: dist 0.12 loss 2.09 \nstep 414/1000: dist 0.13 loss 2.85 \nstep 415/1000: dist 0.13 loss 5.45 \nstep 416/1000: dist 0.12 loss 8.43 \nstep 417/1000: dist 0.13 loss 11.01\nstep 418/1000: dist 0.13 loss 12.25\nstep 419/1000: dist 0.12 loss 10.47\nstep 420/1000: dist 0.12 loss 6.04 \nstep 421/1000: dist 0.13 loss 2.20 \nstep 422/1000: dist 0.13 loss 1.94 \nstep 423/1000: dist 0.13 loss 4.15 \nstep 424/1000: dist 0.12 loss 5.41 \nstep 425/1000: dist 0.12 loss 4.05 \nstep 426/1000: dist 0.12 loss 1.63 \nstep 427/1000: dist 0.12 loss 1.03 \nstep 428/1000: dist 0.12 loss 2.44 \nstep 429/1000: dist 0.12 loss 3.34 \nstep 430/1000: dist 0.12 loss 2.18 \nstep 431/1000: dist 0.12 loss 0.60 \nstep 432/1000: dist 0.12 loss 0.76 \nstep 433/1000: dist 0.12 loss 2.01 \nstep 434/1000: dist 0.12 loss 2.17 \nstep 435/1000: dist 0.12 loss 1.03 \nstep 436/1000: dist 0.12 loss 0.43 \nstep 437/1000: dist 0.12 loss 1.21 \nstep 438/1000: dist 0.12 loss 2.15 \nstep 439/1000: dist 0.12 loss 2.25 \nstep 440/1000: dist 0.12 loss 2.40 \nstep 441/1000: dist 0.12 loss 3.71 \nstep 442/1000: dist 0.12 loss 5.84 \nstep 443/1000: dist 0.12 loss 7.56 \nstep 444/1000: dist 0.13 loss 7.81 \nstep 445/1000: dist 0.12 loss 6.20 \nstep 446/1000: dist 0.12 loss 3.27 \nstep 447/1000: dist 0.12 loss 0.87 \nstep 448/1000: dist 0.12 loss 0.66 \nstep 449/1000: dist 0.12 loss 2.32 \nstep 450/1000: dist 0.12 loss 3.77 \nstep 451/1000: dist 0.12 loss 3.27 \nstep 452/1000: dist 0.12 loss 1.42 \nstep 453/1000: dist 0.12 loss 0.49 \nstep 454/1000: dist 0.12 loss 1.54 \nstep 455/1000: dist 0.12 loss 3.44 \nstep 456/1000: dist 0.12 loss 4.88 \nstep 457/1000: dist 0.12 loss 6.63 \nstep 458/1000: dist 0.11 loss 11.07\nstep 459/1000: dist 0.12 loss 19.15\nstep 460/1000: dist 0.12 loss 26.65\nstep 461/1000: dist 0.11 loss 25.10\nstep 462/1000: dist 0.11 loss 14.39\nstep 463/1000: dist 0.12 loss 10.13\nstep 464/1000: dist 0.12 loss 19.10\nstep 465/1000: dist 0.11 loss 25.19\nstep 466/1000: dist 0.12 loss 14.82\nstep 467/1000: dist 0.12 loss 2.51 \nstep 468/1000: dist 0.11 loss 4.58 \nstep 469/1000: dist 0.11 loss 10.88\nstep 470/1000: dist 0.12 loss 9.43 \nstep 471/1000: dist 0.12 loss 7.30 \nstep 472/1000: dist 0.12 loss 8.99 \nstep 473/1000: dist 0.12 loss 10.00\nstep 474/1000: dist 0.11 loss 14.16\nstep 475/1000: dist 0.11 loss 23.90\nstep 476/1000: dist 0.12 loss 28.68\nstep 477/1000: dist 0.12 loss 27.07\nstep 478/1000: dist 0.12 loss 28.17\nstep 479/1000: dist 0.11 loss 30.84\nstep 480/1000: dist 0.11 loss 24.05\nstep 481/1000: dist 0.11 loss 13.28\nstep 482/1000: dist 0.12 loss 10.98\nstep 483/1000: dist 0.11 loss 15.74\nstep 484/1000: dist 0.11 loss 18.55\nstep 485/1000: dist 0.12 loss 16.06\nstep 486/1000: dist 0.11 loss 16.08\nstep 487/1000: dist 0.11 loss 18.71\nstep 488/1000: dist 0.11 loss 13.35\nstep 489/1000: dist 0.11 loss 5.00 \nstep 490/1000: dist 0.11 loss 6.31 \nstep 491/1000: dist 0.11 loss 10.45\nstep 492/1000: dist 0.11 loss 9.42 \nstep 493/1000: dist 0.12 loss 9.97 \nstep 494/1000: dist 0.11 loss 12.56\nstep 495/1000: dist 0.12 loss 14.97\nstep 496/1000: dist 0.12 loss 23.75\nstep 497/1000: dist 0.11 loss 32.78\nstep 498/1000: dist 0.11 loss 26.02\nstep 499/1000: dist 0.11 loss 13.56\nstep 500/1000: dist 0.11 loss 15.53\nstep 501/1000: dist 0.11 loss 29.08\nstep 502/1000: dist 0.11 loss 37.59\nstep 503/1000: dist 0.11 loss 27.47\nstep 504/1000: dist 0.12 loss 7.95 \nstep 505/1000: dist 0.11 loss 4.64 \nstep 506/1000: dist 0.11 loss 16.24\nstep 507/1000: dist 0.11 loss 16.96\nstep 508/1000: dist 0.11 loss 6.14 \nstep 509/1000: dist 0.11 loss 4.52 \nstep 510/1000: dist 0.11 loss 10.30\nstep 511/1000: dist 0.11 loss 8.69 \nstep 512/1000: dist 0.11 loss 3.63 \nstep 513/1000: dist 0.11 loss 4.42 \nstep 514/1000: dist 0.11 loss 6.62 \nstep 515/1000: dist 0.11 loss 4.60 \nstep 516/1000: dist 0.11 loss 2.68 \nstep 517/1000: dist 0.11 loss 4.15 \nstep 518/1000: dist 0.11 loss 4.77 \nstep 519/1000: dist 0.11 loss 3.77 \nstep 520/1000: dist 0.11 loss 5.27 \nstep 521/1000: dist 0.11 loss 8.42 \nstep 522/1000: dist 0.11 loss 11.47\nstep 523/1000: dist 0.11 loss 16.49\nstep 524/1000: dist 0.11 loss 20.74\nstep 525/1000: dist 0.11 loss 17.14\nstep 526/1000: dist 0.11 loss 7.68 \nstep 527/1000: dist 0.11 loss 1.88 \nstep 528/1000: dist 0.11 loss 3.78 \nstep 529/1000: dist 0.11 loss 8.65 \nstep 530/1000: dist 0.11 loss 8.85 \nstep 531/1000: dist 0.11 loss 3.35 \nstep 532/1000: dist 0.11 loss 0.86 \nstep 533/1000: dist 0.11 loss 4.47 \nstep 534/1000: dist 0.11 loss 5.94 \nstep 535/1000: dist 0.11 loss 2.29 \nstep 536/1000: dist 0.11 loss 0.71 \nstep 537/1000: dist 0.11 loss 3.12 \nstep 538/1000: dist 0.11 loss 3.73 \nstep 539/1000: dist 0.11 loss 1.53 \nstep 540/1000: dist 0.11 loss 0.92 \nstep 541/1000: dist 0.11 loss 2.47 \nstep 542/1000: dist 0.11 loss 2.96 \nstep 543/1000: dist 0.11 loss 2.09 \nstep 544/1000: dist 0.11 loss 2.67 \nstep 545/1000: dist 0.11 loss 5.11 \nstep 546/1000: dist 0.11 loss 7.36 \nstep 547/1000: dist 0.11 loss 9.83 \nstep 548/1000: dist 0.11 loss 14.53\nstep 549/1000: dist 0.11 loss 19.85\nstep 550/1000: dist 0.11 loss 22.30\nstep 551/1000: dist 0.11 loss 21.43\nstep 552/1000: dist 0.11 loss 18.03\nstep 553/1000: dist 0.11 loss 11.67\nstep 554/1000: dist 0.11 loss 6.03 \nstep 555/1000: dist 0.11 loss 6.90 \nstep 556/1000: dist 0.11 loss 12.34\nstep 557/1000: dist 0.11 loss 15.60\nstep 558/1000: dist 0.11 loss 16.42\nstep 559/1000: dist 0.11 loss 20.72\nstep 560/1000: dist 0.11 loss 27.72\nstep 561/1000: dist 0.11 loss 24.64\nstep 562/1000: dist 0.11 loss 9.79 \nstep 563/1000: dist 0.11 loss 1.05 \nstep 564/1000: dist 0.11 loss 8.35 \nstep 565/1000: dist 0.11 loss 15.72\nstep 566/1000: dist 0.11 loss 8.95 \nstep 567/1000: dist 0.11 loss 1.13 \nstep 568/1000: dist 0.11 loss 6.10 \nstep 569/1000: dist 0.11 loss 11.90\nstep 570/1000: dist 0.11 loss 8.10 \nstep 571/1000: dist 0.11 loss 6.92 \nstep 572/1000: dist 0.11 loss 15.39\nstep 573/1000: dist 0.11 loss 20.50\nstep 574/1000: dist 0.11 loss 17.41\nstep 575/1000: dist 0.11 loss 13.19\nstep 576/1000: dist 0.11 loss 8.27 \nstep 577/1000: dist 0.11 loss 2.73 \nstep 578/1000: dist 0.11 loss 4.41 \nstep 579/1000: dist 0.11 loss 10.99\nstep 580/1000: dist 0.11 loss 11.06\nstep 581/1000: dist 0.10 loss 7.47 \nstep 582/1000: dist 0.11 loss 11.02\nstep 583/1000: dist 0.11 loss 20.32\nstep 584/1000: dist 0.11 loss 28.52\nstep 585/1000: dist 0.10 loss 34.54\nstep 586/1000: dist 0.11 loss 38.93\nstep 587/1000: dist 0.10 loss 38.64\nstep 588/1000: dist 0.10 loss 29.75\nstep 589/1000: dist 0.10 loss 19.46\nstep 590/1000: dist 0.10 loss 20.81\nstep 591/1000: dist 0.10 loss 26.28\nstep 592/1000: dist 0.10 loss 18.74\nstep 593/1000: dist 0.10 loss 8.18 \nstep 594/1000: dist 0.11 loss 17.73\nstep 595/1000: dist 0.10 loss 35.10\nstep 596/1000: dist 0.10 loss 36.99\nstep 597/1000: dist 0.10 loss 35.22\nstep 598/1000: dist 0.10 loss 40.55\nstep 599/1000: dist 0.10 loss 33.84\nstep 600/1000: dist 0.10 loss 16.79\nstep 601/1000: dist 0.10 loss 15.48\nstep 602/1000: dist 0.10 loss 28.57\nstep 603/1000: dist 0.10 loss 39.72\nstep 604/1000: dist 0.10 loss 47.90\nstep 605/1000: dist 0.10 loss 56.75\nstep 606/1000: dist 0.10 loss 64.10\nstep 607/1000: dist 0.10 loss 57.93\nstep 608/1000: dist 0.10 loss 30.16\nstep 609/1000: dist 0.10 loss 11.71\nstep 610/1000: dist 0.10 loss 25.67\nstep 611/1000: dist 0.10 loss 38.57\nstep 612/1000: dist 0.10 loss 28.65\nstep 613/1000: dist 0.11 loss 20.34\nstep 614/1000: dist 0.10 loss 22.24\nstep 615/1000: dist 0.10 loss 19.86\nstep 616/1000: dist 0.10 loss 13.02\nstep 617/1000: dist 0.11 loss 10.28\nstep 618/1000: dist 0.10 loss 10.43\nstep 619/1000: dist 0.10 loss 10.85\nstep 620/1000: dist 0.10 loss 12.52\nstep 621/1000: dist 0.10 loss 11.57\nstep 622/1000: dist 0.10 loss 6.42 \nstep 623/1000: dist 0.10 loss 6.08 \nstep 624/1000: dist 0.10 loss 10.68\nstep 625/1000: dist 0.10 loss 10.47\nstep 626/1000: dist 0.10 loss 8.74 \nstep 627/1000: dist 0.10 loss 10.47\nstep 628/1000: dist 0.10 loss 9.76 \nstep 629/1000: dist 0.10 loss 7.94 \nstep 630/1000: dist 0.10 loss 8.48 \nstep 631/1000: dist 0.10 loss 5.79 \nstep 632/1000: dist 0.10 loss 1.74 \nstep 633/1000: dist 0.10 loss 2.39 \nstep 634/1000: dist 0.10 loss 3.39 \nstep 635/1000: dist 0.10 loss 2.62 \nstep 636/1000: dist 0.10 loss 3.78 \nstep 637/1000: dist 0.10 loss 4.35 \nstep 638/1000: dist 0.10 loss 2.22 \nstep 639/1000: dist 0.10 loss 1.15 \nstep 640/1000: dist 0.10 loss 1.63 \nstep 641/1000: dist 0.10 loss 1.54 \nstep 642/1000: dist 0.10 loss 1.47 \nstep 643/1000: dist 0.10 loss 1.72 \nstep 644/1000: dist 0.10 loss 1.63 \nstep 645/1000: dist 0.10 loss 1.34 \nstep 646/1000: dist 0.10 loss 0.91 \nstep 647/1000: dist 0.10 loss 0.53 \nstep 648/1000: dist 0.10 loss 0.68 \nstep 649/1000: dist 0.10 loss 0.97 \nstep 650/1000: dist 0.10 loss 1.00 \nstep 651/1000: dist 0.10 loss 0.87 \nstep 652/1000: dist 0.10 loss 0.56 \nstep 653/1000: dist 0.10 loss 0.32 \nstep 654/1000: dist 0.10 loss 0.43 \nstep 655/1000: dist 0.10 loss 0.56 \nstep 656/1000: dist 0.10 loss 0.59 \nstep 657/1000: dist 0.10 loss 0.74 \nstep 658/1000: dist 0.10 loss 0.84 \nstep 659/1000: dist 0.10 loss 1.03 \nstep 660/1000: dist 0.10 loss 1.93 \nstep 661/1000: dist 0.10 loss 3.78 \nstep 662/1000: dist 0.10 loss 6.66 \nstep 663/1000: dist 0.10 loss 10.00\nstep 664/1000: dist 0.10 loss 11.16\nstep 665/1000: dist 0.10 loss 7.32 \nstep 666/1000: dist 0.10 loss 1.68 \nstep 667/1000: dist 0.10 loss 0.47 \nstep 668/1000: dist 0.10 loss 3.76 \nstep 669/1000: dist 0.10 loss 5.75 \nstep 670/1000: dist 0.10 loss 3.27 \nstep 671/1000: dist 0.10 loss 0.37 \nstep 672/1000: dist 0.10 loss 1.28 \nstep 673/1000: dist 0.10 loss 3.44 \nstep 674/1000: dist 0.10 loss 2.68 \nstep 675/1000: dist 0.10 loss 0.53 \nstep 676/1000: dist 0.10 loss 0.82 \nstep 677/1000: dist 0.10 loss 2.59 \nstep 678/1000: dist 0.10 loss 2.68 \nstep 679/1000: dist 0.10 loss 2.03 \nstep 680/1000: dist 0.10 loss 3.72 \nstep 681/1000: dist 0.10 loss 7.87 \nstep 682/1000: dist 0.10 loss 13.37\nstep 683/1000: dist 0.10 loss 21.88\nstep 684/1000: dist 0.10 loss 33.94\nstep 685/1000: dist 0.10 loss 42.28\nstep 686/1000: dist 0.10 loss 34.51\nstep 687/1000: dist 0.10 loss 13.59\nstep 688/1000: dist 0.10 loss 1.02 \nstep 689/1000: dist 0.10 loss 8.35 \nstep 690/1000: dist 0.10 loss 19.48\nstep 691/1000: dist 0.10 loss 15.18\nstep 692/1000: dist 0.10 loss 2.78 \nstep 693/1000: dist 0.10 loss 2.45 \nstep 694/1000: dist 0.10 loss 10.93\nstep 695/1000: dist 0.10 loss 10.03\nstep 696/1000: dist 0.10 loss 1.74 \nstep 697/1000: dist 0.10 loss 1.95 \nstep 698/1000: dist 0.10 loss 7.51 \nstep 699/1000: dist 0.10 loss 5.47 \nstep 700/1000: dist 0.10 loss 0.64 \nstep 701/1000: dist 0.10 loss 2.49 \nstep 702/1000: dist 0.10 loss 5.01 \nstep 703/1000: dist 0.10 loss 2.35 \nstep 704/1000: dist 0.10 loss 0.70 \nstep 705/1000: dist 0.10 loss 2.57 \nstep 706/1000: dist 0.10 loss 2.70 \nstep 707/1000: dist 0.10 loss 1.07 \nstep 708/1000: dist 0.10 loss 1.15 \nstep 709/1000: dist 0.10 loss 1.76 \nstep 710/1000: dist 0.10 loss 1.30 \nstep 711/1000: dist 0.10 loss 0.98 \nstep 712/1000: dist 0.10 loss 1.00 \nstep 713/1000: dist 0.10 loss 0.87 \nstep 714/1000: dist 0.10 loss 0.97 \nstep 715/1000: dist 0.10 loss 0.88 \nstep 716/1000: dist 0.10 loss 0.45 \nstep 717/1000: dist 0.10 loss 0.60 \nstep 718/1000: dist 0.10 loss 0.91 \nstep 719/1000: dist 0.10 loss 0.45 \nstep 720/1000: dist 0.10 loss 0.21 \nstep 721/1000: dist 0.10 loss 0.66 \nstep 722/1000: dist 0.10 loss 0.63 \nstep 723/1000: dist 0.10 loss 0.16 \nstep 724/1000: dist 0.10 loss 0.32 \nstep 725/1000: dist 0.10 loss 0.63 \nstep 726/1000: dist 0.10 loss 0.42 \nstep 727/1000: dist 0.10 loss 0.34 \nstep 728/1000: dist 0.10 loss 0.75 \nstep 729/1000: dist 0.10 loss 1.13 \nstep 730/1000: dist 0.10 loss 1.63 \nstep 731/1000: dist 0.10 loss 2.93 \nstep 732/1000: dist 0.10 loss 5.29 \nstep 733/1000: dist 0.10 loss 9.06 \nstep 734/1000: dist 0.10 loss 14.29\nstep 735/1000: dist 0.10 loss 19.44\nstep 736/1000: dist 0.10 loss 19.63\nstep 737/1000: dist 0.10 loss 12.47\nstep 738/1000: dist 0.10 loss 3.28 \nstep 739/1000: dist 0.10 loss 1.90 \nstep 740/1000: dist 0.10 loss 8.45 \nstep 741/1000: dist 0.10 loss 13.39\nstep 742/1000: dist 0.10 loss 11.99\nstep 743/1000: dist 0.10 loss 11.61\nstep 744/1000: dist 0.10 loss 18.20\nstep 745/1000: dist 0.10 loss 23.20\nstep 746/1000: dist 0.10 loss 16.80\nstep 747/1000: dist 0.10 loss 5.67 \nstep 748/1000: dist 0.10 loss 3.25 \nstep 749/1000: dist 0.10 loss 9.02 \nstep 750/1000: dist 0.10 loss 13.24\nstep 751/1000: dist 0.10 loss 13.23\nstep 752/1000: dist 0.10 loss 13.51\nstep 753/1000: dist 0.10 loss 16.68\nstep 754/1000: dist 0.10 loss 19.92\nstep 755/1000: dist 0.10 loss 17.98\nstep 756/1000: dist 0.10 loss 9.72 \nstep 757/1000: dist 0.10 loss 2.33 \nstep 758/1000: dist 0.10 loss 2.75 \nstep 759/1000: dist 0.10 loss 7.27 \nstep 760/1000: dist 0.10 loss 8.23 \nstep 761/1000: dist 0.10 loss 5.29 \nstep 762/1000: dist 0.10 loss 2.81 \nstep 763/1000: dist 0.10 loss 2.34 \nstep 764/1000: dist 0.10 loss 3.18 \nstep 765/1000: dist 0.09 loss 4.22 \nstep 766/1000: dist 0.10 loss 3.30 \nstep 767/1000: dist 0.09 loss 1.03 \nstep 768/1000: dist 0.09 loss 1.14 \nstep 769/1000: dist 0.09 loss 3.05 \nstep 770/1000: dist 0.09 loss 2.47 \nstep 771/1000: dist 0.09 loss 0.36 \nstep 772/1000: dist 0.09 loss 0.80 \nstep 773/1000: dist 0.09 loss 2.21 \nstep 774/1000: dist 0.09 loss 1.35 \nstep 775/1000: dist 0.09 loss 0.17 \nstep 776/1000: dist 0.09 loss 0.88 \nstep 777/1000: dist 0.09 loss 1.40 \nstep 778/1000: dist 0.09 loss 0.61 \nstep 779/1000: dist 0.09 loss 0.30 \nstep 780/1000: dist 0.09 loss 0.78 \nstep 781/1000: dist 0.09 loss 0.76 \nstep 782/1000: dist 0.09 loss 0.38 \nstep 783/1000: dist 0.09 loss 0.39 \nstep 784/1000: dist 0.09 loss 0.52 \nstep 785/1000: dist 0.09 loss 0.45 \nstep 786/1000: dist 0.09 loss 0.32 \nstep 787/1000: dist 0.09 loss 0.29 \nstep 788/1000: dist 0.09 loss 0.35 \nstep 789/1000: dist 0.09 loss 0.34 \nstep 790/1000: dist 0.09 loss 0.20 \nstep 791/1000: dist 0.09 loss 0.21 \nstep 792/1000: dist 0.09 loss 0.31 \nstep 793/1000: dist 0.09 loss 0.21 \nstep 794/1000: dist 0.09 loss 0.13 \nstep 795/1000: dist 0.09 loss 0.24 \nstep 796/1000: dist 0.09 loss 0.22 \nstep 797/1000: dist 0.09 loss 0.11 \nstep 798/1000: dist 0.09 loss 0.18 \nstep 799/1000: dist 0.09 loss 0.20 \nstep 800/1000: dist 0.09 loss 0.10 \nstep 801/1000: dist 0.09 loss 0.13 \nstep 802/1000: dist 0.09 loss 0.18 \nstep 803/1000: dist 0.09 loss 0.11 \nstep 804/1000: dist 0.09 loss 0.11 \nstep 805/1000: dist 0.09 loss 0.16 \nstep 806/1000: dist 0.09 loss 0.11 \nstep 807/1000: dist 0.09 loss 0.10 \nstep 808/1000: dist 0.09 loss 0.13 \nstep 809/1000: dist 0.09 loss 0.11 \nstep 810/1000: dist 0.09 loss 0.10 \nstep 811/1000: dist 0.09 loss 0.12 \nstep 812/1000: dist 0.09 loss 0.10 \nstep 813/1000: dist 0.09 loss 0.10 \nstep 814/1000: dist 0.09 loss 0.11 \nstep 815/1000: dist 0.09 loss 0.10 \nstep 816/1000: dist 0.09 loss 0.10 \nstep 817/1000: dist 0.09 loss 0.10 \nstep 818/1000: dist 0.09 loss 0.10 \nstep 819/1000: dist 0.09 loss 0.10 \nstep 820/1000: dist 0.09 loss 0.10 \nstep 821/1000: dist 0.09 loss 0.10 \nstep 822/1000: dist 0.09 loss 0.10 \nstep 823/1000: dist 0.09 loss 0.10 \nstep 824/1000: dist 0.09 loss 0.10 \nstep 825/1000: dist 0.09 loss 0.10 \nstep 826/1000: dist 0.09 loss 0.10 \nstep 827/1000: dist 0.09 loss 0.09 \nstep 828/1000: dist 0.09 loss 0.09 \nstep 829/1000: dist 0.09 loss 0.10 \nstep 830/1000: dist 0.09 loss 0.09 \nstep 831/1000: dist 0.09 loss 0.09 \nstep 832/1000: dist 0.09 loss 0.09 \nstep 833/1000: dist 0.09 loss 0.09 \nstep 834/1000: dist 0.09 loss 0.09 \nstep 835/1000: dist 0.09 loss 0.09 \nstep 836/1000: dist 0.09 loss 0.09 \nstep 837/1000: dist 0.09 loss 0.09 \nstep 838/1000: dist 0.09 loss 0.09 \nstep 839/1000: dist 0.09 loss 0.09 \nstep 840/1000: dist 0.09 loss 0.09 \nstep 841/1000: dist 0.09 loss 0.09 \nstep 842/1000: dist 0.09 loss 0.09 \nstep 843/1000: dist 0.09 loss 0.09 \nstep 844/1000: dist 0.09 loss 0.09 \nstep 845/1000: dist 0.09 loss 0.09 \nstep 846/1000: dist 0.09 loss 0.09 \nstep 847/1000: dist 0.09 loss 0.09 \nstep 848/1000: dist 0.09 loss 0.09 \nstep 849/1000: dist 0.09 loss 0.09 \nstep 850/1000: dist 0.09 loss 0.09 \nstep 851/1000: dist 0.09 loss 0.09 \nstep 852/1000: dist 0.09 loss 0.09 \nstep 853/1000: dist 0.09 loss 0.09 \nstep 854/1000: dist 0.09 loss 0.09 \nstep 855/1000: dist 0.09 loss 0.09 \nstep 856/1000: dist 0.09 loss 0.09 \nstep 857/1000: dist 0.09 loss 0.09 \nstep 858/1000: dist 0.09 loss 0.09 \nstep 859/1000: dist 0.09 loss 0.09 \nstep 860/1000: dist 0.09 loss 0.09 \nstep 861/1000: dist 0.09 loss 0.09 \nstep 862/1000: dist 0.09 loss 0.09 \nstep 863/1000: dist 0.09 loss 0.09 \nstep 864/1000: dist 0.09 loss 0.09 \nstep 865/1000: dist 0.09 loss 0.09 \nstep 866/1000: dist 0.09 loss 0.09 \nstep 867/1000: dist 0.09 loss 0.09 \nstep 868/1000: dist 0.09 loss 0.09 \nstep 869/1000: dist 0.09 loss 0.09 \nstep 870/1000: dist 0.09 loss 0.09 \nstep 871/1000: dist 0.09 loss 0.09 \nstep 872/1000: dist 0.09 loss 0.09 \nstep 873/1000: dist 0.09 loss 0.09 \nstep 874/1000: dist 0.09 loss 0.09 \nstep 875/1000: dist 0.09 loss 0.09 \nstep 876/1000: dist 0.09 loss 0.09 \nstep 877/1000: dist 0.09 loss 0.09 \nstep 878/1000: dist 0.09 loss 0.09 \nstep 879/1000: dist 0.09 loss 0.09 \nstep 880/1000: dist 0.09 loss 0.09 \nstep 881/1000: dist 0.09 loss 0.09 \nstep 882/1000: dist 0.09 loss 0.09 \nstep 883/1000: dist 0.09 loss 0.09 \nstep 884/1000: dist 0.09 loss 0.09 \nstep 885/1000: dist 0.09 loss 0.09 \nstep 886/1000: dist 0.09 loss 0.09 \nstep 887/1000: dist 0.09 loss 0.09 \nstep 888/1000: dist 0.09 loss 0.09 \nstep 889/1000: dist 0.09 loss 0.09 \nstep 890/1000: dist 0.09 loss 0.09 \nstep 891/1000: dist 0.09 loss 0.09 \nstep 892/1000: dist 0.09 loss 0.09 \nstep 893/1000: dist 0.09 loss 0.09 \nstep 894/1000: dist 0.09 loss 0.09 \nstep 895/1000: dist 0.09 loss 0.09 \nstep 896/1000: dist 0.09 loss 0.09 \nstep 897/1000: dist 0.09 loss 0.09 \nstep 898/1000: dist 0.09 loss 0.09 \nstep 899/1000: dist 0.09 loss 0.09 \nstep 900/1000: dist 0.09 loss 0.09 \nstep 901/1000: dist 0.09 loss 0.09 \nstep 902/1000: dist 0.09 loss 0.09 \nstep 903/1000: dist 0.09 loss 0.09 \nstep 904/1000: dist 0.09 loss 0.09 \nstep 905/1000: dist 0.09 loss 0.09 \nstep 906/1000: dist 0.09 loss 0.09 \nstep 907/1000: dist 0.09 loss 0.09 \nstep 908/1000: dist 0.09 loss 0.09 \nstep 909/1000: dist 0.09 loss 0.09 \nstep 910/1000: dist 0.09 loss 0.09 \nstep 911/1000: dist 0.09 loss 0.09 \nstep 912/1000: dist 0.09 loss 0.09 \nstep 913/1000: dist 0.09 loss 0.09 \nstep 914/1000: dist 0.09 loss 0.09 \nstep 915/1000: dist 0.09 loss 0.09 \nstep 916/1000: dist 0.09 loss 0.09 \nstep 917/1000: dist 0.09 loss 0.09 \nstep 918/1000: dist 0.09 loss 0.09 \nstep 919/1000: dist 0.09 loss 0.09 \nstep 920/1000: dist 0.09 loss 0.09 \nstep 921/1000: dist 0.09 loss 0.09 \nstep 922/1000: dist 0.09 loss 0.09 \nstep 923/1000: dist 0.09 loss 0.09 \nstep 924/1000: dist 0.09 loss 0.09 \nstep 925/1000: dist 0.09 loss 0.09 \nstep 926/1000: dist 0.09 loss 0.09 \nstep 927/1000: dist 0.09 loss 0.09 \nstep 928/1000: dist 0.09 loss 0.09 \nstep 929/1000: dist 0.09 loss 0.09 \nstep 930/1000: dist 0.09 loss 0.09 \nstep 931/1000: dist 0.09 loss 0.09 \nstep 932/1000: dist 0.09 loss 0.09 \nstep 933/1000: dist 0.09 loss 0.09 \nstep 934/1000: dist 0.09 loss 0.09 \nstep 935/1000: dist 0.09 loss 0.09 \nstep 936/1000: dist 0.09 loss 0.09 \nstep 937/1000: dist 0.09 loss 0.09 \nstep 938/1000: dist 0.09 loss 0.09 \nstep 939/1000: dist 0.09 loss 0.09 \nstep 940/1000: dist 0.09 loss 0.09 \nstep 941/1000: dist 0.09 loss 0.09 \nstep 942/1000: dist 0.09 loss 0.09 \nstep 943/1000: dist 0.09 loss 0.09 \nstep 944/1000: dist 0.09 loss 0.09 \nstep 945/1000: dist 0.09 loss 0.09 \nstep 946/1000: dist 0.09 loss 0.09 \nstep 947/1000: dist 0.09 loss 0.09 \nstep 948/1000: dist 0.09 loss 0.09 \nstep 949/1000: dist 0.09 loss 0.09 \nstep 950/1000: dist 0.09 loss 0.09 \nstep 951/1000: dist 0.09 loss 0.09 \nstep 952/1000: dist 0.09 loss 0.09 \nstep 953/1000: dist 0.09 loss 0.09 \nstep 954/1000: dist 0.09 loss 0.09 \nstep 955/1000: dist 0.09 loss 0.09 \nstep 956/1000: dist 0.09 loss 0.09 \nstep 957/1000: dist 0.09 loss 0.09 \nstep 958/1000: dist 0.09 loss 0.09 \nstep 959/1000: dist 0.09 loss 0.09 \nstep 960/1000: dist 0.09 loss 0.09 \nstep 961/1000: dist 0.09 loss 0.09 \nstep 962/1000: dist 0.09 loss 0.09 \nstep 963/1000: dist 0.09 loss 0.09 \nstep 964/1000: dist 0.09 loss 0.09 \nstep 965/1000: dist 0.09 loss 0.09 \nstep 966/1000: dist 0.09 loss 0.09 \nstep 967/1000: dist 0.09 loss 0.09 \nstep 968/1000: dist 0.09 loss 0.09 \nstep 969/1000: dist 0.09 loss 0.09 \nstep 970/1000: dist 0.09 loss 0.09 \nstep 971/1000: dist 0.09 loss 0.09 \nstep 972/1000: dist 0.09 loss 0.09 \nstep 973/1000: dist 0.09 loss 0.09 \nstep 974/1000: dist 0.09 loss 0.09 \nstep 975/1000: dist 0.09 loss 0.09 \nstep 976/1000: dist 0.09 loss 0.09 \nstep 977/1000: dist 0.09 loss 0.09 \nstep 978/1000: dist 0.09 loss 0.09 \nstep 979/1000: dist 0.09 loss 0.09 \nstep 980/1000: dist 0.09 loss 0.09 \nstep 981/1000: dist 0.09 loss 0.09 \nstep 982/1000: dist 0.09 loss 0.09 \nstep 983/1000: dist 0.09 loss 0.09 \nstep 984/1000: dist 0.09 loss 0.09 \nstep 985/1000: dist 0.09 loss 0.09 \nstep 986/1000: dist 0.09 loss 0.09 \nstep 987/1000: dist 0.09 loss 0.09 \nstep 988/1000: dist 0.09 loss 0.09 \nstep 989/1000: dist 0.09 loss 0.09 \nstep 990/1000: dist 0.09 loss 0.09 \nstep 991/1000: dist 0.09 loss 0.09 \nstep 992/1000: dist 0.09 loss 0.09 \nstep 993/1000: dist 0.09 loss 0.09 \nstep 994/1000: dist 0.09 loss 0.09 \nstep 995/1000: dist 0.09 loss 0.09 \nstep 996/1000: dist 0.09 loss 0.09 \nstep 997/1000: dist 0.09 loss 0.09 \nstep 998/1000: dist 0.09 loss 0.09 \nstep 999/1000: dist 0.09 loss 0.09 \nstep 1000/1000: dist 0.09 loss 0.09 \nElapsed: 733.0 s\n" ] ], [ [ "With the conversion complete, lets have a look at the two GANs.", "_____no_output_____" ] ], [ [ "img_gan_source = cv2.imread('/content/out_source/proj.png')\nimg = cv2.cvtColor(img_gan_source, cv2.COLOR_BGR2RGB)\nplt.imshow(img)\nplt.title('source-gan')\nplt.show()", "_____no_output_____" ], [ "img_gan_target = cv2.imread('/content/out_target/proj.png')\nimg = cv2.cvtColor(img_gan_target, cv2.COLOR_BGR2RGB)\nplt.imshow(img)\nplt.title('target-gan')\nplt.show()", "_____no_output_____" ] ], [ [ "# Build the Video\n\nThe following code builds a transition video between the two latent vectors previously obtained.", "_____no_output_____" ] ], [ [ "import torch\nimport dnnlib\nimport legacy\nimport PIL.Image\nimport numpy as np\nimport imageio\nfrom tqdm.notebook import tqdm\n\nlvec1 = np.load('/content/out_source/projected_w.npz')['w']\nlvec2 = np.load('/content/out_target/projected_w.npz')['w']\n\nnetwork_pkl = \"https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl\"\ndevice = torch.device('cuda')\nwith dnnlib.util.open_url(network_pkl) as fp:\n G = legacy.load_network_pkl(fp)['G_ema'].requires_grad_(False).to(device) # type: ignore\n\ndiff = lvec2 - lvec1\nstep = diff / STEPS\ncurrent = lvec1.copy()\ntarget_uint8 = np.array([1024,1024,3], dtype=np.uint8)\n\nvideo = imageio.get_writer('/content/movie.mp4', mode='I', fps=FPS, codec='libx264', bitrate='16M')\n\nfor j in tqdm(range(STEPS)):\n z = torch.from_numpy(current).to(device)\n synth_image = G.synthesis(z, noise_mode='const')\n synth_image = (synth_image + 1) * (255/2)\n synth_image = synth_image.permute(0, 2, 3, 1).clamp(0, 255).to(torch.uint8)[0].cpu().numpy()\n\n repeat = FREEZE_STEPS if j==0 or j==(STEPS-1) else 1\n \n for i in range(repeat):\n video.append_data(synth_image)\n current = current + step\n\n\nvideo.close()", "_____no_output_____" ] ], [ [ "# Download your Video\n\nIf you made it through all of these steps, you are now ready to download your video.", "_____no_output_____" ] ], [ [ "from google.colab import files\nfiles.download(\"movie.mp4\") ", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e738ae88636f44fb4e79efe1e951f81c898408
428,660
ipynb
Jupyter Notebook
assignment1/knn.ipynb
meijun/cs231n-assignment
6180f3081530db9afca17d15ed6169057d063669
[ "MIT" ]
null
null
null
assignment1/knn.ipynb
meijun/cs231n-assignment
6180f3081530db9afca17d15ed6169057d063669
[ "MIT" ]
null
null
null
assignment1/knn.ipynb
meijun/cs231n-assignment
6180f3081530db9afca17d15ed6169057d063669
[ "MIT" ]
null
null
null
608.028369
297,922
0.931834
[ [ [ "# k-Nearest Neighbor (kNN) exercise\n\n*Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For more details see the [assignments page](http://vision.stanford.edu/teaching/cs231n/assignments.html) on the course website.*\n\nThe kNN classifier consists of two stages:\n\n- During training, the classifier takes the training data and simply remembers it\n- During testing, kNN classifies every test image by comparing to all training images and transfering the labels of the k most similar training examples\n- The value of k is cross-validated\n\nIn this exercise you will implement these steps and understand the basic Image Classification pipeline, cross-validation, and gain proficiency in writing efficient, vectorized code.", "_____no_output_____" ] ], [ [ "# Run some setup code for this notebook.\n\nimport random\nimport numpy as np\nfrom cs231n.data_utils import load_CIFAR10\nimport matplotlib.pyplot as plt\n\n# This is a bit of magic to make matplotlib figures appear inline in the notebook\n# rather than in a new window.\n%matplotlib inline\nplt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots\nplt.rcParams['image.interpolation'] = 'nearest'\nplt.rcParams['image.cmap'] = 'gray'\n\n# Some more magic so that the notebook will reload external python modules;\n# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython\n%load_ext autoreload\n%autoreload 2", "_____no_output_____" ], [ "# Load the raw CIFAR-10 data.\ncifar10_dir = 'cs231n/datasets/cifar-10-batches-py'\nX_train, y_train, X_test, y_test = load_CIFAR10(cifar10_dir)\n\n# As a sanity check, we print out the size of the training and test data.\nprint 'Training data shape: ', X_train.shape\nprint 'Training labels shape: ', y_train.shape\nprint 'Test data shape: ', X_test.shape\nprint 'Test labels shape: ', y_test.shape", "Training data shape: (50000, 32, 32, 3)\nTraining labels shape: (50000,)\nTest data shape: (10000, 32, 32, 3)\nTest labels shape: (10000,)\n" ], [ "# Visualize some examples from the dataset.\n# We show a few examples of training images from each class.\nclasses = ['plane', 'car', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']\nnum_classes = len(classes)\nsamples_per_class = 7\nfor y, cls in enumerate(classes):\n idxs = np.flatnonzero(y_train == y)\n idxs = np.random.choice(idxs, samples_per_class, replace=False)\n for i, idx in enumerate(idxs):\n plt_idx = i * num_classes + y + 1\n plt.subplot(samples_per_class, num_classes, plt_idx)\n plt.imshow(X_train[idx].astype('uint8'))\n plt.axis('off')\n if i == 0:\n plt.title(cls)\nplt.show()", "_____no_output_____" ], [ "# Subsample the data for more efficient code execution in this exercise\nnum_training = 5000\nmask = range(num_training)\nX_train = X_train[mask]\ny_train = y_train[mask]\n\nnum_test = 500\nmask = range(num_test)\nX_test = X_test[mask]\ny_test = y_test[mask]", "_____no_output_____" ], [ "# Reshape the image data into rows\nX_train = np.reshape(X_train, (X_train.shape[0], -1))\nX_test = np.reshape(X_test, (X_test.shape[0], -1))\nprint X_train.shape, X_test.shape", "(5000, 3072) (500, 3072)\n" ], [ "from cs231n.classifiers import KNearestNeighbor\n\n# Create a kNN classifier instance. \n# Remember that training a kNN classifier is a noop: \n# the Classifier simply remembers the data and does no further processing \nclassifier = KNearestNeighbor()\nclassifier.train(X_train, y_train)", "_____no_output_____" ] ], [ [ "We would now like to classify the test data with the kNN classifier. Recall that we can break down this process into two steps: \n\n1. First we must compute the distances between all test examples and all train examples. \n2. Given these distances, for each test example we find the k nearest examples and have them vote for the label\n\nLets begin with computing the distance matrix between all training and test examples. For example, if there are **Ntr** training examples and **Nte** test examples, this stage should result in a **Nte x Ntr** matrix where each element (i,j) is the distance between the i-th test and j-th train example.\n\nFirst, open `cs231n/classifiers/k_nearest_neighbor.py` and implement the function `compute_distances_two_loops` that uses a (very inefficient) double loop over all pairs of (test, train) examples and computes the distance matrix one element at a time.", "_____no_output_____" ] ], [ [ "# Open cs231n/classifiers/k_nearest_neighbor.py and implement\n# compute_distances_two_loops.\n\n# Test your implementation:\ndists = classifier.compute_distances_two_loops(X_test)\nprint dists.shape", "(500, 5000)\n" ], [ "# We can visualize the distance matrix: each row is a single test example and\n# its distances to training examples\nplt.imshow(dists, interpolation='none')\nplt.show()", "_____no_output_____" ] ], [ [ "**Inline Question #1:** Notice the structured patterns in the distance matrix, where some rows or columns are visible brighter. (Note that with the default color scheme black indicates low distances while white indicates high distances.)\n\n- What in the data is the cause behind the distinctly bright rows?\n- What causes the columns?", "_____no_output_____" ], [ "**Your Answer**: \n- Bright rows: the test item has high distance with all train data;\n- Bright columns: the train item has high distance with all test data.\n\n", "_____no_output_____" ] ], [ [ "# Now implement the function predict_labels and run the code below:\n# We use k = 1 (which is Nearest Neighbor).\ny_test_pred = classifier.predict_labels(dists, k=1)\n\n# Compute and print the fraction of correctly predicted examples\nnum_correct = np.sum(y_test_pred == y_test)\naccuracy = float(num_correct) / num_test\nprint 'Got %d / %d correct => accuracy: %f' % (num_correct, num_test, accuracy)", "Got 137 / 500 correct => accuracy: 0.274000\n" ] ], [ [ "You should expect to see approximately `27%` accuracy. Now lets try out a larger `k`, say `k = 5`:", "_____no_output_____" ] ], [ [ "y_test_pred = classifier.predict_labels(dists, k=5)\nnum_correct = np.sum(y_test_pred == y_test)\naccuracy = float(num_correct) / num_test\nprint 'Got %d / %d correct => accuracy: %f' % (num_correct, num_test, accuracy)", "Got 139 / 500 correct => accuracy: 0.278000\n" ] ], [ [ "You should expect to see a slightly better performance than with `k = 1`.", "_____no_output_____" ] ], [ [ "# Now lets speed up distance matrix computation by using partial vectorization\n# with one loop. Implement the function compute_distances_one_loop and run the\n# code below:\ndists_one = classifier.compute_distances_one_loop(X_test)\n\n# To ensure that our vectorized implementation is correct, we make sure that it\n# agrees with the naive implementation. There are many ways to decide whether\n# two matrices are similar; one of the simplest is the Frobenius norm. In case\n# you haven't seen it before, the Frobenius norm of two matrices is the square\n# root of the squared sum of differences of all elements; in other words, reshape\n# the matrices into vectors and compute the Euclidean distance between them.\ndifference = np.linalg.norm(dists - dists_one, ord='fro')\nprint 'Difference was: %f' % (difference, )\nif difference < 0.001:\n print 'Good! The distance matrices are the same'\nelse:\n print 'Uh-oh! The distance matrices are different'", "Difference was: 0.000000\nGood! The distance matrices are the same\n" ], [ "# Now implement the fully vectorized version inside compute_distances_no_loops\n# and run the code\ndists_two = classifier.compute_distances_no_loops(X_test)\n\n# check that the distance matrix agrees with the one we computed before:\ndifference = np.linalg.norm(dists - dists_two, ord='fro')\nprint 'Difference was: %f' % (difference, )\nif difference < 0.001:\n print 'Good! The distance matrices are the same'\nelse:\n print 'Uh-oh! The distance matrices are different'", "Difference was: 0.000000\nGood! The distance matrices are the same\n" ], [ "# Let's compare how fast the implementations are\ndef time_function(f, *args):\n \"\"\"\n Call a function f with args and return the time (in seconds) that it took to execute.\n \"\"\"\n import time\n tic = time.time()\n f(*args)\n toc = time.time()\n return toc - tic\n\ntwo_loop_time = time_function(classifier.compute_distances_two_loops, X_test)\nprint 'Two loop version took %f seconds' % two_loop_time\n\none_loop_time = time_function(classifier.compute_distances_one_loop, X_test)\nprint 'One loop version took %f seconds' % one_loop_time\n\nno_loop_time = time_function(classifier.compute_distances_no_loops, X_test)\nprint 'No loop version took %f seconds' % no_loop_time\n\n# you should see significantly faster performance with the fully vectorized implementation", "Two loop version took 25.608644 seconds\nOne loop version took 49.357512 seconds\nNo loop version took 0.393901 seconds\n" ] ], [ [ "### Cross-validation\n\nWe have implemented the k-Nearest Neighbor classifier but we set the value k = 5 arbitrarily. We will now determine the best value of this hyperparameter with cross-validation.", "_____no_output_____" ] ], [ [ "num_folds = 5\nk_choices = [1, 3, 5, 8, 10, 12, 15, 20, 50, 100]\n\nX_train_folds = []\ny_train_folds = []\n################################################################################\n# TODO: #\n# Split up the training data into folds. After splitting, X_train_folds and #\n# y_train_folds should each be lists of length num_folds, where #\n# y_train_folds[i] is the label vector for the points in X_train_folds[i]. #\n# Hint: Look up the numpy array_split function. #\n################################################################################\nX_train_folds = np.array_split(X_train, num_folds)\ny_train_folds = np.array_split(y_train, num_folds)\n################################################################################\n# END OF YOUR CODE #\n################################################################################\n\n# A dictionary holding the accuracies for different values of k that we find\n# when running cross-validation. After running cross-validation,\n# k_to_accuracies[k] should be a list of length num_folds giving the different\n# accuracy values that we found when using that value of k.\nk_to_accuracies = {}\n\n\n################################################################################\n# TODO: #\n# Perform k-fold cross validation to find the best value of k. For each #\n# possible value of k, run the k-nearest-neighbor algorithm num_folds times, #\n# where in each case you use all but one of the folds as training data and the #\n# last fold as a validation set. Store the accuracies for all fold and all #\n# values of k in the k_to_accuracies dictionary. #\n################################################################################\nfor k in k_choices:\n k_to_accuracies[k] = []\n print k\n for v_id in xrange(num_folds):\n X_train_k = np.concatenate([xs for xs_id, xs in enumerate(X_train_folds) if xs_id != v_id])\n y_train_k = np.concatenate([ys for ys_id, ys in enumerate(y_train_folds) if ys_id != v_id])\n classifier_k = KNearestNeighbor()\n classifier_k.train(X_train_k, y_train_k)\n dists_k = classifier_k.compute_distances_no_loops(X_train_folds[v_id])\n y_test_pred_k = classifier_k.predict_labels(dists_k, k=k)\n num_correct_k = np.sum(y_test_pred_k == y_train_folds[v_id])\n accuracy_k = float(num_correct_k) / X_train_folds[v_id].shape[0]\n k_to_accuracies[k].append(accuracy_k)\n print k_to_accuracies[k]\n################################################################################\n# END OF YOUR CODE #\n################################################################################\n\n# Print out the computed accuracies\nfor k in sorted(k_to_accuracies):\n for accuracy in k_to_accuracies[k]:\n print 'k = %d, accuracy = %f' % (k, accuracy)", "1\n[0.263]\n[0.263, 0.257]\n[0.263, 0.257, 0.264]\n[0.263, 0.257, 0.264, 0.278]\n[0.263, 0.257, 0.264, 0.278, 0.266]\n3\n[0.239]\n[0.239, 0.249]\n[0.239, 0.249, 0.24]\n[0.239, 0.249, 0.24, 0.266]\n[0.239, 0.249, 0.24, 0.266, 0.254]\n5\n[0.248]\n[0.248, 0.266]\n[0.248, 0.266, 0.28]\n[0.248, 0.266, 0.28, 0.292]\n[0.248, 0.266, 0.28, 0.292, 0.28]\n8\n[0.262]\n[0.262, 0.282]\n[0.262, 0.282, 0.273]\n[0.262, 0.282, 0.273, 0.29]\n[0.262, 0.282, 0.273, 0.29, 0.273]\n10\n[0.265]\n[0.265, 0.296]\n[0.265, 0.296, 0.276]\n[0.265, 0.296, 0.276, 0.284]\n[0.265, 0.296, 0.276, 0.284, 0.28]\n12\n[0.26]\n[0.26, 0.295]\n[0.26, 0.295, 0.279]\n[0.26, 0.295, 0.279, 0.283]\n[0.26, 0.295, 0.279, 0.283, 0.28]\n15\n[0.252]\n[0.252, 0.289]\n[0.252, 0.289, 0.278]\n[0.252, 0.289, 0.278, 0.282]\n[0.252, 0.289, 0.278, 0.282, 0.274]\n20\n[0.27]\n[0.27, 0.279]\n[0.27, 0.279, 0.279]\n[0.27, 0.279, 0.279, 0.282]\n[0.27, 0.279, 0.279, 0.282, 0.285]\n50\n[0.271]\n[0.271, 0.288]\n[0.271, 0.288, 0.278]\n[0.271, 0.288, 0.278, 0.269]\n[0.271, 0.288, 0.278, 0.269, 0.266]\n100\n[0.256]\n[0.256, 0.27]\n[0.256, 0.27, 0.263]\n[0.256, 0.27, 0.263, 0.256]\n[0.256, 0.27, 0.263, 0.256, 0.263]\nk = 1, accuracy = 0.263000\nk = 1, accuracy = 0.257000\nk = 1, accuracy = 0.264000\nk = 1, accuracy = 0.278000\nk = 1, accuracy = 0.266000\nk = 3, accuracy = 0.239000\nk = 3, accuracy = 0.249000\nk = 3, accuracy = 0.240000\nk = 3, accuracy = 0.266000\nk = 3, accuracy = 0.254000\nk = 5, accuracy = 0.248000\nk = 5, accuracy = 0.266000\nk = 5, accuracy = 0.280000\nk = 5, accuracy = 0.292000\nk = 5, accuracy = 0.280000\nk = 8, accuracy = 0.262000\nk = 8, accuracy = 0.282000\nk = 8, accuracy = 0.273000\nk = 8, accuracy = 0.290000\nk = 8, accuracy = 0.273000\nk = 10, accuracy = 0.265000\nk = 10, accuracy = 0.296000\nk = 10, accuracy = 0.276000\nk = 10, accuracy = 0.284000\nk = 10, accuracy = 0.280000\nk = 12, accuracy = 0.260000\nk = 12, accuracy = 0.295000\nk = 12, accuracy = 0.279000\nk = 12, accuracy = 0.283000\nk = 12, accuracy = 0.280000\nk = 15, accuracy = 0.252000\nk = 15, accuracy = 0.289000\nk = 15, accuracy = 0.278000\nk = 15, accuracy = 0.282000\nk = 15, accuracy = 0.274000\nk = 20, accuracy = 0.270000\nk = 20, accuracy = 0.279000\nk = 20, accuracy = 0.279000\nk = 20, accuracy = 0.282000\nk = 20, accuracy = 0.285000\nk = 50, accuracy = 0.271000\nk = 50, accuracy = 0.288000\nk = 50, accuracy = 0.278000\nk = 50, accuracy = 0.269000\nk = 50, accuracy = 0.266000\nk = 100, accuracy = 0.256000\nk = 100, accuracy = 0.270000\nk = 100, accuracy = 0.263000\nk = 100, accuracy = 0.256000\nk = 100, accuracy = 0.263000\n" ], [ "# plot the raw observations\nfor k in k_choices:\n accuracies = k_to_accuracies[k]\n plt.scatter([k] * len(accuracies), accuracies)\n\n# plot the trend line with error bars that correspond to standard deviation\naccuracies_mean = np.array([np.mean(v) for k,v in sorted(k_to_accuracies.items())])\naccuracies_std = np.array([np.std(v) for k,v in sorted(k_to_accuracies.items())])\nplt.errorbar(k_choices, accuracies_mean, yerr=accuracies_std)\nplt.title('Cross-validation on k')\nplt.xlabel('k')\nplt.ylabel('Cross-validation accuracy')\nplt.show()", "_____no_output_____" ], [ "# Based on the cross-validation results above, choose the best value for k, \n# retrain the classifier using all the training data, and test it on the test\n# data. You should be able to get above 28% accuracy on the test data.\nbest_k = 10\n\nclassifier = KNearestNeighbor()\nclassifier.train(X_train, y_train)\ny_test_pred = classifier.predict(X_test, k=best_k)\n\n# Compute and display the accuracy\nnum_correct = np.sum(y_test_pred == y_test)\naccuracy = float(num_correct) / num_test\nprint 'Got %d / %d correct => accuracy: %f' % (num_correct, num_test, accuracy)", "Got 141 / 500 correct => accuracy: 0.282000\n" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ] ]
e7e73935284d0d37676f477d65d2a2bbb5072a04
8,110
ipynb
Jupyter Notebook
Reading ipynb.ipynb
ValRCS/RCS_Data_Analysis_Python_2019_July
19e2f8310f41b697f9c86d7a085a9ff19390eeac
[ "MIT" ]
1
2019-07-11T16:25:15.000Z
2019-07-11T16:25:15.000Z
Reading ipynb.ipynb
ValRCS/RCS_Data_Analysis_Python_2019_July
19e2f8310f41b697f9c86d7a085a9ff19390eeac
[ "MIT" ]
8
2020-01-28T22:54:14.000Z
2022-02-10T00:17:47.000Z
Reading ipynb.ipynb
ValRCS/RCS_Data_Analysis_Python_2019_July
19e2f8310f41b697f9c86d7a085a9ff19390eeac
[ "MIT" ]
null
null
null
27.306397
1,207
0.499507
[ [ [ "import json", "_____no_output_____" ], [ "with open('ListComprehension_in_class_30.05.2019.ipynb') as f:\n notebook = f.read()\n ", "_____no_output_____" ], [ "with open('ListComprehension_in_class_30.05.2019.ipynb') as f:\n notedata = json.load(f)\n ", "_____no_output_____" ], [ "type(notedata)", "_____no_output_____" ], [ "notedata.keys()", "_____no_output_____" ], [ "len(notedata['cells'])", "_____no_output_____" ], [ "mycells = notedata['cells']", "_____no_output_____" ], [ "mycells[0]", "_____no_output_____" ], [ "mylist = [1,2,4,5,6]\nfor element in mylist:\n print(element)", "1\n2\n4\n5\n6\n" ], [ "# list iteration\nfor element in mycells:\n for key, value in element.items():\n print(key,value)", "cell_type code\nexecution_count 5\nmetadata {}\noutputs []\nsource ['import random\\n', 'random.seed(42)']\ncell_type code\nexecution_count 6\nmetadata {}\noutputs [{'data': {'text/plain': ['0.6394267984578837']}, 'execution_count': 6, 'metadata': {}, 'output_type': 'execute_result'}]\nsource ['random.random()']\ncell_type code\nexecution_count 8\nmetadata {}\noutputs [{'data': {'text/plain': ['[0.045824383655662215,\\n', ' 0.22789827565154686,\\n', ' 0.28938796360210717,\\n', ' 0.0797919769236275,\\n', ' 0.23279088636103018]']}, 'execution_count': 8, 'metadata': {}, 'output_type': 'execute_result'}]\nsource ['mylist2 = []\\n', 'for _ in range(40):\\n', ' mylist2.append(random.random())\\n', 'mylist2[:5]']\ncell_type code\nexecution_count 11\nmetadata {}\noutputs [{'data': {'text/plain': ['[0.26274160852293527,\\n', ' 0.5845859902235405,\\n', ' 0.897822883602477,\\n', ' 0.39940050514039727,\\n', ' 0.21932075915728333,\\n', ' 0.9975376064951103,\\n', ' 0.5095262936764645,\\n', ' 0.09090941217379389,\\n', ' 0.04711637542473457,\\n', ' 0.10964913035065915,\\n', ' 0.62744604170309,\\n', ' 0.7920793643629641,\\n', ' 0.42215996679968404,\\n', ' 0.06352770615195713,\\n', ' 0.38161928650653676,\\n', ' 0.9961213802400968,\\n', ' 0.529114345099137,\\n', ' 0.9710783776136181,\\n', ' 0.8607797022344981,\\n', ' 0.011481021942819636,\\n', ' 0.7207218193601946,\\n', ' 0.6817103690265748,\\n', ' 0.5369703304087952,\\n', ' 0.2668251899525428,\\n', ' 0.6409617985798081,\\n', ' 0.11155217359587644,\\n', ' 0.434765250669105,\\n', ' 0.45372370632920644,\\n', ' 0.9538159275210801,\\n', ' 0.8758529403781941,\\n', ' 0.26338905075109076,\\n', ' 0.5005861130502983,\\n', ' 0.17865188053013137,\\n', ' 0.9126278393448205,\\n', ' 0.8705185698367669,\\n', ' 0.2984447914486329,\\n', ' 0.6389494948660052,\\n', ' 0.6089702114381723,\\n', ' 0.1528392685496348,\\n', ' 0.7625108000751513]']}, 'execution_count': 11, 'metadata': {}, 'output_type': 'execute_result'}]\nsource ['mylist = [random.random() for myuselessvariable in range(40)]\\n', 'mylist']\ncell_type code\nexecution_count 14\nmetadata {}\noutputs [{'data': {'text/plain': ['[0.9975376064951103,\\n', ' 0.9961213802400968,\\n', ' 0.9710783776136181,\\n', ' 0.9538159275210801,\\n', ' 0.9126278393448205]']}, 'execution_count': 14, 'metadata': {}, 'output_type': 'execute_result'}]\nsource ['myfilteredlist = [element for element in mylist if element > 0.9]\\n', 'myfilteredlist']\ncell_type code\nexecution_count 16\nmetadata {}\noutputs [{'data': {'text/plain': ['20']}, 'execution_count': 16, 'metadata': {}, 'output_type': 'execute_result'}]\nsource ['len(mylist[10:30])']\ncell_type code\nexecution_count 17\nmetadata {}\noutputs [{'data': {'text/plain': ['0.9961213802400968']}, 'execution_count': 17, 'metadata': {}, 'output_type': 'execute_result'}]\nsource ['max(mylist[10:30])']\n" ], [ "# for iterating through dictionaries\nfor key,value in mycells[0].items():\n print(key,value)", "cell_type code\nexecution_count 5\nmetadata {}\noutputs []\nsource ['import random\\n', 'random.seed(42)']\n" ], [ "mycells[0]['source']", "_____no_output_____" ], [ "mycells[0]['source'][1] ", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e739f1539f345e0ba4da5d511d31a949757bd8
8,420
ipynb
Jupyter Notebook
Notebooks/Arguments-and-Unpacking.ipynb
gtavasoli/PyTips
6257114ccc2396193efc0841bfe6ad99b9acade6
[ "MIT" ]
null
null
null
Notebooks/Arguments-and-Unpacking.ipynb
gtavasoli/PyTips
6257114ccc2396193efc0841bfe6ad99b9acade6
[ "MIT" ]
null
null
null
Notebooks/Arguments-and-Unpacking.ipynb
gtavasoli/PyTips
6257114ccc2396193efc0841bfe6ad99b9acade6
[ "MIT" ]
null
null
null
27.880795
587
0.533254
[ [ [ "## Function call parameter rules and unpacking\n\nPython functions have the following four forms when declaring parameters:\n1. Without default value: `def func(a): pass`\n1. With default value: `def func(a, b = 1): pass`\n1. Arbitrary position parameters: `def func(a, b = 1, *c): pass`\n1. Arbitrary key parameter: `def func(a, b = 1, *c, **d): pass`\n\nWhen calling a function, there are two situations:\n1. Parameters without keywords: `func(\"G\", 20)`\n1. Parameters with keywords: `func(a = \"G\", b = 20)` (The order of calls with keywords can be ignored: `func(b = 20, a = \"G\"`)\n\nOf course, these two situations can be mixed: `func(\"G\", b = 20)`, but the most important rule is that **positional parameters cannot appear after keyword parameters**: ", "_____no_output_____" ] ], [ [ "def func(a, b = 1):\n pass\n\nfunc(a = \"G\", 20) # SyntaxError", "_____no_output_____" ] ], [ [ "Another rule is position parameter priority: ", "_____no_output_____" ] ], [ [ "def func(a, b = 1):\n pass\n\nfunc(20, a = \"G\") # TypeError: Repeat assignment to parameter a", "_____no_output_____" ] ], [ [ "**The safest way is to use all keyword parameters.**", "_____no_output_____" ], [ "### Arbitrary Parameters\nAny parameter can accept any number of parameters, where the form of `*a` represents any number of **positional parameters**, and `**d` represents any number of **keyword parameters**:", "_____no_output_____" ] ], [ [ "def concat(*lst, sep = \"/\"):\n return sep.join((str(i) for i in lst))\n\nprint(concat(\"G\", 20, \"@\", \"Hz\", sep = \"\"))", "G20@Hz\n" ] ], [ [ "The syntax of the above `def concat(*lst, sep = \"/\")` was proposed by [PEP 3102](https://www.python.org/dev/peps/pep-3102/) and implemented after **Python 3.0**. The keyword function here must be clearly specified and cannot be inferred by position:", "_____no_output_____" ] ], [ [ "print(concat(\"G\", 20, \"-\")) # Not G-20", "G/20/-\n" ] ], [ [ "`**d` represents any number of keyword parameters", "_____no_output_____" ] ], [ [ "def dconcat(sep = \":\", **dic):\n for k in dic.keys():\n print(\"{}{}{}\".format(k, sep, dic[k]))\n\ndconcat(hello = \"world\", python = \"rocks\", sep = \"~\")", "hello~world\npython~rocks\n" ] ], [ [ "### Unpacking\nThe new feature [PEP 448](https://www.python.org/dev/peps/pep-0448/) added in **Python 3.5** allows `*a` and `**d` to be used outside of function parameters:", "_____no_output_____" ] ], [ [ "print(*range(5))\nlst = [0, 1, 2, 3]\nprint(*lst)\n\na = *range(3), # The comma here cannot be omitted\nprint(a)\n\nd = {\"hello\": \"world\", \"python\": \"rocks\"}\nprint({**d}[\"python\"])\nprint(*d)\nprint([*d][0])", "0 1 2 3 4\n0 1 2 3\n(0, 1, 2)\nrocks\nhello python\nhello\n" ] ], [ [ "The so-called unpacking (Unpacking) can actually be regarded as removing the tuple of `()` or removing the dictionary of `{}`. This syntax also provides a more Pythonic way to merge dictionaries:", "_____no_output_____" ] ], [ [ "user = {'name': \"Trey\", 'website': \"http://treyhunner.com\"}\ndefaults = {'name': \"Anonymous User\", 'page_name': \"Profile Page\"}\n\nprint({**defaults, **user})", "{'name': 'Trey', 'page_name': 'Profile Page', 'website': 'http://treyhunner.com'}\n" ] ], [ [ "Using this unpacking method when calling a function is also available in **Python 2.7**:", "_____no_output_____" ] ], [ [ "print(concat(*\"ILovePython\"))", "I/L/o/v/e/P/y/t/h/o/n\n" ] ], [ [ "## References\n- [The Idiomatic Way to Merge Dictionaries in Python](https://treyhunner.com/2016/02/how-to-merge-dictionaries-in-python/)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ] ]
e7e74e5410a3b06bab92c800f1a84be135470256
12,177
ipynb
Jupyter Notebook
code/notebooks/eph-earth-velocity.ipynb
GandalfSaxe/letomes
5f73a4066fcf69260cb538c105acf898b22e756d
[ "MIT" ]
null
null
null
code/notebooks/eph-earth-velocity.ipynb
GandalfSaxe/letomes
5f73a4066fcf69260cb538c105acf898b22e756d
[ "MIT" ]
null
null
null
code/notebooks/eph-earth-velocity.ipynb
GandalfSaxe/letomes
5f73a4066fcf69260cb538c105acf898b22e756d
[ "MIT" ]
null
null
null
26.357143
133
0.454135
[ [ [ "import pandas as pd\n\nimport numpy as np\n\nimport os\n\nfrom math import sqrt", "_____no_output_____" ], [ "# Script inputs\n \nFILE_PATH = \"../orbsim/r4b_3d/ephemerides/\"\n\nPLANETS = [\"earth\",\n \"mars\"]\n\nEND_YEAR = \"2020\"", "_____no_output_____" ], [ "ephemerides_filename_dict = {}\n\nfor planet in PLANETS:\n ephemerides_filename_dict[planet] = \"{}_2019-{}.csv\".format(planet, END_YEAR)\n\nephemerides_filename_dict", "_____no_output_____" ], [ "# Change CWD of necessary\ncwd = os.getcwd()\nin_correct_cwd = 'code' + FILE_PATH[2:-1] == cwd[-30:] # Check if last part of cwd is '/code/orbsim/r4b_3d'\n\nif not in_correct_cwd: \n os.chdir(FILE_PATH)\n cwd = os.getcwd()\n\nprint(cwd)", "/Users/gandalf/Dropbox/repositories/letomes/code/orbsim/r4b_3d/ephemerides\n" ], [ "# Read CSV files into dict\nephemerides = {}\nfor body, csv_filename in ephemerides_filename_dict.items():\n ephemerides[body] = pd.read_csv(csv_filename, parse_dates=['date'])\n\npd.set_option(\"max_row\", 15)\nephemerides ", "_____no_output_____" ], [ "day = 1\nkm = 149597870.700 # km/AU (precise definition https://en.wikipedia.org/wiki/Astronomical_unit#Development_of_unit_definition)", "_____no_output_____" ], [ "earth_day = ephemerides['earth'].iloc[day]\nearth_day", "_____no_output_____" ], [ "earth_daym1 = ephemerides['earth'].iloc[day-1]\nearth_daym1", "_____no_output_____" ], [ "earth_diff = earth_day - earth_daym1\nearth_diff", "_____no_output_____" ], [ "vx0 = earth_diff['x'] / (24*3600) * km\nvx0", "_____no_output_____" ], [ "vy0 = earth_diff['y'] / (24*3600) * km\nvy0", "_____no_output_____" ], [ "vz0 = earth_diff['z'] / (24*3600) * km\nvz0", "_____no_output_____" ], [ "sqrt(vx0**2+vy0**2+vz0**2)", "_____no_output_____" ] ], [ [ "Average speed of earth is 29.93 km/s, so looks good.", "_____no_output_____" ] ], [ [ "vr0 = earth_diff['r'] / (24*3600) * km\nvr0", "_____no_output_____" ], [ "vtheta0 = earth_diff['theta']\nvtheta0", "_____no_output_____" ], [ "vphi0 = earth_diff['phi']\nvphi0", "_____no_output_____" ] ] ]
[ "code", "markdown", "code" ]
[ [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code" ] ]
e7e76dd2219db2d9c6d8ff05d86adc2a8d756ca7
77,513
ipynb
Jupyter Notebook
cleaning_scripts/ca_crime.ipynb
benmerrilll/milestone-ii
8e743b4f7bd54a49c8327a36663b71a26d0a818c
[ "MIT" ]
null
null
null
cleaning_scripts/ca_crime.ipynb
benmerrilll/milestone-ii
8e743b4f7bd54a49c8327a36663b71a26d0a818c
[ "MIT" ]
null
null
null
cleaning_scripts/ca_crime.ipynb
benmerrilll/milestone-ii
8e743b4f7bd54a49c8327a36663b71a26d0a818c
[ "MIT" ]
null
null
null
29.383245
3,996
0.386825
[ [ [ "empty" ] ] ]
[ "empty" ]
[ [ "empty" ] ]
e7e77d2a4121b654577b105a91319ea1ba231ff1
5,675
ipynb
Jupyter Notebook
ipynb/radar.ipynb
ymohit/fkigp
0a5330c86d5228ff69c9c6f91a73769f792f586f
[ "MIT" ]
1
2021-08-13T16:41:57.000Z
2021-08-13T16:41:57.000Z
ipynb/radar.ipynb
ymohit/fkigp
0a5330c86d5228ff69c9c6f91a73769f792f586f
[ "MIT" ]
null
null
null
ipynb/radar.ipynb
ymohit/fkigp
0a5330c86d5228ff69c9c6f91a73769f792f586f
[ "MIT" ]
null
null
null
30.510753
131
0.537445
[ [ [ "%load_ext autoreload\n%autoreload 2\n\n\nimport yaml \nimport time\nimport pickle \nimport warnings\nimport scipy\nimport scipy.sparse.linalg\nfrom collections import defaultdict\n\nfrom numpy import matrix, asmatrix\nfrom scipy.sparse.sputils import asmatrix\n\nimport random\nimport numpy as np\nimport fastmat as fm # need 0.2a3 or later?\n\nimport matplotlib.gridspec as gridspec\nwarnings.filterwarnings(\"ignore\")\nfrom pylab import rcParams\nfrom matplotlib import container\nfrom matplotlib import pyplot as plt\nfrom IPython.core.display import HTML\n\nimport os, sys\nmodule_path = os.path.abspath(os.path.join('../../../'))\nif module_path not in sys.path:\n sys.path.append(module_path)\nos.environ['PRJ'] = os.environ['HOME'] + \"/skigp/\"\n\n#from src.nmpy.solvers import cg\nrandom.seed(1337)\nnp.random.seed(1337)\n\n\nimport os \nimport decimal\nfrom collections import defaultdict\n# create a new context for this task\nctx = decimal.Context()\n\n# 20 digits should be enough for everyone :D\nctx.prec = 4\n\ndef float_to_str(f):\n \"\"\"\n Convert the given float to a string,\n without resorting to scientific notation\n \"\"\"\n d1 = ctx.create_decimal(repr(f))\n return format(d1, 'f')", "_____no_output_____" ], [ "# Importing required packages \n\nfrom fkigp.configs import GridSizeFunc, get_radar_grid\n\nfrom experiments.plotting import get_fmt, M_rep, plot_attribute_gs, attributes", "_____no_output_____" ], [ "class RadarDataDump(object):\n \n def __init__(self, fname):\n self.fname = fname\n self.data = None \n assert os.path.exists(fname), fname + \" does not exists!\"\n self.extract_values(fname)\n \n def extract_values(self, fname):\n assert os.path.exists(fname), fname\n self.data = yaml.load(open(fname))\n \n def get_att(self, att_name='#iters'):\n attributes = ['#iters', \"time/iter\", 'total', \"data_time\", 'inf_time']\n if att_name == attributes[0]:\n return self.data['num_iters']\n elif att_name == attributes[1]:\n return self.data['inf_time'] / self.data['num_iters']\n elif att_name == attributes[4]:\n return self.data['inf_time']\n else:\n raise NotImplementedError", "_____no_output_____" ], [ "def read_dumps(class_, sweep_id = '0akrbkhi'):\n \n log_dir_path = os.environ['PRJ'] + 'logs/radar/' + sweep_id \n\n assert os.path.exists(log_dir_path) == True\n\n runs = [log_dir_path + '/' + fname + '/results.yaml' for fname in os.listdir(log_dir_path) if fname.startswith('rid')]\n\n seeds = [1, 23, 67, 971, 23427, 431241, 2423717, 9871]\n dumps = {}\n for run in runs:\n try:\n dump = class_(run)\n except AssertionError:\n pass\n \n data = dump.data\n run_index = seeds.index(data['seed'])\n grid_size = np.prod([i[-1] for i in get_radar_grid(data['grid_idx'])]) \n dumps[(grid_size, run_index, methods[data['method']-1])] = dump\n return dumps\n\nmethods = ['kissgp', 'gsgp']", "_____no_output_____" ], [ "# Reproducing inference time results, i.e., Figure \n# means_dumps = read_dumps(RadarDataDump, sweep_id = 'q3leucyf')\n# plot_attribute_gs(means_dumps, attribute='inf_time', x_logscale=True, y_logscale=True, show_legends=True,\n# set_zero_min_y_limit=True, x_label='m', y_label = 'Inference Time (in secs)')", "_____no_output_____" ], [ "# Load dumps corresponding to llk \n# llk_dumps = read_dumps(RadarDataDump, sweep_id = 'llk_sweepid')\n\n#plot_attribute(dumps,attribute='inf_time', x_logscale=True, y_logscale=True, set_zero_min_y_limit=True,\n# x_label='m', y_label = 'Log-det Time (in secs)', set_y_limit=-50, show_legends=True)", "_____no_output_____" ] ] ]
[ "code" ]
[ [ "code", "code", "code", "code", "code", "code" ] ]
e7e792b925132b27d2fe326575c0336947d0d6e0
9,436
ipynb
Jupyter Notebook
pet-finder.ipynb
leopoldavezac/PetFinder
ebc4f5cae019baf89dd78e86a6c2b04f6f43caf0
[ "MIT" ]
null
null
null
pet-finder.ipynb
leopoldavezac/PetFinder
ebc4f5cae019baf89dd78e86a6c2b04f6f43caf0
[ "MIT" ]
null
null
null
pet-finder.ipynb
leopoldavezac/PetFinder
ebc4f5cae019baf89dd78e86a6c2b04f6f43caf0
[ "MIT" ]
null
null
null
9,436
9,436
0.69627
[ [ [ "# Librairies", "_____no_output_____" ] ], [ [ "from typing import List, Union, Tuple, Callable, Dict\n\nfrom os import environ\n\nfrom random import seed\n\nfrom numpy.random import seed as np_seed\nfrom numpy import ndarray, zeros\n\nfrom pandas import DataFrame, read_csv\n\nfrom sklearn.model_selection import train_test_split\n\nimport tensorflow as tf\nfrom tensorflow import random\nfrom tensorflow import keras\nfrom tensorflow.keras import applications\nfrom tensorflow import data\n\nimport plotly.graph_objects as go\n\nimport wandb\nfrom wandb.keras import WandbCallback\n\nfrom kaggle_secrets import UserSecretsClient", "_____no_output_____" ] ], [ [ "# WandB", "_____no_output_____" ] ], [ [ "user_secrets = UserSecretsClient()\napi_key = user_secrets.get_secret(\"WANDB\")\nwandb.login(key=api_key)\n\nrun = wandb.init(\n project=\"pet_finder\",\n entity=\"leopoldavezac\",\n config={\n 'learning_rate':0.001,\n 'epochs':20,\n 'batch_size':24,\n 'loss_func':'mse',\n 'img_width':224,\n 'img_length':224,\n 'efficient_net_symbol':'B0',\n 'efficient_net_trainable':False,\n 'dense_layers_post_efficient_net':[18, 9],\n 'dropout':0.2,\n 'data_augmentation_contrast':0.1,\n }\n)", "_____no_output_____" ] ], [ [ "# Constants", "_____no_output_____" ] ], [ [ "DATA_PATH = '../input/petfinder-pawpularity-score'\n\nID_VAR_NM = 'Id'\nTARGET_VAR_NM = 'Pawpularity'\n\nAUTOTUNE = tf.data.experimental.AUTOTUNE\n\nCONFIG = wandb.config", "_____no_output_____" ] ], [ [ "# Load & Preprocess Data", "_____no_output_____" ] ], [ [ "\ndef get_datasets() -> List[tf.data.Dataset]:\n\n df_train = load_df(set_nm='train')\n df_test = load_df(set_nm='test')\n\n df_train[TARGET_VAR_NM] /= 100\n\n df_train = create_img_path_var(df_train, 'train')\n df_test = create_img_path_var(df_test, 'test')\n\n df_train, df_val = split(df_train)\n\n ds_train = create_dataset_with_preprocessed_imgs(\n df_train.img_path.values,\n df_train[TARGET_VAR_NM].values.astype('float'),\n augment=True\n )\n ds_val = create_dataset_with_preprocessed_imgs(\n df_val.img_path.values,\n df_val[TARGET_VAR_NM].values.astype('float')\n )\n ds_test = create_dataset_with_preprocessed_imgs(\n df_test.img_path.values\n )\n\n return [ds_train, ds_val, ds_test]\n\n\ndef load_df(set_nm:str) -> DataFrame:\n\n var_nms = [ID_VAR_NM] \n var_nms += [TARGET_VAR_NM] if set_nm == 'train' else []\n\n return read_csv('{}/{}.csv'.format(DATA_PATH, set_nm), usecols=var_nms)\n\n\ndef create_img_path_var(df: DataFrame, set_nm:str) -> DataFrame:\n\n df['img_path'] = '{}/{}/'.format(DATA_PATH, set_nm) + df[ID_VAR_NM] + '.jpg'\n df.drop(columns=ID_VAR_NM, inplace=True)\n\n return df\n\n\ndef split(df: DataFrame) -> List[DataFrame]:\n\n train, val = train_test_split(df.values, test_size=0.2)\n\n df_train = DataFrame(train, columns=df.columns)\n df_val = DataFrame(val, columns=df.columns)\n\n return [df_train, df_val]\n\ndef create_dataset_with_preprocessed_imgs(X_paths: ndarray, y: Union[None, ndarray] = None, augment:bool=False) -> data.Dataset:\n\n get_preprocessed_img = build_img_processor(y is not None)\n \n if y is not None:\n ds = data.Dataset.from_tensor_slices((X_paths, y))\n else:\n ds = data.Dataset.from_tensor_slices((X_paths,)) \n \n ds = ds.map(get_preprocessed_img, num_parallel_calls=AUTOTUNE)\n \n if augment:\n augmentation_model = get_augmentation_model()\n ds = ds.map(lambda X, y: (augmentation_model(X, training=True), y))\n \n ds = ds.batch(CONFIG.batch_size)\n ds = ds.prefetch(buffer_size=AUTOTUNE)\n \n return ds\n\ndef build_img_processor(with_target: bool) -> Callable:\n \n def get_preprocessed_img(path: str) -> tf.Tensor:\n\n img = load_img(path)\n img = resize(img)\n img = eff_net_preprocess(img)\n\n return img\n \n def get_preprocessed_img_with_target(path:str, y:float) -> Tuple[Union[tf.Tensor, float]]:\n \n return (get_preprocessed_img(path), y)\n \n return get_preprocessed_img_with_target if with_target else get_preprocessed_img\n\ndef load_img(path: str) -> tf.Tensor:\n\n img = tf.io.read_file(path)\n return tf.io.decode_jpeg(img)\n\ndef resize(img: tf.Tensor) -> tf.Tensor:\n\n return tf.cast(\n tf.image.resize_with_pad(img, CONFIG.img_length, CONFIG.img_width),\n dtype=tf.int32\n )\n\ndef eff_net_preprocess(img: tf.Tensor) -> tf.Tensor:\n \n return keras.applications.efficientnet.preprocess_input(img)\n\ndef normalize(img: tf.Tensor) -> tf.Tensor:\n \n return img / 255.0\n\ndef get_augmentation_model() -> tf.keras.Model:\n \n return tf.keras.Sequential([\n layers.RandomFlip(\"horizontal\"),\n layers.RandomRotation(CONFIG.data_augmentation_contrast),\n ])\n\n ", "_____no_output_____" ], [ "ds_train, ds_val, ds_test = get_datasets()", "_____no_output_____" ] ], [ [ "# Img Dims Visualization", "_____no_output_____" ] ], [ [ "img_paths = ('{}/{}/'.format(DATA_PATH, 'train') + load_df('train')[ID_VAR_NM] + '.jpg').values\nimg_dims = zeros((len(img_paths), 2))\n\nfor i, img_path in enumerate(img_paths):\n \n img_dims[i,:] = load_img(img_path).shape[:-1]\n \n\nfig = go.Figure()\nfig.add_trace(go.Histogram(x=img_dims[:,0], histnorm='probability', name='width'))\nfig.add_trace(go.Histogram(x=img_dims[:,1], histnorm='probability', name='height'))\nfig.update_layout(title_text='Distribution of Img Width and Height')\nfig.show()", "_____no_output_____" ] ], [ [ "# Model", "_____no_output_____" ] ], [ [ "def get_model(efficient_net_model_nm:str, dense_layers_post_eff_net:List[int], dropout: float) -> tf.keras.Model:\n \n \n efficient_net = tf.keras.models.load_model('../input/keras-applications-models/{efficient_net_model_nm}.h5')\n \n if CONFIG.efficient_net_trainable:\n unfreeze_layers(efficient_net)\n \n layers = [\n tf.keras.layers.Input(shape=(CONFIG.img_length, CONFIG.img_width, 3)),\n efficient_net,\n tf.keras.layers.BatchNormalization(),\n tf.keras.layers.Dropout(dropout)\n ]\n \n layers += [tf.keras.layers.Dense(nb_units) for nb_units in dense_layers_post_eff_net]\n \n layers += [tf.keras.layers.Dense(1, activation='sigmoid')]\n \n model = keras.models.Sequential(layers)\n \n print(model.summary())\n \n return model\n\ndef unfreez_layers(model: tf.keras.Model) -> None:\n \n for layer in model.layers:\n if not isinstance(layer, tf.keras.layers.BatchNormalization):\n layer.trainable = True\n else:\n layer.trainable = False\n \n\ndef compile_model(model: keras.Model, learning_rate: float, loss_func:str) -> None:\n \n optimizer = keras.optimizers.Adam(learning_rate=learning_rate)\n \n model.compile(loss=loss_func, optimizer=optimizer, metrics=[keras.metrics.RootMeanSquaredError()])\n\n\ndef fit(model: keras.Model, ds_train: data.Dataset, ds_val: data.Dataset, epochs: int) -> None:\n \n early_stopping = tf.keras.callbacks.EarlyStopping(monitor='val_loss', patience=3)\n\n model.fit(ds_train, epochs=epochs, validation_data=ds_val, callbacks=[WandbCallback(), early_stopping])", "_____no_output_____" ], [ "\nmodel = get_model(CONFIG.efficient_net_symbol, CONFIG.dense_layers_post_efficient_net, CONFIG.dropout)\ncompile_model(model, CONFIG.learning_rate, CONFIG.loss_func)\nfit(model, ds_train, ds_val, CONFIG.epochs)\n\nrun.finish()", "_____no_output_____" ] ], [ [ "# Submissions", "_____no_output_____" ] ], [ [ "\ndef save_test_pred(pred: ndarray) -> None:\n\n df_test = load_df_test()\n df_test[TARGET_VAR_NM] = pred\n\n df_test[[ID_VAR_NM, TARGET_VAR_NM]].to_csv('submission.csv', index=False)\n \ndef load_df_test() -> DataFrame:\n\n return read_csv('{}/test.csv'.format(DATA_PATH), usecols=[ID_VAR_NM])", "_____no_output_____" ], [ "test_pred = model.predict(ds_test)\ntest_pred *= 100\nsave_test_pred(test_pred)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ] ]
e7e7b10d1600953289a5f31278ed8f97d0e39b0b
563,517
ipynb
Jupyter Notebook
빅분기 실기 예제풀이.ipynb
kamzzang/ADPStudy
5676be538c44050bdc3221b6d1eec35cbf95f4c1
[ "MIT" ]
null
null
null
빅분기 실기 예제풀이.ipynb
kamzzang/ADPStudy
5676be538c44050bdc3221b6d1eec35cbf95f4c1
[ "MIT" ]
null
null
null
빅분기 실기 예제풀이.ipynb
kamzzang/ADPStudy
5676be538c44050bdc3221b6d1eec35cbf95f4c1
[ "MIT" ]
1
2022-02-10T15:59:54.000Z
2022-02-10T15:59:54.000Z
158.158013
455,764
0.847407
[ [ [ "# 빅데이터 분석 기사 실기 시험 예제 풀이", "_____no_output_____" ], [ "## 1. 작업형 제1유형 : 데이터 처리 영역\n* mtcars 데이터셋(mtcars.csv)의 qsec 컬럼을 최소최대 척도(Min-Max Scale)로 변환한 후 0.5보다 큰 값을 가지는 레코드 수를 구하시오.", "_____no_output_____" ] ], [ [ "import pandas as pd # pandas import\n\ndf = pd.read_csv('mtcars.csv') # df에 mtcars.csv를 읽어 데이터프레임으로 저장\ndf.head() # df의 앞에서 5개 데이터 출력", "_____no_output_____" ] ], [ [ "* 방법 1 \nsklearn의 MinMaxScaler를 이용해서 변환", "_____no_output_____" ] ], [ [ "from sklearn.preprocessing import MinMaxScaler # sklearn의 min-max scaler import\n\nscaler = MinMaxScaler() # MinMaxScaler 객체 생성\n\n# scaler에 데이터를 넣어서 모델을 만들고 값을 덮어씨움\ndf['qsec'] = scaler.fit_transform(df[['qsec']])\n\n# qsec가 0.5보다 큰 데이터만 색인해서 길이를 구함\nanswer = len(df[df['qsec']>0.5])\nprint(answer)", "9\n" ] ], [ [ "* 방법 2 \nMin-Max Scale을 수식으로 만들어서 변환시킴", "_____no_output_____" ] ], [ [ "df['qsec'] = (df['qsec'] - df['qsec'].min()) / (df['qsec'].max() - df['qsec'].min())\n\nanswer = len(df[df['qsec']>0.5])\nprint(answer)", "9\n" ] ], [ [ "## 2. 작업형 제2유형 : 모형 구축 및 평가 영역\n* 아래는 백화점 고객의 1년간 구매 데이터이다.\n![image.png](attachment:291e1ffc-e949-4bc0-98fe-69e2a04d8546.png)", "_____no_output_____" ], [ "#### 결과 : X_test데이터로 남자일 확률을 구해서 cust_id와 남자일 확률만 가진 csv로 생성\n#### 평가지표 : ROC-AUC Curve\n#### 확인 사항\n* 데이터 전처리\n* Feature Engineering\n* 분류 모델\n* 최적화\n* 앙상블", "_____no_output_____" ], [ "## 1. EDA", "_____no_output_____" ] ], [ [ "import pandas as pd\nimport numpy as np", "_____no_output_____" ], [ "X_train = pd.read_csv('X_train.csv', encoding='euc-kr') # 한글이 있어 인코딩하여 읽믕\ny_train = pd.read_csv('y_train.csv')\nX_test = pd.read_csv('X_test.csv', encoding='euc-kr') # 한글이 있어 인코딩하여 읽믕\n \ndisplay(X_train.head())\ndisplay(y_train.head())\ndisplay(X_test.head())", "_____no_output_____" ], [ "train_data = X_train.merge(y_train, on='cust_id', how='outer') # X와 y를 합침\ntrain_data.head()", "_____no_output_____" ] ], [ [ "* 칼럼 별 데이터 타입과 형태 확인\n * 환불금액에 결측치 있음\n * 주구매상품과 주구매지점만 범주형 데이터 : 필요시 one-hot encoding", "_____no_output_____" ] ], [ [ "train_data.info() ", "<class 'pandas.core.frame.DataFrame'>\nInt64Index: 3500 entries, 0 to 3499\nData columns (total 11 columns):\n # Column Non-Null Count Dtype \n--- ------ -------------- ----- \n 0 cust_id 3500 non-null int64 \n 1 총구매액 3500 non-null int64 \n 2 최대구매액 3500 non-null int64 \n 3 환불금액 1205 non-null float64\n 4 주구매상품 3500 non-null object \n 5 주구매지점 3500 non-null object \n 6 내점일수 3500 non-null int64 \n 7 내점당구매건수 3500 non-null float64\n 8 주말방문비율 3500 non-null float64\n 9 구매주기 3500 non-null int64 \n 10 gender 3500 non-null int64 \ndtypes: float64(3), int64(6), object(2)\nmemory usage: 328.1+ KB\n" ] ], [ [ "* 결측치 확인\n * 환불금액에 결측치가 대부분(2295 / 3500)", "_____no_output_____" ] ], [ [ "train_data.isnull().sum()", "_____no_output_____" ] ], [ [ "* 테스트 데이터의 환불금액도 결측치가 많음", "_____no_output_____" ] ], [ [ "X_test.isnull().sum()", "_____no_output_____" ] ], [ [ "* 숫자형 데이터의 분포 확인\n * 컬럼마다의 스케일 차이가 커서 변환 필요", "_____no_output_____" ] ], [ [ "train_data.describe()", "_____no_output_____" ] ], [ [ "* 문자 데이터 분포 확인", "_____no_output_____" ] ], [ [ "train_data.describe(include=[object])", "_____no_output_____" ], [ "display(train_data['주구매상품'].unique(), len(train_data['주구매상품'].unique()))\ndisplay(X_test['주구매상품'].unique(), len(X_test['주구매상품'].unique()))\ndisplay(train_data['주구매지점'].unique(), len(train_data['주구매지점'].unique()))\ndisplay(X_test['주구매지점'].unique(), len(X_test['주구매지점'].unique()))", "_____no_output_____" ] ], [ [ "* 주구매상품에서 차이나는 상품 확인", "_____no_output_____" ] ], [ [ "for i in train_data['주구매상품'].unique():\n if i not in X_test['주구매상품'].unique():\n print(i)", "소형가전\n" ] ], [ [ "* train_data에 소형 가전 데이터 확인", "_____no_output_____" ] ], [ [ "train_data[train_data['주구매상품']=='소형가전']", "_____no_output_____" ], [ "2/3500 # 0.05% 소형가전 데이터", "_____no_output_____" ] ], [ [ "* 총구매액과 최대구매액에 음수가 확인되어 해당 데이터 출력 \n * 모두 여자의 경우로 확인됨\n * 환불 금액이 최대구매액보다 많은 것의 의미?\n * 최대구매액이 음수는 뭔가?", "_____no_output_____" ] ], [ [ "train_data[(train_data['총구매액']<=0) | (train_data['최대구매액']<=0)]", "_____no_output_____" ] ], [ [ "* 테스트 데이터도 확인\n * 0과 음수의 값을 어떻게 처리할 것인가?", "_____no_output_____" ] ], [ [ "X_test[(X_test['총구매액']<=0) | (X_test['최대구매액']<=0)]", "_____no_output_____" ] ], [ [ "* train_data에서 gender에 따른 값들 비교", "_____no_output_____" ] ], [ [ "display(train_data.groupby('gender').min())\ndisplay(train_data.groupby('gender').mean())\ndisplay(train_data.groupby('gender').max())", "_____no_output_____" ] ], [ [ "* train_data끼리의 상관계수 확인 \n * gender와 상관관계가 높은 데이터가 없음", "_____no_output_____" ] ], [ [ "train_data.corr()", "_____no_output_____" ] ], [ [ "* 성별에 따른 특이점이 보이지 않음\n* 전체 데이터에 성별 데이터 수 확인", "_____no_output_____" ] ], [ [ "print('전체 데이터 :', len(train_data))\nprint('여자 데이터 수 :', len(train_data[train_data['gender']==0]))\nprint('남자 데이터 수 :', len(train_data[train_data['gender']==1]))\nprint('데이터에서 남자일 확률 : {}%'.format(round((len(train_data[train_data['gender']==1]) / len(train_data))*100, 1)))", "전체 데이터 : 3500\n여자 데이터 수 : 2184\n남자 데이터 수 : 1316\n데이터에서 남자일 확률 : 37.6%\n" ] ], [ [ "### 2. 데이터 전처리", "_____no_output_____" ], [ "* 환불금액의 결측치를 0으로 대체", "_____no_output_____" ] ], [ [ "train_data['환불금액'].fillna(0, inplace=True)\nX_test['환불금액'].fillna(0, inplace=True)\n\ndisplay(train_data.isnull().sum())\ndisplay(X_test.isnull().sum())", "_____no_output_____" ] ], [ [ "* 주구매상품이 소형가전인 데이터 삭제", "_____no_output_____" ] ], [ [ "train_data.drop(train_data[train_data['주구매상품']=='소형가전'].index, inplace=True)\ntrain_data[train_data['주구매상품']=='소형가전']", "_____no_output_____" ] ], [ [ "### 3. Feature Engineering", "_____no_output_____" ], [ "* 연속형 데이터 : 표준 정규 분포로 변환\n * 내점당구매건수, 구매주기는 결과를 보고 삭제도 검토(상관계수 낮음)", "_____no_output_____" ] ], [ [ "train_data.head()", "_____no_output_____" ], [ "conti_cols = ['총구매액', '최대구매액', '환불금액','내점일수', '내점당구매건수', '주말방문비율', '구매주기']\n\n# 표준 정규 분표 scaler 사용하여 train데이터에서 만들 scaler를 test에 동일하게 적용하여 변환\nfrom sklearn.preprocessing import StandardScaler\n\nfor col in conti_cols:\n scaler = StandardScaler()\n scaler.fit(train_data[[col]])\n \n train_data[col] = scaler.transform(train_data[[col]])\n X_test[col] = scaler.transform(X_test[[col]])\n\n \ndisplay(train_data.describe())\ndisplay(X_test.describe())", "_____no_output_____" ] ], [ [ "* 범주형 데이터 원핫인코딩", "_____no_output_____" ] ], [ [ "categorical_cols = ['주구매상품', '주구매지점']\n\nfor col in categorical_cols:\n temp = pd.get_dummies(train_data[col])\n train_data = pd.concat([train_data, temp], axis=1)\n del train_data[col]\n \n temp = pd.get_dummies(X_test[col])\n X_test = pd.concat([X_test, temp], axis=1)\n del X_test[col]\n \ndisplay(train_data.head())\ndisplay(X_test.head())", "_____no_output_____" ] ], [ [ "### 4. 분류 알고리즘", "_____no_output_____" ] ], [ [ "from sklearn.ensemble import RandomForestClassifier # 랜덤포레스트\nfrom sklearn.linear_model import LogisticRegression # 로지스틱회귀\nfrom sklearn.metrics import roc_auc_score # 예제의 평가지표인 ROC_AUC score\n\nx_cols = list(train_data.columns)\nx_cols.remove('cust_id')\nx_cols.remove('gender')\n\nX = train_data[x_cols]\ny = train_data['gender']\ntest_x = X_test[x_cols]\n\n# 랜덤포레스트 모델 생성/학습\nmodel_rf = RandomForestClassifier(n_estimators=100, max_leaf_nodes=32)\nmodel_rf.fit(X, y)\npred_rf = model_rf.predict_proba(X)\n\nprint('RF ROCAUC Score: ', roc_auc_score(y, pred_rf[:,1]))\n\n# 로지스틱 회귀 모델 생성/학습\nmodel_lr = LogisticRegression()\nmodel_lr.fit(X, y)\npred_lr = model_lr.predict_proba(X)\n\nprint('LR ROCAUC Score: ', roc_auc_score(y, pred_lr[:,1]))", "RF ROCAUC Score: 0.7546568802481672\nLR ROCAUC Score: 0.6955802615788438\n" ] ], [ [ "### 5. 결과 제출", "_____no_output_____" ] ], [ [ "# ROC_AUC score가 높은 랜덤폴스트로 테스트 데이터로 결과 예측값 정리\npred_result = pd.DataFrame(model_rf.predict_proba(test_x))\nresult = pd.concat([X_test['cust_id'], pred_result[[1]]], axis=1)\nresult.columns = [['cust_id', 'gender']] # 예측결과의 컬럼이 1이므로 문제와 동일하게 컬럼 변경\nresult", "_____no_output_____" ], [ "result.to_csv('result.csv', index=False) # 별도의 인덱스 없이 csv로 저장", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code" ] ]
e7e7b30bba891674b19454accbc4186ad78d2cce
1,717
ipynb
Jupyter Notebook
docs/Page3.ipynb
AaronCHH/nbdev2
9f6c913d4ee1cbb85e6aba077ce111efda97193e
[ "Apache-2.0" ]
null
null
null
docs/Page3.ipynb
AaronCHH/nbdev2
9f6c913d4ee1cbb85e6aba077ce111efda97193e
[ "Apache-2.0" ]
null
null
null
docs/Page3.ipynb
AaronCHH/nbdev2
9f6c913d4ee1cbb85e6aba077ce111efda97193e
[ "Apache-2.0" ]
null
null
null
18.663043
45
0.525917
[ [ [ "print('hello')", "hello\n" ] ] ]
[ "code" ]
[ [ "code" ] ]
e7e7e9fb9526351dc4f7d14377a65d7e6ecd9ab9
119,125
ipynb
Jupyter Notebook
K-means clustering_pyspark.ipynb
Molla80/K-means-clustering-using-pyspark
0de2284877a4146491cdbc2e651fee3d65d34d74
[ "MIT" ]
null
null
null
K-means clustering_pyspark.ipynb
Molla80/K-means-clustering-using-pyspark
0de2284877a4146491cdbc2e651fee3d65d34d74
[ "MIT" ]
null
null
null
K-means clustering_pyspark.ipynb
Molla80/K-means-clustering-using-pyspark
0de2284877a4146491cdbc2e651fee3d65d34d74
[ "MIT" ]
null
null
null
71.935386
53,752
0.621079
[ [ [ "# A K-means clustering project", "_____no_output_____" ], [ "The purpose of this exercise is to implement the K-means clustering module of pyspark and find how many hacker groups were involved in the data brach of a certain technology firm. The forensic engineers of the firm were able to collect some meta data of each brach. The firm suspects that there might be two or three hacker group. But they are sure that each group attacked the same number of times, i.e. the attack from the hacker groups was 50 - 50. ", "_____no_output_____" ] ], [ [ "import findspark\nfindspark.init('/home/yohannes/spark-2.4.7-bin-hadoop2.7')\n%config Completer.use_jedi = False", "_____no_output_____" ], [ "from pyspark.sql import SparkSession", "_____no_output_____" ], [ "spark = SparkSession.builder.appName('Kmeans').getOrCreate()", "_____no_output_____" ], [ "data = spark.read.csv('hack_data.csv',header=True,inferSchema=True)", "_____no_output_____" ] ], [ [ "### Data exploration", "_____no_output_____" ] ], [ [ "data.printSchema()", "root\n |-- Session_Connection_Time: double (nullable = true)\n |-- Bytes Transferred: double (nullable = true)\n |-- Kali_Trace_Used: integer (nullable = true)\n |-- Servers_Corrupted: double (nullable = true)\n |-- Pages_Corrupted: double (nullable = true)\n |-- Location: string (nullable = true)\n |-- WPM_Typing_Speed: double (nullable = true)\n\n" ], [ "data.head(1)", "_____no_output_____" ] ], [ [ "### Creating features vector", "_____no_output_____" ] ], [ [ "from pyspark.ml.feature import VectorAssembler", "_____no_output_____" ], [ "data.columns", "_____no_output_____" ], [ "assembler = VectorAssembler(inputCols=['Session_Connection_Time',\n 'Bytes Transferred',\n 'Kali_Trace_Used',\n 'Servers_Corrupted',\n 'Pages_Corrupted',\n 'WPM_Typing_Speed'], outputCol='features')", "_____no_output_____" ], [ "final_data = assembler.transform(data)", "_____no_output_____" ], [ "final_data.printSchema()", "root\n |-- Session_Connection_Time: double (nullable = true)\n |-- Bytes Transferred: double (nullable = true)\n |-- Kali_Trace_Used: integer (nullable = true)\n |-- Servers_Corrupted: double (nullable = true)\n |-- Pages_Corrupted: double (nullable = true)\n |-- Location: string (nullable = true)\n |-- WPM_Typing_Speed: double (nullable = true)\n |-- features: vector (nullable = true)\n\n" ] ], [ [ "### Scaling the data", "_____no_output_____" ] ], [ [ "from pyspark.ml.feature import StandardScaler", "_____no_output_____" ], [ "scaler = StandardScaler(inputCol='features',outputCol='scaledFeat')", "_____no_output_____" ], [ "final_data = scaler.fit(final_data).transform(final_data)", "_____no_output_____" ], [ "final_data.printSchema()", "root\n |-- Session_Connection_Time: double (nullable = true)\n |-- Bytes Transferred: double (nullable = true)\n |-- Kali_Trace_Used: integer (nullable = true)\n |-- Servers_Corrupted: double (nullable = true)\n |-- Pages_Corrupted: double (nullable = true)\n |-- Location: string (nullable = true)\n |-- WPM_Typing_Speed: double (nullable = true)\n |-- features: vector (nullable = true)\n |-- scaledFeat: vector (nullable = true)\n\n" ] ], [ [ "### K-means clustering model", "_____no_output_____" ] ], [ [ "from pyspark.ml.clustering import KMeans", "_____no_output_____" ], [ "# let's try with the assumption that there were two hacker groups\nkmeans = KMeans(featuresCol='scaledFeat',k=2)", "_____no_output_____" ], [ "model = kmeans.fit(final_data)", "_____no_output_____" ], [ "results = model.transform(final_data)", "_____no_output_____" ], [ "centers = model.clusterCenters()", "_____no_output_____" ], [ "print(centers)", "[array([2.99991988, 2.92319035, 1.05261534, 3.20390443, 4.51321315,\n 3.28474 ]), array([1.26023837, 1.31829808, 0.99280765, 1.36491885, 2.5625043 ,\n 5.26676612])]\n" ], [ "results.printSchema()", "root\n |-- Session_Connection_Time: double (nullable = true)\n |-- Bytes Transferred: double (nullable = true)\n |-- Kali_Trace_Used: integer (nullable = true)\n |-- Servers_Corrupted: double (nullable = true)\n |-- Pages_Corrupted: double (nullable = true)\n |-- Location: string (nullable = true)\n |-- WPM_Typing_Speed: double (nullable = true)\n |-- features: vector (nullable = true)\n |-- scaledFeat: vector (nullable = true)\n |-- prediction: integer (nullable = false)\n\n" ], [ "results.describe().show()", "+-------+-----------------------+------------------+------------------+-----------------+------------------+-----------+------------------+------------------+\n|summary|Session_Connection_Time| Bytes Transferred| Kali_Trace_Used|Servers_Corrupted| Pages_Corrupted| Location| WPM_Typing_Speed| prediction|\n+-------+-----------------------+------------------+------------------+-----------------+------------------+-----------+------------------+------------------+\n| count| 334| 334| 334| 334| 334| 334| 334| 334|\n| mean| 30.008982035928145| 607.2452694610777|0.5119760479041916|5.258502994011977|10.838323353293413| null|57.342395209580864| 0.5|\n| stddev| 14.088200614636158|286.33593163576757|0.5006065264451406| 2.30190693339697| 3.06352633036022| null| 13.41106336843464|0.5007501879687625|\n| min| 1.0| 10.0| 0| 1.0| 6.0|Afghanistan| 40.0| 0|\n| max| 60.0| 1330.5| 1| 10.0| 15.0| Zimbabwe| 75.0| 1|\n+-------+-----------------------+------------------+------------------+-----------------+------------------+-----------+------------------+------------------+\n\n" ], [ "results.groupBy('prediction').count().show()\n# This shows that the attack was equaly sheared by the hacker groups", "+----------+-----+\n|prediction|count|\n+----------+-----+\n| 1| 167|\n| 0| 167|\n+----------+-----+\n\n" ] ], [ [ "### Graphical visualization of the clusters", "_____no_output_____" ] ], [ [ "results_pd = results.toPandas()", "_____no_output_____" ], [ "results_pd", "_____no_output_____" ], [ "import matplotlib.pyplot as plt\n%matplotlib inline", "_____no_output_____" ], [ "plot = plt.scatter(data=results_pd, x=results_pd.index, y=results_pd['Bytes Transferred'],c=results_pd['prediction'])\nplt.ylabel('Bytes Transferred')", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code" ] ]
e7e80c906cdf8d1903fe0cbbdd1843f182e5c0da
30,480
ipynb
Jupyter Notebook
credit_risk_resampling.ipynb
douglasg-fintec/Credit_Risk_Resampling
8fd52c90870ce4b2a4099c4853110092bacbb10d
[ "MIT" ]
null
null
null
credit_risk_resampling.ipynb
douglasg-fintec/Credit_Risk_Resampling
8fd52c90870ce4b2a4099c4853110092bacbb10d
[ "MIT" ]
null
null
null
credit_risk_resampling.ipynb
douglasg-fintec/Credit_Risk_Resampling
8fd52c90870ce4b2a4099c4853110092bacbb10d
[ "MIT" ]
null
null
null
32.66881
811
0.492618
[ [ [ "# Credit Risk Classification\n\nCredit risk poses a classification problem that’s inherently imbalanced. This is because healthy loans easily outnumber risky loans. In this Challenge, you’ll use various techniques to train and evaluate models with imbalanced classes. You’ll use a dataset of historical lending activity from a peer-to-peer lending services company to build a model that can identify the creditworthiness of borrowers.\n\n## Instructions:\n\nThis challenge consists of the following subsections:\n\n* Split the Data into Training and Testing Sets\n\n* Create a Logistic Regression Model with the Original Data\n\n* Predict a Logistic Regression Model with Resampled Training Data \n\n### Split the Data into Training and Testing Sets\n\nOpen the starter code notebook and then use it to complete the following steps.\n\n1. Read the `lending_data.csv` data from the `Resources` folder into a Pandas DataFrame.\n\n2. Create the labels set (`y`) from the “loan_status” column, and then create the features (`X`) DataFrame from the remaining columns.\n\n > **Note** A value of `0` in the “loan_status” column means that the loan is healthy. A value of `1` means that the loan has a high risk of defaulting. \n\n3. Check the balance of the labels variable (`y`) by using the `value_counts` function.\n\n4. Split the data into training and testing datasets by using `train_test_split`.\n\n### Create a Logistic Regression Model with the Original Data\n\nEmploy your knowledge of logistic regression to complete the following steps:\n\n1. Fit a logistic regression model by using the training data (`X_train` and `y_train`).\n\n2. Save the predictions on the testing data labels by using the testing feature data (`X_test`) and the fitted model.\n\n3. Evaluate the model’s performance by doing the following:\n\n * Calculate the accuracy score of the model.\n\n * Generate a confusion matrix.\n\n * Print the classification report.\n\n4. Answer the following question: How well does the logistic regression model predict both the `0` (healthy loan) and `1` (high-risk loan) labels?\n\n### Predict a Logistic Regression Model with Resampled Training Data\n\nDid you notice the small number of high-risk loan labels? Perhaps, a model that uses resampled data will perform better. You’ll thus resample the training data and then reevaluate the model. Specifically, you’ll use `RandomOverSampler`.\n\nTo do so, complete the following steps:\n\n1. Use the `RandomOverSampler` module from the imbalanced-learn library to resample the data. Be sure to confirm that the labels have an equal number of data points. \n\n2. Use the `LogisticRegression` classifier and the resampled data to fit the model and make predictions.\n\n3. Evaluate the model’s performance by doing the following:\n\n * Calculate the accuracy score of the model.\n\n * Generate a confusion matrix.\n\n * Print the classification report.\n \n4. Answer the following question: How well does the logistic regression model, fit with oversampled data, predict both the `0` (healthy loan) and `1` (high-risk loan) labels?\n\n### Write a Credit Risk Analysis Report\n\nFor this section, you’ll write a brief report that includes a summary and an analysis of the performance of both machine learning models that you used in this challenge. You should write this report as the `README.md` file included in your GitHub repository.\n\nStructure your report by using the report template that `Starter_Code.zip` includes, and make sure that it contains the following:\n\n1. An overview of the analysis: Explain the purpose of this analysis.\n\n\n2. The results: Using bulleted lists, describe the balanced accuracy scores and the precision and recall scores of both machine learning models.\n\n3. A summary: Summarize the results from the machine learning models. Compare the two versions of the dataset predictions. Include your recommendation for the model to use, if any, on the original vs. the resampled data. If you don’t recommend either model, justify your reasoning.", "_____no_output_____" ] ], [ [ "# Import the modules\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom pathlib import Path\r\nfrom sklearn.metrics import balanced_accuracy_score\r\nfrom sklearn.metrics import confusion_matrix\r\nfrom imblearn.metrics import classification_report_imbalanced\r\n\r\nimport warnings\r\nwarnings.filterwarnings('ignore')", "_____no_output_____" ] ], [ [ "---", "_____no_output_____" ], [ "## Split the Data into Training and Testing Sets", "_____no_output_____" ], [ "### Step 1: Read the `lending_data.csv` data from the `Resources` folder into a Pandas DataFrame.", "_____no_output_____" ] ], [ [ "# Read the CSV file from the Resources folder into a Pandas DataFrame\r\n# Using the read_csv function and Path module, create a DataFrame \r\nlending_data_df = pd.read_csv(\r\n Path('./Resources/lending_data.csv'),\r\n).dropna()\r\n\r\n# Review the DataFrame\r\ndisplay(lending_data_df.head())\r\ndisplay(lending_data_df.tail())", "_____no_output_____" ] ], [ [ "### Step 2: Create the labels set (`y`) from the “loan_status” column, and then create the features (`X`) DataFrame from the remaining columns.", "_____no_output_____" ] ], [ [ "# Separate the data into labels and features\r\n\r\ny = lending_data_df['loan_status']\r\n\r\n# Separate the X variable, the features\r\nX = lending_data_df[['loan_size','interest_rate','borrower_income','debt_to_income','num_of_accounts','derogatory_marks','total_debt']]", "_____no_output_____" ], [ "# Review the y variable Series\r\ndisplay(y[:5])", "_____no_output_____" ], [ "# Review the X variable DataFrame\r\ndisplay(X.head())", "_____no_output_____" ] ], [ [ "### Step 3: Check the balance of the labels variable (`y`) by using the `value_counts` function.", "_____no_output_____" ] ], [ [ "# Check the balance of our target values\r\ny.value_counts()", "_____no_output_____" ] ], [ [ "### Step 4: Split the data into training and testing datasets by using `train_test_split`.", "_____no_output_____" ] ], [ [ "# Import the train_test_learn module\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n# Split the data using train_test_split\r\n# Assign a random_state of 1 to the function\r\nX_train, X_test,y_train,y_test= train_test_split(X, y,random_state=1)\r\n", "_____no_output_____" ] ], [ [ "---", "_____no_output_____" ], [ "## Create a Logistic Regression Model with the Original Data", "_____no_output_____" ], [ "### Step 1: Fit a logistic regression model by using the training data (`X_train` and `y_train`).", "_____no_output_____" ] ], [ [ "# Import the LogisticRegression module from SKLearn\r\nfrom sklearn.linear_model import LogisticRegression\r\n\r\n# Instantiate the Logistic Regression model\r\n# Assign a random_state parameter of 1 to the model\r\nlogistic_regression_model = LogisticRegression(random_state=1)\r\n\r\n# Fit the model using training data\r\nlogistic_regression_model.fit(X_train,y_train)", "_____no_output_____" ] ], [ [ "### Step 2: Save the predictions on the testing data labels by using the testing feature data (`X_test`) and the fitted model.", "_____no_output_____" ] ], [ [ "# Make a prediction using the testing data\r\ny_predict = logistic_regression_model.predict(X_test)", "_____no_output_____" ] ], [ [ "### Step 3: Evaluate the model’s performance by doing the following:\n\n* Calculate the accuracy score of the model.\n\n* Generate a confusion matrix.\n\n* Print the classification report.", "_____no_output_____" ] ], [ [ "# Print the balanced_accuracy score of the model\r\nbalanced_accuracy = balanced_accuracy_score(y_test,y_predict)\r\nprint(balanced_accuracy)", "0.9520479254722232\n" ], [ "# Generate a confusion matrix for the model\r\nlogistic_regression_matrix =confusion_matrix(y_test, y_predict)\r\nprint(logistic_regression_matrix)", "[[18663 102]\n [ 56 563]]\n" ], [ "# Print the classification report for the model\r\nlogistic_regression_report = classification_report_imbalanced(y_test, y_predict)\r\nprint(logistic_regression_report)", " pre rec spe f1 geo iba sup\n\n 0 1.00 0.99 0.91 1.00 0.95 0.91 18765\n 1 0.85 0.91 0.99 0.88 0.95 0.90 619\n\navg / total 0.99 0.99 0.91 0.99 0.95 0.91 19384\n\n" ] ], [ [ "### Step 4: Answer the following question.\r\n\r\n**Question:** How well does the logistic regression model predict both the `0` (healthy loan) and `1` (high-risk loan) labels?\r\n\r\n**Answer:** The model performed better for the 0 class of samples than it did for the 1 class of samples. The precision and the recall for the 0 class (healthy loan) is much better than that for the 1 class (high-risk loan). The precision for the 0 values is very high at 1.00. This means that out of all the times that the model predicted a testing data observation to be the value 0, 100% of those predictions were correct. This number is largely due to the fact we are workong with an imbalanced data set where 0 values represent the majority class with 18765 instances found in the data versus only 619 instances in the minority class. In contrast, out of all the times that the model predicted a value of 1, only 85% of those predictions were correct with 1 class represents the minority class.\r\n\r\nThe recall for the 0 and 1 classes almost matches which means the model accuratly calculated the respecitve class values equaly.\r\n", "_____no_output_____" ], [ "---", "_____no_output_____" ], [ "## Predict a Logistic Regression Model with Resampled Training Data", "_____no_output_____" ], [ "### Step 1: Use the `RandomOverSampler` module from the imbalanced-learn library to resample the data. Be sure to confirm that the labels have an equal number of data points. ", "_____no_output_____" ] ], [ [ "# Import the RandomOverSampler module form imbalanced-learn\r\nfrom imblearn.over_sampling import RandomOverSampler\r\n\r\n# Instantiate the random oversampler model\r\n# # Assign a random_state parameter of 1 to the model\r\nrandom_oversampler_model = RandomOverSampler(random_state=1)\r\n\r\n# Fit the original training data to the random_oversampler model\r\nX_resampled, y_resampled = random_oversampler_model.fit_resample(X_train,y_train)", "_____no_output_____" ], [ "# Count the distinct values of the resampled labels data\r\ny_resampled.value_counts()\r\n", "_____no_output_____" ] ], [ [ "### Step 2: Use the `LogisticRegression` classifier and the resampled data to fit the model and make predictions.", "_____no_output_____" ] ], [ [ "# Instantiate the Logistic Regression model\r\n# Assign a random_state parameter of 1 to the model\r\nlogistic_regression_resample_model = LogisticRegression(random_state=1)\r\n\r\n# Fit the model using the resampled training data\r\nlogistic_regression_resample_model.fit(X_resampled, y_resampled)\r\n\r\n# Make a prediction using the testing data\r\ny_resampled_perdict = logistic_regression_resample_model.predict(X_test)", "_____no_output_____" ] ], [ [ "### Step 3: Evaluate the model’s performance by doing the following:\n\n* Calculate the accuracy score of the model.\n\n* Generate a confusion matrix.\n\n* Print the classification report.", "_____no_output_____" ] ], [ [ "# Print the balanced_accuracy score of the model \r\nbalanced_accuracy = balanced_accuracy_score(y_test,y_resampled_perdict)\r\nprint(balanced_accuracy)", "0.9936781215845847\n" ], [ "# Generate a confusion matrix for the model\r\nlogistic_regression_resample_matrtix = confusion_matrix(y_test, y_resampled_perdict)\r\nprint(logistic_regression_resample_matrtix)", "[[18649 116]\n [ 4 615]]\n" ], [ "# Print the classification report for the model\r\nlogistic_regression_resample_report = classification_report_imbalanced(y_test, y_resampled_perdict)\r\nprint(logistic_regression_resample_report)", " pre rec spe f1 geo iba sup\n\n 0 1.00 0.99 0.99 1.00 0.99 0.99 18765\n 1 0.84 0.99 0.99 0.91 0.99 0.99 619\n\navg / total 0.99 0.99 0.99 0.99 0.99 0.99 19384\n\n" ] ], [ [ "### Step 4: Answer the following question", "_____no_output_____" ], [ "**Question:** How well does the logistic regression model, fit with oversampled data, predict both the `0` (healthy loan) and `1` (high-risk loan) labels?\r\n\r\n**Answer:** The model performed better for the 0 class of samples than it did for the 1 class of samples. The precision and the recall for the 0 class (healthy loan) is much better than that for the 1 class (high-risk loan). The precision for the 0 values is very high at 1.00. This means that out of all the times that the model predicted a testing data observation to be the value 0, 100% of those predictions were correct. In contrast, out of all the times that the model predicted a value of 1, only 84% of those predictions were correct with 1 class represents the minority class.\r\n\r\nThe recall for the 0 and 1 classes almost matches which means the model accuratly calculated the respecitve class values equaly.\r\n", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown" ]
[ [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown", "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown", "markdown", "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown", "markdown" ] ]
e7e80e90093096d869a268fab462ccab1703e7b0
163,220
ipynb
Jupyter Notebook
PyTorchNN/1610_PT_FCU.ipynb
marcinbogdanski/ai-sketchpad
cd97a99ab0504b845e6962de5970042acd2cb91c
[ "MIT" ]
8
2019-01-04T18:54:39.000Z
2021-06-16T22:10:44.000Z
PyTorchNN/1610_PT_FCU.ipynb
marcinbogdanski/ai-sketchpad
cd97a99ab0504b845e6962de5970042acd2cb91c
[ "MIT" ]
null
null
null
PyTorchNN/1610_PT_FCU.ipynb
marcinbogdanski/ai-sketchpad
cd97a99ab0504b845e6962de5970042acd2cb91c
[ "MIT" ]
1
2021-04-02T02:44:40.000Z
2021-04-02T02:44:40.000Z
271.129568
145,200
0.912002
[ [ [ "# Imports", "_____no_output_____" ] ], [ [ "import os\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import datasets, transforms, models\nfrom collections import OrderedDict\nimport PIL", "_____no_output_____" ], [ "device = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")", "_____no_output_____" ], [ "dataset_location = '/home/marcin/Datasets/camvid/'", "_____no_output_____" ] ], [ [ "# CamVid Dataset", "_____no_output_____" ] ], [ [ "def download(url, dest, md5sum):\n import os\n import urllib\n import hashlib\n\n folder, file = os.path.split(dest)\n if folder != '':\n os.makedirs(folder, exist_ok=True)\n if not os.path.isfile(dest):\n print('Downloading', file, '...')\n urllib.request.urlretrieve(url, dest)\n else:\n print('Already Exists:', file)\n assert hashlib.md5(open(dest, 'rb').read()).hexdigest() == md5sum", "_____no_output_____" ], [ "download(url='https://github.com/alexgkendall/SegNet-Tutorial/archive/master.zip',\n dest=os.path.join(dataset_location, 'master.zip'),\n md5sum='9a61b9d172b649f6e5da7e8ebf75338f')", "Already Exists: master.zip\n" ], [ "def extract(src, dest):\n import os\n import zipfile\n \n path, file = os.path.split(src)\n extract_path, _ = os.path.splitext(src)\n already_extracted = os.path.isdir(dest)\n if not already_extracted:\n with zipfile.ZipFile(src, 'r') as zf:\n print('Extracting', file, '...')\n zf.extractall(dest)\n else:\n print('Already Extracted:', file) \n assert os.path.isdir(extract_path)", "_____no_output_____" ], [ "extract(src=os.path.join(dataset_location, 'master.zip'),\n dest=os.path.join(dataset_location, 'master'))", "Already Extracted: master.zip\n" ], [ " \n \nclass camvidLoader(torch.utils.data.Dataset):\n def __init__(\n self,\n root,\n split=\"train\",\n is_transform=False,\n img_size=None,\n augmentations=None,\n img_norm=True,\n test_mode=False,\n ):\n self.root = root\n self.split = split\n self.img_size = [360, 480]\n self.is_transform = is_transform\n self.augmentations = augmentations\n self.img_norm = img_norm\n self.test_mode = test_mode\n self.mean = np.array([104.00699, 116.66877, 122.67892])\n self.n_classes = 12\n self.files = collections.defaultdict(list)\n\n if not self.test_mode:\n for split in [\"train\", \"test\", \"val\"]:\n file_list = os.listdir(root + \"/\" + split)\n self.files[split] = file_list\n\n def __len__(self):\n return len(self.files[self.split])\n\n def __getitem__(self, index):\n img_name = self.files[self.split][index]\n img_path = self.root + \"/\" + self.split + \"/\" + img_name\n lbl_path = self.root + \"/\" + self.split + \"annot/\" + img_name\n\n img = m.imread(img_path)\n img = np.array(img, dtype=np.uint8)\n\n lbl = m.imread(lbl_path)\n lbl = np.array(lbl, dtype=np.uint8)\n\n if self.augmentations is not None:\n img, lbl = self.augmentations(img, lbl)\n\n if self.is_transform:\n img, lbl = self.transform(img, lbl)\n\n return img, lbl\n\n def transform(self, img, lbl):\n img = m.imresize(img, (self.img_size[0], self.img_size[1])) # uint8 with RGB mode\n img = img[:, :, ::-1] # RGB -> BGR\n img = img.astype(np.float64)\n img -= self.mean\n if self.img_norm:\n # Resize scales images from 0 to 255, thus we need\n # to divide by 255.0\n img = img.astype(float) / 255.0\n # NHWC -> NCHW\n img = img.transpose(2, 0, 1)\n\n img = torch.from_numpy(img).float()\n lbl = torch.from_numpy(lbl).long()\n return img, lbl\n\n def decode_segmap(self, temp, plot=False):\n Sky = [128, 128, 128]\n Building = [128, 0, 0]\n Pole = [192, 192, 128]\n Road = [128, 64, 128]\n Pavement = [60, 40, 222]\n Tree = [128, 128, 0]\n SignSymbol = [192, 128, 128]\n Fence = [64, 64, 128]\n Car = [64, 0, 128]\n Pedestrian = [64, 64, 0]\n Bicyclist = [0, 128, 192]\n Unlabelled = [0, 0, 0]\n\n label_colours = np.array(\n [\n Sky,\n Building,\n Pole,\n Road,\n Pavement,\n Tree,\n SignSymbol,\n Fence,\n Car,\n Pedestrian,\n Bicyclist,\n Unlabelled,\n ]\n )\n r = temp.copy()\n g = temp.copy()\n b = temp.copy()\n for l in range(0, self.n_classes):\n r[temp == l] = label_colours[l, 0]\n g[temp == l] = label_colours[l, 1]\n b[temp == l] = label_colours[l, 2]\n\n rgb = np.zeros((temp.shape[0], temp.shape[1], 3))\n rgb[:, :, 0] = r / 255.0\n rgb[:, :, 1] = g / 255.0\n rgb[:, :, 2] = b / 255.0\n return rgb", "_____no_output_____" ], [ "import scipy.misc as m\nimport collections", "_____no_output_____" ], [ "t_loader = camvidLoader(\n root=os.path.join(dataset_location, 'master/SegNet-Tutorial-master/CamVid'),\n split='train', is_transform=True, img_size=(360, 480))", "_____no_output_____" ], [ "img, lbl = t_loader[0]", "/home/marcin/.anaconda/envs/ptgpu/lib/python3.7/site-packages/ipykernel_launcher.py:38: DeprecationWarning: `imread` is deprecated!\n`imread` is deprecated in SciPy 1.0.0, and will be removed in 1.2.0.\nUse ``imageio.imread`` instead.\n/home/marcin/.anaconda/envs/ptgpu/lib/python3.7/site-packages/ipykernel_launcher.py:41: DeprecationWarning: `imread` is deprecated!\n`imread` is deprecated in SciPy 1.0.0, and will be removed in 1.2.0.\nUse ``imageio.imread`` instead.\n/home/marcin/.anaconda/envs/ptgpu/lib/python3.7/site-packages/ipykernel_launcher.py:53: DeprecationWarning: `imresize` is deprecated!\n`imresize` is deprecated in SciPy 1.0.0, and will be removed in 1.2.0.\nUse ``skimage.transform.resize`` instead.\n" ], [ "lbl.max()", "_____no_output_____" ], [ "t_loader.files['train'][0]", "_____no_output_____" ], [ "import functools\n\nclass fcn32s(nn.Module):\n def __init__(self, n_classes=21, learned_billinear=False):\n super(fcn32s, self).__init__()\n self.learned_billinear = learned_billinear\n self.n_classes = n_classes\n self.loss = functools.partial(cross_entropy2d, size_average=False)\n\n self.conv_block1 = nn.Sequential(\n nn.Conv2d(3, 64, 3, padding=100),\n nn.ReLU(inplace=True),\n nn.Conv2d(64, 64, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.MaxPool2d(2, stride=2, ceil_mode=True),\n )\n\n self.conv_block2 = nn.Sequential(\n nn.Conv2d(64, 128, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(128, 128, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.MaxPool2d(2, stride=2, ceil_mode=True),\n )\n\n self.conv_block3 = nn.Sequential(\n nn.Conv2d(128, 256, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(256, 256, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(256, 256, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.MaxPool2d(2, stride=2, ceil_mode=True),\n )\n\n self.conv_block4 = nn.Sequential(\n nn.Conv2d(256, 512, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(512, 512, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(512, 512, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.MaxPool2d(2, stride=2, ceil_mode=True),\n )\n\n self.conv_block5 = nn.Sequential(\n nn.Conv2d(512, 512, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(512, 512, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.Conv2d(512, 512, 3, padding=1),\n nn.ReLU(inplace=True),\n nn.MaxPool2d(2, stride=2, ceil_mode=True),\n )\n\n self.classifier = nn.Sequential(\n nn.Conv2d(512, 4096, 7),\n nn.ReLU(inplace=True),\n nn.Dropout2d(),\n nn.Conv2d(4096, 4096, 1),\n nn.ReLU(inplace=True),\n nn.Dropout2d(),\n nn.Conv2d(4096, self.n_classes, 1),\n )\n\n if self.learned_billinear:\n raise NotImplementedError\n\n def forward(self, x):\n conv1 = self.conv_block1(x)\n conv2 = self.conv_block2(conv1)\n conv3 = self.conv_block3(conv2)\n conv4 = self.conv_block4(conv3)\n conv5 = self.conv_block5(conv4)\n\n score = self.classifier(conv5)\n\n out = F.upsample(score, x.size()[2:])\n\n return out\n\n def init_vgg16_params(self, vgg16, copy_fc8=True):\n blocks = [\n self.conv_block1,\n self.conv_block2,\n self.conv_block3,\n self.conv_block4,\n self.conv_block5,\n ]\n\n ranges = [[0, 4], [5, 9], [10, 16], [17, 23], [24, 29]]\n features = list(vgg16.features.children())\n\n for idx, conv_block in enumerate(blocks):\n for l1, l2 in zip(features[ranges[idx][0] : ranges[idx][1]], conv_block):\n if isinstance(l1, nn.Conv2d) and isinstance(l2, nn.Conv2d):\n assert l1.weight.size() == l2.weight.size()\n assert l1.bias.size() == l2.bias.size()\n l2.weight.data = l1.weight.data\n l2.bias.data = l1.bias.data\n for i1, i2 in zip([0, 3], [0, 3]):\n l1 = vgg16.classifier[i1]\n l2 = self.classifier[i2]\n l2.weight.data = l1.weight.data.view(l2.weight.size())\n l2.bias.data = l1.bias.data.view(l2.bias.size())\n n_class = self.classifier[6].weight.size()[0]\n if copy_fc8:\n l1 = vgg16.classifier[6]\n l2 = self.classifier[6]\n l2.weight.data = l1.weight.data[:n_class, :].view(l2.weight.size())\n l2.bias.data = l1.bias.data[:n_class]\n", "_____no_output_____" ], [ "def cross_entropy2d(input, target, weight=None, size_average=True):\n n, c, h, w = input.size()\n nt, ht, wt = target.size()\n\n # Handle inconsistent size between input and target\n if h != ht and w != wt: # upsample labels\n input = F.interpolate(input, size=(ht, wt), mode=\"bilinear\", align_corners=True)\n\n input = input.transpose(1, 2).transpose(2, 3).contiguous().view(-1, c)\n target = target.view(-1)\n loss = F.cross_entropy(\n input, target, weight=weight, size_average=size_average, ignore_index=250\n )\n return loss", "_____no_output_____" ], [ "model = fcn32s(n_classes=12)\nvgg16 = models.vgg16(pretrained=True)\nmodel.init_vgg16_params(vgg16)", "_____no_output_____" ], [ "res = model(img.expand(1, -1, -1, -1))", "_____no_output_____" ], [ "def plot_all(img, res, lbl):\n fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, figsize=[16,9])\n \n kkk = np.array(img.numpy().transpose(1, 2, 0)*255 + t_loader.mean, dtype=int)\n kkk = kkk[:,:,::-1]\n ax1.imshow(kkk)\n \n arr = np.argmax( res.detach()[0].numpy(), axis=0) # res to numpy\n ax2.imshow(t_loader.decode_segmap(arr))\n \n ax3.imshow(t_loader.decode_segmap(lbl.numpy()))", "_____no_output_____" ], [ "plot_all(img, res, lbl)", "_____no_output_____" ], [ "for e in range(300000)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code" ]
[ [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code", "code" ] ]
e7e8187c597fa3a1168c1f61e1ec4611924afccc
25,562
ipynb
Jupyter Notebook
04_Apply/US_Crime_Rates/Exercises_with_solutions.ipynb
chisus089/3_pandas_exercises
fc0b0d761d9410152f76e2cb974babd50e61b825
[ "BSD-3-Clause" ]
null
null
null
04_Apply/US_Crime_Rates/Exercises_with_solutions.ipynb
chisus089/3_pandas_exercises
fc0b0d761d9410152f76e2cb974babd50e61b825
[ "BSD-3-Clause" ]
null
null
null
04_Apply/US_Crime_Rates/Exercises_with_solutions.ipynb
chisus089/3_pandas_exercises
fc0b0d761d9410152f76e2cb974babd50e61b825
[ "BSD-3-Clause" ]
1
2020-07-03T12:46:12.000Z
2020-07-03T12:46:12.000Z
32.521628
181
0.401142
[ [ [ "# United States - Crime Rates - 1960 - 2014", "_____no_output_____" ], [ "### Introduction:\n\nThis time you will create a data \n\nSpecial thanks to: https://github.com/justmarkham for sharing the dataset and materials.\n\n### Step 1. Import the necessary libraries", "_____no_output_____" ] ], [ [ "import numpy as np\nimport pandas as pd", "_____no_output_____" ] ], [ [ "### Step 2. Import the dataset from this [address](https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/04_Apply/US_Crime_Rates/US_Crime_Rates_1960_2014.csv). ", "_____no_output_____" ], [ "### Step 3. Assign it to a variable called crime.", "_____no_output_____" ] ], [ [ "url = \"https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/04_Apply/US_Crime_Rates/US_Crime_Rates_1960_2014.csv\"\ncrime = pd.read_csv(url)\ncrime.head()", "_____no_output_____" ] ], [ [ "### Step 4. What is the type of the columns?", "_____no_output_____" ] ], [ [ "crime.info()", "<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 55 entries, 0 to 54\nData columns (total 12 columns):\nYear 55 non-null int64\nPopulation 55 non-null int64\nTotal 55 non-null int64\nViolent 55 non-null int64\nProperty 55 non-null int64\nMurder 55 non-null int64\nForcible_Rape 55 non-null int64\nRobbery 55 non-null int64\nAggravated_assault 55 non-null int64\nBurglary 55 non-null int64\nLarceny_Theft 55 non-null int64\nVehicle_Theft 55 non-null int64\ndtypes: int64(12)\nmemory usage: 5.2 KB\n" ] ], [ [ "##### Have you noticed that the type of Year is int64. But pandas has a different type to work with Time Series. Let's see it now.\n\n### Step 5. Convert the type of the column Year to datetime64", "_____no_output_____" ] ], [ [ "# pd.to_datetime(crime)\ncrime.Year = pd.to_datetime(crime.Year, format='%Y')\ncrime.info()", "<class 'pandas.core.frame.DataFrame'>\nRangeIndex: 55 entries, 0 to 54\nData columns (total 12 columns):\nYear 55 non-null datetime64[ns]\nPopulation 55 non-null int64\nTotal 55 non-null int64\nViolent 55 non-null int64\nProperty 55 non-null int64\nMurder 55 non-null int64\nForcible_Rape 55 non-null int64\nRobbery 55 non-null int64\nAggravated_assault 55 non-null int64\nBurglary 55 non-null int64\nLarceny_Theft 55 non-null int64\nVehicle_Theft 55 non-null int64\ndtypes: datetime64[ns](1), int64(11)\nmemory usage: 5.2 KB\n" ] ], [ [ "### Step 6. Set the Year column as the index of the dataframe", "_____no_output_____" ] ], [ [ "crime = crime.set_index('Year', drop = True)\ncrime.head()", "_____no_output_____" ] ], [ [ "### Step 7. Delete the Total column", "_____no_output_____" ] ], [ [ "del crime['Total']\ncrime.head()", "_____no_output_____" ] ], [ [ "### Step 8. Group the year by decades and sum the values\n\n#### Pay attention to the Population column number, summing this column is a mistake", "_____no_output_____" ] ], [ [ "# To learn more about .resample (https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.resample.html)\n# To learn more about Offset Aliases (http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases)\n\n# Uses resample to sum each decade\ncrimes = crime.resample('10AS').sum()\n\n# Uses resample to get the max value only for the \"Population\" column\npopulation = crime['Population'].resample('10AS').max()\n\n# Updating the \"Population\" column\ncrimes['Population'] = population\n\ncrimes", "_____no_output_____" ] ], [ [ "### Step 9. What is the mos dangerous decade to live in the US?", "_____no_output_____" ] ], [ [ "# apparently the 90s was a pretty dangerous time in the US\ncrime.idxmax(0)", "_____no_output_____" ] ] ]
[ "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "markdown", "markdown" ], [ "code" ], [ "markdown", "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code" ] ]
e7e829653d5bd8b676b84f89dbaad41b31cf81c7
88,147
ipynb
Jupyter Notebook
Exercise01.ipynb
lnsongxf/Applied_Computational_Economics_and_Finance
f14661bfbfa711d49539bda290d4be5a25087185
[ "MIT" ]
19
2018-05-09T08:17:44.000Z
2021-12-26T07:02:17.000Z
Exercise01.ipynb
lnsongxf/Applied_Computational_Economics_and_Finance
f14661bfbfa711d49539bda290d4be5a25087185
[ "MIT" ]
null
null
null
Exercise01.ipynb
lnsongxf/Applied_Computational_Economics_and_Finance
f14661bfbfa711d49539bda290d4be5a25087185
[ "MIT" ]
11
2017-12-15T13:39:35.000Z
2021-05-15T15:06:02.000Z
72.969371
30,817
0.72049
[ [ [ "# pylab Populating the interactive namespace from numpy and matplotlib\n# numpy for numerical computation\n# matplotlib for ploting\n%pylab notebook", "Populating the interactive namespace from numpy and matplotlib\n" ] ], [ [ "## Exercise1.1\nPlot $f(x) = 1 - e ^ (2 * x)$ over $[-1, 1]$ with intervals $.01$", "_____no_output_____" ] ], [ [ "\"\"\"\nExercise1.1\nPlot f(x) = 1 - e ^ (2 * x) over [-1, 1] with intervals .01\n\"\"\"\n\nx_range = arange(-1, 1, .01)\ny_range = array([1 - exp(2 * x) for x in x_range])\nplot(x_range, y_range, 'k-', label = \"Exercise1.1\")\nylabel(\"y\")\nxlabel(\"x\")\nlegend(loc='upper right')", "_____no_output_____" ] ], [ [ "## Exercise1.2\nSolve matrix multiplication of\n\n$$\nAB = \n\\left[\\begin{array}{ccc} \n0 &-1& 2\\\\\n-2& -1& 4\\\\\n2& 7& -2\n\\end{array}\\right]\n\\left[\\begin{array}{ccc} \n-7& 1& 1\\\\ \n7& -3& -2\\\\\n3& 5& 0\n\\end{array}\\right]\n$$ \n\n$$y = [3, -1, 2] $$\n\n\n\nSolve $C = A*B$, \n\n$$Cx = y$$.\n\n", "_____no_output_____" ] ], [ [ "\"\"\"\nExercise1.2\nSolve matrix multiplication \n\"\"\"\n#from numpy import array, linalg\n\nA = array([[0, -1, 2], [-2, -1, 4], [2, 7, -2]])\nB = array([[-7, 1, 1], [7, -3, -2], [3, 5, 0]])\ny = array([3, -1, 2])\n\n", "_____no_output_____" ], [ "# part_a():\n\"\"\"\nSolve Cx = y using standard matrix multiplication for A and B\n\"\"\"\nC = A.dot(B)\nx = linalg.solve(C, y)\n\nprint(\"The standard matrix product C: \" ,C)\n\nprint(\"\\nSolution from Matrix multiplication: \", x) \n\n\n", "The standard matrix product C: [[ -1 13 2]\n [ 19 21 0]\n [ 29 -29 -12]]\n\nSolution from Matrix multiplication: [-1.046875 0.89955357 -4.87053571]\n" ], [ "#part_b():\n\"\"\"\nSolve Cx = y using element-wise multiplication (Hadamard product)\n\"\"\"\nC = A * B\nx = linalg.solve(C, y)\n\n\nprint(\"\\nThe element-by-element matrix product C:\")\nprint(C)\n\nprint(\"\\nSolution from Element-wise multiplication:\")\nprint(x)", "\nThe element-by-element matrix product C:\n[[ 0 -1 2]\n [-14 3 -8]\n [ 6 35 0]]\n\nSolution from Element-wise multiplication:\n[-0.79958678 0.19421488 1.59710744]\n" ] ], [ [ "## Exercise1.3\n\ncalculate the time series\n\n$$yt = 5 + .05 * t + Et$$ \n\n(Where E is epsilon)\n\nfor years $1960, 1961, ..., 2016$ assuming $Et$ independently and identically distributed with mean $0$ and sigma $0.2$.", "_____no_output_____" ] ], [ [ "# Setting a random seed for reproducibility\nrnd = np.random.RandomState(seed=123)\n# https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.RandomState.html", "_____no_output_____" ], [ "\"\"\"\nExercise1.3\ncalculate the time series\n\"\"\"\n\n#from numpy import random, array, polyfit, poly1d\n\nmu = -0.2\nsigma = 0.2\n\n\n\"\"\"\nCreate the time series, yt, then perform a regress on yt, plot yt and the its trendline\n\"\"\"\nstart_year = 1960\nend_year = 2016\n\nt_array = array(range(start_year, end_year + 1))\n\n# Generating a random array\nepsilon_t = array(rnd.normal(mu, sigma,len(t_array)))\n#https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.normal.html\n\n\n\n\n\nyt = array([5 + .05 * t_i + epsilon_t[i] for i, t_i in enumerate(t_array)])\nfit = polyfit(t_array, yt, 1)\n#https://docs.scipy.org/doc/numpy/reference/generated/numpy.polyfit.html\n\"\"\"\nLeast squares polynomial fit.\n\nFit a polynomial p(x) = p[0] * x**deg + ... + p[deg] of degree deg to points (x, y). \n\nReturns a vector of coefficients p that minimises the squared error.\n\"\"\"\n\nfit_func = poly1d(fit)\n\n\"\"\"\nhttps://docs.scipy.org/doc/numpy/reference/generated/numpy.poly1d.html\nA one-dimensional polynomial class.\n\nA convenience class, \nused to encapsulate “natural” operations on polynomials \nso that said operations may take on their customary form in code .\n\n\"\"\"\n\n\n# two plots together\nplot(t_array, yt, \"yo\", t_array, fit_func(t_array), \"--k\")\n", "_____no_output_____" ] ], [ [ "## Exercise1.4\n\n\nConsider the original example with the farmer where acreage planted will be\n\n$$a = 0.5 + 0.5 * Ep$$ (Ep is expected price)\n\nQuantity q is equivalent to\n\n$$q = a * y$$ (y is yield)\n\nClearing price p is\n\n$$p = 3 - 2 * q$$\n\nAssume in our case that yield will be a random two point distribution s.t.\n\n```\ny = array([0.7, 1.3])\n```\n\n\n\nOur goal is to compute the variance of this price distribution, otherwise known\nas $sigma^2$ for part a.", "_____no_output_____" ] ], [ [ "\n\n#from math import exp, fabs\n\n#from numpy import array, var\n\n\n\n\n#part_a():\n\"\"\"\nCompute the variance in price\n\"\"\"\na = 1\ny, w = array([0.7, 1.3]), array([0.5, 0.5])\n\n\n\n\nfor _ in range(100):\n a_previous = a\n p = 3 - 2 * a * y\n f = w.dot(p)\n a = 0.5 + 0.5 * f\n if fabs(a_previous - a) < exp(-8):\n break\nprint \"acreage\", a, \"variance:\", var(p), \"expectation\", p.dot(w)\n\n\n\n\n\n\n", "acreage 1.0 variance: 0.36 expectation 1.0\n" ], [ " ", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code" ], [ "markdown" ], [ "code" ], [ "markdown" ], [ "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code" ] ]
e7e82a89d492b528070f324a7aa6b912018db340
27,942
ipynb
Jupyter Notebook
03_train3d_experiments/03_train3d_02d_train_transformer_head.ipynb
bearpelican/rsna_retro
1475da3224403261c48f0425b4a24e060d07556c
[ "Apache-2.0" ]
3
2020-01-27T09:49:37.000Z
2020-09-15T06:55:38.000Z
03_train3d_experiments/03_train3d_02d_train_transformer_head.ipynb
bearpelican/rsna_retro
1475da3224403261c48f0425b4a24e060d07556c
[ "Apache-2.0" ]
1
2021-05-20T12:44:34.000Z
2021-05-20T12:44:34.000Z
03_train3d_experiments/03_train3d_02d_train_transformer_head.ipynb
bearpelican/rsna_retro
1475da3224403261c48f0425b4a24e060d07556c
[ "Apache-2.0" ]
1
2020-09-15T06:55:40.000Z
2020-09-15T06:55:40.000Z
55.112426
16,420
0.750913
[ [ [ "from rsna_retro.imports import *\nfrom rsna_retro.metadata import *\nfrom rsna_retro.preprocess import *\nfrom rsna_retro.train import *\nfrom rsna_retro.train3d import *", "Loading imports\n" ], [ "torch.cuda.set_device(1)", "_____no_output_____" ], [ "dls_feat = get_3d_dls_feat(Meta.df_comb, path=path_feat_384avg, bs=32)", "_____no_output_____" ] ], [ [ "## Model", "_____no_output_____" ] ], [ [ "xb, yb = dls_feat.one_batch(); xb.shape", "_____no_output_____" ], [ "from torch.nn import TransformerEncoder, TransformerEncoderLayer\nclass SeqHead(nn.Module):\n def __init__(self):\n super().__init__()\n# d_model = 2048+6+1\n d_model = 1024\n n_head = 4\n \n self.flat = nn.Sequential(AdaptiveConcatPool2d(), Flatten())\n self.hook = ReshapeBodyHook(self.flat)\n \n# self.linear = nn.Linear(d_model+7, d_model)\n encoder_layers = TransformerEncoderLayer(d_model, n_head, d_model*2)\n self.transformer = TransformerEncoder(encoder_layers, 4)\n \n self.head = nn.Sequential(nn.Linear(d_model,6))\n \n def forward(self, x):\n x = self.flat(x)\n# x = torch.cat(x, axis=-1)\n# x = self.linear(x)\n feat = self.transformer(x.transpose(0,1))\n return self.head(feat.transpose(0,1))", "_____no_output_____" ], [ "m = SeqHead()\nname = 'train3d_baseline_feat_transformer'\nlearn = get_learner(dls_feat, m, name=name)\nlearn.add_cb(DePadLoss())", "_____no_output_____" ], [ "xb.shape", "_____no_output_____" ], [ "# with torch.no_grad():\n# learn.model(xb).shape", "_____no_output_____" ], [ "# learn.summary()", "_____no_output_____" ] ], [ [ "## Training", "_____no_output_____" ] ], [ [ "learn.lr_find()", "_____no_output_____" ], [ "do_fit(learn, 10, 1e-4)\nlearn.save(f'runs/{name}-1')", "_____no_output_____" ] ], [ [ "## Testing", "_____no_output_____" ] ], [ [ "sub_fn = f'subm/{name}'\nlearn.load(f'runs/{name}-1')", "_____no_output_____" ], [ "learn.validate()", "_____no_output_____" ], [ "learn.dls = get_3d_dls_feat(Meta.df_tst, path=path_feat_tst_384avg, bs=32, test=True)", "_____no_output_____" ], [ "preds,targs = learn.get_preds()\npreds.shape, preds.min(), preds.max()", "_____no_output_____" ], [ "pred_csv = submission(Meta.df_tst, preds, fn=sub_fn)", "_____no_output_____" ], [ "api.competition_submit(f'{sub_fn}.csv', name, 'rsna-intracranial-hemorrhage-detection')", "100%|██████████| 26.0M/26.0M [00:03<00:00, 8.04MB/s]\n" ], [ "api.competitions_submissions_list('rsna-intracranial-hemorrhage-detection')[0]", "_____no_output_____" ] ] ]
[ "code", "markdown", "code", "markdown", "code", "markdown", "code" ]
[ [ "code", "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code" ], [ "markdown" ], [ "code", "code" ], [ "markdown" ], [ "code", "code", "code", "code", "code", "code", "code" ] ]