text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
## Training Notebook
This notebook illustrates training of a simple model to classify digits using the MNIST dataset. This code is used to train the model included with the templates. This is meant to be a starter model to show you how to set up Serverless applications to do inferences. For deeper understanding of how... | github_jupyter |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# $H_{\rm Orb, NS}$, up to and including third post-Newtoni... | github_jupyter |
# Unsupervised learning
### AutoEncoders
An autoencoder, is an artificial neural network used for learning efficient codings.
The aim of an autoencoder is to learn a representation (encoding) for a set of data, typically for the purpose of dimensionality reduction.
<img src="imgs/autoencoder.png" width="25%">
Uns... | 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 |
```
# 需要先安裝 gym[atari]
# headless 執行: xvfb-run -a jupyter notebook
import gym
env = gym.make('Pong-ram-v0')
import numpy as np
import ipywidgets as W
from PIL import Image
from io import BytesIO
def to_png(a):
with BytesIO() as bio:
Image.fromarray(a).save(bio, 'png')
return bio.getvalue()
```
Q le... | github_jupyter |
```
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from sklearn.utils import shuffle
from sklearn.utils import check_random_state
from sklearn.cluster import KMeans
from sklearn.preprocessing import normalize
from sklearn.metrics import pairwise_distances
from sklearn.feature_extraction.te... | github_jupyter |
> 原文地址 https://mp.weixin.qq.com/s?__biz=MzIzNzA4NDk3Nw==&mid=2457739380&idx=1&sn=122f15af3520857314199127ca79cad4&chksm=ff44882ac833013cb52d848aa03f2547f973d05572a0e90f3f68e662f573076507853691e222&mpshare=1&scene=24&srcid=&sharer_sharetime=1590505368566&sharer_shareid=316859bf78c7a4dcfe65351f82355327&key=4a6324d6ed203... | github_jupyter |
```
%matplotlib inline
from pyvista import set_plot_theme
set_plot_theme('document')
```
# Create a 3D model of a Permo-Carboniferous Trough (PCT)
Based on four seismic sections from the NAGRA report
`NAGRA NTB 14-02 <https://www.nagra.ch/data/documents/database/dokumente/$default/Default\%20Folder/Publikationen/NT... | github_jupyter |
### Deep Learning Tutorial for NLP with Tensorflow
This tutorial borrows from here and tries to show how to work with NLP tasks using Tensorflow. Borrowed material from [here]([here](https://github.com/rguthrie3/DeepLearningForNLPInPytorch/blob/master/Deep%20Learning%20for%20Natural%20Language%20Processing%20with%20Pyt... | github_jupyter |
### **PINN eikonal solver for a smooth v(z) model**
```
from google.colab import drive
drive.mount('/content/gdrive')
cd "/content/gdrive/My Drive/Colab Notebooks/Codes/PINN_isotropic_eikonal_R1"
!pip install sciann==0.5.4.0
!pip install tensorflow==2.2.0
#!pip install keras==2.3.1
import numpy as np
import pandas as ... | github_jupyter |
# Transfer Learning on TPUs
In the <a href="3_tf_hub_transfer_learning.ipynb">previous notebook</a>, we learned how to do transfer learning with [TensorFlow Hub](https://www.tensorflow.org/hub). In this notebook, we're going to kick up our training speed with [TPUs](https://www.tensorflow.org/guide/tpu).
## Learning ... | github_jupyter |
# Lecture 1: Introduction
[Download on GitHub](https://github.com/NumEconCopenhagen/lectures-2020)
[<img src="https://mybinder.org/badge_logo.svg">](https://mybinder.org/v2/gh/NumEconCopenhagen/lectures-2020/master?urlpath=lab/tree/01/Introduction.ipynb)
1. [Solve the consumer problem](#Solve-the-consumer-problem)
2... | github_jupyter |
```
#lets start by importing a bunch of stuff
import tensorflow as tf
import pandas as pd
import numpy as np
import math
# Downloading and separating data
#explictily setting the types and names
names_data = ['entry','entry_name','protein_name','gene_name','organism','length','sequence',
'gene_ontology',... | github_jupyter |
```
import astropy.coordinates as coord
import astropy.units as u
from astropy.table import Table, join, vstack
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
from astropy.io import ascii
from scipy.interpolate import interp1d
from scipy.stats import binned_statistic
im... | github_jupyter |
```
# !pip install git+https://github.com/nockchun/rspy --force
import rspy as rsp
import os
import numpy as np
import pandas as pd
```
# Pandas
## DataFrame 만들기
```
df = pd.DataFrame({
"col1" : ["foo1", "foo2", "foo3"],
"col2" : ["bar1", "bar2", "bar3"],
"col3" : ["A", "B", "C"],
"col4" : [100, 200,... | github_jupyter |
```
from numpy import array
import numpy as np
import pandas as pd
from numpy import array
from keras.models import Sequential
from keras.layers import Dense, LSTM, Dropout
from sklearn.preprocessing import MinMaxScaler
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
im... | github_jupyter |
# RadarCOVID-Report
## Data Extraction
```
import datetime
import json
import logging
import os
import shutil
import tempfile
import textwrap
import uuid
import matplotlib.pyplot as plt
import matplotlib.ticker
import numpy as np
import pandas as pd
import pycountry
import retry
import seaborn as sns
%matplotlib in... | github_jupyter |
# Full-Waveform Inversion (FWI)
This notebook highlights various aspects of seismic inversion based on Devito operators. In this example we aim to illustrate the core ideas behind seismic inversion, where we create an image of the subsurface from field recorded data. This tutorial follows on `03_propagators-acoustic.i... | github_jupyter |
# Multi-State Model first example
## In this notebook
This notebook provides a simple setting which illustrates basic usage of the model.
## Typical settings
In a typical setting of modelling patient illness trajectories, there are multiple sources of complexity:
1. There could be many states (mild, severe, recove... | github_jupyter |
# Excercises Electric Machinery Fundamentals
## Chapter 6
## Problem 6-26
```
%pylab notebook
```
### Description
A 460-V 50-hp six-pole $\Delta$ -connected 60-Hz three-phase induction motor has a full-load slip of 4 percent, an efficiency of 91 percent, and a power factor of 0.87 lagging. At start-up, the motor de... | github_jupyter |
Implement strStr().
Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Example 1:
Input: haystack = "hello", needle = "ll"
Output: 2
Example 2:
Input: haystack = "aaaaa", needle = "bba"
Output: -1
Clarification:
What should we return when needle... | github_jupyter |
Python code for generating figures used in the paper "What Determines the Sizes of Bars in Spiral Galaxies?" (Erwin 2019, submitted)
## Setup
### General Setup
```
%pylab inline
matplotlib.rcParams['figure.figsize'] = (8,6)
matplotlib.rcParams['xtick.labelsize'] = 16
matplotlib.rcParams['ytick.labelsize'] = 16
matp... | github_jupyter |
# Ensembale Mode here
Combine all the sub-model with Bagging method
```
import numpy as np
import pandas as pd
import scipy
import json
import seaborn as sns
from sklearn.base import TransformerMixin
from sklearn import preprocessing
from sklearn import metrics
from sklearn.feature_extraction.text import CountVectoriz... | github_jupyter |
# Crime project report
In this report, we are going to examine hate crime data from the United States between the years of 1991-2020.
```
import pandas as pd
import seaborn as sns
import sklearn
import matplotlib as plt
from matplotlib import colors
from matplotlib import pyplot
import squarify
import pyspark
fr... | 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 |
```
!pip install bilby
!pip install lalsuite
!pip install gwpy
#necessary modules are downloaded
"""
A script to sample a lensed signal by assuming that there is no lensing present
"""
from __future__ import division, print_function
import bilby
import numpy as np
import scipy
from scipy.special import hyp1f1
import mp... | github_jupyter |
```
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "-1"
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sns
import pandas as pd
from tqdm.auto import tqdm
import torch
from torch import nn
import gin
import pickle
import io
from sparse_causal_model_learner_rl.trainable.gumbel_switch import Wit... | github_jupyter |
# Carrinheiros
"Carrinheiros" are collectors of recyclable materials that use human propulsion vehicles in the selective collection. The problem is that route can be very tiring for waste pickers according to the increase in vehicle weight and the roads' slope. Therefore, this work proposes a route suggestion service ... | github_jupyter |
```
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
def plot_series(time, series, format="-", start=0, end=None):
plt.plot(time[start:end], series[start:end], format)
plt.xlabel("Time")
plt.ylabel("Value")
plt.grid(True)
def trend(time, slope=0):
ret... | github_jupyter |
# Mappe interattive
## Introduzione
Vediamo come controllare da Python delle mappe visualizzate in Jupyter con la libreria [ipyleaflet](https://ipyleaflet.readthedocs.io/) e [OpenStreetMap](https://www.openstreetmap.org), la mappa libera del mondo realizzata da volontari.
<div class="alert alert-warning">
**ATT... | github_jupyter |
```
# Copyright (c) 2019 ETH Zurich, Lukas Cavigelli, Georg Rutishauser, Luca Benini
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.gridspec
plt.rc('axes', axisbelow=True)
import pandas as pd
from reporting import readTable, parseTable
# provide the list of result files to analyze:
fnames = [
... | github_jupyter |
# SMP and snow pit profile matching
An example of SMP profiles at snow pit locations are scaled to account for differences
in the target snowpack structure. Because the SMP and density cutter profiles are physically
displaced we use a brute-force approach to match them as best as possible using a 4 step
procedure
1. M... | github_jupyter |
# 머신러닝 프로젝트
--------------
## Step 1. 문제를 정확하게 정의
## Step 2. 데이터 구하기
## Step 3. 데이터 탐색 및 시각화
## Step 4. 데이터 가공
## Step 5. 모델 선택 및 모델 훈련
## Step 6. 모델의 하이퍼파라미터 튜닝 및 성능 고도화
## Step 7. 솔루션 제시
## Step 8. 모델 배포 및 서비스 적용
-----
## 1. 문제를 정확하게 정의
- 해결하고자 하는 문제가 무엇인가?
- Input? Output?
### 1.1 문제 정의 : 미국 캘리포니아 지역내 블록의 중간 주택가격... | github_jupyter |
# 커널 서포트 벡터 머신
- perceptron & SVM같은 선형판별함수(Decision hyperplane) 분류모형은 XOR 문제 풀지 못함
### 1. 기저함수: 비선형 판별 모형
- 비선형 $\hat{y} = w^Tx$
- 선형 $\hat{y} = w^T\phi(x)$
- original D차원 독립변수 벡터 $x$
- transformed M차원 독립변수 벡터 $\phi(x)$
$$
\phi(\cdot): {R}^D \rightarrow {R}^M \\
\text{vector x} = (x_1, x_2, \cdots, x_D) \rightarro... | github_jupyter |
# Bayesian Structural Time Series: Forecasting and Decomposition Using PyMC3
This is an advanced example of how a custom Bayesian time series forecasting/decomposition model can be built using PyMC3. The implementation is based on this [example](https://docs.pymc.io/notebooks/GP-MaunaLoa.html).
## Data
The notebook u... | github_jupyter |
# Interpolation
```
import numpy as np
import matplotlib.pyplot as plt
import math
```
### Linear Interpolation
Suppose we are given a function $f(x)$ at just two points, $x=a$ and $x=b$, and you want to know the function at another point in between. The simplest way to find an estimate of this value is using linear... | github_jupyter |
# Stop Detection
<img align="right" src="https://anitagraser.github.io/movingpandas/pics/movingpandas.png">
[](https://mybinder.org/v2/gh/anitagraser/movingpandas/master?filepath=tutorials/4-stop-detection.ipynb)
**<p style="color:#e31883">This notebook demonstrates the ... | github_jupyter |
<a href="https://www.kaggle.com/drjohnwagner/heart-disease-prediction-with-xgboost?scriptVersionId=85327390" target="_blank"><img align="left" alt="Kaggle" title="Open in Kaggle" src="https://kaggle.com/static/images/open-in-kaggle.svg"></a>
```
import json
import random
import numpy as np
import pandas as pd
from igr... | github_jupyter |
## Load original model
```
import tensorflow as tf
import pathlib
import os
import numpy as np
from matplotlib.pyplot import imshow
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
root_dir = '../train_base_model'
model_dir = 'trained_resnet_vector-unquantized/save_model'
saved_model_dir = os... | github_jupyter |
<hr style="height:2px;">
# Demo: Training data generation for combined denoising and upsamling of synthetic 3D data
This notebook demonstrates training data generation for a combined denoising and upsampling task of synthetic 3D data, where corresponding pairs of isotropic low and high quality stacks can be acquired.... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import torch
import random
device = 'cuda' if torch.cuda.is_available() else 'cpu'
import os, sys
opj = os.path.join
from tqdm import tqdm
from functools import partial
import acd
from copy import deepcopy
sys.p... | github_jupyter |
```
# (1) Import the required Python dependencies
import findspark
findspark.init()
from pyspark import SparkContext, SparkConf
from pyspark.sql import SQLContext
from pyspark.ml.feature import VectorAssembler
from pyspark.ml.classification import MultilayerPerceptronClassifier
from pyspark.ml.evaluation import Multicl... | github_jupyter |
# Piston expander
This example explains how to use properly PDSim to simulate a piston expander. The same methodology can be readily applied to other positive displacement machines.
```
## COMMON IMPORTS ##
from __future__ import division, print_function
from math import pi, cos, sin
from timeit import default_timer
... | github_jupyter |
We have already seen lists and how they can be used. Now that you have some more background I will go into more detail about lists. First we will look at more ways to get at the elements in a list and then we will talk about copying them.
Here are some examples of using indexing to access a single element of an list.... | github_jupyter |
## Minicurso - Análise exploratória
## Mateus Pedrino - Igor Martinelli
Este notebook se dedica à análise exploratória de diferentes bases de dados. Serão comentadas distribuições, análise de outliers, valores ausentes, correlações, entre outros.
```
import numpy as np
import pandas as pd
import seaborn as sns
impor... | github_jupyter |

<hr>
### Kalman Filters and Pairs Trading
There are a few Python packages out there for Kalman filters, but we're adapting this example and the Kalman filter class code from [this article](https://www.quantstart.com/articles/kalman-filter-based-pairs-t... | github_jupyter |
# Time series Forecasting in Python & R, Part 1 (EDA)
> Time series forecasting using various forecasting methods in Python & R in one notebook. In the first, part I cover Exploratory Data Analysis (EDA) of the time series using visualizations and statistical methods.
- toc: true
- badges: true
- comments: true
- c... | github_jupyter |
# Intro Deep Learning Notebook
This notebook demonstrates how to actually implement the ideas discussed in the presentation.
## Step 1: Imports
There are two main frameworks used for deep learning in a research setting: [Pytorch](https://pytorch.org/) and [Tensorflow](https://www.tensorflow.org/).
Because the code fo... | github_jupyter |
# Markdown Cells
Text can be added to IPython Notebooks using Markdown cells. Markdown is a popular markup language that is a superset of HTML. Its specification can be found here:
<http://daringfireball.net/projects/markdown/>
## Markdown basics
You can make text *italic* or **bold**.
You can build nested itemiz... | github_jupyter |
Deep Learning using Rectified Linear Units
===
## Overview
In this notebook, we explore the performance of an autoencoder with varying activation functions on an image reconstruction task.
We load our dependencies.
```
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import tensorflow as tf
... | github_jupyter |
# MLP ORF to GenCode
Try using a saved model.
Run notebook 113 first.
It will save to my drive / best model.
This notebook will use the model trained in notebook 113.
```
import time
def show_time():
t = time.time()
print(time.strftime('%Y-%m-%d %H:%M:%S %Z', time.localtime(t)))
show_time()
import numpy... | github_jupyter |
# Basic of object detection program using OpenVINO
You will learn the basic of object detection program using OpenVINO in through this exercise.
Here, we'll go through a simple object detection progam using SSD(Single Shot multi-box Detection) model and learn how it works.
### Installing required Python packages
We'... | github_jupyter |
```
import pandas as pd
import numpy as np
data = pd.read_csv('./source/esol.csv',sep=',')
print(len(data))
data.head()
import rdkit
from rdkit import Chem
from rdkit.Chem import AllChem
from tqdm import tqdm_notebook
# cal the atom num
data_smiles = data['smiles'].values.tolist()
data_labels = data['measured log solu... | github_jupyter |
# Plot Actions
Plots can be configured to run code or other cells when the user clicks on or types into them.
```
from beakerx import *
from beakerx_base import *
from random import randint
abc = 0 # test variable
p = Plot(showLegend = True, useToolTip= False)
def on_click1(info):
info.graphics.display_name = "n... | github_jupyter |
# Project 4: Multi-factor Model
## Instructions
Each problem consists of a function to implement and instructions on how to implement the function. The parts of the function that need to be implemented are marked with a `# TODO` comment. After implementing the function, run the cell to test it against the unit tests w... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.

# Assess Fairness, Explore Inte... | github_jupyter |
## RKR Computation
All Code and Markdown written by Gary Zeri, Chapman University Student and member of the LaRue Cat Lab
All equations and information within this notebook originated from <i>The Computation of RKR Potential Energy Curves of Diatomic Molecules using Matematica</i>, written by Peter Senn.
The RKR meth... | github_jupyter |
# Data Science and Business Analytics Internship-Dec20
#### GRIP @ The Sparks Foundation
### Create the Decision Tree classifier and visualize it graphically.
### Task-6 Prediction using Decision Tree Algorithm
### Author: Abu Bakkar Siddikk
##### Batch: December-2020
```
# Import Neccessary Dependency
import numpy a... | github_jupyter |
<img src="https://i.ytimg.com/vi/yjprpOoH5c8/maxresdefault.jpg" width="300" height="300" align="center"/>
```
import numpy as np
import tensorflow as tf
seed=1234
np.random.seed(seed)
tf.random.set_seed(seed)
%config IPCompleter.use_jedi = False
```
## Tensors
What is a `Tensor` anyway?<br>
Although the meaning o... | github_jupyter |
# Custom Observers
Observers are at the heart of PyBN, but unfortunately it is not possible to define a recipe for everyones needs, but we built the system flexible enough that anybody can design its own observer. For simplicity of reading of this section we will recurr to a Jupyter Notebook trick to define a class al... | github_jupyter |
Data source: https://www.kaggle.com/mirichoi0218/insurance/downloads/insurance.zip/1
# Introduction
Health insurance in India is a growing segment of India's economy. The Indian health system is one of the largest in the world, with the number of people it concerns: nearly 1.3 billion potential beneficiaries. The hea... | github_jupyter |
# Data structures
## Nested Lists and Dictionaries
In research programming, one of our most common tasks is building an appropriate *structure* to model our complicated
data. Later in the course, we'll see how we can define our own types, with their own attributes, properties, and methods. But probably the most commo... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/drive')
GOOGLE_COLAB = True
%reload_ext autoreload
%autoreload 2
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import random
import pickle
import sys
if GOOGLE_COLAB:
sys.path.append('drive/My Drive/yelp_sentimen... | github_jupyter |
# Using Markov transition fields and network graphs to uncover time series behavior
Markov transition fields (MTF) is a visualization technique to highlight behavior of time series. This notebook dives into how we build and interpret these fields. We will then further build on top of MTF by exploring network graphs int... | github_jupyter |
```
# analyse data from csv. how can I improve it?
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
# smooth function, adapted from scipy formula at http://scipy-cookbook.readthedocs.io/items/SignalSmooth.html
def smooth(x,window_len=11,window='hanning'):
... | github_jupyter |
# Pricing Bull Spreads
### Introduction
<br>
Suppose a [bull spread](http://www.theoptionsguide.com/bull-call-spread.aspx) with strike prices $K_1 < K_2$ and an underlying asset whose spot price at maturity $S_T$ follows a given random distribution.
The corresponding payoff function is defined as:
$$\min\{\max\{S_T ... | github_jupyter |
## 5.3 계절 등 주기성 필드로 매출 예측하기 (시계열 분석)
### 공통 전처리
```
# 공통 처리
# 불필요한 경고 메시지 무시
import warnings
warnings.filterwarnings('ignore')
# 라이브러리 임포트
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# 한글 글꼴 설정
import platform
if platform.system() == 'Windows':
plt.rc('font', family='Malgun Gothic')... | github_jupyter |
# statsmodels Principal Component Analysis
*Key ideas:* Principal component analysis, world bank data, fertility
In this notebook, we use principal components analysis (PCA) to analyze the time series of fertility rates in 192 countries, using data obtained from the World Bank. The main goal is to understand how the... | github_jupyter |
# Demonstrating PERCIVAL
See "Learning Bayes' theorem with a neural network for gravitational-wave inference" by A. J. K. Chua and M. Vallisneri ([arXiv:1904.05355](http://www.arxiv.org/abs/1904.05355)).
*Michele and Alvin, 9/23/2019*
## Install
Install the `TrueBayes` Python package from [source on GitHub](https:/... | github_jupyter |
```
# !wget https://f000.backblazeb2.com/file/malaya-speech-model/data/audio-iium.zip
# !unzip -q audio-iium.zip
# !wget https://f000.backblazeb2.com/file/malaya-speech-model/data/audio-wattpad.zip
# !unzip -q audio-wattpad.zip
# !wget https://f000.backblazeb2.com/file/malaya-speech-model/data/news-speech.zip
# !unzip ... | github_jupyter |
```
%matplotlib inline
```
# Basic Usage of DirtyDF with Stainers
This page shows some basic examples of using DirtyDF, and applying stainers to transform them. We recommend you go through the
Basic Usage of Stainers (no DirtyDF) example first.
```
import pandas as pd
import numpy as np
from ddf.stainer import Shu... | github_jupyter |
<a href="https://colab.research.google.com/github/Rishit-dagli/GDG-Nashik-2020/blob/master/tfhub_neural_style_transfer.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Neural Style Transfer
This notebook shows how you could use TensorFlow Hub to v... | github_jupyter |
# Path Overview
`Path` contains `Lines` and `Curves` which can be stroked or filled. `Contour` is composed of a series of connected `Lines` and `Curves`. `Path` may contain zero, one, or more `Contours`. Each `Line` and `Curve` are described by `Verb`, `Points`, and optional `Path_Conic_Weight`.
Each pair of connected... | github_jupyter |
```
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
from pathlib import Path
import toolbox
import fcn
import yaml
import shutil
import sys
import chainer
%matplotlib inline
sns.set()
%load_ext autoreload
# Note: this reload all lib at each cell exec, just for convenienc... | github_jupyter |
# Exploring Web Map Service (WMS)
1. WMS and OWSLib
2. Getting some information about the service
3. Getting the basic information we need to perform a GetMap request
4. More on GetMap request
5. TDS-ncWMS styles and extensions
6. WMS and basemap
## 1. WMS and OWSLib
- WMS is the Open Geospatial Consortium (OGC) ... | github_jupyter |
# Pembukaan
Assalamualaikum warahmatullahi wabarakatuh. Mohon ijin pimpinan 🙏🏽 . Dengan ini saya sampaikan data mengenai persekolahan di Indonesia, wabil khusus perbandingan antara kondisi nasional dan Papua (Provinsi Papua dan Provinsi Papua Barat). Data diperoleh dari situs [Data Pokok Pendidikan Dasar dan Menenga... | github_jupyter |
<h4>Unit 1 <h1 style="text-align:center"> Chapter 1</h1>
---
```
import re
import logging
from importlib import reload
reload(logging)
import sys
logging.basicConfig(format='Explanation | %(levelname)s : %(message)s', level=logging.INFO, stream=sys.stdout)
log = logging.getLogger("Zero to Hero in NLP")
```
### R... | github_jupyter |
**Chapter 5 – Support Vector Machines**
_This notebook contains all the sample code and solutions to the exercises in chapter 5._
<table align="left">
<td>
<a target="_blank" href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/05_support_vector_machines.ipynb"><img src="https://www.ten... | github_jupyter |
```
import numpy as np
from keras.layers import Input, Dense, Lambda
from keras.layers.merge import concatenate as concat
from keras.models import Model
from keras import backend as K
from keras.datasets import mnist
from keras.utils import to_categorical
from keras.callbacks import EarlyStopping
from keras.optimizers ... | github_jupyter |
<a id='start'></a>
# Collecting
In questo notebook vengono spiegati i principali metodi per raccogliere ed effettuare una prima manipolazione sui dati. <br>
La libreria più usata per effettuare queste operazioni principali è **Pandas**. <br>
<br>
Il notebook è suddiviso nelle seguenti sezioni:<br>
- [DataFrame e Serie... | 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 |
# KNN (K-Nearest Neighbors) is Dead!
[](https://colab.research.google.com/github/stephenleo/adventures-with-ann/blob/main/knn_is_dead.ipynb)
Long live ANNs for their whopping 380X speedup over sklearn's KNN while delivering 99.3% similar results... | github_jupyter |
```
# we assume that we have the pycnn module in your path.
# we also assume that LD_LIBRARY_PATH includes a pointer to where libcnn_shared.so is.
from pycnn import *
```
## An LSTM/RNN overview:
An (1-layer) RNN can be thought of as a sequence of cells, $h_1,...,h_k$, where $h_i$ indicates the time dimenstion.
Eac... | github_jupyter |
# Physionet 2017 | ECG Rhythm Classification
## 4. Train Model
### Sebastian D. Goodfellow, Ph.D.
# Setup Noteboook
```
# Import 3rd party libraries
import os
import sys
import numpy as np
import pickle
# Deep learning libraries
import tensorflow as tf
# Import local Libraries
sys.path.insert(0, r'C:\Users\sebastia... | github_jupyter |
```
import gurobipy as gp
from gurobipy import GRB
from itertools import product
from math import sqrt
import numpy as np
import random as rd
import copy
def read_data(file_name):
edge = []
with open(file_name) as f:
data = f.readlines()
_,p,v = data[0].replace('\n','').split(' ')
for i in data[... | github_jupyter |
# [Lists](https://docs.python.org/3/library/stdtypes.html#lists)
```
my_empty_list = []
print('empty list: {}, type: {}'.format(my_empty_list, type(my_empty_list)))
list_of_ints = [1, 2, 6, 7]
list_of_misc = [0.2, 5, 'Python', 'is', 'still fun', '!']
print('lengths: {} and {}'.format(len(list_of_ints), len(list_of_m... | github_jupyter |
# Building queries with the Python SDK
In the following notebook, we will show how to build complex queries in GOR using the Python SDK to connect to our instance. First, as always, we load the gor magic extension to be able to use the `%gor` and `%%gor` syntax.
This notebook assumes you are familiar with the gor synta... | github_jupyter |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-59152712-8');
</script>
# Start-to-Finish Example: Numerical Solution of the Scalar... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# AutoML 05: Blacklisting Models, Early Termination, and Handling Missing Data
In this example we use the scikit-learn's [digit dataset](http://scikit-learn.org/stable/datasets/index.html#optical-recognition-of-handwritten-digi... | github_jupyter |
```
# Import the modules
import datetime
import pathlib
import urllib
import os
import numpy as np
import spiceypy
# Load the SPICE kernels via a meta file
spiceypy.furnsh('kernel_meta.txt')
# Create an initial date-time object that is converted to a string
datetime_utc = datetime.datetime(year=2021, month=11, day=21... | github_jupyter |
# Convexity
:label:`sec_convexity`
Convexity plays a vital role in the design of optimization algorithms.
This is largely due to the fact that it is much easier to analyze and test algorithms in such a context.
In other words,
if the algorithm performs poorly even in the convex setting,
typically we should not hope ... | github_jupyter |
# A Spam Classifier
> This project builds a spam classifier using Apache SpamAssassin's public datasets.
- toc:true
- branch: master
- badges: true
- comments: true
- author: Peiyi Hong
- categories: [project, machine learning, classification]
- image: images/roc.png
# Introduction
In this project, I built a spam cl... | github_jupyter |
# Converting Exact GP Models to TorchScript
In this notebook, we'll demonstrate converting an Exact GP model to TorchScript. In general, this is the same as for standard PyTorch models where we'll use `torch.jit.trace`, but there are two pecularities to keep in mind for GPyTorch:
1. The first time you make prediction... | github_jupyter |
```
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
```
# 1D Example
```
dx = 0.01
x = np.arange(0, 1, dx)
y = np.sin(x * np.pi)
pdf = y / y.sum()
cdf = pdf.cumsum()
fig = plt.figure(figsize=(9, 3), dpi=96)
plt.subplot(121)
plt.plot(pdf)
plt.subplot(122)
plt.plot(cdf)
r = np.ra... | github_jupyter |
# [ATM 623: Climate Modeling](../index.ipynb)
[Brian E. J. Rose](http://www.atmos.albany.edu/facstaff/brose/index.html), University at Albany
# Lecture 15: Insolation
## Warning: content out of date and not maintained
You really should be looking at [The Climate Laboratory book](https://brian-rose.github.io/Climate... | github_jupyter |
# Webscraping 40k Hindi songs
We'll be scraping http://giitaayan.com/
### Phase 1
In Phase 1, we will only scrape the category pages to get the song page URLs for all the songs on the website.
```
from selenium import webdriver
import re
import pandas as pd
import csv
import time
Chrome = webdriver.Chrome
chromedri... | github_jupyter |
```
import re
import pickle
import numpy as np
from collections import defaultdict
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.cm as cm
import seaborn as sns
import pandas as pd
import torch
import torch.nn as nn
from sklearn.metrics import confusion_matrix
from torch_geometri... | github_jupyter |
<a href="https://colab.research.google.com/github/ralsouza/python_fundamentos/blob/master/src/02_loops_condicionais_metodos_funcoes/12_calculadora.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Desenvolver uma Calculadora
## Versão 1
```
print(... | github_jupyter |
# The heart of Austin
For this tutorial, imagine you are a data scientist in a medical device company. We will learn how to simulate the Heart Rate (HR) of ten citizens of Austin, TX. Our virtual study participants will be 10, 25-years old, individuals that sleep (8 hours a day), perform normal activites for the major... | github_jupyter |
```
from ConvGRU import ConvGRU, ConvGRUCell
from reformer.reformer_enc_dec import ReformerEncDec
from reformer.reformer_pytorch import Reformer, ReformerLM
from patchify import patchify, unpatchify
from axial_positional_embedding import AxialPositionalEmbedding
from transformers import ReformerModel, ReformerConfig, R... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.