text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Experiment 1: k-Shape on Raw Time Series ## Select context csv to work with (see above) ``` import pandas as pd df_weekday = pd.read_csv('data/weekdayContext.csv') print(df_weekday) # in this notebook we use Week Day Context ``` ## Download k-Shape library First from: https://github.com/Mic92/kshape ``` from ksh...
github_jupyter
## sigMF RF classification; 12 classes ``` import os import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.utils.data import torch.utils.data as data from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt from scipy import signal imp...
github_jupyter
# DAG Creation and Submission Launch this tutorial in a Jupyter Notebook on Binder: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/htcondor/htcondor-python-bindings-tutorials/master?urlpath=lab/tree/DAG-Creation-And-Submission.ipynb) In this tutorial, we will learn how to use `htcondor.d...
github_jupyter
# Ways to visualize top count with atoti Given different categories of items, we will explore how to achieve the following with atoti: - Visualize top 10 apps with the highest rating in table - Visualize top 10 categories with most number of apps rated 5 in Pie chart - Visualize top 10 apps for each category in subplo...
github_jupyter
## Reading/writing files ### BIOINF 575 - Fall 2020 ### Functions recap - important functions continued #### RECAP & RESOURCES #### RECAP ```python # FUNCTIONS # DEFINITION - creating a function def function_name(arg1, arg2, darg=None): # instructions to compute result return result # CALL - running a f...
github_jupyter
# Too Fast. Too Furious. (AKA This Week.) **Goal:** Build a classification model to classify unseen faces to 'match' those of characters from the beloved _**Fast and Furious**_ movie franchise. ``` # # Required installations (run once) # !brew install wget # Added by Miles # !pip install --upgrade --ignore-installed...
github_jupyter
<a href="https://colab.research.google.com/github/ilopezfr/gpt-2/blob/master/gpt-2-playground_.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # GPT-2 Playground ## Background In this Jupyter notebook you can play around with of **Open AI's GPT-2**...
github_jupyter
``` from decodes.core import * from decodes.io.jupyter_out import JupyterOut import math out = JupyterOut.unit_square( ) ``` # Transformations in Code todo ## Xform Objects in Decod.es <img src="http://geometric-computation-images.s3-website-us-east-1.amazonaws.com/3.00.D96 Xform Large.jpg" style="width: 600px; dis...
github_jupyter
# <p style="text-align: center;"> Social Butterfly - Umbrella Academy - After Metadata </p> ![title](Images\Title_Images\Title_Image.jpg) ``` from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); } else { $('div.input').show(); } code_...
github_jupyter
``` library(tidyverse) library(skimr) #Import the new-animals_all.csv dataset into R as a dataframe, #and then Then perform the routine checks about the types of the columns, the missing values, and output a quick summary of the dataset. new_animal <- read_csv("new-animals_all.csv") new_animal %>% glimpse() new_anim...
github_jupyter
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\rightarrow$Run All). Make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE", as we...
github_jupyter
## Fares Joni's Reasearch Questions 1. BMI of Gender in relation to Tobacco Users 2. Medical charges of Tobacco Users in relation to Age ##### Import data in from clean spreadsheet ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import os from Jscripts.project_functi...
github_jupyter
# Chafee-Infante方程式の離散化 ``` import numpy as np import pathfollowing as pf import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline sns.set('poster', 'whitegrid', 'dark', rc={"lines.linewidth": 2, 'grid.linestyle': '-'}) N = 16 ds = np.pi / N def func(x, a): n = len(x) A = np.zeros(n) A = 2 ...
github_jupyter
# TopicBank Demo The notebook contains a demonstration of the [TopicBank approach](https://github.com/machine-intelligence-laboratory/OptimalNumberOfTopics/tree/master/topnum/search_methods/topic_bank) for finding an appropriate number of topics. Dataset used for demonstration is [20 Newsgroups](http://qwone.com/~jas...
github_jupyter
## 1. Credit card applications <p>Commercial banks receive <em>a lot</em> of applications for credit cards. Many of them get rejected for many reasons, like high loan balances, low income levels, or too many inquiries on an individual's credit report, for example. Manually analyzing these applications is mundane, error...
github_jupyter
# Chapter 5: Monte Carlo Methods ## 1. Introduction - Do not assume complete knownledge of the environment - Learning from experience of interaction with environment - Experience is divided into **episodes** - Based on averaging sample returns - complete returns of each episode - Like an associative bandit ...
github_jupyter
[![AWS Data Wrangler](_static/logo.png "AWS Data Wrangler")](https://github.com/awslabs/aws-data-wrangler) # 11 - CSV Datasets Wrangler has 3 different write modes to store CSV Datasets on Amazon S3. - **append** (Default) Only adds new files without any delete. - **overwrite** Deletes everything in t...
github_jupyter
# Forced pattern analysis of SST Reading in SST data and performing low-frequency component analysis ``` %matplotlib inline import xarray as xr import numpy as np import matplotlib.pyplot as plt import intake #import cftime # util.py is in the local directory # it contains code that is common across project noteboo...
github_jupyter
# Investigation into Sklearn Pipelines for Scaling and Model Selection Using http://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html and data https://archive.ics.uci.edu/ml/datasets/APS+Failure+at+Scania+Trucks ``` import numpy as np import pandas as pd import re import os from pandas.plottin...
github_jupyter
``` import pandas as pd import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import Dataset from torch.autograd import Variable import string import pickle as pkl import random import pdb import re from functools import partial from collections import Counter, defa...
github_jupyter
# Machine Learning artifacts management This notebook contains steps and code to demonstrate how to manage and clean up Watson Machine Learning instance. This notebook contains steps and code to work with Watson Machine Learning API. This notebook introduces API calls for listing artifacts, getting artifacts details a...
github_jupyter
# Proper Orthogonal Decomposition Example 2 Author: Katiana Kontolati \ Date: August 27, 2020 In this example, the diffusion equation is solved and then methods from the POD class are used to decompose the output solutions/dataset and extract its basis functions which can be used for the reconstruction of the solutio...
github_jupyter
# Tile Coding --- Tile coding is an innovative way of discretizing a continuous space that enables better generalization compared to a single grid-based approach. The fundamental idea is to create several overlapping grids or _tilings_; then for any given sample value, you need only check which tiles it lies in. You c...
github_jupyter
# Utilizing existing FAQs for Question Answering [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deepset-ai/haystack/blob/master/tutorials/Tutorial4_FAQ_style_QA.ipynb) While *extractive Question Answering* works on pure texts and is therefore more...
github_jupyter
#COVID-19 - Pandemic in India! ##About COVID-19 The **coronavirus (COVID-19)** pandemic has spread across 190 countries infecting 4.2 lakh people and killing 16,500 so far. In India, as many as 562 COVID-19 cases have been reported so far. Of these, 37 have recovered and 10 have died. On March 24, Prime Minister Na...
github_jupyter
# The Finite Element Mesh The finite element mesh is a fundamental construct for Underworld models. This notebook will go through different examples of what can be done with Underworld's mesh object. #### Overview: 1. Creating, visualising and accessing a mesh object. 2. Modifing a mesh. 3. Loading and saving mesh...
github_jupyter
# Demo of MUMBO for multi-fidelity Bayesian Optimisation This notebook provides a demo of the MUlti-task Max-value Bayesian Optimisation (MUMBO) acquisition function of Moss et al [2020]. https://arxiv.org/abs/2006.12093 MUMBO provides the high perfoming optimization of other entropy-based acquisitions. However, unli...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
# Gradient Checking Welcome to the final assignment for this week! In this assignment you will learn to implement and use __gradient checking__. You are part of a team working to make mobile payments available globally, and are asked to build a deep learning model to detect __fraud__--whenever someone makes a paymen...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from os.path import join from sklearn.compose import ColumnTransformer from sklearn.impute import SimpleImputer from sklearn.metrics import mean_absolute_error from sklearn.pipeline import Pipeline from sklearn.preprocessin...
github_jupyter
``` #hide !pip install -Uqq fastbook import fastbook fastbook.setup_book() #hide from fastai.vision.all import * from fastbook import * matplotlib.rc('image', cmap='Greys') ``` # Under the Hood: Training a Digit Classifier Having seen what it looks like to actually train a variety of models in Chapter 2, let’s now l...
github_jupyter
``` #default_exp core.utils #export from fastai2.test import * from fastai2.core.foundation import * from fastai2.core.imports import * from nbdev.showdoc import * from PIL import Image import torch ``` # Utility functions > Utility functions used in the fastai library ## Basics ``` # export def ifnone(a, b): "...
github_jupyter
``` import json import os, shutil from ovejero import model_trainer, hierarchical_inference from matplotlib import pyplot as plt from matplotlib.lines import Line2D import matplotlib def NOTIMPLEMENTED(): raise NotImplementedError('Must specify config/save path') ``` # Hierarchical Inference on a Test Set __Auth...
github_jupyter
``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt w = np.load('w_windows.npy') n = np.load('n_windows.npy') from scipy.stats import skew, kurtosis from numba import jit fs = 256 jw = fs//.25 @jit(nopython=True) def energy(x): return np.sum(np.abs(x)**2) @jit(nopytho...
github_jupyter
# Cats vs Dogs - Best Model ``` # In this exercise you will train a CNN on the FULL Cats-v-dogs dataset # This will require you doing a lot of data preprocessing because # the dataset isn't split into training and validation for you # This code block has all the required inputs import os import zipfile import random i...
github_jupyter
# Portfolio Optimization using cvxpy ## Imports ``` import cvxpy as cvx import numpy as np import quiz_tests ``` ## Optimization with cvxpy http://www.cvxpy.org/ Practice using cvxpy to solve a simple optimization problem. Find the optimal weights on a two-asset portfolio given the variance of Stock A, the varianc...
github_jupyter
# MNIST DATA with Convolutional Neural Network ## 1. Import Packages ``` import input_data import numpy as np import matplotlib.pylab as plt import tensorflow as tf import keras from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers.convolutional import Conv2D, MaxPooli...
github_jupyter
``` import sys import os from glob import glob import random import numpy as np import pandas as pd from scipy import stats import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import seaborn as sns from openpyxl import load_workbook from sinaplot import sinaplot ## Default plotting params %...
github_jupyter
``` %matplotlib inline ``` Magnetostatic Fields ===================== An example of using PlasmaPy's `Magnetostatic` class in `physics` subpackage. ``` from plasmapy.formulary import magnetostatics from plasmapy.plasma.sources import Plasma3D import numpy as np import astropy.units as u import matplotlib.pyplot as ...
github_jupyter
``` from keras.datasets import mnist from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D from keras.layers.advanced_activations import LeakyReLU from keras.layers.convolutional import UpSampling2D, Co...
github_jupyter
# More accurately concept blinding and removal of punctuation, normalizing digit, stop word removal, ner blinding For the Semeval 2010 dataset, this means replacing entity words by entity1 and entity2. For DDI dataset, this means replacing the two involved drug words and the other drug words. For the i2b2 dataset, thi...
github_jupyter
``` #Measure pitch of all wav files in directory import glob import numpy as np import pandas as pd import parselmouth from parselmouth.praat import call from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler # This is the function to measure voice pitch def measurePitch(voiceID, f0min,...
github_jupyter
# Home Work Assignment 3: Bootstrap ``` import numpy as np import pandas as pd df = pd.read_csv('star_dataset.csv') df.head() ``` Best partition from previous work is determined by the following parameters. ``` n_cluster = 4 random_state = 9 from sklearn.cluster import KMeans from sklearn.preprocessing import Stand...
github_jupyter
##### Copyright 2018 The TensorFlow Hub Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
github_jupyter
# Correlation Analysis Talapas TTbar70 Author: Brain Gravelle (gravelle@cs.uoregon.edu) All this is using the taucmdr python libraries from paratools http://taucommander.paratools.com/ <a href='#top'>top</a><br> ## Imports This section imports necessary libraies, the metrics.py and utilities.py files and sets up t...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt import yt from galaxy_analysis.gizmo import yield_model from galaxy_analysis.utilities import cy_convert_abundances as ca #from galaxy_analysis.utilities import convert_abundances as ca from galaxy_analysis.plot.plot_styles import * from matplot...
github_jupyter
# Random Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Cumulative Distribution Functions A random process can be ch...
github_jupyter
# Implementation of a Devito self adjoint variable density visco- acoustic isotropic modeling operator <br>-- Nonlinear Ops -- ## This operator is contributed by Chevron Energy Technology Company (2020) This operator is based on simplfications of the systems presented in: <br>**Self-adjoint, energy-conserving second-...
github_jupyter
<font color='green'> <h1> <b> Web Scraping </b> </h1> </font> <br /> <font color='black'> <h3> Working on Textual data to understand the overall conditions related to the company. </h3> </font> ``` import requests import nltk nltk.download('wordnet') from nltk.stem import WordNetLemmatizer fr...
github_jupyter
## Image Classification Problems - Warm-Up In the following set of tutorials, we will focus on a particular class of problems, namely supervised classification, as a typical example for machine learning application use cases. Generally, in classification the task is to assign data items to a fixed set of categories, o...
github_jupyter
``` # Starr Report copied from # https://www.washingtonpost.com/wp-srv/politics/special/clinton/icreport/srprintable.htm !ls import pdfminer import re import scattertext as st import pandas as pd from pdfminer import pdfparser parser = pdfparser.PDFParser(open('mueller-report.pdf', 'rb')) #From http://stanford.edu/~mg...
github_jupyter
# Pandas In this tutorial we will learn to work with tables of data with the `pandas` Python package. Pandas is an industry standard analysis package for data science, so it has many features and is actively being updated and supported (full documentation [here](https://pandas.pydata.org/pandas-docs/stable/)). ## Ove...
github_jupyter
hvPlot provides one API to explore data of many different types. Previous sections have exclusively worked with tabular data stored in pandas (or pandas-like) DataFrames. The other most common type of data are n-dimensional arrays. hvPlot aims to eventually support different array libraries but for now focuses on [xarr...
github_jupyter
**Notas para contenedor de docker:** Comando de docker para ejecución de la nota de forma local: nota: cambiar `<ruta a mi directorio>` por la ruta de directorio que se desea mapear a `/datos` dentro del contenedor de docker. ``` docker run --rm -v <ruta a mi directorio>:/datos --name jupyterlab_numerical -p 8888:88...
github_jupyter
### Trade and Tariff Dataset at the County level This notebook constructs a trade and county-level tariff data, over time, dataset. **This is a core notebook to the project** so I will try and explain each step clearly. This is one aspect of my code to be scrutinized. It outputs the county-level trade and tariff datas...
github_jupyter
<a href="https://colab.research.google.com/github/reallygooday/60daysofudacity/blob/master/Linear_Regression2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Link to Colab Jupyter Notebook: https://colab.research.google.com/drive/19QYWp_lExrN65b6Oes...
github_jupyter
# Python для анализа данных *Алла Тамбовцева, НИУ ВШЭ* дополнения: *Ян Пиле, НИУ ВШЭ* Посмотрим на другие примеры использования `selenium`. **Пример.** Зайдем на сайт книжного магазина и найдем все книги про Python. Загрузим библиотеку, веб-драйвер и откроем страницу в браузере через Python. ``` from selenium imp...
github_jupyter
生存分析是用于分析直到一个或多个事件发生的预期持续时间的统计分支,例如生物有机体中的死亡和机械系统中的失败。本主题被称为可靠性理论和可靠性分析的工程,持续时间分析或持续时间建模在经济学和事件历史分析,在社会学。生存分析试图回答以下问题:在一定时间内存活的人口比例是多少?那些幸存下来的人会以什么样的速度死亡或失败?可以考虑多种死亡原因吗?具体情况或特征如何增加或减少生存的概率? 理论链接: 生存分析(survival analysis)https://www.cnblogs.com/wwxbi/p/6136348.html 生存分析学习笔记https://blog.csdn.net/jaen_tail/article/detail...
github_jupyter
# Block Move in Fixed Time Here, we look at a problem called "Block Move". Block Move is a very simple optimal control problem defined by Matthew Kelly in the paper *[An Introduction to Trajectory Optimization: How to Do Your Own Direct Collocation](https://epubs.siam.org/doi/10.1137/16M1062569)*. The basics of the p...
github_jupyter
``` import numpy as np import pandas as pd import scipy import psycopg2 %matplotlib inline import matplotlib.pyplot as plt import seaborn as sns import os import json from collections import Counter def parse_testdata(path='../data/rainfall-submissions.tsv'): file = open(path,'r') raw = file.readlines() f...
github_jupyter
#### *** Adjust the path parameter to user local catalog location.*** ``` # Local directory path for the galaxy zoo 2 catalog dir_cat = "/home/hhg/Research/galaxyClassify/catalog/galaxyZoo/zoo2/" ``` ## ------------ start ------------ ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt %config...
github_jupyter
## Basic training functionality ``` from fastai.basic_train import * from fastai.gen_doc.nbdoc import * from fastai.vision import * from fastai.distributed import * ``` [`basic_train`](/basic_train.html#basic_train) wraps together the data (in a [`DataBunch`](/basic_data.html#DataBunch) object) with a PyTorch model t...
github_jupyter
###Conditional Statement * if * if-else * if-elif-else ###Loops and Iterations * for * while ###Recursion * Function calling iteself ###Break * Stop iteration ###Continue * Stop current iteration ###Pass * Passing for non-executable condition 📌After using **:**, it is necessary to shift each statement by 4 white...
github_jupyter
``` #1. Use matplotlib to plot the following equation: # y = x^2 -x + 2 #You'll need to write the code that generates the x and y points. #Add an anotation for the point 0, 0, the origin. import matplotlib.pyplot as plt x = list(range(-50, 50)) # generate our y values y = [(n ** 2 - n + 2) for n in x] plt.plot(x, y...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams['axes.unicode_minus'] = False ``` # Graphical Representations of Data By Evgenia "Jenny" Nitishinskaya, Maxwell Margenot, and Delaney Granizo-Mackenzie. Part of the Quantopian Lecture Series: * [www.quant...
github_jupyter
# PRMT-2297: Look at attachments data from a supplier perspective ## Context We have performed some analysis on the attachments data set which suggests that nearly half of transfers contain no attachments. When we presented this in showcase we received feedback from clinical leads that they believe the number to be h...
github_jupyter
``` import pandas as pd import numpy as np import cPickle from nltk.corpus import stopwords from gensim.models import word2vec import nltk.data import re import logging with open("prep_data_tokens_underscore_1", "rb") as g: data_dice = cPickle.load(g) print len(data_dice) data_dice[0] data_must_have = pd.read_csv(...
github_jupyter
``` import pandas as pd import datetime import matplotlib.pyplot as plt all_o3_df = pd.read_csv("./Resources/all_years_o3.csv") #turn date column elements into datetime objects all_o3_df["Date"] = pd.to_datetime(all_o3_df["Date"]) all_o3_df = all_o3_df.set_index("Date") all_pm25_df = pd.read_csv("./Resources/all_year...
github_jupyter
## DR = (Digit Recognizer) - https://www.kaggle.com/c/digit-recognizer ``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import matplotlib.cm as cm import tensorflow as tf import time train = pd.read_csv("./input/train.csv") test = pd.read_csv("./input/test.csv") train....
github_jupyter
<img src="../../../images/qiskit-heading.png" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left"> ## _*Comparing Classical and Quantum Finite Automata (QFA)*_ Finite Automaton has been a mathematical model for computation since i...
github_jupyter
<a href="https://colab.research.google.com/github/gumdropsteve/intro_to_python/blob/main/day_08/00_intro_to_python_visualizations.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Visualization in Python Matplotlib with Pandas [.plot()](https://pand...
github_jupyter
<font size="+5">#01 | The Use of Functions</font> <div class="alert alert-warning"> <ul> <li> <b>Python</b> + <b>Data Science</b> Tutorials in ↓ <ul> <li> <a href="https://www.youtube.com/c/PythonResolver?sub_confirmation=1" >YouTube</a > </li> ...
github_jupyter
##### Copyright 2020 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
# Geochem for Machine Learning: Preprocessing and a Simple Classification Example In this notebook we'll provide a simple example of preprocessing some geochemical data for use in a classificaiton workflow. We'll also look at how this contrasts to more traditional methods of classification within geochemistry, and how...
github_jupyter
Copyright (c) 2018 [Geosoft Inc.](geosoft.com) https://github.com/GeosoftInc/gxpy/blob/master/README.md [BSD 2-clause License](https://github.com/GeosoftInc/gxpy/blob/master/LICENSE) # Tilt Depth The depth to magnetic sources from the edges of magnetic features can be determined from the reciprocal of the gradient...
github_jupyter
# Tally Arithmetic This notebook shows the how tallies can be combined (added, subtracted, multiplied, etc.) using the Python API in order to create derived tallies. Since no covariance information is obtained, it is assumed that tallies are completely independent of one another when propagating uncertainties. The targ...
github_jupyter
# Artificial Neural Network in Python with Keras In this program we construct an Artificial Neuron Network model. The aim is to build a classification model to predict if a certain customer will leave the bank services in the six months. **Dataset Description** For this problem we have a Dataset composed by 10000 in...
github_jupyter
# Writing Functions in Python **by [Richard W. Evans](https://sites.google.com/site/rickecon/), June 2019** Python has many [built-in functions](https://docs.python.org/3/library/functions.html). Functions are objects that accept a specific set of inputs, perform operations on those inputs, and return a set of outputs...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from keras.layers import Input, Dense from keras.models import Model from keras.datasets import fashion_mnist (x_train, y_train), (x_test, y_test) = fashion_mnist.load_data() x_train.shape, x_test.shape, type(x_train) plt.imshow(x_train[1], cmap='binary') # Size ...
github_jupyter
# VGG-16 on CIFAR-10 ### Imports ``` import time import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torchvision import datasets from torchvision import transforms from torch.utils.data import DataLoader if torch.cuda.is_available(): torch.backends.cudnn.deterministic = Tru...
github_jupyter
``` import tensorflow as tf from tensorflow import keras print( 'Tensorflow : ',tf.__version__) print( ' |-> Keras : ',keras.__version__) ``` # 5.1 - Introduction to convnets This notebook contains the code sample found in Chapter 5, Section 1 of [Deep Learning with Python](https://www.manning.com/books/deep-learning...
github_jupyter
# Random Variables and The Normal Distribution #### Definition of a Random Variable A random variable is a number that describes the outcome of an event. We can never be certain what value a random variable will take until after the event happens. #### Examples of Random Variables | Event ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import logging logging.basicConfig(format="%(asctime)s [%(process)d] %(levelname)-8s " "%(name)s,%(lineno)s\t%(message)s") logging.getLogger().setLevel('DEBUG') %matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt from t...
github_jupyter
# Table of Contents - **Series** - **DataFrame** - Accessing a DataFrame - Boolean Indexing - Adding columns - Deleting columns - Importing Excel files as DataFrames - Missing Data - Writing and reading CSV files - **DataFrame Operations** - Matrix operations - Column operations -...
github_jupyter
# Table of Contents * [**Preparation**](#Preparation) * [**Introduction**](#Introduction) * [**Data Collection**](#Data-Collection) * [**Data Preprocessing**](#Data-Preprocessing) * [**Building and Training the Model**](#Building-and-Training-the-Model) * [**Qualitative Analysis of Player Vectors**](#Qualitative-Anal...
github_jupyter
# Functions - Best practices In this notebook we will discuss a bit about what are the best practices of documenting and writing functions. These topics won't be graded but they will give you a general idea of what to do once you start developing in real-world. They are also usable throughout any programming language....
github_jupyter
# Bayesian optimization *Selected Topics in Mathematical Optimization: 2017-2018* **Michiel Stock** ([email](michiel.stock@ugent.be)) ![](Figures/logo.png) ``` import numpy as np import sympy as sp sp.init_printing() from numpy import sin, exp, cos from sklearn.preprocessing import normalize from scipy.stats import...
github_jupyter
# Using Amazon Elastic Inference with MXNet on an Amazon SageMaker Notebook Instance This notebook demonstrates how to enable and utilize Amazon Elastic Inference with our predefined SageMaker MXNet containers. Amazon Elastic Inference (EI) is a resource you can attach to your Amazon EC2 instances to accelerate your ...
github_jupyter
##### Copyright 2020 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
# Cesium ``` #!pip install cesium # !pip install pandas==1.0.5 %load_ext autoreload %load_ext memory_profiler %autoreload 2 import numpy as np import pandas as pd from pathlib import Path from datetime import datetime import scipy.stats as ss ``` --- ``` # create some dummy data data_dir = Path("../data") df_acc = ...
github_jupyter
# Translator: Go from moment representation to ExpFam-representation This task is about taking a distribution represented by its moment-parameters, translate it into the exponential family representation, and compare the two by plotting them. We will focus on Gaussians and Gamma-distributed variables here, but this exe...
github_jupyter
# Notebook to recenter images of a DICOM dataset - CT scan version Use this notebook to navigate and select a location in the image to recenter a series of images. It loads an specific series and uses the notebook to select a location. This notebook shows an example how to process a CT dataset. Some tricks need to be ...
github_jupyter
# Heap Overflow - buffer overflow can happen in other segments such as **heap**, **data** and **bss** - if an important variable is located after a buffer vulnerable to an overflow, the program's control flow can be altered (regardless of the memory segment) - controls may be limited ## Heap Overflow - heap o...
github_jupyter
<img src="https://upload.wikimedia.org/wikipedia/en/a/a1/Visma_logo.jpg" align="right" width="30%" alt="Visma logo"> Semi supervised learning (Still under development!) ============= <img src="http://www.rm.dk/siteassets/regional-udvikling/digitalisering/dabai/dabai-logo.png" align="right" wi...
github_jupyter
# Using EMI-FastGRNN on the HAR Dataset This is a very simple example of how the existing EMI-FastGRNN implementation can be used on the HAR dataset. We illustrate how to train a model that predicts on 48 step sequence in place of the 128 length baselines while attempting to predict early. For more advanced use cases ...
github_jupyter
``` # Setting options for the plots %matplotlib inline %config InlineBackend.figure_formats={'retina', 'svg'} %config InlineBackend.rc={'savefig.dpi': 150} ``` # Experiment Report ``` import itertools import math import os import re import pickle import platform import time import warnings from functools import part...
github_jupyter
``` import pandas as pd from matplotlib import pyplot as plt df = pd.DataFrame(columns=["time", "sys", "dia", "rate"], data=[ # [ "2018-12-27 04:19", 158, 80, 60 ], # [ "2018-12-27 04:20", 131, 80, 60 ], # 05 Jan 2018 [ "2019-01-05 19:00", 152, 69, 62 ], [ "2019-01-05 19:50", 156, 69, 64 ], [ "2019-01-05 20:4...
github_jupyter
## 1. Of cats and cookies <p><a href="https://www.facebook.com/cookiecatsgame">Cookie Cats</a> is a hugely popular mobile puzzle game developed by <a href="http://tactile.dk">Tactile Entertainment</a>. It's a classic "connect three"-style puzzle game where the player must connect tiles of the same color to clear the bo...
github_jupyter
# Feature Selection * ` skelearn.feaeture_selection ` module can be used for feature selection / dimensionality reduction. * This helps to imporve the accuracy score or performance while dealing with large dimensional data. https://scikit-learn.org/stable/modules/feature_selection.html ## Removing features with low...
github_jupyter
# <center>Python Basics<center/> <img height="60" width="120" src="https://www.python.org/static/img/python-logo-large.png?1414305901"></img> # Table of contents <br/> <a href = "#12.-Operators">12. Operators</a><br/> 1. Arithmetic operators 2. Comparison (Relational) operators 3. Logical (Boolean) operat...
github_jupyter