text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
Start jupyter server such that the print of the current working dir below is the root directory of the repo Setup the environment... ``` import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Conv2D, Dropout, Flatten, MaxPooling2D import os import sys os.envir...
github_jupyter
# ExtraTreesClassifier ``` from __future__ import division from IPython.display import display from matplotlib import pyplot as plt %matplotlib inline import numpy as np import pandas as pd import random, sys, os, re from sklearn.ensemble import ExtraTreesClassifier from sklearn.cross_validation ...
github_jupyter
# Quantization of 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).* ## Quantization Error of a Linear Uniform Quantizer As...
github_jupyter
# Planet Tasking API Order Creation --- ## Introduction --- This tutorial is an introduction on how to create tasking orders using [Planet](https://www.planet.com)'s Tasking API. It provides code samples on how to write simple Python code to do this. The API reference documentation can be found at https://develope...
github_jupyter
``` import pandas as pd import nltk from nltk.stem import WordNetLemmatizer from nltk.tokenize import RegexpTokenizer import ast import numpy as np import os import ast import urllib.request from urllib.request import urlopen from bs4 import BeautifulSoup import os.path from datetime import datetime from collections im...
github_jupyter
### Protocols Python is a protocol based language. If you're coming from Java, you can think of protocols the same way you think of interfaces. Except Python does not have this very strict idea of an interface. You simply add some functions to your class using a specific name, and if Python finds it there, it will ...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from __future__ import print_function import sklearn from sklearn.ensemble import RandomForestClassifier from sklearn import preprocessing from datetime import datetime import os %matplotlib inline %config InlineBackend.fi...
github_jupyter
# EZyRB Tutorial In this tutorial we will show the typical workflow for the construcion of the Reduced Order Model based only on the outputs of the higher-order model. We consider a parametric steady heat conduction problem in a two-dimensional domain $\Omega$. While in this tutorial we are going to focus on the data-...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/pipeline-batch-scoring/pipeline-batch-scoring.png) # Using Azure Machine...
github_jupyter
conda environment to use on nightingale: /scratch/conda_envs/elmo-embeddings ``` %load_ext autoreload %autoreload from allennlp.commands.elmo import ElmoEmbedder import os from sys import path path.append('..') from relation_extraction.data import utils import h5py import numpy as np data_path = '/data/medg/misc/seme...
github_jupyter
# miRNA-Seq (2019.04.02) ## Only valid miRNAs On the paper [Evolutionary history of plant microRNAs](https://doi.org/10.1016/j.tplants.2013.11.008), miRBase is scan for valid miRNAs. For a miRNA to be considered valid... * miRNA sequence must have high complementarity to opposing arm (>= 15 nt) * It should be obser...
github_jupyter
## 5.7: 文字列の書式設定 ``` # リスト 5.7.1 テキストの描画 import matplotlib.pyplot as plt import numpy as np %matplotlib inline fig, ax = plt.subplots(1, 1) # 軸範囲の設定 ticks = np.linspace(0, 10, 6) ax.set_xticks(ticks) ax.set_yticks(ticks) # テキストの描画 ax.text(2, 4, "Jupyter") # 目盛り線描画 ax.grid(linestyle="-") # リスト 5.7.2 フォントの設定 fig, ...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://githubtocolab.com/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/streamlit_notebooks/NER_PT.ipynb) # **Detect legal entities in Portuguese text** ## 1. Co...
github_jupyter
## Implementation of subspace alignment This is based on the following paper: <i>Unsupervised Visual Domain Adaptation Using Subspace Alignment</i>. ``` import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from sklearn.decomposition import PCA import tensorflow_hub as hub import warni...
github_jupyter
# Analyzing the Parker Solar Probe flybys ## 1. Modulus of the exit velocity, some features of Orbit #2 First, using the data available in the reports, we try to compute some of the properties of orbit #2. This is not enough to completely define the trajectory, but will give us information later on in the process. `...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline from torch.utils.data import Dataset, DataLoader import torch import torchvision import torch.nn as nn import torch.optim as optim from torch.nn import functional as F device = torch.device("cuda" i...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/regression-car-price-model-explaination-and-featurization/auto-ml-regressi...
github_jupyter
# Logistic Regression <br /> <br /> <br /> ### Table of Contents * Introduction * Loading Dataset * Logistic Regression Model * Using a Scaled Model * Quantitative Assessment with Cross-Validation * Adding Volume and Interaction Terms <br /> <br /> <br /> ## Introduction In this notebook, we illustrate the use of...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm #Data Loading data = np.genfromtxt('sgd_data.txt',delimiter = ',') x = np.zeros((40,1), dtype = np.float) y = np.zeros((40,1), dtype = np.float) for i in range(data.shape[0]): x[i] = data[i][0] f...
github_jupyter
``` videos = """ https://www.youtube.com/watch?v=RBShCX3-BtQ&t=1099s https://www.youtube.com/watch?v=WnipnOcDkx8 https://www.youtube.com/watch?v=fzuKoKTxfEs https://www.youtube.com/watch?v=Hioy9UvH4yE https://www.youtube.com/watch?v=98CiTQQtqak https://www.youtube.com/watch?v=HKnXUGo_H2U https://www.youtube.com/watch?v...
github_jupyter
# Azure Data Scientist Certification (DP-100) Resources & Tips > I passed the DP-100 certification exam yesterday. Here are some of the resources I used and the tips for you to prepare well. - toc: true - badges: true - comments: true - categories: [certification] - hide: false ## DP-100 ![DP-100](https://miro.m...
github_jupyter
# Pricing European Call Options ### Introduction <br> Suppose a <a href="http://www.theoptionsguide.com/call-option.aspx">European call option</a> with strike price $K$ and an underlying asset whose spot price at maturity $S_T$ follows a given random distribution. The corresponding payoff function is defined as: $$\m...
github_jupyter
# Convolutional Neutral Network ## Objectives: Building Convolutional Neutral Networks (CNN) to: * Learn and train based on the matrix of features by building convolutional neutral network layers * Use feature detectors (filters - e.g., sharpen, blur, edge detect) to find features in the images by convolving with i...
github_jupyter
``` import os import sys import numpy as np import pandas as pd import pysubgroup as ps sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.getcwd())),'sd-4sql\\packages')) saved_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))),'Data\\saved-data\\') from sd_analysis import ...
github_jupyter
In this lecture we're going to address how you can bring multiple dataframe objects together, either by merging them horizontally, or by concatenating them vertically. Before we jump into the code, we need to address a little relational theory and to get some language conventions down. I'm going to bring in an image to...
github_jupyter
# How common is introduced unfairness In the paper *Why fair lables can yield unfair predictions: graphical conditions on introduced unfairness* Carolyn Ashurst, Ryan Carey, Silvia Chiappa, Tom Everitt AAAI, 2022 we explore conditions under which fair labels can yield optimal unfair models. This notebook illust...
github_jupyter
# The Agate Tutorial The best way to learn to use any tool is to actually use it. In this tutorial we will use agate to answer some basic questions about a dataset. The data we will be using is a copy of the [National Registry of Exonerations]( http://www.law.umich.edu/special/exoneration/Pages/detaillist.aspx) made ...
github_jupyter
# Collapsed Gibbs sampler for Generalized Relational Topic Models with Data Augmentation <div style="display:none"> $ \DeclareMathOperator{\dir}{Dirichlet} \DeclareMathOperator{\dis}{Discrete} \DeclareMathOperator{\normal}{Normal} \DeclareMathOperator{\ber}{Bernoulli} \DeclareMathOperat...
github_jupyter
Authors: * Mainak Jas (plotly figures) * Alexandre Gramfort and Denis Engemann (original tutorial) [MNE-Python](http://martinos.org/mne/stable/mne-python.html) is a software package for processing [MEG](http://en.wikipedia.org/wiki/Magnetoencephalography)/[EEG](http://en.wikipedia.org/wiki/Electroencephalography) data...
github_jupyter
# Measurements in stabilography > Marcos Duarte > Laboratory of Biomechanics and Motor Control ([http://demotu.org/](http://demotu.org/)) > Federal University of ABC, Brazil Posturography is a general term for all techniques concerned with quantifying postural sway of a standing person. Typically in posturogra...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) # Train POS Tagger in French by Spark NLP ### Based on Universal Dependency `UD_French-GSD` ``` import os # Install java ! apt-get update -qq ! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-...
github_jupyter
# Tuples Data Structure ## Python Tuples (a,b) * Immutable - can NOT be changed * Use - passing data that does not need changing * Faster than list * "safer" than list * Can be key in dict unlike list * For Heterogeneous data - meaning mixing different data types(int,str,list et al) inside * https://docs.python.org/3/...
github_jupyter
# Data Wrangling with Spark This is the code used in the previous screencast. Run each code cell to understand what the code does and how it works. These first three cells import libraries, instantiate a SparkSession, and then read in the data set ``` from pyspark.sql import SparkSession from pyspark.sql.functions i...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib import rcParams # figure size in inches rcParams['figure.figsize'] = 15,15 data = pd.read_excel('Data_Train.xlsx') data_submit = pd.read_excel('Test_set.xlsx') data.head(15) data.info() data_submit.info() ``...
github_jupyter
# Understanding Data Types in Python Effective data-driven science and computation requires understanding how data is stored and manipulated. This section outlines and contrasts how arrays of data are handled in the Python language itself, and how NumPy improves on this. Understanding this difference is fundamental to...
github_jupyter
<h3>ローカルでモデルをトレーニングする</h3> <h4>エクスポートしたデータを読込みます</h4> ``` import numpy as np npz = np.load('docdata1.npz') print(npz.files) x = npz['arr_0'] y = npz['arr_1'] ``` <h4>読込んだ内容を確認します</h4> ``` print(x.shape) print(y.shape) print(x[0]) print(y[0]) ``` <h4>モデル学習のためのデータ準備をします</h4> - torch 関連のパッケージをインポートします ``` import to...
github_jupyter
## Visualizing simple geospatial data In this first exercise we want to see the simplictiy of geoplotlib in its fullest. Loading data and displaying it with pre-defined plots is really simple but already enables us to get incredible insights into our datasets. We'll be looking at a dataset containing all poachi...
github_jupyter
# SLU03 | Visualization with Pandas & Matplotlib: Learning notebook *** In this notebook we will cover the following: - Scatter plots - Line charts - Bar/Column charts - Histograms - Box plots - Chartjunk - Matplotlib basics - How to choose the right chart ## Some theory first! Data Visualization techniques serve ...
github_jupyter
# Effects of moving the locus along the genome (c) 2019 Manuel Razo. This work is licensed under a [Creative Commons Attribution License CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/). All code contained herein is licensed under an [MIT license](https://opensource.org/licenses/MIT) --- ``` import os import...
github_jupyter
``` # Import libraries from keras import optimizers, losses, activations, models from keras.callbacks import ModelCheckpoint, EarlyStopping, LearningRateScheduler, ReduceLROnPlateau from keras.layers import Layer, GRU, LSTM, Dense, Input, Dropout, Convolution1D, MaxPool1D, GlobalMaxPool1D, GlobalAveragePooling1D, \ ...
github_jupyter
``` import os os.environ.keys() ``` # Imports ``` import pygrib import os import numpy as np from matplotlib import pyplot as plt from matplotlib import colors from mpl_toolkits.basemap import Basemap, addcyclic import plotly.graph_objs as go from plotly.offline import download_plotlyjs, init_notebook_mode, plot, i...
github_jupyter
# Accelerating Deep Learning with Dask and GPUs ## Stephanie Kirmer, Senior Data Scientist ### Center for Deep Learning, Northwestern University ### April 27, 2021 [stephaniekirmer.com](https://www.stephaniekirmer.com) | twitter: [@data_stephanie](https://twitter.com/data_stephanie) | [saturncloud.io](https://s...
github_jupyter
## Imports Suppress TensorFlow warnings. ``` # Copied from: # https://weepingfish.github.io/2020/07/22/0722-suppress-tensorflow-warnings/ # Filter tensorflow version warnings import os # https://stackoverflow.com/questions/40426502/is-there-a-way-to-suppress-the-messages-tensorflow-prints/40426709 os.environ["TF_CP...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/MisaOgura/flashtorch/blob/master/examples/activation_maximization_colab.ipynb) ## Activation maximization --- A quick demo of activation maximization with [FlashTorch 🔦](https://github.com/MisaOgura...
github_jupyter
# Alternating minimization Reconstruction with alternating minimization (possible using both strobed illumination for initializations) ``` %matplotlib notebook %load_ext autoreload %autoreload 2 import numpy as np import scipy as sp import scipy.misc as misc import matplotlib.pyplot as plt import time import sys impo...
github_jupyter
# Regression: underfitting and overfitting We will look at a simple example of fitting a polynomial function to a set of data points. A polynomial is defined by its degree $n$ and can be written as: $y = \sum_{k=0}^n a_k x^k$. The simplest polynomial, with a degree of $n=1$, is the linear function: $y = a_1x + a_0$....
github_jupyter
# Nature of signals In the context of this class, a signal is the data acquired by the measurement system. It contains much information that we need to be able to identify to extract knowledge about the system being tested and how to optimize the measurements. A signal caries also messages and information. We will u...
github_jupyter
``` from IPython.core.display import HTML display(HTML("<style>.container { width:95% !important; }</style>")) import pandas as pd import numpy as np from elasticsearch import Elasticsearch, helpers from elasticsearch_dsl import Search, Q, SF from bs4 import BeautifulSoup # es = Elasticsearch(http_compress=True, maxsiz...
github_jupyter
# TimeSeries - a new object for handling time domain data ### NOTE: Internet access is required in order to use this tutorial TimeSeries is a new feature in the SunPy 0.8 release, replacing the LightCurve object which is now deprecated. Similar to LightCurve, TimeSeries handles time domain data from a variety of sola...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/get_image_id.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href="htt...
github_jupyter
<img src="images/logo.jpg" style="display: block; margin-left: auto; margin-right: auto;" alt="לוגו של מיזם לימוד הפייתון. נחש מצויר בצבעי צהוב וכחול, הנע בין האותיות של שם הקורס: לומדים פייתון. הסלוגן המופיע מעל לשם הקורס הוא מיזם חינמי ללימוד תכנות בעברית."> # <p style="text-align: right; direction: rtl; float: righ...
github_jupyter
``` from sklearn import datasets import numpy as np import matplotlib.pyplot as plt iris = datasets.load_iris() digits = datasets.load_digits() print(np.shape(digits.data)) print(np.shape(digits.target)) from sklearn import svm clf = svm.SVC(gamma=0.001, C=100.) clf.fit(digits.data[:-1], digits.target[:-1]) clf.predict...
github_jupyter
<table> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="..\images\qworld.jpg" width="25%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared by <a href="http://abu.lu....
github_jupyter
# Baseball pitcher WAR calculation using Statcast data by Lau Sze Yui (13/2/2019) Here is an example on how to calculate Wins Over Replacement (WAR) using Statcast data. [Baseball Reference](https://www.baseball-reference.com/about/war_explained.shtml) and [Fangraphs](https://library.fangraphs.com/misc/war/) both pr...
github_jupyter
``` import os import sys import matplotlib.pyplot as plt import itertools ROOT_DIR = os.path.dirname(os.path.dirname(os.getcwd())) if ROOT_DIR not in sys.path: sys.path.append(ROOT_DIR) import numpy as np import proplot as plot import tensorflow as tf import pandas as pd import DeepSparseCoding.tf1x.analysis.analysi...
github_jupyter
<a href="https://colab.research.google.com/github/bxck75/piss-ant-pix2pix/blob/master/modeltransferv2_apes_imshow.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # remove defaults !rm -r sample_data # Clone the repo !git clone https://github.com...
github_jupyter
This notebook compares various Factorization Machines implementations. # I - Factorization Machines The dataset used here is [MovieLens 100K](https://grouplens.org/datasets/movielens/). ``` %load_ext watermark %watermark --python --machine --packages creme,numpy,pandas,sklearn,xlearn --datename ``` ## LibFM Downlo...
github_jupyter
<a href="https://colab.research.google.com/github/PytorchLightning/pytorch-lightning/blob/master/notebooks/05-trainer-flags-overview.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Introduction to Lightning Flags ⚡🚩 In this notebook, we'll go ov...
github_jupyter
<p><font size="6"><b>04 - Pandas: Working with time series data</b></font></p> > *DS Data manipulation, analysis and visualization in Python* > *May/June, 2021* > > *© 2021, Joris Van den Bossche and Stijn Van Hoey (<mailto:jorisvandenbossche@gmail.com>, <mailto:stijnvanhoey@gmail.com>). Licensed under [CC BY 4.0 C...
github_jupyter
``` # We will import our libraries import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline from google.colab import files uploaded = files.upload() train = pd.read_csv('titanic_train.csv') train[:5] train.info() ``` We can already see that there are some missing ...
github_jupyter
``` import pandas as pd import geopandas as gpd from IPython.display import HTML, display import matplotlib.pyplot as plt ``` This notebook joins and exports DFPS datasets for manual review of violations for potential injuries and other characteristics. It uses data exported from the state data portal on Feb 1, 2018...
github_jupyter
``` from __future__ import print_function from bs4 import BeautifulSoup import requests ``` # Beautiful soup on test data Here, we create some simple HTML that include some frequently used tags. Note, however, that we have also left one paragraph tag unclosed. ``` source = """ <!DOCTYPE html> <html> <head> ...
github_jupyter
#Cleaning the dataset ``` !pip install -q wordcloud import wordcloud import nltk nltk.download('stopwords') nltk.download('wordnet') nltk.download('punkt') nltk.download('averaged_perceptron_tagger') # Dataset: https://www.kaggle.com/amananandrai/clickbait-dataset=clickbait_data.csv #https://towardsdatascience.com...
github_jupyter
``` import numpy as np import xarray as xr import pandas as pd import scipy from scipy import signal import scipy.stats as stats import statsmodels.api as sm import matplotlib.pyplot as plt import numpy.random as random #import cartopy ``` Create toy data set in space-time [x,y,t]. We start with random noise in [x,y]...
github_jupyter
# Developing an AI application Going forward, AI algorithms will be incorporated into more and more everyday applications. For example, you might want to include an image classifier in a smart phone app. To do this, you'd use a deep learning model trained on hundreds of thousands of images as part of the overall appli...
github_jupyter
# Solutions to Exercises For each exercise, the solutions below show one possible way of solving it, but you might have used a different approach, and that's great! There is almost always more than one way to solve any particular problem in Python. **Note**: Since this notebook is in the `solutions` sub-folder, the f...
github_jupyter
## California wildfires 2017 - Thomas Fire analysis The Thomas Fire was a massive wildfire that started in early December 2017 in Ventura and Santa Barbara counties and grew into California's largest fire ever. ![](../../static/img/thomasfire_cropped.jpg) ``` import arcgis from arcgis import * from arcgis.mapping im...
github_jupyter
# Generalizing Failure Circumstances One central question in debugging is: _Does this bug occur in other situations, too?_ In this chapter, we present a technique that is set to _generalize_ the circumstances under which a failure occurs. The DDSET algorithm takes a failure-inducing input, breaks it into individual el...
github_jupyter
``` import re test_string =''' source ip: 10.16.90.249 source hostname: android-ba50a4497de455a source port: 55198 source mac address: 50:2e:5c:f0:f6:98 system name : user name: location : sep , sms status : field sales user ( yes / no) : dsw event log: ---------------------------------------------------------------...
github_jupyter
``` # Scrape crowsourced labels of Exchange Ethereum addresses import requests from bs4 import BeautifulSoup import time def find_tag(address): url = 'https://etherscan.io/address/{}'.format(address) html = requests.get(url).content soup = BeautifulSoup(html, 'html.parser') #find tag tag = soup.find...
github_jupyter
# Iris Training and Prediction with Sagemaker Scikit-learn This tutorial shows you how to use [Scikit-learn](https://scikit-learn.org/stable/) with Sagemaker by utilizing the pre-built container. Scikit-learn is a popular Python machine learning framework. It includes a number of different algorithms for classification...
github_jupyter
``` %load_ext autoreload %autoreload 2 import sys sys.path.append('../../src/') import json import os from pathlib import Path ``` ## HisDB ``` import experiment.data as exp import datasets.divahisdb as hisdb env = exp.Environment() img_path = Path('../../doc/figures/') dataset = hisdb.HisDBDataset(env.dataset(exp.Da...
github_jupyter
# Maximum Mean Discrepancy drift detector on CIFAR-10 ### Method The [Maximum Mean Discrepancy (MMD)](http://jmlr.csail.mit.edu/papers/v13/gretton12a.html) detector is a kernel-based method for multivariate 2 sample testing. The MMD is a distance-based measure between 2 distributions *p* and *q* based on the mean emb...
github_jupyter
# LeNet on Cifar with Dropout (0.5) This is LeNet (6c-16c-120-84) on MNIST. Adam algorithm (lr=0.001) with 100 epoches. #### LeNet Total params: 44,426 Trainable params: 44,426 Non-trainable params: 0 #### LeNet with 10 intrinsic dim Total params: 488,696 Trainable params: 10 Non-trainab...
github_jupyter
# Examples of Multicore Applications: # Shared-Memory Multiprocess Applications In this notebook we look at multiprocess applications in IoTPy. The processes share memory. Associated with each process is an agent. The application can also have: <ol> <li> source threads that acquire data from external sources and <...
github_jupyter
# Inverted encoding models, revisited ``` import numpy as np import matplotlib.pyplot as plt import pymc3 as pm from scipy.stats import pearsonr from sklearn.base import RegressorMixin, BaseEstimator from sklearn.model_selection import cross_val_score from sklearn.preprocessing import OneHotEncoder import seaborn as s...
github_jupyter
# Loop API Example on Hartmann6 The loop API is the most lightweight way to do optimization in Ax. The user makes one call to `optimize`, which performs all of the optimization under the hood and returns the optimized parameters. For more customizability of the optimization procedure, consider the Service or Develope...
github_jupyter
``` %matplotlib inline import matplotlib import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = (12, 9) plt.rcParams["font.size"] = 18 ``` # Radioactivity Learning Objectives: - Explain how radioactivity was discovered - Explain the nuclear physical reason for radioactive decay - List ...
github_jupyter
# Инициализация ``` #@markdown - **Монтирование GoogleDrive** from google.colab import drive drive.mount('GoogleDrive') # #@markdown - **Размонтирование** # !fusermount -u GoogleDrive ``` # Область кодов ``` #@title Распознавание лиц { display-mode: "both" } # facial recognition # В этой программе реализовано распо...
github_jupyter
# Python in 5 minutes... While its absurd to think we can learn Python in 5 minutes, it's useful to at least introduce a few basic concepts of the language before we dive in. After covering these, you'll at least get past that first speed bump and can start interacting on your own. ## Variable assignment and data type...
github_jupyter
# Publications markdown generator for academicpages Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter....
github_jupyter
``` import tensorflow as tf from tensorflow import keras import glob import json import pandas as pd import os import gzip import re from nltk.stem import WordNetLemmatizer from nltk import pos_tag from nltk.corpus import stopwords import numpy as np import pandas as pd from sklearn.feature_extraction import DictVecto...
github_jupyter
# Data Science in Medicine using Python ### Author: Dr Gusztav Belteki Today's code has been inspired and modified from these books' code examples <img src="./images/cover.jpg" alt="Drawing" style="width: 300px;"/> <img src="./images/Geron_book_cover.png" alt="Drawing" style="width: 300px;"/> <img src="./images/ra...
github_jupyter
# Sampling pose DKF trained on H3.6M ``` %matplotlib inline %load_ext autoreload %autoreload 2 import os import addpaths from load import loadDataset from h36m_loader import insert_junk_entries import os import numpy as np from scipy.signal import convolve2d # Stupid hack to make parameter loading actually work # (u...
github_jupyter
**Challenges in Representation Learning: Facial Expression Recognition Challenge** from *https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data* # Data Exploration Some data exploration, looking at the structure of the files etc. ``` # loading packages import nump...
github_jupyter
# Wie lernt ein Neuronales Netz https://bootcamp.codecentric.ai/ In diesem Notebook trainieren wir einen Classifier auf dem MNIST Datenatz. Viele finden diesen Datensatz inzwischen langweilige und "zu einfach" - aber für dieses Notebook ist er genau richtig. Wir brauchen ein kleines einfaches Dataset, um zeigen zu kö...
github_jupyter
``` %load_ext autoreload %autoreload 2 import wfdb import pandas as pd from utils.scoring_metrics import ( RefInfo, load_ans, score, ue_calculate, ur_calculate, compute_challenge_metric, gen_endpoint_score_mask, ) from utils.scoring_metrics_test import _load_af_episodes # from database_reader.cpsc_database...
github_jupyter
# Unify and clean-up intersections of divided roads Divided roads are represented by separate centerline edges. The intersection of two divided roads thus creates 4 nodes, representing where each edge intersects a perpendicular edge. These 4 nodes represent a single intersection in the real world. Roundabouts similarl...
github_jupyter
``` import os import cv2 import math import warnings import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix, fbeta_score from keras import optimizers from keras...
github_jupyter
``` !apt-get install -y -qq software-properties-common python-software-properties module-init-tools !add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null !apt-get update -qq 2>&1 > /dev/null !apt-get -y install -qq google-drive-ocamlfuse fuse from google.colab import auth auth.authenticate_user() from oauth...
github_jupyter
# Crocoddyl: Contact RObot COntrol by Differential DYnamic programming Library ## I. Welcome to crocoddyl Crocoddyl is an **optimal control library for robot control under contact sequence**. Its solver is based on an efficient Differential Dynamic Programming (DDP) algorithm. Crocoddyl computes optimal trajectories ...
github_jupyter
### Refactor Clinic #1 In this post, we're going to refactor a function that returns a start and end date, or some defaults that are deemed "sensible" in the context of the application. The function is adapted from a real-life example in the wild! We do necessarily believe this logic actually requires a function, but...
github_jupyter
# Advanced Analytics and Machine Learning Overview Beyond large-scale SQL analysis and streaming, Spark also provides support for statistics, machine learning, and graph analytics. These encompass a set of workloads that we will refer to as advanced analytics. This notebook offers a basic overview of advanced analyti...
github_jupyter
# Full packet capture ## /Me > https://github.com/markuskont/Talsec-meetup ``` stuff = [ "IDS", "PCAP", "coding", "teaching", "hunting", "devops", "logging", "/^.*data.*$/" ] speciality = "spec==[{}]".format(",".join(stuff[:-1])) speciality = " || ".join([speciality, "spec=={}".format...
github_jupyter
**Introduction to model validation** ___ - What is model validation? - Model validation consists of: - ensuring your model performs as expected on new data - testing model performance on holdout datasets - selecting the best model, parameters, and accuracy metrics - achieving the bes...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of the License at...
github_jupyter
# AWS Hail on EMR Bokeh Plotting Example This is taken from the [Hail Plotting Tutorial](https://hail.is/docs/0.2/tutorials/08-plotting.html) with adjustments for use with SageMaker Notebook instances and EMR. ### List EMR Master Nodes `~/SageMaker/bin/list-clusters` will output the IP of each master node in your ac...
github_jupyter
# Programming and Database Fundamentals for Data Scientists - EAS503 While Python provides many (about 69) built in functions for the programmers to use, we will look at a few important ones. ### Math `abs`, `complex`,`divmod`, `hex`, `max`, `min`, `oct`, `pow`, `round`, etc. ### Type Conversion/Handling `bin`, `b...
github_jupyter
``` if 'google.colab' in str(get_ipython()): !pip install -q condacolab import condacolab condacolab.install() """ You can run either this notebook locally (if you have all the dependencies and a GPU) or on Google Colab. Instructions for setting up Colab are as follows: 1. Open a new Python 3 notebook. 2. Import...
github_jupyter
# Defect Detection: Semantic Segmentation - Pipeline Execution In this notebook, we will use the pipeline configured in the included python package under `pipelines` together with the defined code for preprocessing and training to automate the model training. It is easy to use such that you can simple drop in whatever...
github_jupyter