code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# About This Notebook * The following notebooks utilizes the [generated outputs](https://www.kaggle.com/usaiprashanth/gptmodel-outputs) and performs some Exploratory Data Analysis ``` #loading the outputs import joblib withoutshuffle = joblib.load('../input/gptmodel-outputs/results (4)/withoutshuffle.pkl') withshuffle...
github_jupyter
``` ## Import Libraries import sys import os sys.path.append(os.path.abspath(os.path.join('..'))) import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from pandas.api.types import is_string_dtype, is_numeric_dtype %matplotlib inline CSV_PATH = "../data/impression_log.cs...
github_jupyter
# Denoising Autoencoder Sticking with the MNIST dataset, let's add noise to our data and see if we can define and train an autoencoder to _de_-noise the images. <img src='notebook_ims/autoencoder_denoise.png' width=70%/> Let's get started by importing our libraries and getting the dataset. ``` import torch import n...
github_jupyter
# Sparkify Project Workspace This workspace contains a tiny subset (128MB) of the full dataset available (12GB). Feel free to use this workspace to build your project, or to explore a smaller subset with Spark before deploying your cluster on the cloud. Instructions for setting up your Spark cluster is included in the ...
github_jupyter
``` import requests # Get token from Hoopla username = 'HOOPLA_LOGIN' # for test, fake password = 'HOOPLA_PWD' hoopla_headers = {'accept':'application/json, text/plain, */*', 'accept-encoding': 'gzip, deflate, br', 'content-type':'application/x-www-form-urlencoded', 'device-version': 'Chrome', 'referer':'https:...
github_jupyter
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tueda/mympltools/HEAD?labpath=examples/Examples.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tueda/mympltools/blob/HEAD/examples/Examples.ipynb) ``` # Install mymp...
github_jupyter
# Geofísica Matemática y Computacional. ## Examen ### 23 de noviembre de 2021 Antes de entregar este *notebook*, asegúrese de que la ejecución se realiza como se espera. 1. Reinicie el kernel. - Para ello seleccione en el menú principal: Kernel$\rightarrow$Restart. 2. Llene todos las celdas que indican: - `Y...
github_jupyter
<a href="https://colab.research.google.com/github/DiGyt/snippets/blob/master/NeuropynamicsToolboxFirstDraft.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> BSD 3-Clause License Copyright (c) 27.07.2020, Dirk Gütlin All rights reserved. # *Simulat...
github_jupyter
# Add a new language to SoS It is relatively easy to define a new language module to allow SoS to exchange variables with a kernel. To make the extension available to other users, you will need to create a package with proper entry points. Please check documentation on [`Extending SoS`](Extending_SoS.html) for details...
github_jupyter
``` from datascience import * from datascience.predicates import are path_data = '../../../data/' import numpy as np import matplotlib matplotlib.use('Agg', warn=False) %matplotlib inline import matplotlib.pyplot as plots plots.style.use('fivethirtyeight') import warnings warnings.simplefilter(action="ignore", category...
github_jupyter
<h2> ====================================================</h2> <h1>MA477 - Theory and Applications of Data Science</h1> <h1>Lesson 1: General Overview</h1> <h4>Dr. Valmir Bucaj</h4> <br> United States Military Academy, West Point, AY20-2 <h2>=====================================================</h2> <h2> Lec...
github_jupyter
# House Price Prediction <p><b>Status: <span style=color:orange;>In process</span></b></p> ##### LOAD THE FEATURE DATA ``` import pandas as pd import numpy as np X = pd.read_csv('../../../data/preprocessed_data/X.csv', sep=',') print ('Feature data, shape:\nX: {}'.format(X.shape)) X.head() y = pd.read_csv('../../....
github_jupyter
### Previous: <a href = "keras_10.ipynb">1.10 Activation function </a> # <center> Keras </center> ## <center>1.11 Units</center> # Explanation # Units units: Positive integer, dimensionality of the output space. The amount of "neurons", or "cells", or whatever the layer has inside it. The "units" of each layer wi...
github_jupyter
# CI/CD for a Kubeflow pipeline on Vertex AI **Learning Objectives:** 1. Learn how to create a custom Cloud Build builder to pilote Vertex AI Pipelines 1. Learn how to write a Cloud Build config file to build and push all the artifacts for a KFP 1. Learn how to setup a Cloud Build GitHub trigger a new run of the Kubef...
github_jupyter
# Word2Vec **Learning Objectives** 1. Compile all steps into one function 2. Prepare training data for Word2Vec 3. Model and Training 4. Embedding lookup and analysis ## Introduction Word2Vec is not a singular algorithm, rather, it is a family of model architectures and optimizations that can be used to learn wo...
github_jupyter
``` #default_exp tabular.core #export from fastai2.torch_basics import * from fastai2.data.all import * from nbdev.showdoc import * #export pd.set_option('mode.chained_assignment','raise') ``` # Tabular core > Basic function to preprocess tabular data before assembling it in a `DataLoaders`. ## Initial preprocessing...
github_jupyter
# This notebook is dedicated to the visualization of the Yield Curve. ## What is the yield curve? The yield curve shows the different yields, or interest rates, across different contract lengths at a snapshot in time (typically daily). The curves below are all based on data obtained from [FRED](https://research.stlou...
github_jupyter
``` from scipy.sparse import diags import random import numpy as np import scipy as sc import pandas as pd import csv import scipy.linalg as spl import matplotlib.pyplot as plt from matplotlib import rc rc('text', usetex=True) import time import sys sys.path.insert(0, '../../python/') from opt_utils import * from grad_...
github_jupyter
# Neural Networks <a id='Table_of_Content'></a> **[1. Neural Networks](#1.Neural_Networks)** * [1.1. Perceptron](#1.1.Perceptron) * [1.2. Sigmoid](#1.2.Sigmoid) **[2. Neural Networks Architecture](#2.Neural_Networks_Architecture)** **[3. Training Neural Network](#3.Training_Neural_Network)** * [3.1. Forward Pro...
github_jupyter
# <div class="girk">With this notebook you can search all available databases seperately. You can edit the search string for each database and download the results for each. If desired you can join all the results and download a combined excel at the bottom of the page</div> # How-to: - Start Institutional VPN ...
github_jupyter
<a href="https://colab.research.google.com/github/aniketsharma00411/employee_future_prediction/blob/main/xgboost.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Dataset link: https://www.kaggle.com/tejashvi14/employee-future-prediction # Uploading ...
github_jupyter
``` """ @author: Jay Mehta Based on the work of Maziar Raissi """ import sys # Include the path that contains a number of files that have txt files containing solutions to the Burger's problem. sys.path.insert(0,'../../Utilities/') # Import required modules import torch import torch.nn as nn import numpy as np imp...
github_jupyter
# Beautiful Technical Documentation with nbdoc and Docusarus > [nbdoc](https://github.com/outerbounds/nbdoc) is a lightweight version of [nbdev](https://github.com/fastai/nbdev) that allows you to create rich, testable content with notebooks. [Docusarus](https://docusaurus.io/) is a beautiful static site generator fo...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES']='0,1,2,3,4,5,6,7' %run -p ../beta_tinfocnf.py --softcond False --sup False --cond False --latent_dim 4 --noise_std 0.3 --a_range "1.0, .08" --b_range "0.25, .03" --noise_std_test 0.3 --a_range_test "1.0, .08" --b_range_test "0.25, .03" --adjoint False --visualize True --...
github_jupyter
# 1-4.1 Intro Python ## Conditionals - **`if`, `else`, `pass`** - **Conditionals using Boolean String Methods** - Comparison operators - String comparisons ----- ><font size="5" color="#00A0B2" face="verdana"> <B>Student will be able to</B></font> - **control code flow with `if`... `else` conditional logic...
github_jupyter
``` import glob import os import librosa import numpy as np import matplotlib.pyplot as plt %matplotlib inline def gen_mfcc_fn(fn, mfcc_window_size, mfcc_stride_size): X, sample_rate = librosa.load(fn, sr=None, mono=True) if sample_rate != 44100: return mfcc = libr...
github_jupyter
# Handling Missing Data The difference between data found in many tutorials and data in the real world is that real-world data is rarely clean and homogeneous. In particular, many interesting datasets will have some amount of data missing. To make matters even more complicated, different data sources may indicate miss...
github_jupyter
## Dependencies ``` import os, random, warnings import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt from sklearn.model_selection import train_test_split from transformers import TFDistilBertModel from tokenizers import BertWordPieceTokenizer import tensorflow as tf from te...
github_jupyter
<div class="alert alert-block alert-info"> Section of the book chapter: <b>5.3 Model Selection, Optimization and Evaluation</b> </div> # 5. Model Selection and Evaluation **Table of Contents** * [5.1 Hyperparameter Optimization](#5.1-Hyperparameter-Optimization) * [5.2 Model Evaluation](#5.2-Model-Evaluation) **Lea...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from sympy import Symbol, integrate %matplotlib notebook ``` ### Smooth local paths We will use cubic spirals to generate smooth local paths. Without loss of generality, as $\theta$ smoothly changes from 0 to 1, we impose a condition on the curvature as follows $...
github_jupyter
## Add cancer analysis Analysis of results from `run_add_cancer_classification.py`. We hypothesized that adding cancers in a principled way (e.g. by similarity to the target cancer) would lead to improved performance relative to both a single-cancer model (using only the target cancer type), and a pan-cancer model us...
github_jupyter
``` import environmentv6 as e import mdptoolbox import matplotlib.pyplot as plt import numpy as np import progressbar as pb import scipy.sparse as ss import seaborn as sns import warnings warnings.filterwarnings('ignore', category=ss.SparseEfficiencyWarning) # params alpha = 0.4 gamma = 0.5 T = 8 epsilon = 10e-5 # gam...
github_jupyter
``` import json import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.svm import SVC from sklearn.metrics import accuracy_score pd.options.mode.chained_assignment = None SRC_TRAIN = "../../../data/src/tr...
github_jupyter
Reference: https://qiita.com/sasayabaku/items/b7872a3b8acc7d6261bf LSTMの学習を倍の長さでしてみる ``` from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Activation from tensorflow.keras.layers import LSTM from tensorflow.keras.optimizers import Adam from tensorflow.keras.callbacks import...
github_jupyter
# Exploring Texas Execution Data # Setup ``` import matplotlib.pyplot as plt import matplotlib import seaborn as sns import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures from sklearn.pipeline import make_pipeline #...
github_jupyter
``` """ Author: Shaimaa K. El-Baklish This file is under MIT License. Link: https://github.com/shaimaa-elbaklish/funcMinimization/blob/main/LICENSE.md """ import numpy as np import plotly.graph_objects as go ``` ## Benchmark Multimodal Functions Available | Function | Dimension | Bounds | Optimal Function Value | | --...
github_jupyter
``` import os import sys module_path = "/gpfs/space/home/roosild/ut-mit-news-classify/NYT/" if module_path not in sys.path: sys.path.append(module_path) from torch.utils.data import DataLoader import torch import os from tqdm.auto import tqdm from utils import print_f %load_ext autoreload %autoreload 2 print_f('A...
github_jupyter
# Face Recognition for the Happy House Welcome to the first assignment of week 4! Here you will build a face recognition system. Many of the ideas presented here are from [FaceNet](https://arxiv.org/pdf/1503.03832.pdf). In lecture, we also talked about [DeepFace](https://research.fb.com/wp-content/uploads/2016/11/deep...
github_jupyter
# Reshaping & Tidy Data > Structuring datasets to facilitate analysis [(Wickham 2014)](http://www.jstatsoft.org/v59/i10/paper) So, you've sat down to analyze a new dataset. What do you do first? In episode 11 of [Not So Standard Deviations](https://www.patreon.com/NSSDeviations?ty=h), Hilary and Roger discussed thei...
github_jupyter
# The Tractable Buffer Stock Model <p style="text-align: center;"><small><small><small>Generator: BufferStockTheory-make/notebooks_byname</small></small></small></p> The [TractableBufferStock](http://www.econ2.jhu.edu/people/ccarroll/public/LectureNotes/Consumption/TractableBufferStock/) model is a (relatively) simpl...
github_jupyter
#![Spark Logo](http://spark-mooc.github.io/web-assets/images/ta_Spark-logo-small.png) + ![Python Logo](http://spark-mooc.github.io/web-assets/images/python-logo-master-v3-TM-flattened_small.png) # **First Notebook: Virtual machine test and assignment submission** #### This notebook will test that the virtual machine (V...
github_jupyter
# Collaboration and Competition --- In this notebook, you will learn how to use the Unity ML-Agents environment for the third project of the [Deep Reinforcement Learning Nanodegree](https://www.udacity.com/course/deep-reinforcement-learning-nanodegree--nd893) program. ### 1. Start the Environment We begin by import...
github_jupyter
``` import h5py import keras import numpy as np import os import random import sys import tensorflow as tf sys.path.append("../src") import localmodule # Define constants. dataset_name = localmodule.get_dataset_name() models_dir = localmodule.get_models_dir() units = localmodule.get_units() n_input_hops = 104 n_filt...
github_jupyter
# Data Row ## Analisys of Tweets of Trump, Clinton, and Sander #### Ref: ## https://www.dataquest.io/blog/matplotlib-tutorial/ -------------------------------------------- ## Exploring tweets with Pandas ``` import pandas as pd tweets = pd.read_csv("tweets.csv") tweets.head() ``` --------------------------------...
github_jupyter
For all numerical experiments, we will be using the Chambolle-Pock primal-dual algorithm - details can be found on: 1. [A First-order Primal-dual Algorithm for Convex Problems with Applications to Imaging](https://link.springer.com/article/10.1007/s10851-010-0251-1), A. Chambolle, T. Pock, Journal of Mathematical Imagi...
github_jupyter
# Figure. X Inactivation ``` import cPickle import datetime import glob import os import random import re import subprocess import cdpybio as cpb import matplotlib as mpl import matplotlib.gridspec as gridspec import matplotlib.pyplot as plt import numpy as np import pandas as pd import pybedtools as pbt import scipy...
github_jupyter
# Sensing Local Field Potentials with a Directional and Scalable Depth Array: the DISC electrode array ## Supp Figure 1 - Associated data: Supp fig 1 data - Link: (nature excel link) ## Description: #### This module does the following: 1. Reads .csv data from ANSYS 2. Calculate F/B ratios for each orientation 3. Plot ...
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
This notebook wants to make use of the evaluation techniques previously developed to select the best algorithms for this problem. ``` import pandas as pd import numpy as np import tubesml as tml from sklearn.model_selection import KFold from sklearn.pipeline import Pipeline from sklearn.linear_model import Lasso, ...
github_jupyter
``` %matplotlib inline ``` 분류기(Classifier) 학습하기 ============================ 지금까지 어떻게 신경망을 정의하고, 손실을 계산하며 또 가중치를 갱신하는지에 대해서 배웠습니다. 이제 아마도 이런 생각을 하고 계실텐데요, 데이터는 어떻게 하나요? ------------------------ 일반적으로 이미지나 텍스트, 오디오나 비디오 데이터를 다룰 때는 표준 Python 패키지를 이용하여 NumPy 배열로 불러오면 됩니다. 그 후 그 배열을 ``torch.*Tensor`` 로 변환합니다. - 이미지...
github_jupyter
<a href="https://colab.research.google.com/github/NoerNikmat/machine_learning_models_for_absenteeism_at_work_dataset/blob/main/1_Data_Preparation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # DATA PREPARATION FOR MACHINE LEARNING MODELS Using A...
github_jupyter
# Bidirection LSTM - IMDB sentiment classification see **https://github.com/fchollet/keras/blob/master/examples/imdb_bidirectional_lstm.py** ``` KERAS_MODEL_FILEPATH = '../../demos/data/imdb_bidirectional_lstm/imdb_bidirectional_lstm.h5' import numpy as np np.random.seed(1337) # for reproducibility from keras.prepr...
github_jupyter
## TODO: <ul> <li>Usar o libreoffice e encontrar 2000 palavras erradas (80h)</li> <li>Classificar as palavras por tipo (80h)</li> </ul> ## <b>Italian Pipeline</b> ``` # load hunspell import urllib import json import numpy as np import pandas as pd import itertools from matplotlib import pyplot as plt import r...
github_jupyter
# Anna KaRNNa In this notebook, I'll build a character-wise RNN trained on Anna Karenina, one of my all-time favorite books. It'll be able to generate new text based on the text from the book. This network is based off of Andrej Karpathy's [post on RNNs](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) and [i...
github_jupyter
# Bayesian Estimation Supersedes the T-Test ``` %matplotlib inline import numpy as np import pymc3 as pm import pandas as pd import matplotlib.pyplot as plt plt.style.use('seaborn-darkgrid') print('Running on PyMC3 v{}'.format(pm.__version__)) ``` This model replicates the example used in: Kruschke, John. (2012) **Ba...
github_jupyter
``` %matplotlib inline from matplotlib import pyplot as plt import numpy as np import torch torch.set_printoptions(edgeitems=2) torch.manual_seed(123) class_names = ['airplane','automobile','bird','cat','deer', 'dog','frog','horse','ship','truck'] from torchvision import datasets, transforms data_path =...
github_jupyter
# TensorFlow实战Titanic解析 ## 一、数据读入及预处理 ### 1. 使用pandas读入csv文件,读入为pands.DataFrame对象 ``` import os import numpy as np import pandas as pd import tensorflow as tf # read data from file data = pd.read_csv('data/train.csv') print(data.info()) ``` ### 2. 预处理 1. 剔除空数据 2. 将'Sex'字段转换为int类型 3. 选取数值类型的字段,抛弃字符串类型字段 ``` # fil...
github_jupyter
``` !pip install pandas==1.0.3 from sklearn.model_selection import StratifiedKFold, GroupKFold import matplotlib.pyplot as plt import pandas as pd import numpy as np from tqdm import tqdm_notebook from math import log import lightgbm as lgb import gc import shap from sklearn.metrics import f1_score from tqdm.notebook i...
github_jupyter
``` #!/usr/bin/env python # vim:fileencoding=utf-8 import sys import numpy as np import matplotlib.pyplot as plt import soundfile as sf import matplotlib import pandas as pd #データセットの分割 from sklearn.model_selection import train_test_split #深層学習ライブラリ from keras.models import Sequential from keras.layers.core import Dens...
github_jupyter
``` from bs4 import BeautifulSoup import requests import pandas as pd from pandas import Series, DataFrame from ipywidgets import FloatProgress from time import sleep from IPython.display import display import re import pickle url = 'http://www.imdb.com/chart/top?ref_=nv_mv_250_6' result = requests.get(url) c = result....
github_jupyter
# The Stanford Sentiment Treebank The Stanford Sentiment Treebank consists of sentences from movie reviews and human annotations of their sentiment. The task is to predict the sentiment of a given sentence. We use the two-way (positive/negative) class split, and use only sentence-level labels. ``` from IPython.displa...
github_jupyter
# データサイエンス100本ノック(構造化データ加工編) - Python ## はじめに - 初めに以下のセルを実行してください - 必要なライブラリのインポートとデータベース(PostgreSQL)からのデータ読み込みを行います - pandas等、利用が想定されるライブラリは以下セルでインポートしています - その他利用したいライブラリがあれば適宜インストールしてください("!pip install ライブラリ名"でインストールも可能) - 処理は複数回に分けても構いません - 名前、住所等はダミーデータであり、実在するものではありません ``` import os import pandas as pd import n...
github_jupyter
# Setup the ABSA Demo ### Step 1 - Install aditional pip packages on your Compute instance ``` !pip install git+https://github.com/hnky/nlp-architect.git@absa !pip install spacy==2.1.8 ``` ### Step 2 - Download Notebooks, Training Data, Training / Inference scripts ``` import azureml from azureml.core import Worksp...
github_jupyter
``` # default_exp pds.utils # default_cls_lvl 3 ``` # PDS Utils > Utilities used by the `pds` sub-package. ``` # hide from nbverbose.showdoc import show_doc # noqa # export from typing import Union from fastcore.utils import Path import pandas as pd import pvl from planetarypy import utils # export class IndexLabe...
github_jupyter
# **Built in Functions** # **bool()** Valores vazios ou zeros são considerado False, do contrário são considerados True (Truth Value Testing). "Truth Value Testing". Isto é, decidir quando um valor é considerado True ou False ``` print(bool(0)) print(bool("")) print(bool(None)) print(bool(1)) print(bool(-100)...
github_jupyter
# Validation of gf_eia923 This notebook runs sanity checks on the Generation Fuel data that are reported in EIA Form 923. These are the same tests which are run by the gf_eia923 validation tests by PyTest. The notebook and visualizations are meant to be used as a diagnostic tool, to help understand what's wrong when t...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><ul class="toc-item"><li><span><a href="#(a)" data-toc-modified-id="(a)-0.1"><span class="toc-item-num">0.1&nbsp;&nbsp;</span>(a)</a></span></li><li><span><a href="#(b)" data-toc-modified-id="(b)-0...
github_jupyter
``` import torch from torch.autograd import Variable from torch import nn import matplotlib.pyplot as plt %matplotlib inline torch.manual_seed(3) ``` # make data ``` x_train = torch.Tensor([[1],[2],[3]]) y_train = torch.Tensor([[1],[2],[3]]) x, y = Variable(x_train), Variable(y_train) plt.scatter(x.data.numpy(), ...
github_jupyter
``` import random import pennylane as qml from pennylane import numpy as np import sys sys.path.insert(0,'..') from maskit.datasets import load_data # Setting seeds for reproducible results np.random.seed(1337) random.seed(1337) ``` # Loading the data Data of interest is MNIST data. As we want to go for reproducible ...
github_jupyter
# Import Dependencies ``` from config import api_key import matplotlib.pyplot as plt import pandas as pd import numpy as np import requests import datetime import json ``` # Use API to get .json ``` endpoint = 'breweries' page = 1 url = f"https://sandbox-api.brewerydb.com/v2/{endpoint}/?key={api_key}&p={page}&withLo...
github_jupyter
# What's this TensorFlow business? You've written a lot of code in this assignment to provide a whole host of neural network functionality. Dropout, Batch Norm, and 2D convolutions are some of the workhorses of deep learning in computer vision. You've also worked hard to make your code efficient and vectorized. For t...
github_jupyter
``` import itertools import numpy as np import pyquil.api as api from pyquil.gates import * from pyquil.quil import Program from gaussian_elimination import * ``` ##### Problem Setup The setup for Simon's problem consists of a given black-box operator that is a generalization from those given in the Deutsch and Deuts...
github_jupyter
# Image features exercise *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.* We have see...
github_jupyter
# Automate Retraining of Models using SageMaker Pipelines and Lambda # Learning Objectives 1. Construct a [SageMaker Pipeline](https://aws.amazon.com/sagemaker/pipelines/) that consists of a data preprocessing step and a model training step. 2. Execute a SageMaker Pipeline manually 3. Build infrastructure, using [Clou...
github_jupyter
*This tutorial is part Level 2 in the [Learn Machine Learning](https://www.kaggle.com/learn/machine-learning) curriculum. This tutorial picks up where Level 1 finished, so you will get the most out of it if you've done the exercise from Level 1.* In this step, you will learn three approaches to dealing with missing va...
github_jupyter
<a href="https://colab.research.google.com/github/mfernandes61/python-intro-gapminder/blob/binder/colab/04_built_in.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` ``` --- title: "Built-in Functions and Help" teaching: 15 exercises: 10 question...
github_jupyter
## Tutorial : Automatically determining TF binding site locations The code in this tutorial is released under the [MIT License](https://opensource.org/licenses/MIT). All the content in this notebook is under a [CC-by 4.0 License](https://creativecommons.org/licenses/by/4.0/). Created by Bill Ireland, Suzy Beleer and...
github_jupyter
## 0.0. Objetivo do Problema: -- 1.0. Previsao do primeiro destino que um novo usuário irá escolher. -- Porque? -- Qual tipo de modelo de negócio do Airbnb? - Marketplace ( Conectar pessoas que oferecem acomodacao, com pessoas que estao procurando acomodacao) - Oferta ( pessoas oferece...
github_jupyter
## Simple regression ``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt # Import relevant modules import pymc import numpy as np def generateData(size, true_intercept, true_slope, order, noiseSigma): x = np.linspace(0, 1, size) # y = a + b*x true_y = true_intercept + true_slope * (...
github_jupyter
# Module 5: Hierarchical Generators This module covers writing layout/schematic generators that instantiate other generators. We will write a two-stage amplifier generator, which instatiates the common-source amplifier followed by the source-follower amplifier. ## AmpChain Layout Example First, we will write a layout...
github_jupyter
# MNIST Convolutional Neural Network - Ensemble Learning Gaetano Bonofiglio, Veronica Iovinella In this notebook we will verify if our single-column architecture can get any advantage from using **ensemble learning**, so a multi-column architecture. We will train multiple networks identical to the best one defined i...
github_jupyter
<img src="https://github.com/gantian127/pymt_nwis/blob/master/docs/_static/logo.png?raw=true" width='600' align='center'></a> ## Introduction [nwis](https://github.com/gantian127/nwis) package provides a set of functions that allows downloading of the National Water Information System datasets for data visualization ...
github_jupyter
# Supplementary information for damage mapper tool Development of the damage mapper tool can be broken down into three parts: 1. A function `damage_zones` to calculate the coordinates of the surface zero location and the airblast damage radii 2. A function to plot the blast zones on a map 3. Functions to locate the p...
github_jupyter
<a href="https://www.matheharry.de/"> <img src="https://www.matheharry.de/wp-content/uploads/2020/12/cropped-MatheHarry-logos-banner.jpg" width="300" align="center"></a> --- # Bedingungen (conditions) und Ablaufsteuerung in Python **Willkommen!** In diesem Notebook lernst du die Bedingungsanweisungen in Python ...
github_jupyter
# PyCaret Fugue Integration [Fugue](https://github.com/fugue-project/fugue) is a low-code unified interface for different computing frameworks such as Spark, Dask and Pandas. PyCaret is using Fugue to support distributed computing scenarios. ## Hello World ### Classification Let's start with the most standard examp...
github_jupyter
We use Embeddings to represent text into a numerical form. Either into a one-hot encoding format called sparse vector or a fixed Dense representation called Dense Vector. Every Word gets it meaning from the words it is surrounded by, So when we train our embeddings we want word with similar meaning or words used in si...
github_jupyter
# Document Embedding with Amazon SageMaker Object2Vec 1. [Introduction](#Introduction) 2. [Background](#Background) 1. [Embedding documents using Object2Vec](#Embedding-documents-using-Object2Vec) 3. [Download and preprocess Wikipedia data](#Download-and-preprocess-Wikipedia-data) 1. [Install and load dependencies...
github_jupyter
<center> <img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0220EN-SkillsNetwork/labs/project/Images/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" /> </center> # Descriptive Statistics Estimated time needed: **30** minutes In this lab, you'll go ove...
github_jupyter
## Working with CSV files and CSV Module [1. What is a CSV file?](#section1) [2. CSV Sample File.](#section2) [3. Python CSV Module](#section3) [4. CSV Module Functions](#section4) [5. Reading CSV Files](#section5) [6. Reading as a Dictionary](#section6) [7. Writing to CSV Files](#section7) <a id="section...
github_jupyter
# <img style="float: left; padding-right: 10px; width: 45px" src="https://raw.githubusercontent.com/Harvard-IACS/2018-CS109A/master/content/styles/iacs.png"> CS-109B Introduction to Data Science ## Lab 5: Convolutional Neural Networks **Harvard University**<br> **Spring 2020**<br> **Instructors:** Mark Glickman, Pavlo...
github_jupyter
# Working with HEALPix data [HEALPix](https://healpix.jpl.nasa.gov/) (Hierarchical Equal Area isoLatitude Pixelisation) is an algorithm that is often used to store data from all-sky surveys. There are several tools in the Astropy ecosystem for working with HEALPix data, depending on what you need to do: * The [astro...
github_jupyter
# Datasets for the book Here we provide links to the datasets used in the book. Important Notes: 1. Note that these datasets are provided on external servers by third parties 2. Due to security issues with github you will have to cut and paste FTP links (they are not provided as clickable URLs) # Python and the Sur...
github_jupyter
``` import torch import torch.nn as nn from torch.autograd import Variable def conv3x3(in_, out): return nn.Conv2d(in_, out, 3, padding=1) class ConvRelu(nn.Module): def __init__(self, in_, out): super().__init__() self.conv = conv3x3(in_, out) self.activation = nn.ReLU(inplace=True) ...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#Python-Basics-with-Numpy-(optional-assignment)" data-toc-modified-id="Python-Basics-with-Numpy-(optional-assignment)-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Python Basics with Numpy (optional assignment)</a></div><div class="lev2 toc-item"><a href="...
github_jupyter
``` import tensorflow as tf from matplotlib import pylab from tensorflow.examples.tutorials.mnist import input_data import numpy as np # Required for Data downaload and preparation import struct import gzip import os from six.moves.urllib.request import urlretrieve ``` ## Defining Hyperparameters Here we define the ...
github_jupyter
# CCL feature demo **SLAC 2018 DESC meeting** In this demo, we use CCL to set up a cosmology and show how to get different quantities of interest. ``` import numpy as np import matplotlib.pyplot as plt import pyccl as ccl ``` We start by setting up a cosmology object. This holds the cosmological parameters and metad...
github_jupyter
``` import numpy as np import random import sys from scipy.special import expit as sigmoid training_data_path = sys.argv[1] testing_data_path = sys.argv[2] output_path = sys.argv[3] batch_size = int(sys.argv[4]) n0 = float(sys.argv[5]) activation = sys.argv[6] hidden_layers_sizes = [] for i in range(7,len(sys.argv)): ...
github_jupyter
``` from pyesasky import ESASkyWidget from pyesasky import Catalogue from pyesasky import CatalogueDescriptor from pyesasky import MetadataDescriptor from pyesasky import MetadataType from pyesasky import CooFrame # instantiating pyESASky instance esasky = ESASkyWidget() # loading pyESASky instance esasky # Go to the C...
github_jupyter
``` %pylab %matplotlib inline %run pdev notebook ``` # Radiosonde SONDE ``` ident = "SONDE" plt.rcParams['figure.figsize'] = [12.0, 6.0] plt.rcParams['lines.linewidth'] = 2 plt.rcParams['font.size'] = 15 yplevs = np.array([10,100,200,300,400,500,700,925])*100 save = True !mkdir -p figures rt.load_config() rt.config i...
github_jupyter
# Rechenpyramiden Die Zellen werden ausgeführt mit gelichzeitigem drücken von 'Shift'+'Enter' </br> Führe als erstes die Zelle unten aus damit der Pyramidengenerator parat ist. </br> Die Funktion Pyramide() erzeugt die Pyramide und die Lösung: </br> `Pyramide(7)` </br> => erzeugt eine Pyramide mit 7 zufälligen Basis...
github_jupyter