text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Homework 1 *This notebook includes both coding and written questions. Please hand in this notebook file with all the outputs and your answers to the written questions.* This assignment covers linear filters, convolution and correlation ``` # Setup import numpy as np import matplotlib.pyplot as plt from time import ...
github_jupyter
# Rileva e analizza i volti Le soluzioni di visione artificiale spesso richiedono una soluzione di intelligenza artificiale (IA) per essere in grado di rilevare, analizzare o identificare i volti umani. Ad esempio, supponiamo che l'azienda di vendita al dettaglio Northwind Traders abbia deciso di implementare un "nego...
github_jupyter
# 03_compute_bandSNR ``` import numpy as np from os.path import join as pjoin from os.path import isdir import os import matplotlib.pyplot as plt from matplotlib import cm, colors import mne_bids import mne from mne_bids import write_raw_bids, BIDSPath from scipy import stats import re from scipy import signal import ...
github_jupyter
``` import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.covariance import EllipticEnvelope from sklearn.ensemble import IsolationForest from sklearn.decomposition import PCA ``` ## Data Exploration ``` pd.option...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/ImageCollection/landsat_filtering.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_bl...
github_jupyter
# Content: 1. [Riemann approximation](#riemann) 2. [Newton-Cotes formulae](#newton) 3. [Trapezoidal rule](#trap) 4. [Simpson's 1/3 rule](#simp13) 5. [Arbitray order Newton-Cotes with Scipy](#newtonscipy) 6. [Gaussian quadrature](#quadrature) 7. [Gauss-Legendre quadrature](#gaussleg) 8. [Gauss-Laguerre quadrature](#gaus...
github_jupyter
``` lambda argument_list: expression ``` ``` sum = lambda x, y : x + y sum(3,4) # lambda function foo_lam = lambda a: 2 # regular function def foo_def(a): return 2 foo.__qualname__ = '<lambda>' foo_lam(2) foo_def(2) print(type(foo_def)) print(type(foo_lam)) # lambda function sum_lam = lambda x, y : x + y # regu...
github_jupyter
``` from glob import glob from os import path import re from skbio import DistanceMatrix import pandas as pd import numpy as np import scipy as sp from kwipexpt import * %matplotlib inline %load_ext rpy2.ipython %%R library(tidyr) library(dplyr, warn.conflicts=F, quietly=T) library(ggplot2) library(reshape2) ``` Calc...
github_jupyter
<IMG align="center" src="https://cdn.havecamerawilltravel.com/photographer/files/2013/03/Amazon-S3-1068x339.jpg" width="500"/> # <center> AWS S3(Simple Storage Services) </center> requirements - boto3==1.16.52 - pandas==1.2.1 ### <center> Contents </center> [1. Clear the workspace](#1.-Clear-the-workspace) [2....
github_jupyter
# Chapter 12 *Modeling and Simulation in Python* Copyright 2021 Allen Downey License: [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/) ``` # download modsim.py if necessary from os.path import basename, exists def download(url): file...
github_jupyter
# 206 Optimizers View more, visit my tutorial page: https://morvanzhou.github.io/tutorials/ My Youtube Channel: https://www.youtube.com/user/MorvanZhou Dependencies: * torch: 0.1.11 * matplotlib ``` import torch import torch.utils.data as Data import torch.nn.functional as F from torch.autograd import Variable impor...
github_jupyter
# 삼성전자 첨기연 시각 심화 - **Instructor**: Jongwoo Lim / Jiun Bae - **Email**: [jlim@hanyang.ac.kr](mailto:jlim@hanyang.ac.kr) / [jiun.maydev@gmail.com](mailto:jiun.maydev@gmail.com) ## NeuralNetwork Example In this example you will practice a simple neural network written by only [Numpy](https://www.numpy.org) which is fun...
github_jupyter
> Copyright 2020 DeepMind Technologies Limited. > > 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 agre...
github_jupyter
# Principal component analysis with MinMaxScaler This code template is for simple Principal Component Analysis(PCA) along feature scaling MinMaxScaler in python for dimensionality reduction technique. It is used to decompose a multivariate dataset into a set of successive orthogonal components that explain a maximum a...
github_jupyter
# Iterative methods for solving GEE ``` import numpy as np import pandas as pd from scipy import linalg from typing import List, NamedTuple class CovarianceParameters(NamedTuple('CovarianceParameters', [ ('alpha', np.float64), ('sigma2', np.float64), ])): def make_correlation_matrix(self, size): c...
github_jupyter
``` try: __IPYTHON__ USING_IPYTHON = True except NameError: USING_IPYTHON = False ``` #### Argparse ``` import argparse ap = argparse.ArgumentParser() ap.add_argument('mrp_data_dir', help='') ap.add_argument('--train-sub-dir', default='training', help='') ap.add_argument('--companion-sub-dir', default='./...
github_jupyter
``` from os import path from matplotlib import pyplot as plt import pandas as pd import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.naive_bayes import ComplementNB, BernoulliNB, MultinomialNB from sklearn.pipeline import make_pipeline, make_union from sklearn....
github_jupyter
``` import os import sys import pandas as pd import numpy as np from rpy2.robjects import packages, pandas2ri, r import dask.dataframe as dd PROJECT_PATH = os.path.abspath(os.path.join(os.getcwd(), '../')) if PROJECT_PATH not in sys.path: sys.path.append(PROJECT_PATH) from src.data.fitzroy_data import fitzro...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive', force_remount=True) DATA_DIR = '/content/drive/Shareddrives/Intelligent System - Assignment /Data/' import numpy as np import pandas as pd import tensorflow as tf import nltk import string import re from sklearn.preprocessing import LabelEncoder from skle...
github_jupyter
# Main notebook for battery state estimation ``` import numpy as np import pandas as pd import scipy.io import math import os import ntpath import sys import logging import time import sys from importlib import reload import plotly.graph_objects as go import tensorflow as tf from tensorflow import keras from tensorf...
github_jupyter
Below is code with a link to a happy or sad dataset which contains 80 images, 40 happy and 40 sad. Create a convolutional neural network that trains to 100% accuracy on these images, which cancels training upon hitting training accuracy of >.999 Hint -- it will work best with 3 convolutional layers. ``` import tens...
github_jupyter
# Registration Sandbox This notebook is a test-bed for regularization and reconstruction methods ``` %matplotlib notebook %load_ext autoreload %autoreload 2 # Load motiondeblur module and Dataset class import libwallerlab.projects.motiondeblur as md from libwallerlab.utilities.io import Dataset, isDataset # Platform...
github_jupyter
# How reusable is software mentioned in Open Access papers? An empirical study using code-cite _Neil Chue Hong, Robin Long, Martin O’Reilly, Naomi Penfold, Isla Staden, Alexander Struck, Shoaib Sufi, Matthew Upson, Andrew Walker, Kirstie Whitaker_ RSE18, Birmingham - 4th September 2018 https://github.com/softwaresav...
github_jupyter
``` %matplotlib inline %load_ext autoreload %autoreload 2 import sys sys.path.insert(1, '../') import itertools import numpy as np import matplotlib import matplotlib.pyplot as plt import seaborn as sns import sampl.gsn_api as gsn import sampl.semantics as sem import sampl.update as update import sampl.gsn_plot as ...
github_jupyter
``` import pandas as pd import numpy as np import re import os import utils import string pd.options.display.max_columns = 100 pd.options.display.max_rows = 1000 data_dir = "data/" files = ["H-1B_Disclosure_Data_FY16.xlsx", "H-1B_Disclosure_Data_FY15_Q4.xlsx", "H-1B_Disclosure_Data_FY17.xls...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/JavaScripts/FeatureCollection/FromPolygons.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a ta...
github_jupyter
# Molecular Dynamics We have introduced the classical potential models, and have derived and showen some of their basic properties. Now we can use these potential models to look at the dynamics of the system. ## Force and acceleration The particles that we study are classical in nature, therefore we can apply classi...
github_jupyter
# Quantization of Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Introduction [Digital signal processors](https://en...
github_jupyter
``` import numpy as np import json import warnings import operator import h5py from keras.models import model_from_json from keras import backend as K from keras.utils import get_custom_objects warnings.filterwarnings("ignore") size_title = 18 size_label = 14 n_pred = 2 def read_file(file_path): with open(file...
github_jupyter
<h1 align='center'>Домашнее задание</h1> **Дополнительный материал для выполнения дз**: - Лекция Coursera: https://ru.coursera.org/learn/machine-learning/lecture/4BHEy/regularized-logistic-regression - Статья на Хабре: https://habrahabr.ru/company/io/blog/265007/ - Книжка ISLR, 4 глава: http://www-bcf.usc.edu/~gareth...
github_jupyter
``` import torch import torchvision import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torchvision import datasets from torchvision import transforms from torchvision.utils import save_image ``` ### GAN 초간단 정리 - Discriminator - 784, 256 - ReLU - 256, 256 - Re...
github_jupyter
``` torchserve --stop sleep 1s torchserve --start --model-store model-archive/model_store/ --workflow-store model-archive/wf_store/ --ncs sleep 1s curl -X POST "localhost:7081/workflows?url=ocr.war" curl -X POST -H "Content-Type: application/json; charset=utf-8" -d @sample_b64.json localhost:7080/wfpredict/ocr -o...
github_jupyter
# ObJAX Tutorial ``` # Load the dependencies ## TEMPORARY HACK import os os.environ["CUDA_VISIBLE_DEVICES"] = '1' import sys sys.path.append("../../") ## </hack> import numpy as np import jax import jax.numpy as jn import objax import matplotlib.pyplot as plt %matplotlib inline # Load the MNIST dataset import ten...
github_jupyter
# Rust Crash Course - 03 - Ownership and Borrowing The central concept of Rust is called *Ownership*. It enables memory safety at compile time without requiring a garbage collector. In the following, ownership, borrowing, and related structures are explained. The contents represent a brief and compact introduction t...
github_jupyter
## Team 9– Alcove: **Music Generation with Neural Networks** **Group Members:** _Evan Kubick, Louis Lizzadro, Joseph May, Jason Miller, and Emily Musselman_ For this project, we will develop a recurrent neural network to generate pop music. Specifically, we will use a Long Short-Term Memory (LSTM) network, a type of ...
github_jupyter
``` %load_ext notexbook %texify ``` <span class="badges"> [![myBinder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/leriomaggio/deep-learning-for-data-science/HEAD?filepath=1_ANN/0_intro.ipynb) [![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google....
github_jupyter
``` #convert ``` # babilim.core.itensor > Tensor interface for babilim. Shared by tensorflow and pytorch. This code is under the MIT License. ``` #export # MIT License # # Copyright (c) 2019 Michael Fuerst # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associ...
github_jupyter
``` import math import json import random from os import path import pandas as pd import numpy as np from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio import AlignIO from Bio.Align import MultipleSeqAlignment from Bio.Align import AlignInfo import matplotlib.pyplot as plt import...
github_jupyter
# Purposive Action ## Unraveling the Mystery > <img src="https://github.com/jlcatonjr/Macroeconomics-Growth-and-Monetary-Equilibrium/blob/main/Chapter%201/Figure%201.jpg?raw=true" alt="City" /> > <center> <b> Figure 1 There is order to the world. Step on to the streets of New York City and you will notice that tr...
github_jupyter
``` import pandas as pd import numpy as np import torch print(f"Torch Version: {torch.__version__}") import transformers print(f"transformers (Adapter) Version: {transformers.__version__}") from transformers import RobertaTokenizer import numpy as np tokenizer = RobertaTokenizer.from_pretrained("roberta-base") from ...
github_jupyter
# Multi-dimensional numpy arrays You have now learned how to read and analyze 1-dimensional data with numpy (and with pandas as an additional "layer" of tools on top of the core numpy arrays). For the final two weeks of the semester, you will learn to manipulate multi-dimensional arrays ([ndarrays](https://numpy.org/...
github_jupyter
``` #!!!!!!!!!!!!! Make sure that the correct model is being loaded in EXPORT_PATH = '../data/processed/submission9.csv' TESTING_FILE = "../data/raw/test.csv" LOG_IMPORT = './reg_model_v1.dat' NAIVE_BAYES_IMPORT = './nb_model_v1.dat' DECISION_TREE_IMPORT = './dt_model_v1.dat' import pandas as pd import numpy as np impo...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D1_RealNeurons/student/W3D1_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neuromatch Academy: Week 3, Day 1, Tutorial 2 # Real N...
github_jupyter
``` main_script = 'home/jacob/projects/pyleaves/pyleaves/train/tf_parameterized_train_main.py' # import os # os.environ['KMP_DUPLICATE_LIB_OK']='True' # %debug # train.tf_parameterized_train_main.main(**{'-gpu':'4', # '--experiment_name': 'leaves_minimal_example', # ...
github_jupyter
``` import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline def load_datasets(filename): ''' Читає вхідний файл Параметри: filename - шлях до вхідного...
github_jupyter
# linear regreesion(线性回归) 注意:python版本为3.6, 安装TensorFlow的方法:pip install tensorflow ``` import pandas as pd import seaborn as sns sns.set(context="notebook", style="whitegrid", palette="dark") import matplotlib.pyplot as plt # 2020-03-31 修复 bug #import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_b...
github_jupyter
### B. Former In-Class Exercise Word Count #### To answer marketing manager's questions: The first assumption is that the customer segment (sons, significant others, grandchildren, siblings, self, etc.) appeared in the reviews indicates who the toy was bought for. * From the result of unique word count, we can see t...
github_jupyter
``` import os import numpy as np from sklearn.cluster import MiniBatchKMeans from tqdm import tqdm from math import log import pickle import matplotlib.pyplot as plt X = [] y = [] z = [] check = ['us','indian','england','canada','australia','scotland','african'] phones_all = ['ah', 't', 'n', 'ih', 'd', 's', 'r', 'l', '...
github_jupyter
``` from bs4 import BeautifulSoup import requests import pandas as pd from datetime import datetime header = ({'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'}) web = "https://www.worldors.info/coronavirus/" response = reques...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import sys sys.path.append('../../pyutils') import metrics import utils ``` # Generalized Additive Models ``` from sklearn.datasets import load_boston from scipy.interpolate import UnivariateSpline class SmoothingSpline: def __init__(self): pas...
github_jupyter
## 12. Time Series [![Python Data Science](https://apmonitor.com/che263/uploads/Begin_Python/DataScience12.png)](https://www.youtube.com/watch?v=yfgE0GheCWY&list=PLLBUgWXdTBDg1Qgmwt4jKtVn9BWh5-zgy "Python Data Science") **Time series** data is produced sequentially as new measurements are recorded. Models derived fro...
github_jupyter
# IMPORTS ## Libraries ``` import pandas as pd import numpy as np import random import datetime import pickle import json import requests import warnings warnings.filterwarnings("ignore") import seaborn as sns import matplotlib.pyplot as plt from IPython.core.display import HTML from sklearn.preprocessing import R...
github_jupyter
``` import numpy as np import scipy.linalg as la import utils import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import colors %matplotlib inline from IPython.display import set_matplotlib_formats set_matplotlib_formats('png', 'pdf') plt.rc('font', size=14) ``` ##...
github_jupyter
# Machine Learning Engineer Nanodegree ## Unsupervised Learning ## Project: Creating Customer Segments Welcome to the third project of the Machine Learning Engineer Nanodegree! In this notebook, some template code has already been provided for you, and it will be your job to implement the additional functionality nece...
github_jupyter
#Traffic flow optimization without constraint term on quantum computing using quantum alternating operator ansatz ##Quantum Alternating Operator Ansatz Here think about how to rise up the accuracy of optimization problems on quantum computing. One of this answer is to use Quantum Alternating Operator Ansatz for QAOA....
github_jupyter
# Residual networks with PyTorch In this example, we'll implement the various types of residual blocks using PyTorch. We'll train the network on the CIFAR-10 dataset. _The code in this section is partially based on the pre-activation ResNet implementation in_ [https://github.com/kuangliu/pytorch-cifar](https://github...
github_jupyter
<a href="https://colab.research.google.com/github/hansong0219/Advanced-DeepLearning-Study/blob/master/CNN_based_Classification/Y_NetCNN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Y - Network Y - Network 는 동일한 입력을 CNN 의 왼쪽과 오른쪽 가지에 두번 사용한다. ...
github_jupyter
## First level GLM analysis This script performs subject level modeling of BOLD response. Script features: - reads BIDS dataset, loads imaging files, confounds and parametric modulations - for each subject and session: - creates parametrically modulated regressors - creates full first level GLM - estimate...
github_jupyter
# widgets.image_cleaner fastai offers several widgets to support the workflow of a deep learning practitioner. The purpose of the widgets are to help you organize, clean, and prepare your data for your model. Widgets are separated by data type. ``` from fastai.vision import * from fastai.widgets import DatasetFormatt...
github_jupyter
## <div style="text-align: center">50 commands for Exploratory Data Analysis Pipeline </div> <div style="text-align: center">If you've followed my other kernels so far. You have noticed that for those who are <b>beginners</b>, I've introduced a course "<b> <a href='https://www.kaggle.com/mjbahmani/10-steps-to-become-a...
github_jupyter
<a href="https://colab.research.google.com/github/khipu-ai/practicals-2019/blob/master/3b_generative_models.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Practical 3b: Deep Generative Models © Deep Learning Indaba. Apache License 2.0. ## Intr...
github_jupyter
# Fetch Tweets by User NOTE: You must have [Python Twitter Tools](https://github.com/sixohsix/twitter) installed on the machine to run this script. You can install it by running the below cell (change the cell type in the toolbar above to `Code` instead of `Raw NBConvert`). You may need to use `"! sudo easy_install tw...
github_jupyter
``` !pip install pandas import pandas as pd train = pd.read_csv('mobilenet_mixed_train2.csv') # eval = pd.read_csv('mobilenet5_pedraza__test_features.csv') test = pd.read_csv('mobilenet_mixed_test2.csv') all = pd.concat([train,test]) train.shape all_feat = all.drop(['idx','prob0','target'],axis=1) test_feat = test.drop...
github_jupyter
# TensorFlow Tutorial #01 # Simple Linear Model by [Magnus Erik Hvass Pedersen](http://www.hvass-labs.org/) / [GitHub](https://github.com/Hvass-Labs/TensorFlow-Tutorials) / [Videos on YouTube](https://www.youtube.com/playlist?list=PL9Hr9sNUjfsmEu1ZniY0XpHSzl5uihcXZ) ### Summary This tutorial is slightly modified fro...
github_jupyter
``` import numpy as np import numpy.matlib import matplotlib.pyplot as plt %matplotlib inline ``` ## Discrete updating algorithm ### Continuous time definitions $y_{\textrm{ref}}$ : Reference level $y_{\textrm{SAM}}$ : Output of SAM $y_{\textrm{MPM}}$ : Output of of MPM $I_{\textrm{SAM}}$ : Input to SAM $I_{\tex...
github_jupyter
# Python and Web Tutorial Part 2 <h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Python-and-Web-Tutorial-Part-2" data-toc-modified-id="Python-and-Web-Tutorial-Part-2-1">Python and Web Tutorial Part 2</a></span></li><li><span><a href="#URL-Encoding" data...
github_jupyter
# Questions: 1. Construct a phylogenetic relationship for the given nucleotide sequences (Nucleotide.txt). 1. Write a script (q1a) to generate a distance matrix csv file for the sequences present in the data file. Name the distance matrix file as 'Ndistance.txt'. * For example, * seq1 = 'ATGCATGCAA' * seq2 = ...
github_jupyter
``` import pandas as pd import numpy as np import time import operator from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import StratifiedShuffleSplit from sklearn.metrics import log_loss, f1_score, accuracy_score import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns trn = ...
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 agree...
github_jupyter
# Datafaucet Datafaucet is a productivity framework for ETL, ML application. Simplifying some of the common activities which are typical in Data pipeline such as project scaffolding, data ingesting, start schema generation, forecasting etc. ``` import datafaucet as dfc ``` ## Metadata Project configuration is done ...
github_jupyter
# 第11章 测试代码 ### 1.编写函数或类时,还可为其编写测试。通过测试,可确定代码面对各种输入都能够按要求的那样工作。 ### 2.在程序中添加新代码时,你也可以对其进行测试,确认他们不会破坏程序既有的行为。 ## 11.1 测试函数 #### name_function.py ``` def get_formatted_name(first, last): """Generate a neatly formatted full name.""" full_name = first + ' ' + last return full_name.title() ``` #### names.py...
github_jupyter
``` import xarray as xr import numpy as np import glob import os import matplotlib.pyplot as plt ``` ### File Path to Leaf Area Index Data ``` data_path="raw/LAI_interpolated_2010_2017/LAI_201[0-6]*.nc" ``` ### File Path to Above Ground Biomass Data (Baseline) ``` agb_data = xr.open_dataset("preprocess/agb_avitabil...
github_jupyter
# 머신 러닝 교과서 3판 # HalvingGridSearchCV ### 경고: 이 노트북은 사이킷런 0.24 이상에서 실행할 수 있습니다. ``` # 코랩에서 실행할 경우 최신 버전의 사이킷런을 설치합니다. !pip install --upgrade scikit-learn import pandas as pd df = pd.read_csv('https://archive.ics.uci.edu/ml/' 'machine-learning-databases' '/breast-cancer-wisconsin/wdb...
github_jupyter
``` import os import json ``` This notebook creates a dataset (images and labels as a json file). The dataset created can be used for pose classification. In order to create a new dataset for gesture recoginition specify the following parameters **no_of_classes** - Number of classes to be created. i.e. For hand p...
github_jupyter
``` from pynucastro.rates import Library, Nucleus, RateFilter from pynucastro.nucdata import BindingTable from pynucastro.networks import StarKillerNetwork, Composition full_lib = Library("reaclib-2017-10-20") # Could introduce pp-chain nuclei (d, t, he3, be7, li7, etc.) core_nuclei = ["p", "d", "he3", "he4", "li7", "...
github_jupyter
Copyright (c) 2019 Primoz Ravbar UCSB Licensed under BSD 2-Clause [see LICENSE for details] Written by Primoz Ravbar This batch processes ST-images (3C) into ethograms. ``` # process ST-images (3C) into ethograms import numpy as np import scipy from scipy import ndimage from scipy import misc import pickle import pa...
github_jupyter
## Rap network analysis: Which rappers work together? ``` import matplotlib.pyplot as plt import numpy as np import pandas as pd pd.options.mode.chained_assignment = None from collections import Counter import networkx as nx import re networks = pd.read_csv('.\rap_networks.csv', encoding='ISO-8859-1') # Remove artis...
github_jupyter
# FitzHugh-Nagumo Model The FitzHugh-Nagumo model was devised to describe excitable systems, namely neurons. It was proposed originally by Richard FitzHugh in 1961 [[1]](#References), and by Nagumo, who developed the equivalent circuit the following year. The derivation of the FitzHugh-Nagumo model comes initially f...
github_jupyter
``` import numpy as np import tensorflow as tf from sklearn.utils import shuffle import re import time import collections import os def build_dataset(words, n_words, atleast=1): count = [['PAD', 0], ['GO', 1], ['EOS', 2], ['UNK', 3]] counter = collections.Counter(words).most_common(n_words) counter = [i for...
github_jupyter
DistArray Julia Set =================== The Julia set, for a given complex number $c$, is the set of points $z$ such that $|z_{i}|$ remains bounded where $z_{i+1} = z_{i}^2 + c$. This can be plotted by counting how many iterations are required for $|z_{i}|$ to exceed a cutoff. Depending on the value of $c$, the Juli...
github_jupyter
# Jupyter with large datasets * [Reading Data](#Reading-data) * [Dask](#Dask) * [Processing 60 GB](#Processing-60-GB) * [Saving Data](#Saving-Data) * [Processing 3 TB](#Processing-3-TB) * [Parallel Processing](#Parallel-Processing) ## Our objective The target today is to calculate a daily wind magnitude field over T...
github_jupyter
# FIFA19 Explanatory Data Analysis ![](http://i.imgur.com/EzhxngF.jpg) What will you will find in this Kernel - Q 1. Average, maximum and minimum players count. - Q 2. Age vs Potential - Q 3. Average potential by age - Q 4. Players joinee as per year - Q 5. Players joinee as per month - Q 6. Height and dribblling - Q...
github_jupyter
# CSE 6040, Fall 2015 [26]: Logistic regression, Part 2 ## Maximum likelihood estimation and numerical optimization 101 In [Lab 25](http://nbviewer.ipython.org/github/rvuduc/cse6040-ipynbs/blob/master/25--logreg.ipynb), we looked at geometric solutions to the binary classification problem. In particular, the data is ...
github_jupyter
<a href="https://www.bigdatauniversity.com"><img src="https://ibm.box.com/shared/static/cw2c7r3o20w9zn8gkecaeyjhgw3xdgbj.png" width="400" align="center"></a> <h1 align="center"><font size="5">CONTENT-BASED FILTERING</font></h1> Recommendation systems are a collection of algorithms used to recommend items to users bas...
github_jupyter
# Getting started [Qiskit](https://www.qiskit.org/) is a comprehensive suite of a language allowing you to define circuits, a simulator, a collection of quantum algorithms, among other important components. For setting it up on your computer, please refer to the Qiskit documentation. Here we spell out the details of Q...
github_jupyter
``` import pandas as pd, json, numpy as np import matplotlib.pyplot as plt %matplotlib inline flights=json.loads(file('flights_ae.json','r').read()) locations=json.loads(file('locations_ae.json','r').read()) citysave_dest=json.loads(file('citysave_ae_dest.json','r').read()) citysave_arrv=json.loads(file('citysave_ae_ar...
github_jupyter
# Videos Pipeline ``` # Import everything needed to edit/save/watch video clips from moviepy.editor import VideoFileClip from IPython.display import HTML # load helper functions %run -i "0. Functions_Clases Pipeline.py" %run -i "Line.py" # Load Camera calibration params [ret, mtx, dist, rvecs, tvecs] = pickle.load(o...
github_jupyter
# Introduction to Programming --- Topics for today will include: - Syllabus - Welcome to CMPT 120 - What is Computer Science - Hardware vs Software - How Do Computers Work? - Programming Languages - Why Computer Science is Relevant ### Welcome to CMPT 120! --- In this course I'll be teaching you introduc...
github_jupyter
# Aries Basic Controller Example ## Controllers Api This can be used to make connections between two aries agents. A connection invitation must be created by Alice which is then copied to Bob's notebook to accept the invitation request. Once Bob accepted the invitation, Alice can accept the invitation response from ...
github_jupyter
<a href="https://colab.research.google.com/github/probml/pyprobml/blob/master/book1/intro/pandas_intro.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Pandas [Pandas](https://pandas.pydata.org/) is a widely used Python library for storing and man...
github_jupyter
# Improvise a Jazz Solo with an LSTM Network Welcome to your final programming assignment of this week! In this notebook, you will implement a model that uses an LSTM to generate music. You will even be able to listen to your own music at the end of the assignment. **You will learn to:** - Apply an LSTM to music gen...
github_jupyter
``` import tensorflow as tf import tensorflow_hub as hub import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import seaborn as sns import requests import re from bs4 import BeautifulSoup def print_phase(phase): print(phase) print('<=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=...
github_jupyter
I started tracking the time I spend on various "work-related" activities near the beginning of my third year of grad school. When I started, I hadn't yet discovered the magic of tidy data so I kept putting off analyzing the data. Now that it's been over a year since I converted to tidy data, it's time to dig in and see...
github_jupyter
# Datatypes and Conversion ## Overview: - **Teaching:** 10 min - **Exercises:** 5 min **Questions** - Why are there different types of values a computer can store? - What kind data types do programs store? - How can I convert one type to another? **Objectives** - Explain key differences between integers and floating...
github_jupyter
# "fastcore: An Underrated Python Library" > A unique python library that extends the python programming language and provides utilities that enhance productivity. - author: "<a href='https://twitter.com/HamelHusain'>Hamel Husain</a>" - toc: false - image: images/copied_from_nb/fastcore_imgs/td.png - comments: true - ...
github_jupyter
``` import cv2 import os def save_all_frames(video_path, dir_path, basename, ext='jpg'): cap = cv2.VideoCapture(video_path) if not cap.isOpened(): return os.makedirs(dir_path, exist_ok=True) base_path = os.path.join(dir_path, basename) digit = len(str(int(cap.get(cv2.CAP_PROP_...
github_jupyter
# Predicting Price for Wholesale and Internet segments First thing we need to do is predict the average prices in the wholesale and internet segments for North America, Europe Africa, Asia Pacific, and Latin America. This helps us make more accurate decisions in BSG and identify if we'll hit the shareholder expectatio...
github_jupyter
# Neural network hybrid recommendation system on Google Analytics data preprocessing This notebook demonstrates how to implement a hybrid recommendation system using a neural network to combine content-based and collaborative filtering recommendation models using Google Analytics data. We are going to use the learned ...
github_jupyter
### What-If Tool in colab and jupyter notebooks This notebook shows use of the [What-If Tool](https://pair-code.github.io/what-if-tool) inside of a colab or jupyter notebook. If running in colab, you can use this notebook out-of-the-box. If running in jupyter, you must run the What-If Tool [widget installation instr...
github_jupyter
# KA SEIRSPlus > backtesting on KA data - toc: true - badges: false - comments: true - metadata_key1: metadata_value1 - metadata_key2: metadata_value2 ``` # hide # !pip install seirsplus # !pip install -U plotly import contextlib import io import json import random import sys import warnings from pathlib import Pat...
github_jupyter