text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# 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 |
# Time Domain Spectral Simulations
Demonstrate how to inspect simulated spectra produced using `quicktransients`.
```
import numpy as np
from astropy.io import fits
from astropy.table import Table, Column
from desispec.io.spectra import read_spectra
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rc(... | github_jupyter |
```
# import packages
import numpy as np
import matplotlib.pyplot as plt
import arviz as az
import pybeam.default as pbd
# modify figure text settings
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
plt.rcParams['font.family'] = 'Times New Roman'
plt.rcParams.update({ 'mathtext.default' : 'regular' ... | github_jupyter |
```
# Imports
import os
import numpy as np
import xarray as xr
def load_ndwi(prod, res=30.):
"""
Load NDWI index (and rename the array)
"""
# Read NDWI index
ndwi = prod.load(NDWI)[NDWI]
ndwi_name = f"NDWI {ndwi.attrs['sensor']}"
return ndwi.rename(ndwi_name)
def extract_water(ndwi):
""... | github_jupyter |
```
import xarray as xr
import numpy as np
import pandas as pd
# random fake dataset
da = xr.DataArray(np.random.randn(2, 3, 2), dims=("x", "y",'t'), coords={"x": [10, 20], 'y':[33,44,55], 't':[7,8]})
da=da.rename('elev')
ds=da.to_dataset()
ds
# function to apply
def fn(x,y,elev,z):
misc_arr = [np.array([[1,2],[3,4... | github_jupyter |
```
#importing libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import nltk
import re
from collections import Counter
import time
import operator
#nltk.download('stopwords')
#from nltk.corpus import stopwords
#Importing dataset with codes description
descr = pd.read_csv('desc.csv', encod... | github_jupyter |
```
import lifelines
import matplotlib.pyplot as plt
from lifelines.datasets import load_rossi
from lifelines import CoxPHFitter
import pandas as pd
%matplotlib inline
from functools import reduce
from math import log, exp
import operator
rossi = load_rossi()
rossi.head()
def run_filtered_cox_ph(df, time_col, event_c... | github_jupyter |
# Plotly Visualization
The aim of this notebook is to proivde guidelines on how to achieve parity with Pandas' visualization methods as explained in http://pandas.pydata.org/pandas-docs/stable/visualization.html with the use of **Plotly** and **Cufflinks**
```
import pandas as pd
import cufflinks as cf
import numpy a... | github_jupyter |
<a href="https://colab.research.google.com/github/r12habh/Google-Colab-Torrent-Downloader-To-Drive/blob/master/Torrent_To_Google_Drive_Downloader_v4_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Torrent To Google Drive Downloader v4.1
### Mou... | github_jupyter |
<a href="https://colab.research.google.com/github/tae898/DeepLearning/blob/master/Chapter02_Linear_Algebra.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# 2.1 Scalars, Vectors, Matrices and Tensors
numpy package has a lot of useful stuffs for lin... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import os
import pickle
from glob import glob
import re
from concurrent.futures import ProcessPoolExecutor, as_completed
import numpy as np
import pandas as pd
#from tqdm import tqdm
from scipy import stats
from sklearn.metrics import pairwise_distances
import settings as conf
#... | github_jupyter |
# 1. 2D Linear Convection
We consider the 1d linear Convection equation, under a constant velocity
$$
\partial_t u + \mathbf{a} \cdot \nabla u - \nu \nabla^2 u = 0
$$
```
# needed imports
from numpy import zeros, ones, linspace, zeros_like
from matplotlib.pyplot import plot, contourf, show, colorbar
%matplotlib inli... | github_jupyter |
# Предсказание временных рядов
## Библиотеки
```
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from matplotlib import gridspec
from tqdm.notebook import tqdm
import numpy as np
import pandas as pd
import seaborn as sns
import torch
import scipy
import json
import sys
import re
import os
import n... | github_jupyter |
# **Coco Dataset Notebook and Inference Notebook**
https://www.kaggle.com/vexxingbanana/sartorius-coco-dataset-notebook
https://www.kaggle.com/vexxingbanana/mmdetection-neuron-inference
# **References**
https://www.kaggle.com/dschettler8845/sartorius-segmentation-eda-and-baseline
https://www.kaggle.com/ihelon/cell... | github_jupyter |
- [Lab 1: Principal Component Analysis](#Lab-1:-Principal-Component-Analysis)
- [Lab 2: K-Means Clustering](#Lab-2:-Clustering)
- [Lab 2: Hierarchical Clustering](#10.5.3-Hierarchical-Clustering)
- [Lab 3: NCI60 Data Example](#Lab-3:-NCI60-Data-Example)
# Chapter 10 - Unsupervised Learning
```
# %load ../standard_imp... | github_jupyter |
# Analysing model capacity
Author: Alexandre Gramfort, based on materials from Jake Vanderplas
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
```
The issues associated with validation and
cross-validation are some of the most important
aspects of the practice of machine learning. Selectin... | github_jupyter |
## Recap
Here's the code you've written so far.
```
# Code you have previously used to load data
import pandas as pd
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor
# Path of the file to read
iowa_file_path = '../inpu... | github_jupyter |
# Managing Device Data (C/C++)
#### Sections
- [Learning Objectives](#Learning-Objectives)
- [Data Offload](#Data-Offload)
- [Map Clause](#Map-Clause)
- _Code:_ [Lab Exercise: Map Clause](#Lab-Exercise:-Map-Clause)
- [Dynamically Allocated Data and Length Specification](#Dynamically-Allocated-Data-and-Length-Specifica... | github_jupyter |
# References
Some of the notebooks included in this collection have been borrowed or adapted from the ones available in the [**Introduction to Python**](https://github.com/ehmatthes/intro_programming) project by [Eric Matthes](mailto:ehmatthes@gmail.com).
Documentation
---
For information related to Python programmi... | github_jupyter |
# Feature: POS/NER Tag Similarity
Derive bag-of-POS-tag and bag-of-NER-tag vectors from each question and calculate their vector distances.
## Imports
This utility package imports `numpy`, `pandas`, `matplotlib` and a helper `kg` module into the root namespace.
```
from pygoose import *
import os
import warnings
fr... | github_jupyter |
# Activity Recognition using Machine Learning
In this project, I take the activity recognition dataset. The dataset includes sensor readings of 30 different individuals and the type of activity they were recorded for. Here, I'll use the dataset from Kaggle to classify various activities.
## Import libraries
Let's st... | github_jupyter |
#### - Merge Cell painting & L1000 Level-4 data
- Merge both CP and L1000 based on the compounds present in both assays, and make sure the number of replicates for the compounds in both assays per treatment dose are the same, to be able to have an aligned dataset.
#### - Train/Test split the merged Level-4 data
```
... | github_jupyter |
##### Copyright 2018 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 |
# Initializing a fiber with custom spectroscopy
This short example demonstrates how you can initialize a fiber with your own absorption and emission cross section data. In practice, this example uses the same spectroscopy files for Yb germano-silicate as the demonstration classes YbDopedFiber and YbDopedDoubleCladFibe... | github_jupyter |
# Machine Learning GridSearch Pipeline
```
# Import libraries
import os
import sys
# cpu_count returns the number of CPUs in the system.
from multiprocessing import cpu_count
import numpy as np
import pandas as pd
# Import metrics
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_auc_score
... | 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 |
<p><img src="https://oceanprotocol.com/static/media/banner-ocean-03@2x.b7272597.png" alt="drawing" width="800" align="center"/>
<h1><center>Ocean Protocol - Manta Ray project</center></h1>
<h3><center>Decentralized Data Science and Engineering, powered by Ocean Protocol</center></h3>
<p>Version 0.6.6 - beta</p>
<p>P... | github_jupyter |
# Symmetric Interior Penalty for the Poisson Equation
## What's new
- Symmetric Interior Penalty method (SIP)
- investigating matrix properties
## Prerequisites
- basics SIP method
- spatial operator, chapter corresponding to the SpatialOperator
- implementing numerical fluxes and convergence study, chapter corresp... | github_jupyter |
# Part 5 - Intro to Encrypted Programs
Believe it or not, it is possible to compute with encrypted data. In other words, it's possible to run a program where ALL of the variables in the program are encrypted!
In this tutorial, we're going to walk through very basic tools of encrypted computation. In particular, we'r... | github_jupyter |
# <font color="Red"><h3 align="center">Table of Contents</h3></font>
1. Introduction and Installation
2. DataFrame Basics
3. Read Write Excel CSV File
4. Different Ways Of Creating DataFrame
5. Handle Missing Data: fillna, dropna, interpolate
6. Handle Missing Data: replace function
7. Concat Dataframes
8. Pivot tab... | github_jupyter |
# Map Making
In this lesson we cover the mapmaking problem and current and available TOAST mapmaking facilities
* `OpMadam` -- interface to `libMadam`, a parallel Fortran library for destriping and mapping signal
* `OpMapmaker` -- nascent implementation of a native TOAST mapmaker with planned support for a host of sys... | github_jupyter |
# In this notebook we show the basic experiment with our end-to-end Sinkhorn Autoencoder with Noise Generation, using standard MNIST dataset
```
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variabl... | github_jupyter |
## Facies classification using KNN
##### Zhili Wei revised 2019 summer
```
import pandas as pd
import numpy as np
from math import radians, cos, sin, asin, sqrt
import itertools
from sklearn import neighbors
from sklearn import preprocessing
from sklearn import ensemble
from sklearn.model_selection import LeaveOne... | github_jupyter |
**[Course Home Page](https://www.kaggle.com/learn/machine-learning-for-insights)**
---
## Set Up
Today you will create partial dependence plots and practice building insights with data from the [Taxi Fare Prediction](https://www.kaggle.com/c/new-york-city-taxi-fare-prediction) competition.
We have again provided co... | github_jupyter |
# Complex Fourier Transform
## Complex numbers
Although complex numbers are fundamentally disconnected from our reality, they can be used to solve science and engineering problems in two ways:
1. As parameters from a real world problem than can be substituted into a complex form.
2. As complex numbers that ... | github_jupyter |
<a href="https://colab.research.google.com/github/faizuddin/IBB31103/blob/main/lab_exercise_2_(probability).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Probability Exercise
We’re going to calculate the probability a student gets an A (80%+) i... | github_jupyter |
# Working with Projections
This section of the tutorial discusses [map projections](https://en.wikipedia.org/wiki/Map_projection). If you don't know what a projection is, or are looking to learn more about how they work in `geoplot`, this page is for you!
I recommend following along with this tutorial interactively u... | github_jupyter |
```
# this is an example of federated leraning for voice data
# I borrowed almost all codes from this repositry. Thank a lot!
# https://github.com/tugstugi/pytorch-speech-commands.git
# you can learn
# 1. how to handle audio datasets
# 2. how to do federated learning with audio datasets
import warnings
warnings.filte... | github_jupyter |
# Overview
This colab demonstrates the steps to use the DeepLab model to perform semantic segmentation on a sample input image. Expected outputs are semantic labels overlayed on the sample image.
### About DeepLab
The models used in this colab perform semantic segmentation. Semantic segmentation models focus on assig... | github_jupyter |
```
export_folder = "sp2"
filename_prefix = "sp2"
from local_vars import root_folder
import os
export_fullpath = os.path.join(root_folder, export_folder)
if not os.path.exists(export_fullpath):
os.makedirs(export_fullpath)
print("Created folder: " + export_fullpath)
print "Export data to: " + export_fullpat... | github_jupyter |
```
import ete3
import re
import itertools
import multiprocessing
import random
import pandas as pd
import numpy as np
import igraph as ig
import pickle as pkl
from scipy.spatial.distance import squareform, pdist
from scipy.stats import mannwhitneyu
from collections import Counter
ncbi = ete3.... | github_jupyter |
```
%matplotlib inline
import plot_helpers as ph
from matplotlib import pyplot as plt
fairgp_files_race = [
('../results/ICML/propublica/gpyt500_eqopp_tuning_race.csv', ''),
]
def label_change(label):
parts = label.split('_')
#mode = parts[-1]
in_True = parts[4] == "True"
tnr = parts[6]
if not i... | github_jupyter |
## Enviroment:
Open AI gym [CartPole v0](https://github.com/openai/gym/wiki/CartPole-v0)
### Observation
Type: Box(4)
| Num | Observation | Min | Max |
| ---- | -------------------- | -------- | ------- |
| 0 | Cart Position | -2.4 | 2.4 |
| 1 | Cart Velocity | -Inf ... | github_jupyter |
# Evaluation of a QA System
[](https://colab.research.google.com/github/deepset-ai/haystack/blob/master/tutorials/Tutorial5_Evaluation.ipynb)
To be able to make a statement about the performance of a question-answering system, it is important t... | github_jupyter |
# <center>Regression Models - The why and the how </center>
**Notebook Outline:**
**Regression Models**
- [Introduction](#Introduction)
- [Hedonic House Price Models](#Hedonic-House-Price-Models)
- [Spatial Dependency and Heterogeneity](#Spatial-Dependency-and-Heterogeneity) <br><br>
[Back to the main page](http... | github_jupyter |
## Setup Data Fetching
```
import ta
import pandas as pd
import tensortrade.env.default as default
from tensortrade.data.cdd import CryptoDataDownload
from tensortrade.feed.core import Stream, DataFeed, NameSpace
from tensortrade.oms.instruments import USD, BTC, ETH, LTC
from tensortrade.oms.wallets import Wallet, P... | 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 |
# Aufgabe 11 - Trading Environment Setup
22.01.2022, Thomas Iten
**Content**
0. Setup
1. Load S&P 500 Dataset
2. Define Trading Environment
3. Create Trading Environment and visualize some state values
4. Test some random actions and visualize the rewards
## 0. Setup
```
import random
import numpy as np
import gym
i... | github_jupyter |
```
%gui qt5
import datetime
from collections import defaultdict
import ibapi
from tws_async import TWSClientQt, iswrapper, util, Stock
util.logToConsole()
# sample application
class TWS(TWSClientQt):
def __init__(self):
TWSClientQt.__init__(self)
self._reqIdSeq = 0
self._histData = default... | github_jupyter |
```
... # these dots mean the code segement is not executable
# prepare dataset
data = ...
# define transform
lda = LinearDiscriminantAnalysis()
# prepare transform on dataset
lda.fit(data)
# apply transform to dataset
transformed = lda.transform(data)
...
# define the pipeline
steps = [('lda', LinearDiscriminantAnaly... | github_jupyter |
#**THE SPARKS FOUNDATION**
*Graduate Rotational Internship Program* <br>
**Task 2: Prediction using Unsupervised ML**
**Author: Rushabh Thakkar**
```
#importing required libraries
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.cluster import KMeans
%matplotlib inline
from google.colab impor... | github_jupyter |
```
# preliminaries
import sys,os,time,cv2
import numpy as np
import matplotlib.pyplot as plt
from utils import imread_to_rgb, img_rgb2bw
DB_PATH = '/home/jhchoi/datasets4/RAF/'
raf_dict = dict()
#FER: 0=angry, 1=disgust, 2=fear, 3=happy, 4=sad, 5=surprise, 6=neutral
#RAF-basic and RAF-multi:
# 1:Surprise, 2:Fear, 3:... | github_jupyter |
```
from IPython.display import Markdown as md
### change to reflect your notebook
_nb_loc = "05_create_dataset/05_audio.ipynb"
_nb_title = "Vision ML on Audio, Video, Text, etc."
### no need to change any of this
_nb_safeloc = _nb_loc.replace('/', '%2F')
_nb_safetitle = _nb_title.replace(' ', '+')
md("""
<table clas... | github_jupyter |
# Example: CanvasXpress violin Chart No. 14
This example page demonstrates how to, using the Python package, create a chart that matches the CanvasXpress online example located at:
https://www.canvasxpress.org/examples/violin-14.html
This example is generated using the reproducible JSON obtained from the above page ... | github_jupyter |
<a href="https://colab.research.google.com/github/IEwaspbusters/KopuruVespaCompetitionIE/blob/main/Competition_subs/2021-04-28_submit/batch_LARVAE/HEX.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# XGBoost Years: Prediction with Cluster Variables... | github_jupyter |
```
1, 2, 3, 4 # int – целые числа
int(3.5)
round(4.5)
round(5.5)
import numpy as np
np.round(3.5, 0) # первый аргумент – число, которое округляем, второй – сколько знаков после запятой
3.5, 4.5, 5.5 # float
'строка' # string
True, False # bool
5 == 7
145 / 3 >= 12 *8
a, b = [int(i) for i in input().split()]
if a > b... | github_jupyter |
# <div style="text-align: center">A Data Science Framework for Elo </div>
### <div align="center"><b>Quite Practical and Far from any Theoretical Concepts</b></div>
<div style="text-align:center">last update: <b>11/28/2018</b></div>
<img src='http://s8.picofile.com/file/8344134250/KOpng.png'>
You can Fork and Run this ... | github_jupyter |
# Index
- B*Tree 인덱스는 나뭇잎으로 무성한 나무를 뒤집어 놓은 듯한 모습
- Root에서 Leaf 블럭까지의 거리를 깊이 (Height) 라고 부르며, 인덱스의 반복 탐색시 성능에 영향을 미치는 요소
- Root / Branch 블럭은 하위 노드들의 데이터 값 범위를 나타내는 Key 값과, 키 값에 해당하는 블록 주소 정보를 가지고 있음
- Leaf 블럭은 인덱스 키 값을 가지고, 그 키값에 해당하는 테이블 레코드를 찾아갈 때 필요한 주소 정보(row id)를 가짐
- 같은 키 값일때 row id순으로 정렬
- 인덱스 키(key) 값... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
import keras
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error
from sklearn.metrics import median_absolute_error
from sklearn.metrics import r2_score
import matplotlib.pyplot as ... | github_jupyter |
<a href="https://colab.research.google.com/github/Serbeld/Practicas-de-Python/blob/master/Matriz4x4_10.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
# Empresa Yogur
# Funcion que crea Matriz_de_frutas
def Matriz_de_frutas():
#Fresa, Mora, ... | github_jupyter |
# Basic training functionality
```
from fastai.basic_train import *
from fastai.gen_doc.nbdoc import *
from fastai.vision import *
from fastai.distributed import *
```
[`basic_train`](/basic_train.html#basic_train) wraps together the data (in a [`DataBunch`](/basic_data.html#DataBunch) object) with a pytorch model to... | github_jupyter |
# Python Developers Survey 2017
## Exploratory Data Analysis
Data source: [Python Developers Survey 2017](https://www.jetbrains.com/research/python-developers-survey-2017/)
This notebook demonstrates how the simple summary techniques we've learned in the [workshop](https://jenfly.github.io/pydata-intro-workshop/) ca... | github_jupyter |
More Functions
===
Earlier we learned the most bare-boned versions of functions. In this section we will learn more general concepts about functions, such as how to use functions to return values, and how to pass different kinds of data structures between functions.
<a name="top"></a>Contents
===
- [Default argument ... | github_jupyter |
# Reconhecimento de atividade humana usando conjunto de dados de smartphones
## Random Forest com classificação e clustering - Preditor de atividade humana
A Contoso Behavior Systems está desenvolvendo uma ferramenta de IA que tentará reconhecer a atividade humana (1-Walking, 2-Walking upstairs, 3-Walking downstairs,... | github_jupyter |
## scRNA-seq analysis (dimensionality reduction, clustering, identifying DE genes)
Now that we've rigourously QC'd and normalized our data to remove confounders, we can move on to the interesting part! Of course, analysis steps will vary depending on the biological question, but there a few things we can do that are u... | github_jupyter |
<a href="https://colab.research.google.com/github/googol88/intro-to-tensorflow/blob/main/l08c05_forecasting_with_machine_learning.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
##### Copyright 2018 The TensorFlow Authors.
```
#@title Licensed unde... | github_jupyter |
# Network Measures
Generating metrics of walking edge lengths and intersection density for a hex grid
First we need to download OSM network data using OSMNX. The data is to big to download and process at once, so we do this in chunks, for each of the 17 census divisions in the region, and then patch it back together ... | github_jupyter |
## Q-learning
This notebook will guide you through implementation of vanilla Q-learning algorithm.
You need to implement QLearningAgent (follow instructions for each method) and use it on a number of tests below.
```
# In google collab, uncomment this:
# !wget https://bit.ly/2FMJP5K -q -O setup.py
# !bash setup.py 2... | github_jupyter |
# The Matrix Profile
## Laying the Foundation
At its core, the STUMPY library efficiently computes something called a <i><b>matrix profile</b>, a vector that stores the [z-normalized Euclidean distance](https://youtu.be/LnQneYvg84M?t=374) between any subsequence within a time series and its nearest neigbor</i>.
To f... | github_jupyter |
```
!pip install numpy==1.20.3
!pip install sentencepiece==0.1.96
import csv
import re
import numpy as np
import sentencepiece as spm
from IPython.display import Audio
!git clone https://github.com/octanove/neuralmorse.git
token2symbol = {}
with open('neuralmorse/assignment.tsv') as f:
reader = csv.reader(f, deli... | github_jupyter |
<a href="https://colab.research.google.com/github/mbarbetti/unifi-physics-lab3/blob/main/CL_efficacia_vaccino.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Calcolo del livello di confidenza per l'efficacia di un vaccino sulla base dei dati riporta... | github_jupyter |
# A simple waveform demo
Select an audio file to explore. Use the tools on the left to navigate the waveform and click a button to play a portion of the waveform in your browser.
If running in a BinderHub instance instead of in a local notebook, it might be necessary to change the `default_jupyter_url` in the code.
... | github_jupyter |
```
import pandas as pd
import re
from collections import defaultdict
df = pd.read_csv("../top1000.csv")
df_t = pd.read_csv("top1000_num.csv")
df
df_t
def fine_word(dft, word):
idx = dft.find(word)
if(idx<0):
return False
else:
return True
def find_dfs(df_t, word, num, go=0):
hangul = re... | github_jupyter |
# GAN
```
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv2D
from keras.models import... | github_jupyter |
##### Copyright 2018 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 |
```
import sys
import os
import datetime
import pandas as pd
import seaborn as sns
from keras import backend as K
from PIL import Image
Image.MAX_IMAGE_PIXELS = 1000000000
from matplotlib import pyplot as plt
sys.path.insert(0, '../')
%load_ext autoreload
%autoreload 2
from src.models.params import get_params
from ... | github_jupyter |
<a id="title_ID"></a>
# JWST Pipeline Validation Notebook:
# < pipeline name >, < step name>
<span style="color:red"> **Instruments Affected**</span>: e.g., FGS, MIRI, NIRCam, NIRISS, NIRSpec
### Table of Contents
Follow this general outline. Additional sections may be added and others can be excluded, as needed. S... | github_jupyter |
# About this kernel
+ eca_nfnet_l0
+ ArcFace
+ Mish() activation
+ Ranger (RAdam + Lookahead) optimizer
+ margin = 0.7
## Imports
```
import sys
sys.path.append('../input/shopee-competition-utils')
sys.path.insert(0,'../input/pytorch-image-models')
import numpy as np
import pandas as pd
import torch
from torch... | github_jupyter |
# Ejercicios - 16 septiembre
Curso Introducción a Python - Tecnun, Universidad de Navarra
## Creacción diccionario
1. Crear un diccionario donde las claves sean los días de la semana y los valores sean cuántos de esos dias hay en septiembre.
2. Del diccionario anterior, convertir todas las claves mayúsculas.
EXTRA: ... | github_jupyter |
# Snippets
### Arrays
```
%%writefile test04.f90
program main
integer :: i, j, k, N=3
real, dimension(3,3,3) :: a
a = reshape([.50, .73, .22, .29, .65, .41, .69, .25, .76, .64, &
.60, .73, .93, .24, .63, .19, .73, .77, .93, .70, &
.29, .53, .34, .20, .91, .02, .47], &
... | github_jupyter |
##### Copyright 2020 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
```
#@title License header
# Copyright 2020 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 ... | github_jupyter |
```
import matplotlib.pyplot as plt
import numpy as np
def evaluate_h(w, X):
assert len(w.shape) == 1
assert len(X.shape) == 2
assert w.shape[0] == X.shape[0]
return np.sign(w @ X)
def run_perceptron(w_initial, X_training, y_training, iteration_callback=None):
w = w_initial.copy()
n = 0
... | github_jupyter |
```
%matplotlib notebook
import control as c
import ipywidgets as w
import numpy as np
from IPython.display import display, HTML
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib.gridspec as gridspec
display(HTML('<script> $(document).ready(function() { $("div.input").hide(); ... | github_jupyter |
```
import numpy
from numpy import arange
from matplotlib import pyplot
import pandas as pd
from pandas import set_option
from pandas.plotting import scatter_matrix
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold
from sklear... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import syft as sy
import numpy as np
import torch as th
from syft import VirtualMachine
from pathlib import Path
from torchvision import datasets, transforms
from syft.core.plan.plan_builder import PLAN_BUILDER_VM, make_plan, build_plan_inputs, ROOT_CLIENT
from syft.lib.python.col... | github_jupyter |
# Pawnee Fire analysis
The Pawnee Fire was a large wildfire that burned in Lake County, California. The fire started on June 23, 2018 and burned a total of 15,185 acres (61 km2) before it was fully contained on July 8, 2018.

## Remote Sensing using Sentinel-2 layer
```
from arcgis import G... | github_jupyter |
<a href="https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/50_cartoee_projections.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"/></a>
Uncomment the following line to install [geemap](https://geemap.org) and [cartopy](https://scitool... | github_jupyter |
# 3. Naive Bayes: Un Ejemplo
Haremos un ejemplo para ilustrar el clasificador Naive Bayes.
En este ejemplo, clasificaremos textos según hablen de China ('zh') o Japón ('ja').
```
import numpy as np
```
## Datos de Entrenamiento
Supongamos que tenemos los siguientes datos de entrenamiento:
```
training = [
('c... | github_jupyter |
# Oil and Gas Visualization/Dashboard
### Import required libraries
```
import numpy as np
import pandas as pd
import plotly.plotly as py
import plotly.offline as pyo
import cufflinks as cf
```
### Import New York State dataset
```
df = pd.read_csv('data/wellspublic.csv', low_memory=False)
df.shape
df.columns
```
... | github_jupyter |
# [Applied Statistics](https://lamastex.github.io/scalable-data-science/as/2019/)
## 1MS926, Spring 2019, Uppsala University
©2019 Raazesh Sainudiin. [Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/)
# Assignment 3 for Course 1MS926
Fill in your Personal Number, make s... | github_jupyter |
## Face and Facial Keypoint detection
After you've trained a neural network to detect facial keypoints, you can then apply this network to *any* image that includes faces. The neural network expects a Tensor of a certain size as input and, so, to detect any face, you'll first have to do some pre-processing.
1. Detect... | github_jupyter |
```
# hide
%load_ext autoreload
%autoreload 2
%load_ext nb_black
%load_ext lab_black
# default_exp model
```
# Model
> Generating predictions for Numerai on preprocessed data.
## Overview
Currently supported frameworks and formats:
1. `.joblib` (Common format to save Python objects. These models should have a `.pred... | 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 |
```
from __future__ import division, print_function, unicode_literals
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from utils.metrics import threshold_at_completeness_of, threshold_at_purity_of
from utils.bootstrap import (
kde_purity,
kde_comp... | github_jupyter |
<a href="https://colab.research.google.com/github/TheGupta2012/qctrl-qhack-Hostages-of-the-Entangled-Dungeons/blob/master/Robust_control_x_gate.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
**Creating Robust Control for Single qubit gates**
Here... | github_jupyter |
# Tuning Hyperparameters
There are many machine learning algorithms that require *hyperparameters* (parameter values that influence training, but can't be determined from the training data itself). For example, when training a logistic regression model, you can use a *regularization rate* hyperparameter to counteract ... | github_jupyter |
### Introduction
This notebook records the experiments I have done in the article of "Computing Semantic Similarity of Concepts in Knowledge Graphs". If someone is interested in reproducing the experiments, one can install Sematch and use this notebook for reference.
```
from sematch.semantic.similarity import WordNe... | github_jupyter |
```
# !python -m spacy download en_core_web_sm
# import spacy
# spacy.load('en_core_web_sm')
import spacy
import torch
import torchtext
from torchtext.legacy import datasets, data
import torch.nn.functional as F
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Containers for tokenisation
# using... | github_jupyter |
## Image网 Submission `128x128`
This contains a submission for the Image网 leaderboard in the `128x128` category.
In this notebook we:
1. Train on 1 pretext task:
- Train a network to do image inpatining on Image网's `/train`, `/unsup` and `/val` images.
2. Train on 4 downstream tasks:
- We load the pretext weight... | github_jupyter |
# Topic Modelling (LDA) of Turing Institute publications
# 0: Set up
### Required packages
```
#data manipulation and organisation
import pandas as pd
import numpy as np
#topic modelling
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
#visuali... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.