text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` %matplotlib inline import numpy as np from scipy.sparse.linalg import spsolve from scipy.sparse import csr_matrix import matplotlib.pyplot as plt import seaborn as sns from condlib import conductance_matrix_READ from timeit import default_timer as timer # Memory array parameters rL = 12 rHRS = 1e6 rPU = 1e3 n = 16 ...
github_jupyter
# Telescopes: Tutorial 5 This notebook will build on the previous tutorials, showing more features of the `PsrSigSim`. Details will be given for new features, while other features have been discussed in the previous tutorial notebook. This notebook shows the details of different telescopes currently included in the `P...
github_jupyter
``` import glob import os import sys import struct import pandas as pd from nltk.tokenize import sent_tokenize from tensorflow.core.example import example_pb2 sys.path.append('../src') import data_io, params, SIF_embedding def return_bytes(reader_obj): len_bytes = reader_obj.read(8) str_len = struct.unpack('q...
github_jupyter
## FCLA/FNLA Fast.ai Numerical/Computational Linear Algebra ### Lecture 3: New Perspectives on NMF, Randomized SVD Notes / In-Class Questions WNixalo - 2018/2/8 Question on section: [Truncated SVD](http://nbviewer.jupyter.org/github/fastai/numerical-linear-algebra/blob/master/nbs/2.%20Topic%20Modeling%20with%20NMF%2...
github_jupyter
# USDA Unemployment <hr> ``` import pandas as pd import os import matplotlib.pyplot as plt import seaborn as sns ``` # Data ## US Unemployment data by county Economic Research Service U.S. Department of Agriculture link: ### Notes - Year 2020, Median Household Income (2019), & '% of State Median HH Income ha...
github_jupyter
``` import pandas as pd import bs4 as bs dfs=pd.read_html('https://en.wikipedia.org/wiki/Research_stations_in_Antarctica#List_of_research_stations') dfr=pd.read_html('https://en.wikipedia.org/wiki/Antarctic_field_camps') df=dfs[1][1:] df.columns=dfs[1].loc[0].values df.to_excel('bases.xlsx') import requests url='https:...
github_jupyter
# Python Collections * Lists * Tuples * Dictionaries * Sets ## lists ``` x = 10 x = 20 x x = [10, 20] x x = [10, 14.3, 'abc', True] x print(dir(x)) l1 = [1, 2, 3] l2 = [4, 5, 6] l1 + l2 # concat l3 = [1, 2, 3, 4, 5, 6] l3.append(7) l3 l3.count(2) l3.count(8) len(l3) sum(l3), max(l3), min(l3) l1 l2 l_sum = [] # ...
github_jupyter
# Generate and Perform Tiny Performances from the MDRNN - Generates unconditioned and conditioned output from RoboJam's MDRNN - Need to open `touchscreen_performance_receiver.pd` in [Pure Data](http://msp.ucsd.edu/software.html) to hear the sound of performances. - To test generated performances, there need to be exam...
github_jupyter
*Accompanying code examples of the book "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python" by [Sebastian Raschka](https://sebastianraschka.com). All code examples are released under the [MIT license](https://github.com/rasbt/deep-learning-book/blob/master/LICEN...
github_jupyter
<a href="https://colab.research.google.com/github/modichirag/flowpm/blob/master/notebooks/flowpm_tutorial.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` %pylab inline from flowpm import linear_field, lpt_init, nbody, cic_paint import tensorflo...
github_jupyter
# 1. 다변수 가우시안 정규분포MVN $$\mathcal{N}(x ; \mu, \Sigma) = \dfrac{1}{(2\pi)^{D/2} |\Sigma|^{1/2}} \exp \left( -\dfrac{1}{2} (x-\mu)^T \Sigma^{-1} (x-\mu) \right)$$ - $\Sigma$ : 공분산 행렬, positive semidefinite - x : 확률변수 벡터 $$x = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_M \end{bmatrix} $$ eg. $\mu = \begin{bmatrix}2 \\ 3 \...
github_jupyter
# First Graph Convolutional Neural Network This notebook shows a simple GCN learning using the KrasHras dataset from [Zamora-Resendiz and Crivelli, 2019](https://www.biorxiv.org/content/10.1101/610444v1.full). ``` import gcn_prot import torch import torch.nn.functional as F from os.path import join, pardir from rando...
github_jupyter
<a href="https://colab.research.google.com/github/DingLi23/s2search/blob/pipelining/pipelining/exp-cscv/exp-cscv_cscv_1w_ale_plotting.ipynb" target="_blank"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### Experiment Description > This notebook is for experiment \<ex...
github_jupyter
# SAT Analysis **We wish to answer the question whether SAT is a fairt test?** ## Read in the data ``` import pandas as pd import numpy as np import re data_files = [ "ap_2010.csv", "class_size.csv", "demographics.csv", "graduation.csv", "hs_directory.csv", "sat_results.csv" ] data = {} fo...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Peeker-Groups" data-toc-modified-id="Peeker-Groups-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Peeker Groups</a></span></li></ul></div> # Peeker Groups `Peeker` objects are normally stored in a glob...
github_jupyter
# Multivariate Analysis for Planetary Atmospheres This notebooks relies on the pickle dataframe in the `notebooks/` folder. You can also compute your own using `3_ColorColorFigs.ipynb` ``` #COLOR COLOR PACKAGE from colorcolor import compute_colors as c from colorcolor import stats import matplotlib.pyplot as plt imp...
github_jupyter
``` from sklearn.cluster import MeanShift, estimate_bandwidth import pandas as pd import numpy as np import matplotlib.pyplot as plt import datetime import math import os import sys from numpy.fft import fft, ifft import glob def remove_periodic(X, df_index, detrending=True, model='additive', frequency_threshold=0.1e...
github_jupyter
## loading an image ``` from PIL import Image im = Image.open("lena.png") ``` ## examine the file contents ``` from __future__ import print_function print(im.format, im.size, im.mode) ``` - The *format* attribute identifies the source of an image. If the image was not read from a file, it is set to None. - The *si...
github_jupyter
``` import pandas as pd import numpy as np import scanpy as sc import os from sklearn.cluster import KMeans from sklearn.cluster import AgglomerativeClustering from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import adjusted_mutual_info_score from sklearn.metrics.cluster import homog...
github_jupyter
<h3>Sin Cython</h3> <p>Este programa genera $N$ enteros aleatorios entre $1$ y $M$, y una vez obtenidos los&nbsp; eleva al cuadrado y devuelve la suma de los cuadrados. Por tanto, calcula el cuadrado de la longitud&nbsp; de un vector aleatorio con coordenadas enteros en el intervalo $[1,M]$.</p> ``` def cuadrados(N,M)...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/regression-hardware-performance/auto-ml-regression-hardware-performance.pn...
github_jupyter
``` %matplotlib inline ``` Word Embeddings: Encoding Lexical Semantics =========================================== Word embeddings are dense vectors of real numbers, one per word in your vocabulary. In NLP, it is almost always the case that your features are words! But how should you represent a word in a computer? ...
github_jupyter
# Online prediction for radon-small In online mode, the model is learning as soon as a new data arrives. It means that when we want our prediction we don't need to provide feature vector, since all data was already processed by the model. Explore the following models: * Constant model - The same value for all fut...
github_jupyter
# classificate speaking_audio files ``` # 균형있게 구성하기 # 1. 성별 50:50 # 2. 지역 25:25:25:25 # 각 지역별로 남 10, 여 10명 # 총 80명. import os import shutil import random from typing_extensions import final A = [] # 강원 B = [] # 서울/경기 C = [] # 경상 D = [] # 전라 E = [] # 제주(현재 없음) F = [] # 충청(현재 없음) G = [] # 기타(현재 없음) re...
github_jupyter
## Exploratory data analysis of Dranse discharge data Summary: The data is stationary even without differencing, but ACF and PACF plots show that an hourly first order difference and a periodic 24h first order difference is needed for SARIMA fitting. Note: Final fitting done in Google Colab due to memory constraints ...
github_jupyter
``` %load_ext autoreload %autoreload 2 from pymedphys_monomanage.tree import PackageTree import networkx as nx from copy import copy package_tree = PackageTree('../../packages') package_tree.package_dependencies_digraph package_tree.roots modules = list(package_tree.digraph.neighbors('pymedphys_analysis')) modules int...
github_jupyter
##### M5_Idol_lyrics/SongTidy 폴더의 전처리 ipnb을 총정리하고, 잘못된 코드를 수정한 노트북 ### 가사 데이터(song_tidy01) 전처리 **df = pd.read_csv('rawdata/song_data_raw_ver01.csv')**<br> **!!!!!!!!!!!!!순서로 df(번호)로 지정!!!!!!!!!!!!!** 1. Data20180915/song_data_raw_ver01.csv 데이터로 시작함 (키스있는지체크) - 제목에 리믹스,라이브,inst,영일중,ver 인 행 - 앨범에 나가수, 불명, 복면인 행 ...
github_jupyter
``` from linebot import LineBotApi from linebot.exceptions import LineBotApiError ``` # 官方DEMO- Message Type :https://developers.line.me/en/docs/messaging-api/message-types/ # Doc : https://github.com/line/line-bot-sdk-python/blob/master/linebot/models/send_messages.py ``` CHANNEL_ACCESS_TOKEN = "YOUR CHANNEL TOKEN"...
github_jupyter
``` import pandas as pd import numpy as np from pathlib import Path import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from sklearn.feature_extraction import DictVectorizer from sklearn.ensemble import RandomForestRegressor from sklearn.impute import SimpleImputer from sklearn.inspection imp...
github_jupyter
# Heikin-Ashi PSAR Strategy _Roshan Mahes_ In this tutorial, we implement the so-called _Parabolic Stop and Reverse (PSAR)_ strategy. Given any stock, currency or commodity, this indicator tells us whether to buy or sell the stock at any given time. The momentum strategy is based on the open, high, low and close price...
github_jupyter
## 1. Introduction to pyLHD pyLHD is a python implementation of the R package [LHD](https://cran.r-project.org/web/packages/LHD/index.html) by Hongzhi Wang, Qian Xiao, Abhyuday Mandal. As of now, only the algebraic construction of Latin hypercube designs (LHD) are implemented in this package. For search algorithms t...
github_jupyter
# NEXUS tool: case study for the Souss-Massa basin - energy demand calculations In this notebook a case study for the Souss-Massa basin is covered using the `nexustool` package. The water requirements for agricultural irrigation and domestic use were previously calculated using the Water Evaluation and Planning System...
github_jupyter
Interactive analysis with python -------------------------------- Before starting this tutorial, ensure that you have set up _tangos_ [as described here](https://pynbody.github.io/tangos/) and the data sources [as described here](https://pynbody.github.io/tangos/data_exploration.html). We get started by importing the...
github_jupyter
n=b ``` # Binary representation ---> Microsoft # Difficulty: School   Marks: 0 ''' Write a program to print Binary representation of a given number N. Input: The first line of input contains an integer T, denoting the number of test cases. Each test case contains an integer N. Output: For each test case, print the b...
github_jupyter
# Generative models - variational auto-encoders ### Author: Philippe Esling (esling@ircam.fr) In this course we will cover 1. A [quick recap](#recap) on simple probability concepts (and in TensorFlow) 2. A formal introduction to [Variational Auto-Encoders](#vae) (VAEs) 3. An explanation of the [implementation](#imple...
github_jupyter
``` !wget https://datahack-prod.s3.amazonaws.com/train_file/train_LZdllcl.csv -O train.csv !wget https://datahack-prod.s3.amazonaws.com/test_file/test_2umaH9m.csv -O test.csv !wget https://datahack-prod.s3.amazonaws.com/sample_submission/sample_submission_M0L0uXE.csv -O sample_submission.csv # Import the required packa...
github_jupyter
[View in Colaboratory](https://colab.research.google.com/github/3catz/DeepLearning-NLP/blob/master/Time_Series_Forecasting_with_EMD_and_Fully_Convolutional_Neural_Networks_on_the_IRX_data_set.ipynb) # TIME SERIES FORECASTING -- using Empirical Mode Decomposition with Fully Convolutional Networks for One-step ahead for...
github_jupyter
<a href="https://colab.research.google.com/github/unicamp-dl/IA025_2022S1/blob/main/ex07/Guilherme_Pereira/Aula_7_Guilherme_Pereira.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` nome = 'Guilherme Pereira' print(f'Meu nome é {nome}') ``` # Ex...
github_jupyter
# Network Training ## Includes ``` # mass includes import os, sys, warnings import ipdb import torch as t import torchnet as tnt from tqdm.notebook import tqdm # add paths for all sub-folders paths = [root for root, dirs, files in os.walk('.')] for item in paths: sys.path.append(item) from ipynb.fs.full.config ...
github_jupyter
``` from __future__ import print_function from ipywidgets import interact, interactive, fixed, interact_manual import ipywidgets as widgets %matplotlib inline #Importamos nuestros módulos y clases necesarias import Image_Classifier as img_clf import Labeled_Image as li import classifiers as clfs from skimage import i...
github_jupyter
# COMP90051 Workshop 3 ## Logistic regression *** In this workshop we'll be implementing L2-regularised logistic regression using `scipy` and `numpy`. Our key objectives are: * to become familiar with the optimisation problem that sits behind L2-regularised logistic regression; * to apply polynomial basis expansion a...
github_jupyter
``` import numpy as np import pandas as pd from sklearn import * import warnings; warnings.filterwarnings("ignore") train = pd.read_csv('../input/train.csv') test = pd.read_csv('../input/test.csv') sub = pd.read_csv('../input/sample_submission.csv') train.shape, test.shape, sub.shape ``` Wordplay in Column Names ====...
github_jupyter
# Accessing the Trigger In ATLAS all access to event trigger decision is via the Trigger Decision Tool (TDT). There is quite a bit of information attached to the trigger, and its layout is quite complex - for that reason one should use the TDT to access the data. It is not really possible for a human to navigate the d...
github_jupyter
# Additive Secret Sharing Author: - Carlos Salgado - [email](mailto:csalgado@uwo.ca) - [linkedin](https://www.linkedin.com/in/eng-socd/) - [github](https://github.com/socd06) ## Additive Secret Sharing Additive Secret Sharing is a mechanism to share data among parties and to perform computation on it. ![Secret Sha...
github_jupyter
``` # This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
github_jupyter
# Optimization of a Dissipative Quantum Gate ``` # NBVAL_IGNORE_OUTPUT %load_ext watermark import sys import os import qutip import numpy as np import scipy import matplotlib import matplotlib.pylab as plt import krotov import copy from functools import partial from itertools import product %watermark -v --iversions `...
github_jupyter
# Working with Scikit-learn This notebook shows how PySINDy objects interface with some useful tools from [Scikit-learn](https://scikit-learn.org/stable/). ## Setup ``` import numpy as np from scipy.integrate import odeint import pysindy as ps ``` Let's generate some training data from the [Lorenz system](https://e...
github_jupyter
# An Introduction to Natural Language in Python using spaCy ## Introduction This tutorial provides a brief introduction to working with natural language (sometimes called "text analytics") in Pytho, using [spaCy](https://spacy.io/) and related libraries. Data science teams in industry must work with lots of text, one...
github_jupyter
``` %load_ext watermark %watermark -d -u -a 'Andreas Mueller, Kyle Kastner, Sebastian Raschka' -v -p numpy,scipy,matplotlib,scikit-learn %matplotlib inline import numpy as np import matplotlib.pyplot as plt ``` # SciPy 2016 Scikit-learn Tutorial # In Depth - Support Vector Machines SVM stands for "support vector m...
github_jupyter
# Think Bayes This notebook presents example code and exercise solutions for Think Bayes. Copyright 2018 Allen B. Downey MIT License: https://opensource.org/licenses/MIT ``` # Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an assignmen...
github_jupyter
<img width="10%" alt="Naas" src="https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160"/> # YahooFinance - Get Stock Update <a href="https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/YahooFinance/YahooFinance_Get_Stock_Update.ipynb" ...
github_jupyter
Before we begin, let's execute the cell below to display information about the CUDA driver and GPUs running on the server by running the `nvidia-smi` command. To do this, execute the cell block below by giving it focus (clicking on it with your mouse), and hitting Ctrl-Enter, or pressing the play button in the toolbar ...
github_jupyter
# Recruitment Across Datasets In this notebook, we further examine the capability of ODIF to transfer across datasets, building upon the prior FTE/BTE experiments on MNIST and Fashion-MNIST. Using the datasets found in [this repo](https://github.com/neurodata/LLF_tidy_images), we perform a series of experiments to eva...
github_jupyter
$\newcommand{\xv}{\mathbf{x}} \newcommand{\wv}{\mathbf{w}} \newcommand{\Chi}{\mathcal{X}} \newcommand{\R}{\rm I\!R} \newcommand{\sign}{\text{sign}} \newcommand{\Tm}{\mathbf{T}} \newcommand{\Xm}{\mathbf{X}} \newcommand{\Im}{\mathbf{I}} \newcommand{\Ym}{\mathbf{Y}} $ ### ITCS8010 # G_np Simulation Experiment I...
github_jupyter
## Classify Radio Signals from Space using Keras In this experiment, we attempt to classify radio signals from space. Dataset has been provided by SETI. Details can be found here: https://github.com/setiQuest/ML4SETI/blob/master/tutorials/Step_1_Get_Data.ipynb ## Import necessary libraries ``` import pandas as pd i...
github_jupyter
### building a dask array without knowing sizes #### from dask.dataframe ``` from dask import array as da, dataframe as ddf, delayed, compute import numpy as np import pandas as pd import matplotlib.pyplot as plt da.from_delayed def get_chunk_df(array_size,n_cols): col_names = [f"col_{i}" for i in range(n_cols)]...
github_jupyter
## Linear Regression with PyTorch #### Part 2 of "PyTorch: Zero to GANs" *This post is the second in a series of tutorials on building deep learning models with PyTorch, an open source neural networks library developed and maintained by Facebook. Check out the full series:* 1. [PyTorch Basics: Tensors & Gradients](...
github_jupyter
# Spin-polarized calculations with BigDFT The goal of this notebook is to explain how to do a spin-polarized calculation with BigDFT (`nspin=2`). We start with the molecule O$_2$ and a non-spin polarized calculation, which is the code default. To do that we only have to specify the atomic positions of the molecule. `...
github_jupyter
<a href="https://colab.research.google.com/github/GoogleCloudPlatform/training-data-analyst/blob/master/courses/fast-and-lean-data-science/01_MNIST_TPU_Keras.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## MNIST on TPU (Tensor Processing Unit)<br...
github_jupyter
``` import numpy as np import pandas as pd df_can = pd.read_excel('https://ibm.box.com/shared/static/lw190pt9zpy5bd1ptyg2aw15awomz9pu.xlsx', sheet_name='Canada by Citizenship', skiprows=range(20), skip_footer=2 ) print('Data dow...
github_jupyter
``` import numpy as np import pandas as pd from pathlib import Path import matplotlib.pyplot as plt import plotly.graph_objects as go from tqdm import tqdm from scipy.spatial.distance import cdist from sklearn.metrics import roc_curve, roc_auc_score timings = Path('timings/') raw_data = Path('surface_data/raw/protein_s...
github_jupyter
## Student Activity on Advanced Data Structure In this activity we will have to do the following tasks - Look up the definition of permutations, and dropwhile from [itertools documentation](https://docs.python.org/3/library/itertools.html) in Python - Using permutations generate all possible three digit numbers that ...
github_jupyter
--- **Universidad de Costa Rica** | Escuela de Ingeniería Eléctrica *IE0405 - Modelos Probabilísticos de Señales y Sistemas* ### `PyX` - Serie de tutoriales de Python para el análisis de datos # `Py5` - *Curvas de ajuste de datos* > Los modelos para describir un fenómeno y sus parámetros pueden obtenerse a partir...
github_jupyter
# This task is not quite ready as we don't have an open source route for simulating geometry that requires imprinting and merging. However this simulation can be carried out using Trelis. # Heating Mesh Tally on CAD geometry made from Components This constructs a reactor geometry from 3 Component objects each made fr...
github_jupyter
# MDT Validation Notebook Validated on Synthea +MDT population vs MEPS for Pediatric Asthma ``` import pandas as pd import datetime as dt import numpy as np from scipy.stats import chi2_contingency ``` # Grab medication RXCUI of interest Grabs the MEPS product RXCUI lists for filtering of Synthea to medicati...
github_jupyter
``` import numpy as np import pandas as pd from tqdm import tqdm_notebook, tqdm from scipy.spatial.distance import jaccard from surprise import Dataset, Reader, KNNBasic, KNNWithMeans, SVD, SVDpp, accuracy from surprise.model_selection import KFold, train_test_split, cross_validate, GridSearchCV import warnings warni...
github_jupyter
<a href="https://colab.research.google.com/github/ArpitaChatterjee/Comedian-transcript-Analysis/blob/main/Exploratory_Data_Analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #To find the pattern of each comedian and find the reason of the lika...
github_jupyter
# Going deeper with Tensorflow В этом семинаре мы начнем изучать [Tensorflow](https://www.tensorflow.org/) для построения deep learning моделей. Для установки tf на свою машину * `pip install tensorflow` версия с поддержкой **cpu-only** для Linux & Mac OS * для автомагической поддержки GPU смотрите документацию [TF ...
github_jupyter
<link rel="stylesheet" href="../../styles/theme_style.css"> <!--link rel="stylesheet" href="../../styles/header_style.css"--> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <table width="100%"> <tr> <td id="image_td" width="15%" class="head...
github_jupyter
``` import pandas as pd import os import time import re import numpy as np import json from urllib.parse import urlparse, urljoin run_root = "/home/icejm/Code/OpenWPM/stockdp/page_ana/" # gather all potent/black links count = 0 for root, dirs, files in os.walk(os.path.abspath('.')): if len(dirs)==0: for i i...
github_jupyter
# CSAILVision semantic segmention models This is a semantic segmentation notebook using an [ADE20K](http://groups.csail.mit.edu/vision/datasets/ADE20K/) pretrained model from the open source project [CSAILVision/semantic-segmentation-pytorch](https://github.com/CSAILVision/semantic-segmentation-pytorch). For other de...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline from torch.utils.data import Dataset, DataLoader import torch import torchvision import torch.nn as nn import torch.optim as optim from torch.nn import functional as F device = torch.device("cuda" i...
github_jupyter
# Bayesian Camera Calibration > Let's apply Bayesian analysis to calibrate a camera - toc: true - badges: true - comments: true - categories: [Bayesian, Computer Vision] - image: images/2020-03-28-Bayesian-Camera-Calibration/header.jpg ``` import numpy as np import matplotlib.pyplot as plt import pymc3 as pm plt.rc...
github_jupyter
# How to read data from varius file formats some of the most basic things noone ever treaches you is how to actually access your data in various formats. This notebook shows a couple of examples on how to read data from a number of sources. Feel free to edit this notebook with more methods that you have worked with. ...
github_jupyter
``` from itertools import combinations import qiskit import numpy as np import tqix import sys def generate_u_pauli(num_qubits): lis = [0, 1, 2] coms = [] if num_qubits == 2: for i in lis: for j in lis: coms.append([i, j]) if num_qubits == 3: for i in lis: ...
github_jupyter
# Simulate Artificial Physiological Signals Neurokit's core signal processing functions surround electrocardiogram (ECG), respiratory (RSP), electrodermal activity (EDA), and electromyography (EMG) data. Hence, this example shows how to use Neurokit to simulate these physiological signals with customized parametric co...
github_jupyter
<a href="https://colab.research.google.com/github/cstorm125/abtestoo/blob/master/notebooks/frequentist_colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # A/B Testing from Scratch: Frequentist Approach Frequentist A/B testing is one of the most...
github_jupyter
## CS536: Perceptrons #### Done by - Vedant Choudhary, vc389 In the usual way, we need data that we can fit and analyze using perceptrons. Consider generating data points (X, Y) in the following way: - For $i = 1,....,k-1$, let $X_i ~ N(0, 1)$ (i.e. each $X_i$ is an i.i.d. standard normal) - For $i = k$, generate $X_k$...
github_jupyter
# 5章 線形回帰 ``` # 必要ライブラリの導入 !pip install japanize_matplotlib | tail -n 1 !pip install torchviz | tail -n 1 !pip install torchinfo | tail -n 1 # 必要ライブラリのインポート %matplotlib inline import numpy as np import matplotlib.pyplot as plt import japanize_matplotlib from IPython.display import display import torch import torch.n...
github_jupyter
# XGBoost vs LightGBM In this notebook we collect the results from all the experiments and reports the comparative difference between XGBoost and LightGBM ``` import matplotlib.pyplot as plt import nbformat import json from toolz import pipe, juxt import pandas as pd import seaborn from toolz import curry from bokeh...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D3_NetworkCausality/W3D3_Tutorial3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neuromatch Academy 2020 -- Week 3 Day 3 Tutorial 3 # Caus...
github_jupyter
``` # Setup Sets cities = ["C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9"] power_plants = ["P1", "P2", "P3", "P4", "P5", "P6"] connections = [("C1", "P1"), ("C1", "P3"), ("C1","P5"), \ ("C2", "P1"), ("C2", "P2"), ("C2","P4"), \ ("C3", "P2"), ("C3", "P3"), ("C3","P4"), \ ...
github_jupyter
``` import pandas as pd disp_url = 'https://raw.githubusercontent.com/PacktWorkshops/The-Data-Science-Workshop/master/Chapter12/Dataset/disp.csv' trans_url = 'https://raw.githubusercontent.com/PacktWorkshops/The-Data-Science-Workshop/master/Chapter12/Dataset/trans.csv' account_url = 'https://raw.githubusercontent.com/P...
github_jupyter
``` import os import sys import time import matplotlib.pyplot as plt import numpy as np import GCode import GRBL # Flip a 2D array. Effectively reversing the path. flip2 = np.array([ [0, 1], [1, 0], ]) flip2 # Flip a 2x3 array. Effectively reversing the path. flip3 = np.array([ [0, 0, 1], [0, 1, 0], ...
github_jupyter
``` import pandas as pd import numpy as np import tensorflow as tf import matplotlib.pyplot as plt raw_data = pd.read_excel("hydrogen_test_classification.xlsx") raw_data.head() # 分开特征值和标签值 X = raw_data.drop("TRUE VALUE", axis=1).copy() y = raw_data["TRUE VALUE"] y.unique() from sklearn.model_selection import train_test...
github_jupyter
# Supervised Learning Supervised learning consists in learning the link between two datasets: the observed data X and an external variable y that we are trying to predict, usually called “target” or “labels”. Most often, y is a 1D array of length n_samples. If the prediction task is to classify the observations in a ...
github_jupyter
# Your first neural network In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code, but left the implementation of the neural network up to you (for the most part). After you've submitted this project, feel free to explore the data and...
github_jupyter
``` # Author: Robert Guthrie from copy import copy import torch import torch.autograd as autograd import torch.nn as nn import torch.optim as optim torch.manual_seed(1) def argmax(vec): # return the argmax as a python int _, idx = torch.max(vec, 1) return idx.item() def prepare_sequence(seq, to_ix): ...
github_jupyter
Lambda School Data Science *Unit 2, Sprint 1, Module 3* --- ``` %%capture import sys # If you're on Colab: if 'google.colab' in sys.modules: DATA_PATH = 'https://raw.githubusercontent.com/LambdaSchool/DS-Unit-2-Applied-Modeling/master/data/' !pip install category_encoders==2.* # If you're working locally: ...
github_jupyter
# Simple ARIMAX This code template is for Time Series Analysis and Forecasting to make scientific predictions based on historical time stamped data with the help of ARIMAX algorithm ### Required Packages ``` import warnings import numpy as np import pandas as pd import seaborn as se import matplotlib.pyplot a...
github_jupyter
# Plotting with matplotlib ### Setup ``` %matplotlib inline import numpy as np import pandas as pd pd.set_option('display.max_columns', 10) pd.set_option('display.max_rows', 10) ``` ### Getting the pop2019 DataFrame ``` csv ='../csvs/nc-est2019-agesex-res.csv' pops = pd.read_csv(csv, usecols=['SEX', 'AGE', 'POPEST...
github_jupyter
``` import string import random from deap import base, creator, tools ## Create a Finess base class which is to be minimized # weights is a tuple -sign tells to minimize, +1 to maximize creator.create("FitnessMax", base.Fitness, weights=(1.0,)) ``` This will define a class ```FitnessMax``` which inherits the Fitness...
github_jupyter
# 06_Business_Insights In this section, we will expend upon the features used by the model and attempt to explain its significance as well as contributions to the pricing model. Accordingly, in Section Four, we identified the following key features that that are strong predictors of housing price based upon a combina...
github_jupyter
# Bulk RNA-seq eQTL analysis This notebook provide a command generator on the XQTL workflow so it can automate the work for data preprocessing and association testing on multiple data collection as proposed. ``` %preview ../images/eqtl_command.png ``` This master control notebook is mainly to serve the 8 tissues snu...
github_jupyter
``` import os import pandas as pd import matplotlib.pyplot as plt import numpy as np import plotly.plotly as py from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot import plotly.graph_objs as go init_notebook_mode(connected=True) %matplotlib inline data_folder = r'C:\Users\ocni\PycharmProjects...
github_jupyter
# Artificial Intelligence Nanodegree ## Convolutional Neural Networks --- In this notebook, we visualize four activation maps in a CNN layer. ### 1. Import the Image ``` import cv2 import scipy.misc import matplotlib.pyplot as plt %matplotlib inline # TODO: Feel free to try out your own images here by changing i...
github_jupyter
# Part - 2: COVID-19 Time Series Analysis and Prediction using ML.Net framework ## COVID-19 - As per [Wiki](https://en.wikipedia.org/wiki/Coronavirus_disease_2019) **Coronavirus disease 2019** (**COVID-19**) is an infectious disease caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2). The disease wa...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/jupyter/transformers/HuggingFace%20in%20Spark%20NLP%20-%20RoBertaForTokenClassification.ipynb) ## Import RoBertaForTokenClassification models from HuggingFac...
github_jupyter
# Section 2.1 `xarray`, `az.InferenceData`, and NetCDF for Markov Chain Monte Carlo _How do we generate, store, and save Markov chain Monte Carlo results_ ``` import numpy as np import pandas as pd import scipy.stats as stats import matplotlib.pyplot as plt import arviz as az import pystan import xarray as xr from IP...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D1_ModelTypes/student/W1D1_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 1: "What" models **Week 1, Day 1: Model Types*...
github_jupyter