code
stringlengths
2.5k
150k
kind
stringclasses
1 value
``` import numpy as np import os, sys, datetime, string sys.path.append('/Volumes/SANDISK128/Documents/Thesis/Python/') sys.path.append('/Volumes/SANDISK128/Documents/Thesis/Python/MEPS/') import matplotlib.pyplot as plt from scipy import stats from mpl_toolkits.basemap import Basemap import netCDF4 import matplotlib ...
github_jupyter
``` # Visualization of the KO+ChIP Gold Standard from: # Miraldi et al. (2018) "Leveraging chromatin accessibility for transcriptional regulatory network inference in Th17 Cells" # TO START: In the menu above, choose "Cell" --> "Run All", and network + heatmap will load # NOTE: Default limits networks to TF-TF edges i...
github_jupyter
``` from round import lc import matplotlib.pyplot as pl import glob %matplotlib inline pl.rc('xtick', labelsize=20) pl.rc('ytick', labelsize=20) pl.rc('axes', labelsize=25) pl.rc('axes', titlesize=30) pl.rc('legend', handlelength=3) pl.rc('legend', fontsize=20) files = glob.glob("../light_curves/*.fits") i = 0 # 38...
github_jupyter
[this doc on github](https://github.com/dotnet/interactive/tree/master/samples/notebooks/polyglot) # Visualizing the Johns Hopkins COVID-19 time series data **This is a work in progress.** It doesn't work yet in [Binder](https://mybinder.org/v2/gh/dotnet/interactive/master?urlpath=lab) because it relies on HTTP commu...
github_jupyter
# Examples Below you will find various examples for you to experiment with HOG. For each image, you can modify the `cell_size`, `num_cells_per_block`, and `num_bins` (the number of angular bins in your histograms), to see how those parameters affect the resulting HOG descriptor. These examples, will help you get some ...
github_jupyter
<a href="https://colab.research.google.com/github/ai-fast-track/icevision-gradio/blob/master/IceApp_pets.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # IceVision Deployment App: PETS Dataset This example uses Faster RCNN trained weights using the...
github_jupyter
<div class="alert alert-info" role="alert"> This tutorial contains a lot of bokeh plots, which may take a little while to load and render. </div> ``Element``s are the basic building blocks for any HoloViews visualization. These are the objects that can be composed together using the various [Container](Containers....
github_jupyter
``` import numpy as np import pandas as pd size = 300 X = np.random.rand(size)*5-2.5 w4, w3, w2, w1, w0 = 1, 2, 1, -4, 2 y = w4*(X**4) + w3*(X**3) + w2*(X**2) + w1*X + w0 + np.random.randn(size)*8-4 df = pd.DataFrame({'x': X, 'y': y}) df.to_csv('dane_do_regresji.csv',index=None) df.plot.scatter(x='x',y='y') X = X.res...
github_jupyter
# Defining your own classes ## User Defined Types A **class** is a user-programmed Python type (since Python 2.2!) It can be defined like: ``` class Room(object): pass ``` Or: ``` class Room(): pass ``` Or: ``` class Room: pass ``` What's the difference? Before Python 2.2 a class was distinct from ...
github_jupyter
# Testing Click-Through-Rates for Banner Ads (A/B Testing) * Lets say we are a new apparel store; after thorough market research, we decide to open up an <b> Online Apparel Store.</b> We hire Developers, Digital Media Strategists and Data Scientists, who help develop the store, place products and conduct controlled ex...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/1_getting_started_roadmap/5_update_hyperparams/1_model_params/5)%20Switch%20deep%20learning%20model%20from%20default%20mode.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import gpplot as gpp from poola import core as pool import anchors import core_functions as fns gpp.set_aesthetics(palette='Set2') def run_guide_residuals(lfc_df, paired_lfc_cols=[]): ''' Calls get_guide_residuals...
github_jupyter
# Now You Code 2: Paint Pricing House Depot, a big-box hardware retailer, has contracted you to create an app to calculate paint prices. The price of paint is determined by the following factors: - Everyday quality paint is `$19.99` per gallon. - Select quality paint is `$24.99` per gallon. - Premium quality paint i...
github_jupyter
``` from path import Path from PIL import Image import cv2 import random import pandas as pd import pickle def arg_parse(): parser = argparse.ArgumentParser() parser = argparse.ArgumentParser( prog="annotation.py", usage="annotation.py -n <<num_of_evaluation>>", ...
github_jupyter
# Extra Trees Classifier with MinMax Scaler ### Required Packages ``` import numpy as np import pandas as pd import seaborn as se import warnings import matplotlib.pyplot as plt from sklearn.ensemble import ExtraTreesClassifier from sklearn.preprocessing import LabelEncoder, MinMaxScaler from sklearn.model_selection ...
github_jupyter
# Creating Word Vectors with word2vec Let's start with NLTK #### Load Dependencies ``` import nltk from nltk.tokenize import word_tokenize, sent_tokenize import gensim from gensim.models.word2vec import Word2Vec from sklearn.manifold import TSNE import pandas as pd from bokeh.io import output_notebook from bokeh.plo...
github_jupyter
# Co je API? ## Klient a server API (Application Programming Interface) je dohoda mezi dvěma stranami o tom, jak si mezi sebou budou povídat. Těmto stranám se říká klient a server. **Server** je ta strana, která má zajímavé informace nebo něco zajímavého umí a umožňuje ostatním na internetu, aby toho využili. Server...
github_jupyter
``` from sportsreference.nfl.teams import Teams import pandas as pd import numpy as np from scipy import stats from datetime import datetime # Pull 2020 NFL Data from sportsreference api teams = Teams(year= '2020') teams_df = teams.dataframes teams_df.sort_values(by=['name'], inplace=True, ascending=True) teams_df.se...
github_jupyter
# SSD300 Training Tutorial This tutorial explains how to train an SSD300 on the Pascal VOC datasets. The preset parameters reproduce the training of the original SSD300 "07+12" model. Training SSD512 works simiarly, so there's no extra tutorial for that. The same goes for training on other datasets. You can find a su...
github_jupyter
``` % matplotlib inline import matplotlib.pyplot as plt from matplotlib import colors, cm import numpy as np from numpy import matmul from scipy.spatial.distance import pdist, squareform from sklearn.datasets import load_diabetes import pandas as pd from scipy.linalg import cholesky from scipy.linalg import solve from ...
github_jupyter
#Object Detection Framework ``` # If you forked the repository, you can replace the link. repo_url = 'https://github.com/PramukaWeerasinghe/object_detection_demo' # Number of training steps. num_steps = 1000 # 200000 # Number of evaluation steps. num_eval_steps = 50 MODELS_CONFIG = { 'ssd_mobilenet_v2': { ...
github_jupyter
## Interobserver Variability This Notebook demonstrates how to compute the interobserver variability of your Atlas data. ``` import os import sys import gc import re import time sys.path.append('../../..') import pandas as pd import SimpleITK as sitk from loguru import logger # Format the output a bit nicer for ...
github_jupyter
# VQ-VAE WaveRNN [![Generic badge](https://img.shields.io/badge/vqvaevc--PyTorch-9cf.svg)][github] [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)][notebook] Reimplmentation of VQ-VAE WaveRNN Author: [tarepan] [github]:https://github.com/tarepan/vqvaevc [notebook]:https://colab.research....
github_jupyter
# Convolutional Networks So far we have worked with deep fully-connected networks, using them to explore different optimization strategies and network architectures. Fully-connected networks are a good testbed for experimentation because they are very computationally efficient, but in practice all state-of-the-art resu...
github_jupyter
# Implementing doND using the dataset ``` from functools import partial import numpy as np from qcodes.dataset.database import initialise_database from qcodes.dataset.experiment_container import new_experiment from qcodes.tests.instrument_mocks import DummyInstrument from qcodes.dataset.measurements import Measureme...
github_jupyter
``` import pandas as pd df = pd.DataFrame( {"AAA": [4, 5, 6, 7], "BBB": [10, 20, 30, 40], "CCC": [100, 50, -30, -50]} ) df # Conditional replacement df.loc[df.AAA >= 5, "BBB"] = -1 df # Conditional replacement, multiple columns df.loc[df.BBB == -1, ["AAA", "CCC"]] = 1 df df_mask = pd.DataFrame( {"AAA": [Tru...
github_jupyter
``` !pip install seaborn !pip install newspaper3k import nltk nltk.download('stopwords') ``` The next two lines are required to load files from your Google drive. ``` from google.colab import drive drive.mount('/content/drive') ``` # SCRAPER ``` from newspaper import Article from newspaper import ArticleException i...
github_jupyter
# 2D Advection-Diffusion equation in this notebook we provide a simple example of the DeepMoD algorithm and apply it on the 2D advection-diffusion equation. ``` # General imports import numpy as np import torch import matplotlib.pylab as plt # DeepMoD functions from deepymod import DeepMoD from deepymod.model.func_...
github_jupyter
# Cross-asset skewness This notebook analyses cross-asset cross-sectional skewness strategy. The strategy takes long positions on contracts with most negative historical skewness and short positions on ones with most positive skewness. ``` %matplotlib inline from datetime import datetime import logging import warning...
github_jupyter
# GFA Zero Calibration GFA calibrations should normally be updated in the following sequence: zeros, flats, darks. This notebook should be run using a DESI kernel, e.g. `DESI master`. ``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt import os import sys import json import collections from pa...
github_jupyter
# Pandas Playground ## Series in Pandas ``` ''' The following code is to help you play with the concept of Series in Pandas. You can think of Series as an one-dimensional object that is similar to an array, list, or column in a database. By default, it will assign an index label to each item in the Series ranging fr...
github_jupyter
``` # set file path filepath = '../fact/' trainfile = 'train.csv' testfile = 'test.csv' # read train.csv import pandas as pd df_train = pd.read_csv(filepath+trainfile) df_test = pd.read_csv(filepath+testfile) #from sklearn.naive_bayes import MultinomialNB import lightgbm as lgb from sklearn.metrics import confusion_mat...
github_jupyter
# M² Experimental Design **Scott Prahl** **Mar 2021** The basic idea for measuring M² is simple. Use a CCD imager to capture changing beam profile at different points along the direction of propagation. Doing this accurately is a challenge because the beam must always fit within camera sensor and the measurement l...
github_jupyter
``` import numpy as np import pandas as pd from sklearn.model_selection import train_test_split import tensorflow as tf import keras from keras.datasets import fashion_mnist, cifar10 from keras.layers import Dense, Flatten, Normalization, Dropout, Conv2D, MaxPooling2D, RandomFlip, RandomRotation, RandomZoom, BatchNorma...
github_jupyter
# Character-Level LSTM in PyTorch In this notebook, I'll construct a character-level LSTM with PyTorch. The network will train character by character on some text, then generate new text character by character. As an example, I will train on Anna Karenina. **This model will be able to generate new text based on the te...
github_jupyter
``` import numpy as np #UNITS #A = mol/cm^3 -s #n = none #Ea = kcal/k*mol #c = #d = #f = six_parameter_fit_sensitivities = {'H2O2 + OH <=> H2O + HO2':{'A':np.array([-13.37032086, 32.42060027, 19.23022032, 6.843287462 , 36.62853824 ,-0.220309785 ,-0.099366346, -4.134352081]), ...
github_jupyter
# Data Types When reading in a data set, pandas will try to guess the data type of each column like float, integer, datettime, bool, etc. In Pandas, strings are called "object" dtypes. However, Pandas does not always get this right. That was the issue with the World Bank projects data. Hence, the dtype was specified...
github_jupyter
``` from music21 import * import numpy as np import torch import pretty_midi import os import sys import pickle import time import random import re class MusicData(object): def __init__(self, abc_file, culture= None): self.stream = None self.metadata = dict() self.description = None ...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np from tqdm import tqdm %matplotlib inline import datetime import cPickle as pickle import csv import numpy as np import random import sys maxInt = sys.maxsize decrement = True while decrement: # decrease the maxInt value by factor 10 # as long as the Overfl...
github_jupyter
<table> <tr> <td ><h1><strong>NI SystemLink Analysis Automation</strong></h1></td> </tr> </table> This notebook is an example for how you can analyze your data with NI SystemLink Analysis Automation. It forms the core of the analysis procedure, which includes the notebook, the query, and the execution ...
github_jupyter
<a href="https://colab.research.google.com/github/Serbeld/ArtificialVisionForQualityControl/blob/master/Copia_de_Yolo_Step_by_Step.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> **Outline of Steps** + Initialization + Download COCO dete...
github_jupyter
<!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/) doconce format html solutionhw4.do.txt --> <!-- dom:TITLE: PHY321: Classical Mechanics 1 --> # PHY321: Classical Mechanics 1 **Homework 4, due Monday February 15** Date: **Feb 14, 2022** ### Practicalities about homew...
github_jupyter
``` import numpy as np import librosa import os import random import tflearn import tensorflow as tf lr = 0.001 iterations_train = 30 bsize = 64 audio_features = 20 utterance_length = 35 ndigits = 10 def get_mfcc_features(fpath): raw_w,sampling_rate = librosa.load(fpath,mono=True) mfcc_features = librosa.fe...
github_jupyter
# Deploying Machine Learning Models using ksonnet and Ambassador ## Prerequistes You will need - [Git clone of Seldon Core](https://github.com/SeldonIO/seldon-core) - [Minikube](https://github.com/kubernetes/minikube) version v0.24.0 or greater - [python grpc tools](https://grpc.io/docs/quickstart/python.html) - [...
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
<a href="https://colab.research.google.com/github/tjido/ControlCharts/blob/master/Control_Chart_Implementation_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Control Chart_Python Implementation 1 This script takes a date input and creates a Co...
github_jupyter
# Deep Learning Intro ``` %matplotlib inline import matplotlib.pyplot as plt import pandas as pd import numpy as np ``` ## Shallow and Deep Networks ``` from sklearn.datasets import make_moons X, y = make_moons(n_samples=1000, noise=0.1, random_state=0) plt.plot(X[y==0, 0], X[y==0, 1], 'ob', alpha=0.5) plt.plot(X[y...
github_jupyter
``` import sys sys.path.append('../../../GraphGallery/') sys.path.append('../../../GraphAdv/') import tensorflow as tf import numpy as np import networkx as nx import scipy.sparse as sp from graphgallery.nn.models import GCN from graphgallery.nn.functions import softmax from graphadv.attack.targeted import IGA impo...
github_jupyter
``` import numpy as np import pandas as pd from sklearn.datasets import load_wine from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix, accuracy_score, roc_auc_score, roc_curve from sklearn.utils import shuffle import matplotlib.pyplot as plt wine = load_wine() # store the ...
github_jupyter
<a href="https://colab.research.google.com/github/julianovale/project_trains/blob/master/Genetico_Job_Shop.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` ! pip install chart_studio import os if not os.path.isfile('/content/JSP_dataset.xlsx'): ...
github_jupyter
# HAND SIGN DATASET ## Introduction The dataset format is patterned to match closely with the classic MNIST. Each training and test case represents a label (0-25) as a one-to-one map for each alphabet letter A-Z (and no cases for 9=J or 25=Z because of gesture motions). The training data (27,455 cases) and test data ...
github_jupyter
... ***CURRENTLY UNDER DEVELOPMENT*** ... ## Synthetic simulation of historical TCs parameters using Gaussian copulas (Rueda et al. 2016) and subsequent selection of representative cases using Maximum Dissimilarity (MaxDiss) algorithm (Camus et al. 2011) inputs required: * Historical TC parameters that affect the...
github_jupyter
Candidate Site Identification for Classification === Identify of candidate sites for the purposes of broader classification. Using these sampling restrictions: - Health condition is "cancer" - Site's "isDeleted" != 1 - Age of site is "adult" or "teen" - Site's createdAt > 2009-01-01 - Site's last journal post is...
github_jupyter
<a href="https://colab.research.google.com/github/rpinheiro83/1.WebDevelopment/blob/main/Python%20Basic.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Aula 03 - Tipos de Variáveis ``` print("Hello world") # Linhas iniciadas com # são comentários....
github_jupyter
# Hello World! Here's an example notebook with some documentation on how to access CMIP data. ``` %matplotlib inline import xarray as xr import intake # util.py is in the local directory # it contains code that is common across project notebooks # or routines that are too extensive and might otherwise clutter # the...
github_jupyter
# Preprocessing Part ## Author: Xiaochi (George) Li Input: "data.xlsx" provided by the professor Output: "processed_data.pickle" with target variable "Salary" as the last column. And all the missing value should be imputed or dropped. ### Summary In this part, we read the data from the file, did some exploratory d...
github_jupyter
# MPIJob and Horovod Runtime ## Running distributed workloads Training a Deep Neural Network is a hard task. With growing datasets, wider and deeper networks, training our Neural Network can require a lot of resources (CPUs / GPUs / Mem and Time). There are two main reasons why we would like to distribute our Dee...
github_jupyter
``` #importando as bibliotecas import pandas as pd #biblioteca utilizada para o tratamento de dados via dataframes import numpy as np #biblioteca utilizada para o tratamento de valores numéricos (vetores e matrizes) import matplotlib.pyplot as plt #biblioteca utilizada para construir os gráficos from sklearn.metrics i...
github_jupyter
# Training an Encrypted Neural Network In this tutorial, we will walk through an example of how we can train a neural network with CrypTen. This is particularly relevant for the <i>Feature Aggregation</i>, <i>Data Labeling</i> and <i>Data Augmentation</i> use cases. We will focus on the usual two-party setting and sho...
github_jupyter
<a href="https://colab.research.google.com/github/jdilger/tensorflow-notebooks/blob/master/AgroForest.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` gpu_info = !nvidia-smi gpu_info = '\n'.join(gpu_info) if gpu_info.find('failed') >= 0: print(...
github_jupyter
#### TFIDF ``` # loading libraries import pandas as pd from nltk.stem.snowball import SnowballStemmer stemmer = SnowballStemmer("english") import nltk import re from sklearn.cluster import SpectralClustering from sklearn.metrics import silhouette_score from sklearn.cluster import KMeans from sklearn.model_selection im...
github_jupyter
# Amazon Augmented AI(A2I) Integrated with AWS Marketplace ML Models Sometimes, for some payloads, machine learning (ML) model predictions are just not confident enough and you want more than a machine. Furthermore, training a model can be complicated, time-consuming, and expensive. This is where [AWS Marketplace](htt...
github_jupyter
``` ### Load necessary libraries ### import glob import os import librosa import numpy as np from sklearn.model_selection import KFold from sklearn.metrics import accuracy_score import tensorflow as tf from tensorflow import keras ### Define helper functions ### def extract_features(parent_dir,sub_dirs,file_ext="*.wav...
github_jupyter
# NLP - Using spaCy library - **Created by Andrés Segura Tinoco** - **Created on June 04, 2019** - **Updated on October 29, 2021** **Natural language processing (NLP):** is a discipline where computer science, artificial intelligence and cognitive logic are intercepted, with the objective that machines can read and u...
github_jupyter
# Entrada e Saída de Dados Este tutorial tem o objetivo de mostrar brevemente as funções nativas da linguagem Python, utilizadas para entrada e saída padrão. 1. print 2. raw_input 3. casting (int, float, str) ## Comando print Na versão 2 da linguagem Python, o comando responsável pela saída padrão de dados é o __...
github_jupyter
# Tutorial Part 11: Learning Unsupervised Embeddings for Molecules In this example, we will use a `SeqToSeq` model to generate fingerprints for classifying molecules. This is based on the following paper, although some of the implementation details are different: Xu et al., "Seq2seq Fingerprint: An Unsupervised Deep...
github_jupyter
# Matematički softver - prvo predavanje ## Metapodaci ### Materijali Materijali će se nalaziti na Githubu, u repozitoriju kolegija (https://github.com/vedgar/ms). Za potrebe kolegija, svi morate imati _neku_ online bazu vlastitog koda, u kojoj napravite repozitorij 'Matematički softver'. Preporučujem Github. ### Po...
github_jupyter
# Building a Trie in Python Before we start let us reiterate the key components of a Trie or Prefix Tree. A trie is a tree-like data structure that stores a dynamic set of strings. Tries are commonly used to facilitate operations like predictive text or autocomplete features on mobile phones or web search. Before we ...
github_jupyter
``` import argparse import logging from operator import mul import time import os import pubweb.singlecell # import AnnDataSparse from pubweb.hdf5 import Hdf5 from pubweb.commands.convert.singlecell.anndata import ImportAnndata from pubweb.commands.convert.singlecell.cellranger import ImportCellRanger from pubweb.comm...
github_jupyter
# Best-practices for Cloud-Optimized Geotiffs **Part 2. Multiple COGs** This notebook goes over ways to construct a multidimensional xarray DataArray from many 2D COGS ``` import dask import s3fs import intake import os import xarray as xr import pandas as pd # use the same GDAL environment settings as we did for th...
github_jupyter
# Kats 201 - Forecasting with Kats This tutorial will introduce time series modeling and forecasting with Kats. We will show you how to build forecasts with different Kats models and how to do parameter tuning and backtesting using Kats. The complete table of contents for Kats 201 is as follows: 1. Forecasting with...
github_jupyter
Script delete Cassandra en cluster multidomain ``` !pip install mysql-connector==2.1.7 !pip install pandas !pip install sqlalchemy #requiere instalación adicional, consultar https://github.com/PyMySQL/mysqlclient !pip install mysqlclient !pip install numpy !pip install pymysql import pandas as pd import numpy as np im...
github_jupyter
``` import re with open('Day17 input.txt') as f: lines = f.readlines() lines = [x.strip() for x in lines] line = lines[0][13:] print(line) x_range = re.search('(?<=x=).*(?=, )',line)[0] x_range = [int(re.search('.*(?=\.\.)',x_range)[0]), int(re.search('(?<=\.\.).*',x_range)[0])] print(x_range) y_range = re.search('...
github_jupyter
``` %matplotlib inline from mpl_toolkits.mplot3d import Axes3D import scipy.io as io import numpy as np import matplotlib.pyplot as plt from math import ceil from scipy.optimize import curve_fit realization = 1000 import seaborn as sns from matplotlib import cm from array_response import * import itertools mat = io.l...
github_jupyter
<h1 align="center">Introduction to SimpleITKv4 Registration</h1> <table width="100%"> <tr style="background-color: red;"><td><font color="white">SimpleITK conventions:</font></td></tr> <tr><td> <ul> <li>Dimensionality and pixel type of registered images is required to be the same (2D/2D or 3D/3D).</li> <li>Supported ...
github_jupyter
# Colab notebook or tutorial ### [How to run PyTorch with GPU and CUDA 8.0 support on Google Colab](https://www.dlology.com/blog/how-to-run-pytorch-with-gpu-and-cuda-92-support-on-google-colab/) # New Section ``` !nvidia-smi !cat /etc/*-release ``` ## Install [Cuda 8.0 ](https://developer.nvidia.com/cuda-downloads?t...
github_jupyter
# Fit $k_{ij}$ and $r_c^{ABij}$ interactions parameter of Ethanol and CPME --- Let's call $\underline{\xi}$ the optimization parameters of a mixture. In order to optimize them, you need to provide experimental phase equilibria data. This can include VLE, LLE and VLLE data. The objective function used for each equilibr...
github_jupyter
<table width=60%> <tr style="background-color: white;"> <td><img src='https://www.creativedestructionlab.com/wp-content/uploads/2018/05/xanadu.jpg'></td>></td> </tr> </table> --- <img src='https://raw.githubusercontent.com/XanaduAI/strawberryfields/master/doc/_static/strawberry-fields-text.png'> --- ...
github_jupyter
``` # Manipulação e tratamento das bases import pandas as pd import numpy as np #Pré-Processamento das bases !pip install imblearn from imblearn.over_sampling import SMOTE from sklearn.model_selection import train_test_split #Modelagem de Dados from sklearn.ensemble import GradientBoostingClassifier from sklearn.metr...
github_jupyter
``` import numpy as np import MDAnalysis as mda import nglview as nv from sklearn.decomposition import PCA import requests from Bio.PDB import * ``` ### Overall settings ``` movav_resis = 3 # number of residues used to calculate moving averages for CA positions (must be 3,5 or 7) vector_scale_factor = 10 vector_widt...
github_jupyter
This notebook is part of the $\omega radlib$ documentation: https://docs.wradlib.org. Copyright (c) $\omega radlib$ developers. Distributed under the MIT License. See LICENSE.txt for more info. # How to use wradlib's ipol module for interpolation tasks? ``` import wradlib.ipol as ipol from wradlib.util import get_wr...
github_jupyter
<span style="color:red; font-family:Helvetica Neue, Helvetica, Arial, sans-serif; font-size:2em;">An Exception was encountered at '<a href="#papermill-error-cell">In [42]</a>'.</span> # High Value Customers Identification (Insiders) # **By: Marx Cerqueira** # IMPORTS ``` import re import os import inflection import ...
github_jupyter
## Exploratory Data Analysis ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline import warnings warnings.filterwarnings('ignore') # read dataset df = pd.read_csv('../datasets/winequality/winequality-red.csv',sep=';') # check data dimensions print(df.shap...
github_jupyter
# Content with notebooks You can also create content with Jupyter Notebooks. The content for the current page is contained in a Jupyter Notebook in the `notebooks/` folder of the repository. This means that we can include code blocks and their outputs, and export them to Jekyll markdown. **You can find the original n...
github_jupyter
# Tutorial for Geoseg > __version__ == 0.1.0 > __author__ == Go-Hiroaki # Overview: ## 1. Evaluating with pretrained models > Test model performance by providing pretrained models ## 2. Re-training with provided dataset > Trained new models with provide training datastet ## 3. Training with personal dataset >...
github_jupyter
[@LorenaABarba](https://twitter.com/LorenaABarba) 12 steps to Navier–Stokes ====== *** This Jupyter notebook continues the presentation of the **12 steps to Navier–Stokes**, the practical module taught in the interactive CFD class of [Prof. Lorena Barba](http://lorenabarba.com). You should have completed [Step 1](./0...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import warnings warnings.filterwarnings("ignore") ##### Functions # 1st function: to graph time series based on TransactionDT vs the variable selected def scatter(column): fr,no_fr = (train[train['isFraud'] == 1], tra...
github_jupyter
# Dropout Dropout [1] is a technique for regularizing neural networks by randomly setting some features to zero during the forward pass. In this exercise you will implement a dropout layer and modify your fully-connected network to optionally use dropout. [1] [Geoffrey E. Hinton et al, "Improving neural networks by pr...
github_jupyter
# <font color='firebrick'><center>Idx Stats Report</center></font> ### This report provides information from the output of samtools idxstats tool. It outputs the number of mapped reads per chromosome/contig. <br> ``` from IPython.display import display, Markdown from IPython.display import HTML import IPython.core.dis...
github_jupyter
## 1. Meet Dr. Ignaz Semmelweis <p><img style="float: left;margin:5px 20px 5px 1px" src="https://assets.datacamp.com/production/project_20/img/ignaz_semmelweis_1860.jpeg"></p> <!-- <img style="float: left;margin:5px 20px 5px 1px" src="https://assets.datacamp.com/production/project_20/datasets/ignaz_semmelweis_1860.jpeg...
github_jupyter
## Import the scripts ``` %run Implied_Volatility.ipynb %run Option_Greeks.ipynb ``` ## Draw the Impied Volatility Graph of 0130 and 0131 ``` date_ = '0130' S = todayStockPrice(date = date_) list_StockPrices = moneyness_list(S, gapType = "month", gapNum = 3) # only 3 OTM price on monthly basis # Split the df to df_...
github_jupyter
# Neural Network for binary classification using finite difference approximation to update the weights, Leaky ReLu in between the layers and sigmoid for the output ``` import numpy as np import matplotlib.pyplot as plt import copy import matplotlib as mpl global_dpi = 120 mpl.rcParams['figure.dpi']= global_dpi ``` # ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt star_wars = pd.read_csv("star_wars.csv", encoding="ISO-8859-1") star_wars.head(3) ``` Remove all rows where the `RespondentID` column is not null (NaN). ``` star_wars = star_wars[pd.notnull(star_wars["RespondentID"])] star_wars.head() ``` Con...
github_jupyter
<a href="https://colab.research.google.com/github/linesn/xmen/blob/main/covariance_analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import pandas as pd import numpy as np import seaborn as sn import matplotlib.pyplot as plt from sklearn....
github_jupyter
``` # Import lib # =========================================================== import csv import pandas as pd import numpy as np import random import time import collections import math import sys from tqdm import tqdm from time import sleep import matplotlib.pyplot as plt # %matplotlib inline plt.style.use('fivethirt...
github_jupyter
# NumPy 入門 本章では、Python で数値計算を高速に行うためのライブラリ([注釈1](#note1))である NumPy の使い方を学びます。 本章の目標は、[単回帰分析と重回帰分析](https://tutorials.chainer.org/ja/07_Regression_Analysis.html)の章で学んだ重回帰分析を行うアルゴリズムを**NumPy を用いて実装すること**です。 NumPy による**多次元配列(multidimensional array)**の扱い方を知ることは、他の様々なライブラリを利用する際に役立ちます。 例えば、様々な機械学習手法を統一的なインターフェースで利用できる **s...
github_jupyter
# HuberRegressorw with StandardScaler This Code template is for the regression analysis using a Huber Regression and the feature rescaling technique StandardScaler in a pipeline. ### Required Packages ``` import warnings import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as ...
github_jupyter
``` import glob import numpy as np from scipy.interpolate import interp2d import astropy.units as au import astropy.time as at import astropy.coordinates as ac import h5py import os import pylab as plt from RadioArray import RadioArray from UVWFrame import UVW from PointingFrame import Pointing def getDatumIdx(antId...
github_jupyter
# Signal Autoencoder ``` import numpy as np import scipy as sp import scipy.stats import itertools import logging import matplotlib.pyplot as plt import pandas as pd import torch.utils.data as utils import math import time import tqdm import torch import torch.optim as optim import torch.nn.functional as F from argpa...
github_jupyter
# Deep Learning Intro ``` %matplotlib inline import matplotlib.pyplot as plt import pandas as pd import numpy as np ``` ## Shallow and Deep Networks ``` from sklearn.datasets import make_moons X, y = make_moons(n_samples=1000, noise=0.1, random_state=0) plt.plot(X[y==0, 0], X[y==0, 1], 'ob', alpha=0.5) plt.plot(X[y...
github_jupyter