code
stringlengths
2.5k
150k
kind
stringclasses
1 value
<h1> Preprocessing using Dataflow </h1> This notebook illustrates: <ol> <li> Creating datasets for Machine Learning using Dataflow </ol> <p> While Pandas is fine for experimenting, for operationalization of your workflow, it is better to do preprocessing in Apache Beam. This will also help if you need to preprocess da...
github_jupyter
# Arcane Python syntax Python has a syntax with a few features that are quite unique. **General advice:** don't use any of this unless you feel comfortable with it, since mistakes can lead to bugs that are hard to track down. ## Interval checking In Python an expression such as `a < x <= b` is legal and well-define...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '' import malaya_speech.train.model.conformer as conformer import malaya_speech.train.model.transducer as transducer import malaya_speech import tensorflow as tf import numpy as np import json from glob import glob subwords = malaya_speech.subword.load('transducer-mix...
github_jupyter
<a href="https://colab.research.google.com/github/lmoroney/dlaicourse/blob/master/Course%201%20-%20Part%202%20-%20Lesson%202%20-%20Notebook.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ##### Copyright 2019 The TensorFlow Authors. ``` #@title Lic...
github_jupyter
``` queries = [ """ INSERT INTO page_lookup_nonredirect SELECT page.page_id as redircet_id, page.page_title as redirect_title, page.page_title true_title, page.page_id, page.page_latest FROM page LEFT OUTER JOIN redirect ON page.page_id = redirect.rd_from ...
github_jupyter
STAT 453: Deep Learning (Spring 2021) Instructor: Sebastian Raschka (sraschka@wisc.edu) Course website: http://pages.stat.wisc.edu/~sraschka/teaching/stat453-ss2021/ GitHub repository: https://github.com/rasbt/stat453-deep-learning-ss21 ``` %load_ext watermark %watermark -a 'Sebastian Raschka' -v -p torch ``` ...
github_jupyter
<center><img alt="" src="images/Cover_EDA.jpg"/></center> ## <center><font color="blue">EDA-04: Unsupervised Learning - Clustering Bagian ke-02</font></center> <h2 style="text-align: center;">(C) Taufik Sutanto - 2020</h2> <h2 style="text-align: center;">tau-data Indonesia ~ <a href="https://tau-data.id/eda-04/" tar...
github_jupyter
<h1 align="center">TensorFlow Deep Neural Network Lab</h1> <img src="image/notmnist.png"> In this lab, you'll use all the tools you learned from the *Deep Neural Networks* lesson to label images of English letters! The data you are using, <a href="http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html">notMNIST<...
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
# Day and Night Image Classifier --- The day/night image dataset consists of 200 RGB color images in two categories: day and night. There are equal numbers of each example: 100 day images and 100 night images. We'd like to build a classifier that can accurately label these images as day or night, and that relies on f...
github_jupyter
# Components of StyleGAN ### Goals In this notebook, you're going to implement various components of StyleGAN, including the truncation trick, the mapping layer, noise injection, adaptive instance normalization (AdaIN), and progressive growing. ### Learning Objectives 1. Understand the components of StyleGAN that...
github_jupyter
Центр непрерывного образования # Программа «Python для автоматизации и анализа данных» Неделя 1 - 1 *Татьяна Рогович, НИУ ВШЭ* ## Введение в Python. Целые и вещественные числа. Логические переменные. # Функция print() С помощью Python можно решать огромное количество задач. Мы начнем с очень простых и постепенно ...
github_jupyter
``` from mxnet import nd def pure_batch_norm(X, gamma, beta, eps=1e-5): assert len(X.shape) in (2, 4) # 全连接: batch_size x feature if len(X.shape) == 2: # 每个输入维度在样本上的平均和方差 mean = X.mean(axis=0) variance = ((X - mean)**2).mean(axis=0) # 2D卷积: batch_size x channel x height x width ...
github_jupyter
<a href="https://colab.research.google.com/github/wguesdon/BrainPost_google_analytics/blob/master/Report_v01_02.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Project Presentation ## About BrainPost Kasey Hemington runs BrainPost with a fellow ...
github_jupyter
# Merry Christmas and Happy Holidays ! ## Using Python Author: Sumudu Tennakoon\ Created Date: 2020-12-24 ## Goal To create a Greeting Card in the console output with  * An illustration of a Christmas tree using characters. * Randomly distributed Ornaments and Decorations. * a start in the top of of the tree * A borde...
github_jupyter
# Decision tree for regression In this notebook, we present how decision trees are working in regression problems. We show differences with the decision trees previously presented in a classification setting. First, we load the penguins dataset specifically for solving a regression problem. <div class="admonition no...
github_jupyter
# The Correlation Coefficient By Evgenia "Jenny" Nitishinskaya and Delaney Granizo-Mackenzie with example algorithms by David Edwards Part of the Quantopian Lecture Series: * [www.quantopian.com/lectures](https://www.quantopian.com/lectures) * [github.com/quantopian/research_public](https://github.com/quantopian/rese...
github_jupyter
# Data Preparation with SageMaker Data Wrangler (Part 2) > A detailed guide on AWS SageMaker Data Wrangler to prepare data for machine learning models. This is a five parts series where we will prepare, import, explore, process, and export data using AWS Data Wrangler. You are reading **Part 2:Import data from multiple...
github_jupyter
``` import pandas as pd ``` # Load and Read In Dataframes ``` from google.colab import files uploaded = files.upload() df1 = pd.read_csv('base_api_df (7).csv') df2 = pd.read_csv('data-2.csv') df3 = pd.read_csv('featuresdf.csv') df4 = pd.read_csv('SpotifyFeatures.csv') ``` # Cut Dataframes Down to Track Ids and Music...
github_jupyter
# Functions of DataFrame 7 **이산화** ``` import numpy as np import pandas as pd from pandas import DataFrame np.random.seed(777) df=DataFrame({'c1':np.random.randn(20), 'c2':['a','a','a','a','a','a','a','a','a','a', 'b','b','b','b','b','b','b','b','b','b']}) print(df) bins=np.linspace(df.c1....
github_jupyter
``` import pandas as pd import statsmodels.formula.api as smf from statsmodels.iolib.summary2 import summary_col import matplotlib.pyplot as plt %matplotlib inline #%config InlineBackend.figure_format = 'retina' # Uncomment if using a retina display plt.rc('pdf', fonttype=42) plt.rcParams['ps.useafm'] = True plt.rcPara...
github_jupyter
# Storing Multiple Values in Lists Just as a `for` loop is a way to do operations many times, a list is a way to store many values. Unlike NumPy arrays, lists are built into the language (so we don't have to load a library to use them). We create a list by putting values inside square brackets and separating the value...
github_jupyter
Exercise 4 - Polynomial Regression ======== Sometimes our data doesn't have a linear relationship, but we still want to predict an outcome. Suppose we want to predict how satisfied people might be with a piece of fruit, we would expect satisfaction would be low if the fruit was under ripened or over ripened. Satisfac...
github_jupyter
# Building a Classifier from Lending Club Data **An end-to-end machine learning example using Pandas and Scikit-Learn** ## Data Ingestion ``` %matplotlib inline import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from pandas.tools.plotting import scatter_matrix ...
github_jupyter
# Regularization Welcome to the second assignment of this week. Deep Learning models have so much flexibility and capacity that **overfitting can be a serious problem**, if the training dataset is not big enough. Sure it does well on the training set, but the learned network **doesn't generalize to new examples** that...
github_jupyter
## Yield Data ``` import pandas as pd import numpy as np import altair as alt import os pwd vegetables = pd.read_csv('MichiganVegetableData.csv') commodity_list1 = vegetables['Commodity'].unique().tolist() for commodity in commodity_list1: commoditydf = vegetables[vegetables['Commodity'] == commodity] mi_commo...
github_jupyter
# DiscreteDP Example: Water Management **Daisuke Oyama** *Faculty of Economics, University of Tokyo* From Miranda and Fackler, <i>Applied Computational Economics and Finance</i>, 2002, Section 7.6.5 ``` %matplotlib inline import itertools import numpy as np from scipy import sparse import matplotlib.pyplot as plt f...
github_jupyter
# 第3部 Pythonによるデータ分析|Pythonで学ぶ統計学入門 ## 5章 標本の統計量の性質 ### ライブラリのインポート ``` # 数値計算に使うライブラリ import numpy as np import pandas as pd import scipy as sp from scipy import stats # グラフを描画するライブラリ from matplotlib import pyplot as plt import seaborn as sns sns.set() # 表示桁数の指定 %precision 3 # グラフをjupyter Notebook内に表示させるための指定 %ma...
github_jupyter
# Setup IAM for Kinesis ``` import boto3 import sagemaker import pandas as pd sess = sagemaker.Session() bucket = sess.default_bucket() role = sagemaker.get_execution_role() region = boto3.Session().region_name sts = boto3.Session().client(service_name="sts", region_name=region) iam = boto3.Session().client(service_...
github_jupyter
# Plot unit conversions This notebook demonstrates some examples of different kinds of units, and the circumstances under which they are converted and displayed. ``` %matplotlib inline import sys import atomica as at import matplotlib.pyplot as plt import numpy as np import sciris as sc from IPython.display import di...
github_jupyter
# Using the model and best-fit parameters from CenQue, we measure the following values: The "true" SF fraction $$f_{True SF}(\mathcal{M}_*)$$ The "true" SF SMF $$\Phi_{True SF}(\mathcal{M}_*)$$ ``` import numpy as np import pickle import util as UT import observables as Obvs from scipy.interpolate import interp1d # ...
github_jupyter
# Extremal linkage networks This notebook contains code accompanying the paper [extremal linkage networks](https://arxiv.org/abs/1904.01817). We first implement the network dynamics and then rely on [TikZ](https://github.com/pgf-tikz/pgf) for visualization. ## The Model We define a random network on an infinite set...
github_jupyter
``` import os import random import math import time import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.keras.optimizers import Adam from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense, Conv1D, MaxPooling1D, Flatten, concatenate, Conv2D, MaxPooling2D...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import math import random from math import sqrt def sciPrintR(val, relErr, name=None): if name != None: print name, val, "+-", val * relErr, "(", relErr * 100., "%)" else: print val, "+-", val * relErr, "(", relErr * 100., "%)" def...
github_jupyter
``` # libraries from pandas_datareader import data from datetime import datetime import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import os # configure %matplotlib inline sns.set(style = 'whitegrid') # path os.getcwd() # import india rain data india_rain = pd.read_csv('C:\\Us...
github_jupyter
# MT5 Small Model In this notebook, we will be fine tuning the MT5 Sequence-to-Sequence Transformer model to take a Natural Language structured card specification to Java code. ### Check for Cuda Compatibility. ``` import torch import torch.nn as nn torch.cuda.is_available() using_google_drive = True if using_googl...
github_jupyter
# Retail Demo Store Experimentation Workshop - Interleaving Recommendation Exercise In this exercise we will define, launch, and evaluate the results of an experiment using recommendation interleaving using the experimentation framework implemented in the Retail Demo Store project. If you have not already stepped thro...
github_jupyter
``` # Dependencies and Setup %matplotlib inline import matplotlib.pyplot as plt import pandas as pd import numpy as np # Hide warning messages in notebook import warnings warnings.filterwarnings('ignore') # File to Load (Remember to Change These) mouse_drug_data_to_load = "data/mouse_drug_data.csv" clinical_trial_dat...
github_jupyter
# What _projects_ am I a member of? ### Overview There are a number of API calls related to projects. Here we focus on listing projects. As with any **list**-type call, we will get minimal information about each project. There are two versions of this call: 1. (default) **paginated** call that will return 50 projects...
github_jupyter
``` import pandas as pd import numpy as np import pickle pd.set_option('display.max_columns', None) pd.set_option('display.max_rows', None) pd.set_option('display.max_colwidth', -1) %matplotlib inline # Remove unrelated columns form data and get their name folder_path = '../../../datalcdem/data/optima/dementia_18J...
github_jupyter
## Product Review Aspect Detection: Laptop ### This is a Natural Language Processing based solution which can detect up to 8 aspects from online product reviews for laptops. This sample notebook shows you how to deploy Product Review Aspect Detection: Laptop using Amazon SageMaker. > **Note**: This is a reference n...
github_jupyter
``` import numpy as np import pprint import sys if "../" not in sys.path: sys.path.append("../") from lib.envs.gridworld import GridworldEnv pp = pprint.PrettyPrinter(indent=2) env = GridworldEnv() def value_iteration(env, theta=0.0001, discount_factor=1.0): """ Value Iteration Algorithm. Args: ...
github_jupyter
#### New to Plotly? Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/). <br>You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-fo...
github_jupyter
# Asymmetric Loss This documentation is based on the paper "[Asymmetric Loss For Multi-Label Classification](https://arxiv.org/abs/2009.14119)". ## Asymetric Single-Label Loss ``` import timm import torch import torch.nn.functional as F from timm.loss import AsymmetricLossMultiLabel, AsymmetricLossSingleLabel import...
github_jupyter
# 0. Dependências ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import load_iris from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA %matplotlib inline pd.options.display.max_rows = 10 ``` # 1. Introdução **O objetivo principal do...
github_jupyter
## Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. ### Example 1: Input: a = "11", b = "1" Output: "100" ### Example 2: Input: a = "1010", b = "1011" Output: "10101" ``` def add_binary(a,b): return '{0:b}'.format(int(a...
github_jupyter
# Chapter 3: Dynamic Programming ## 1. Exercise 4.1 $\pi$ is equiprobable random policy, so all actions equally likely. - $q_\pi(11, down)$ With current state $s=11$ and action $a=down$, we have next is the terminal state $s'=end$, which have reward $R'=0$ $$ \begin{aligned} q_\pi(11, down) &= \sum_{s',r}p(s',r | s...
github_jupyter
# Predictions with Pyro + GPyTorch (High-Level Interface) ## Overview In this example, we will give an overview of the high-level Pyro-GPyTorch integration - designed for predictive models. This will introduce you to the key GPyTorch objects that play with Pyro. Here are the key benefits of the integration: **Pyro ...
github_jupyter
# Exercise 1: Schema on Read ``` from pyspark.sql import SparkSession import pandas as pd import matplotlib spark = SparkSession.builder.getOrCreate() dfLog = spark.read.text("data/NASA_access_log_Jul95.gz") ``` # Load the dataset ``` #Data Source: http://ita.ee.lbl.gov/traces/NASA_access_log_Jul95.gz dfLog = spark....
github_jupyter
``` %%sh pip -q install sagemaker stepfunctions --upgrade # Enter your role ARN workflow_execution_role = '' import boto3 import sagemaker import stepfunctions from stepfunctions import steps from stepfunctions.steps import TrainingStep, ModelStep, EndpointConfigStep, EndpointStep, TransformStep, Chain from stepfuncti...
github_jupyter
### Math 157: Intro to Mathematical Software ### UC San Diego, Winter 2021 ### Homework 1: due Thursday, Jan 14 at 8PM Pacific In general, each homework will be presented as a single Jupyter notebook like this one. A problem will typically consist of multiple components; however, each overall problem within a homewor...
github_jupyter
``` #@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 agreed to in writing, software # distributed u...
github_jupyter
# Module 10 - Regression Algorithms - Linear Regression Welcome to Machine Learning (ML) in Python! We're going to use a dataset about vehicles and their respective miles per gallon (mpg) to explore the relationships between variables. The first thing to be familiar with is the data preprocessing workflow. Data need...
github_jupyter
# Losing your loops ## Python is slow! * dynamically typed -- Python interpreter needs to compare and convert(if needed) in runtime everytime a variable is written, modified or referenced * interpreted -- Vanilla Python comes with no compiler optimization * Uses buffers inefficiently because Python lists aren't homo...
github_jupyter
<a href="https://colab.research.google.com/github/isaacmg/task-vt/blob/biobert_finetune/drug_treatment_extraction/notebooks/BioBERT_RE.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Finetuning BioBERT for RE This is a fine-tuning notebook that we...
github_jupyter
``` !pip install eli5 !pip install xgboost ``` ## Import of Libraries needed ``` import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.pipeline import make_pipeline from sklearn.ensemble import RandomForestClassifier from sklearn.impute import SimpleImputer from cat...
github_jupyter
``` %matplotlib inline from matplotlib import style style.use('fivethirtyeight') import matplotlib.pyplot as plt import numpy as np import pandas as pd import datetime as dt from sqlalchemy import inspect ``` # Reflect Tables into SQLAlchemy ORM ``` import sqlalchemy from sqlalchemy.ext.automap import automap_base fr...
github_jupyter
# Ensemble Learning * The basic idea of ensemble learning is to have multiple learning algorithms for the same problem and combine their results to make a final prediction * There are multiple types on ensemble learning. Common approaches include: * Boosting * Bagging/Bootstrapping * Random Forests ...
github_jupyter
# MixMod Tutorial Welcome to the MixMod tutorial! Here we'll go over the basic functionality of MixMod. It's a small package, so the explanation of the MixtureModel class will be brief and will largely focus on formatting the inputs correctly. (Mixture models are relatively parameter-rich, so the syntax for properly s...
github_jupyter
# Automated setup of mixtures We've been working on streamlining setup of simulations of arbitrary mixtures in AMBER/GROMACS/OpenMM and others for some of our own research. I thought I'd demo this really quick so you can get a feel for it and see if you're interested in contributing. It also allows quick setup and ana...
github_jupyter
# Mislabel detection using influence function with all of layers on Cifar-10, ResNet ### Author [Neosapience, Inc.](http://www.neosapience.com) ### Pre-train model conditions --- - made mis-label from 1 percentage dog class to horse class - augumentation: on - iteration: 80000 - batch size: 128 #### cifar-10 train d...
github_jupyter
``` import os os.chdir('..') os.chdir('..') print(os.getcwd()) import rsnapsim as rss import numpy as np os.chdir('rsnapsim') os.chdir('interactive_notebooks') import numpy as np import matplotlib.pyplot as plt import time poi_strs, poi_objs, tagged_pois,raw_seq = rss.seqmanip.open_seq_file('../gene_files/H2B_with...
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
##### Copyright 2018 Google LLC. Licensed under the Apache License, Version 2.0 (the "License"); 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...
github_jupyter
# K Nearest Neighbor (KNN) Model ``` # Update sklearn to prevent version mismatches !pip install sklearn --upgrade # Update sklearn to prevent version mismatches !pip install tensorflow==2.2 --upgrade !pip install keras --upgrade # Install joblib. This will be used to save your model. # Restart your kernel after inst...
github_jupyter
``` import pandas as pd import os import glob raw_data_path = os.path.join('data', 'raw') clean_filename = os.path.join('data', 'clean', 'data.csv') ``` # Read data ``` all_files = glob.glob(raw_data_path + "/top_songs_with_lyrics.csv") raw_data = pd.concat(pd.read_csv(f) for f in all_files) raw_data.head() ``` # Pr...
github_jupyter
# Linked List vs. Array ## Node and Linked list linked list is based on node structure. We can imagine a node to be an indivdual pod. In each pod, we store different types of data - numbers, strings A linked list also store pointers in each pod on top of the data. If the linked list only has 1 pointer, which poin...
github_jupyter
``` import matplotlib.pyplot as plt from sklearn.neighbors import LocalOutlierFactor import pandas as pd import os import numpy as np # file_dir = os.getcwd() # raw_data_dir = os.path.join(file_dir, '/raw_data') file_list = [] for root, dirs, files in os.walk('./raw_data'): for file in files: if os.path.s...
github_jupyter
# Working with Samples and Features From a combined dataset of cancer and normal samples, extract the normal samples. Within the normal samples, find the genes coexpressed with LRPPRC (Affymetrix probe M92439_at), a gene with mitochondrial function. ## Before you begin * Sign in to GenePattern by entering your usern...
github_jupyter
# Import Use this resource with the export resource to migrate objects from one organization to another. # Prerequisite - Need to get the source and target object ids When we are performing an import operation, we need to map the source connection with the target connection, similartly map the source runtime environ...
github_jupyter
``` %%html <link href="http://mathbook.pugetsound.edu/beta/mathbook-content.css" rel="stylesheet" type="text/css" /> <link href="https://aimath.org/mathbook/mathbook-add-on.css" rel="stylesheet" type="text/css" /> <style>.subtitle {font-size:medium; display:block}</style> <link href="https://fonts.googleapis.com/css?fa...
github_jupyter
<span style="color:red; font-family:Helvetica Neue, Helvetica, Arial, sans-serif; font-size:2em;">An Exception was encountered at '<a href="#papermill-error-cell">In [40]</a>'.</span> # PA005: High Value Customer Identification # 0.0 Imports ``` import os import joblib import s3fs import pickle import re import nump...
github_jupyter
``` import pandas as pd import numpy as np from matplotlib import pyplot as plt from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from sklearn.metrics import roc_curve from sklearn.metrics import auc from sklearn.metri...
github_jupyter
<p float="center"> <img src="https://github.com/carlosalvarezh/Analisis_Numerico/blob/master/images/C00_Img00_logo.png?raw=true" width="350" /> </p> <h1 align="center">ST0256 - Análisis Numérico</h1> <h1 align="center">Presentación del Curso</h1> <h1 align="center">2021/01</h1> <h1 align="center">MEDELLÍN - COLOMBIA ...
github_jupyter
## CIFAR 10 ``` %matplotlib inline %reload_ext autoreload %autoreload 2 ``` You can get the data via: wget http://pjreddie.com/media/files/cifar.tgz **Important:** Before proceeding, the student must reorganize the downloaded dataset files to match the expected directory structure, so that there is a dedicat...
github_jupyter
# 1. Very simple 'programs' ## 1.1 Running Python from the command line In order to test pieces of code we can run Python from the command line. In this Jupyter Notebook we are going to simulate this. You can type the commands in the fields and execute them.<br> In the field type:<br> `print('Hello, World')`<br> Then p...
github_jupyter
## Install packages and connect to Oracle ``` sc.install_pypi_package("sqlalchemy") sc.install_pypi_package("pandas") sc.install_pypi_package("s3fs") sc.install_pypi_package("cx_Oracle") sc.install_pypi_package("fsspec") from sqlalchemy import create_engine engine = create_engine('oracle://CMSDASHADMIN:4#X9#Veut#KSsU#...
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
``` #!/usr/bin/python # coding: UTF-8 import json import pandas as pd import logging import codecs SimulationName="nii_videodata_jsonl_parse" #ログ設定 log_fmt = '%(asctime)s- %(name)s - %(levelname)s - %(message)s' logger_name = "LOGGER" logging.basicConfig(filename="./Log/" + SimulationName + ".log",format=log_fmt, level...
github_jupyter
# Generative Spaces (ABM) In this workshop we will lwarn how to construct a ABM (Agent Based Model) with spatial behaviours, that is capable of configuring the space. This file is a simplified version of Generative Spatial Agent Based Models. For further information, you can find more advanced versions here: * [Objec...
github_jupyter
``` # from google.colab import drive # drive.mount('/content/drive') import torch.nn as nn import torch.nn.functional as F import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import Dataset, DataLoader...
github_jupyter
# 1. Terrestrial vs solar origins of radiation in Earth's atmosphere ``` import math import numpy as np import matplotlib.pyplot as plt # Define Constants Ts = 5785 # K Te = 255 # K des = 150e9 # m re = 6.371e6 # m rs = 6.96e8 # m h = 6.62e-34 # m^2 kg/s c = 299792458 # m/s k = 1.38e-23 # J/K (kg m2 s-2 K-1)...
github_jupyter
# Introduction This notebook illustrates how to access your database instance using Python by following the steps below: 1. Import the `ibm_db` Python library 1. Identify and enter the database connection credentials 1. Create the database connection 1. Create a table 1. Insert data into the table 1. Query data from t...
github_jupyter
# W3 Lab: Perception In this lab, we will learn basic usage of `pandas` library and then perform a small experiment to test the perception of length and area. ``` import pandas as pd import math import matplotlib.pyplot as plt %matplotlib inline ``` ## Vega datasets Before going into the perception experiment, let...
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"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.o...
github_jupyter
``` import pandas as pd import numpy as np name = 'Revere' #name of the town town = pd.read_csv(name+'-google.csv') #file name, in this case they all followed format "town-google.csv" #strip all white space and split the types into a list for easier searching town['type_list'] = town['types'].str.replace(' ','').str.s...
github_jupyter
# Pre-procesamiento de datos ![image.png](attachment:a70264d0-d460-4c9e-bee9-fd86c37a94b5.png) ## Candidaturas elegidas Principales transformaciones: - Selección de atributos - Tratamiento de valores faltantes ``` import glob import nltk import re import pandas as pd from string import punctuation df_deputadas_1...
github_jupyter
``` import torch from dataset import load_dataset from basic_unet import UNet import matplotlib.pyplot as plt from rise import RISE from pathlib import Path from plot_utils import plot_image_row from skimage.feature import canny batch_size = 1 device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") trai...
github_jupyter
# Testing the Head **Warning:** Before running this notebook, first make sure you understand the command you run and make sure that the robot can freely move. **Note:** Also stop all other running Python script or notebook connected to the robot as only one connection can run at the same time. ``` %matplotlib notebo...
github_jupyter
<a href="https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/TrOCR/Evaluating_TrOCR_base_handwritten_on_the_IAM_test_set.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## Set-up environment ``` !pip install -q gi...
github_jupyter
## Time to do some data science Before creating a tome, we must decide on how to transform our data before concatenating. Therefore, we will explore the data for a single match. We will investigate the number of footsteps players make as a function of rank, wins, and friendly commends. After we developed the code t...
github_jupyter
``` import argparse import os import sys import torch import torch.nn as nn import datasets import models.resnet as ResNet import models.senet as SENet from liveview import LiveView import utils configurations = { 1: dict( max_iteration=1000000, lr=1.0e-1, momentum=0.9, weight_deca...
github_jupyter
``` import os, sys import torch from transformers import BertModel, BertConfig from greenformer import auto_fact from itertools import chain from os import path import sys def count_param(module, trainable=False): if trainable: return sum(p.numel() for p in module.parameters() if p.requires_grad) else:...
github_jupyter
<img src='./img/EU-Copernicus-EUM_3Logos.png' alt='Logo EU Copernicus EUMETSAT' align='right' width='40%'></img> <br> <a href="./00_index.ipynb"><< Index </a><br> <a href="./04_sentinel3_NRT_SLSTR_FRP_load_browse.ipynb"><< 04 - Sentinel-3 NRT SLSTR FRP - Load and browse </a><span style="float:right;"><a href="./06_IA...
github_jupyter
# Keane and Wolpin (1997) **Parameter Estimation via the Method of Simulated Moments (MSM)** In their seminal paper on the career decisions of young men, Keane and Wolpin (1997) estimate a life-cycle model for occupational choice based on NLSY data for young white men. The paper contains a basic and an extended specif...
github_jupyter
``` from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import * import pandas as pd from time import sleep import os nome_hoteis = [] preco_hoteis = [] ...
github_jupyter
# DS108 Databases : Lesson Ten Companion Notebook ### Table of Contents <a class="anchor" id="DS108L10_toc"></a> * [Table of Contents](#DS108L10_toc) * [Page 1 - Overview](#DS108L10_page_1) * [Page 2 - Sharding](#DS108L10_page_2) * [Page 3 - More Methods](#DS108L10_page_3) * [Page 4 - Key Terms](#DS10...
github_jupyter
# Implementing a one-layer Neural Network We will illustrate how to create a one hidden layer NN We will use the iris data for this exercise We will build a one-hidden layer neural network to predict the fourth attribute, Petal Width from the other three (Sepal length, Sepal width, Petal length). ``` import matpl...
github_jupyter
# From batch to online ## A quick overview of batch learning If you've already delved into machine learning, then you shouldn't have any difficulty in getting to use incremental learning. If you are somewhat new to machine learning, then do not worry! The point of this notebook in particular is to introduce simple no...
github_jupyter
#### Copyright 2017 Google LLC. ``` # 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 agreed to in writin...
github_jupyter