text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Soccerstats Predictions v1.2 The changelog from v1.1: * Train on `train` data, and validate using `test` data. ## A. Data Cleaning & Preparation ### 1. Read csv file ``` # load and cache data stat_df = sqlContext.read\ .format("com.databricks.spark.csv")\ .options(header = True)\ .load("data/teamFixtu...
github_jupyter
# Credits Updated to detectwaste by: * Sylwia Majchrowska ``` %matplotlib inline import sys from pycocotools.coco import COCO import json import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns; sns.set() import os import skimage import skimage.io as io import copy def show_values...
github_jupyter
## In this notebook we are going to Predict the Growth of Google Stock using LSTM Model and CRISP-DM. ``` #importing the libraries import math import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import Dense, LSTM import matplotlib...
github_jupyter
# Training a dense neural network The handwritten digit recognition is a classification problem. We will start with the simplest possible approach for image classification - a fully-connected neural network (which is also called a *perceptron*). We use `pytorchcv` helper to load all data we have talked about in the pr...
github_jupyter
![data-x](http://oi64.tinypic.com/o858n4.jpg) --- # Pandas Introduction ### with Stock Data and Correlation Examples **Author list:** Alexander Fred-Ojala & Ikhlaq Sidhu **References / Sources:** Includes examples from Wes McKinney and the 10min intro to Pandas **License Agreement:** Feel free to do whatever yo...
github_jupyter
| Name | Surname | Student No | Department | |---|---|---|---| | Emin | Kartci | S014877 | EE Engineering | ## Emin Kartci #### Student ID: S014877 #### Department : Electrical & Electronics Engineering --- ### Semester Project - Foursquare & Restaurant Report --- #### This module is prepared for GUI --- ``...
github_jupyter
``` import argparse import glob import io import os import random import numpy from PIL import Image, ImageFont, ImageDraw from scipy.ndimage.interpolation import map_coordinates from scipy.ndimage.filters import gaussian_filter SCRIPT_PATH = os.path.dirname(os.path.abspath('./hangul-WR')) # Default data paths. DEFAU...
github_jupyter
``` from os import environ environ['optimizer'] = 'Adam' environ['num_workers']= '2' environ['batch_size']= str(2048) environ['n_epochs']= '1000' environ['batch_norm']= 'True' environ['loss_func']='MAPE' environ['layers'] = '600 350 200 180' environ['dropouts'] = '0.1 '* 4 environ['log'] = 'False' environ['weight_deca...
github_jupyter
# Hyperparameter Optimization (HPO) of Machine Learning Models L. Yang and A. Shami, “On hyperparameter optimization of machine learning algorithms: Theory and practice,” Neurocomputing, vol. 415, pp. 295–316, 2020, doi: https://doi.org/10.1016/j.neucom.2020.07.061. ### **Sample code for regression problems** **Data...
github_jupyter
## 1. Winter is Coming. Let's load the dataset ASAP! <p>If you haven't heard of <em>Game of Thrones</em>, then you must be really good at hiding. Game of Thrones is the hugely popular television series by HBO based on the (also) hugely popular book series <em>A Song of Ice and Fire</em> by George R.R. Martin. In this n...
github_jupyter
## CNN on MNIST digits classification This example is the same as the MLP for MNIST classification. The difference is we are going to use `Conv2D` layers instead of `Dense` layers. The model that will be costructed below is made of: - First 2 layers - `Conv2D-ReLU-MaxPool` - 3rd layer - `Conv2D-ReLU` - 4th layer - `...
github_jupyter
<a href="https://colab.research.google.com/github/BNN-UPC/ignnition/blob/ignnition-nightly/notebooks/shortest_path.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # IGNNITION: Quick start tutorial ### **Problem**: Find the shortest path in graphs w...
github_jupyter
# Lecture 3: Optimize, print and plot [Download on GitHub](https://github.com/NumEconCopenhagen/lectures-2019) [<img src="https://mybinder.org/badge_logo.svg">](https://mybinder.org/v2/gh/NumEconCopenhagen/lectures-2019/master?urlpath=lab/tree/03/Optimize_print_and_plot.ipynb) 1. [The consumer problem](#The-consumer...
github_jupyter
# Step 1) Data Preparation ``` %run data_prep.py INTC import pandas as pd df = pd.read_csv("../1_Data/INTC.csv",infer_datetime_format=True, parse_dates=['dt'], index_col=['dt']) trainCount=int(len(df)*0.4) dfTrain = df.iloc[:trainCount] dfTest = df.iloc[trainCount:] dfTest.to_csv('local_test/test_dir/input/data/tr...
github_jupyter
This notebook is part of the `nbsphinx` documentation: https://nbsphinx.readthedocs.io/. # Installation Note that some packages may be out of date. You can always get the newest `nbsphinx` release from [PyPI](https://pypi.org/project/nbsphinx) (using `pip`). If you want to try the latest development version, have a l...
github_jupyter
# Building your Deep Neural Network: Step by Step Welcome to your week 4 assignment (part 1 of 2)! You have previously trained a 2-layer Neural Network (with a single hidden layer). This week, you will build a deep neural network, with as many layers as you want! - In this notebook, you will implement all the functio...
github_jupyter
``` import time import numpy as np import random def write_table2sql(table, engine, sql=None): def select_col_agg(mask): """ select col agg pair :return: """ col_num = len(table['header']) sel_idx = np.argmax(np.random.rand(col_num) * mask) sel_type = table[...
github_jupyter
###### Text provided under a Creative Commons Attribution license, CC-BY. All code is made available under the FSF-approved MIT license. (c) Daniel Koehn based on Jupyter notebooks by Marc Spiegelman [Dynamical Systems APMA 4101](https://github.com/mspieg/dynamical-systems) and Kyle Mandli from his course [Introductio...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Vowpal Wabbit Deep Dive <center> <img src="https://github.com/VowpalWabbit/vowpal_wabbit/blob/master/logo_assets/vowpal-wabbits-github-logo.png?raw=true" height="30%" width="30%" alt="Vowpal Wabbit"> </center> ...
github_jupyter
# Peak Detection Feature detection, also referred to as peak detection, is the process by which local maxima that fulfill certain criteria (such as sufficient signal-to-noise ratio) are located in the signal acquired by a given analytical instrument. This process results in “features” associated with the analysis of ...
github_jupyter
``` import os import numpy as np from glob import glob from deformation_functions import * from menpo_functions import * from logging_functions import * from data_loading_functions import * from time import time from scipy.misc import imsave %matplotlib inline dataset='training' img_dir='/Users/arik/Dropbox/a_mac_thes...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import cython import timeit import math %load_ext cython ``` # Native code compilation We will see how to convert Python code to native compiled code. We will use the example of calculating the pairwise distance between a set of vectors, a $O(n^2)$ operation. F...
github_jupyter
# MSOA Mapping - England ``` import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt import numpy as np from shapely.geometry import Point from sklearn.neighbors import KNeighborsRegressor import rasterio as rst from rasterstats import zonal_stats %matplotlib inline path = r"[CHANGE THIS PATH]\Eng...
github_jupyter
<font size = "5"> **Chapter 4: [Spectroscopy](CH4-Spectroscopy.ipynb)** </font> <hr style="height:1px;border-top:4px solid #FF8200" /> # Analysis of Core-Loss Spectra <font size = "5"> **This notebook does not work in Google Colab** </font> [Download](https://raw.githubusercontent.com/gduscher/MSE672-Introduct...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
## Problem Given a sorted list of integers of length N, determine if an element x is in the list without performing any multiplication, division, or bit-shift operations. Do this in `O(log N)` time. ## Solution We can't use binary search to locate the element because involves dividing by two to get the middle elemen...
github_jupyter
# Feature processing with Spark, training with BlazingText and deploying as Inference Pipeline Typically a Machine Learning (ML) process consists of few steps: gathering data with various ETL jobs, pre-processing the data, featurizing the dataset by incorporating standard techniques or prior knowledge, and finally tra...
github_jupyter
# Polynomial Regression ``` import numpy as np import matplotlib.pyplot as plt plt.rcParams['axes.labelsize'] = 14 plt.rcParams['axes.titlesize'] = 14 plt.rcParams['legend.fontsize'] = 12 plt.rcParams['figure.figsize'] = (8, 5) %config InlineBackend.figure_format = 'retina' ``` ### Linear models $y = \beta_0 + \beta...
github_jupyter
``` import pickle import pandas as pd import numpy as np import os, sys, gc from plotnine import * import plotnine from tqdm import tqdm_notebook import seaborn as sns import warnings import matplotlib.pyplot as plt import matplotlib.font_manager as fm import matplotlib as mpl from matplotlib import rc import re from...
github_jupyter
# Python Functions ``` import numpy as np ``` ## Custom functions ### Anatomy name, arguments, docstring, body, return statement ``` def func_name(arg1, arg2): """Docstring starts wtih a short description. May have more information here. arg1 = something arg2 = somehting Returns ...
github_jupyter
``` # Require the packages require(ggplot2) library(repr) options(repr.plot.width=15, repr.plot.height=4.5) ladder_results_dir <- "../resources/results/ladder_results_sensem/140" bootstrap_results_dir <- "../resources/results/results_semisupervised_sensem_7k/140" lemma_data <- data.frame(iteration=integer(), sense=cha...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/4_image_classification_zoo/Classifier%20-%20Weed%20Species%20Classification%20-%20Hyperparameter%20Tuning%20using%20Monk.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt...
github_jupyter
## $k$-means clustering: An example implementation in Python 3 with numpy and matplotlib. The [$k$-means](https://en.wikipedia.org/wiki/K-means_clustering) algorithm is an unsupervised learning method for identifying clusters within a dataset. The $k$ represents the number of clusters to be identified, which is specif...
github_jupyter
# Biological question: Are there differences in the binding distance of the same TF-pair in different clusters? - PART2 This notebook can be used to analyse if there are differences in the binding distance of the same TF-pair in two different clusters. In "Outline of this notebook" the general steps in the notebook a...
github_jupyter
``` #!pwd import pandas as pd import os import string from nltk.corpus import stopwords from nltk import word_tokenize, WordNetLemmatizer from nltk import stem, pos_tag from nltk.corpus import wordnet as wn from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer import os import re cwd = os.getcwd(...
github_jupyter
# TV Script Generation In this project, you'll generate your own [Seinfeld](https://en.wikipedia.org/wiki/Seinfeld) TV scripts using RNNs. You'll be using part of the [Seinfeld dataset](https://www.kaggle.com/thec03u5/seinfeld-chronicles#scripts.csv) of scripts from 9 seasons. The Neural Network you'll build will ge...
github_jupyter
### Requirement ``` aliyun-python-sdk-core==2.13.25 aliyun-python-sdk-ocr==1.0.8 Flask==1.1.2 imutils==0.5.3 json5==0.9.5 Keras==2.4.3 Keras-Preprocessing==1.1.2 matplotlib==3.3.0 numpy==1.18.5 opencv-python==4.4.0.40 oss2==2.12.1 Pillow==7.0.0 sklearn==0.0 tensorflow==2.3.0 trdg==1.6.0 ``` ### Import Aliyun python S...
github_jupyter
``` %matplotlib inline %run utils.ipynb import matplotlib.pyplot as plt from matplotlib import colors, ticker # import cartopy.crs as ccrs import pandas as pd import numpy as np import scipy as sp from astropy.table import Table import astropy.units as u import astropy.coordinates as coord import arviz as az import se...
github_jupyter
# Scaling up ML using Cloud AI Platform In this notebook, we take a previously developed TensorFlow model to predict taxifare rides and package it up so that it can be run in Cloud AI Platform. For now, we'll run this on a small dataset. The model that was developed is rather simplistic, and therefore, the accuracy of...
github_jupyter
# Riskfolio-Lib Tutorial: <br>__[Financionerioncios](https://financioneroncios.wordpress.com)__ <br>__[Orenji](https://www.orenj-i.net)__ <br>__[Riskfolio-Lib](https://riskfolio-lib.readthedocs.io/en/latest/)__ <br>__[Dany Cajas](https://www.linkedin.com/in/dany-cajas/)__ <a href='https://ko-fi.com/B0B833SXD' target='...
github_jupyter
# 多层感知机 :label:`sec_mlp` 在 :numref:`chap_linear`中, 我们介绍了softmax回归( :numref:`sec_softmax`), 然后我们从零开始实现softmax回归( :numref:`sec_softmax_scratch`), 接着使用高级API实现了算法( :numref:`sec_softmax_concise`), 并训练分类器从低分辨率图像中识别10类服装。 在这个过程中,我们学习了如何处理数据,如何将输出转换为有效的概率分布, 并应用适当的损失函数,根据模型参数最小化损失。 我们已经在简单的线性模型背景下掌握了这些知识, 现在我们可以开始对深度神经网络的探索,这...
github_jupyter
``` import numpy as np from numpy import loadtxt import pylab as pl from IPython import display from RcTorchPrivate import * from matplotlib import pyplot as plt from scipy.integrate import odeint %matplotlib inline #this method will ensure that the notebook can use multiprocessing on jupyterhub or any other linux base...
github_jupyter
# Using TensorNet (Basic) This notebook will demonstrate some of the core functionalities of TensorNet: - Creating and setting up a dataset - Augmenting the dataset - Creating and configuring a model and viewing its summary - Defining an optimizer and a criterion - Setting up callbacks - Training and validating the m...
github_jupyter
# Exploring Datasets with Python In this short demo we will analyse a given dataset from 1978, which contains information about politicians having affairs. To analyse it, we will use a Jupyter Notebook, which is basically a REPL++ for Python. Entering a command with shift executes the line and prints the result. ```...
github_jupyter
``` import torch from transformers import MT5ForConditionalGeneration, MT5Config, MT5EncoderModel, MT5Tokenizer, Trainer, TrainingArguments from progeny_tokenizer import TAPETokenizer import numpy as np import math import random import scipy import time import pandas as pd from torch.utils.data import DataLoader, Rando...
github_jupyter
# Part 1 - 2D mesh tallies So far we have seen that neutron and photon interactions can be tallied on surfaces or cells, but what if we want to tally neutron behaviour throughout a geometry? (rather than the integrated neutron behaviour over a surface or cell). A mesh tally allows a visual inspection of the neutron b...
github_jupyter
``` from fastai.text import * from fastai.tabular import * path = Path('') data = pd.read_csv('good_small_dataset.csv', engine='python') data.head() df = data.dropna() df.to_csv('good_small_dataset_drop_missing.csv') data_lm = TextLMDataBunch.from_csv(path, 'good_small_dataset_drop_missing.csv', text_cols = 'content', ...
github_jupyter
Taken from fastai NLP "8-translation-transformer" FastText embeddings: https://fasttext.cc/docs/en/crawl-vectors.html ``` from fastai2.text.all import * from fastai2.callback.all import * from fastai2.basics import * import seaborn as sns from einops import rearrange import gc import csv path = Path('../data/irish/c...
github_jupyter
# Deep Markov Model ## Introduction We're going to build a deep probabilistic model for sequential data: the deep markov model. The particular dataset we want to model is composed of snippets of polyphonic music. Each time slice in a sequence spans a quarter note and is represented by an 88-dimensional binary vector...
github_jupyter
``` !pip install --upgrade language-check import numpy as np import seaborn as sns import pandas as pd import matplotlib.pyplot as plt from sklearn.feature_extraction.text import CountVectorizer,_preprocess,TfidfVectorizer from sklearn.metrics.pairwise import linear_kernel,cosine_similarity from nltk.stem.snowball imp...
github_jupyter
##### Copyright 2020 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
``` import os import numpy as np import pandas as pd import json import pickle from scipy import sparse import scipy.io dataset_name = 'dblp' data_path = os.path.join('../dataset/raw/{}'.format(dataset_name)) citations = [] incomming = {} for i in range(4): fn = os.path.join(data_path, 'dblp-ref-{}.json'.format(i...
github_jupyter
# Introduction to PyCaret - An open source low-code ML library ## This notebook consists 2 parts - Classification part using Titanic DataSet - Regression part using House Price Regression DataSet ![](https://pycaret.org/wp-content/uploads/2020/03/Divi93_43.png) You can reach pycaret website and documentation from ...
github_jupyter
## Boxplot plots _______ tg: @misha_grol and anna.petrovskaia@skoltech.ru Boxplots for features based on DEM and NDVI ``` # Uncomment for Google colab # !pip install maxvolpy # !pip install clhs # !git clone https://github.com/EDSEL-skoltech/maxvol_sampling # %cd maxvol_sampling/ import csv import seaborn as ...
github_jupyter
``` from tensorflow.python.keras import backend as K from tensorflow.python.keras.applications.resnet50 import ResNet50, preprocess_input from tensorflow.python.keras.preprocessing import image from tensorflow.python.keras.layers import Conv2D, GlobalAveragePooling2D, Input, Dropout, Dense from tensorflow.python.keras....
github_jupyter
``` import csv import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split RANDOM_SEED = 42 ``` # 各パス指定 ``` dataset = 'model/point_history_classifier/point_history_allkeypoints.csv' model_save_path = 'model/point_history_classifier/point_history_classifier_allkeypoints.hdf5' ``` ...
github_jupyter
# Shor's algorithm, fully classical implementation ``` %matplotlib inline import random import math import itertools def period_finding_classical(a,N): # This is an inefficient classical algorithm to find the period of f(x)=a^x (mod N) # f(0) = a**0 (mod N) = 1, so we find the first x greater than 0 for which ...
github_jupyter
``` %reset ``` # Simulate particles translating through OAM beam Liz Strong 4/17/2020 ``` import sys sys.path.append('../slvel') import pandas as pd import numpy as np import matplotlib.pyplot as plt from calc_intensity import calculate_e_field_intensity from scattering_particle import Particle import scattering_...
github_jupyter
# 02. Custom Dataset 만들어보기 - Dataset Generation! - 폴더별로 사진들이 모여있다면, 그 dataset을 우리가 원하는 형태로 바꿔봅시다! ``` import numpy as np import os from scipy.misc import imread, imresize import matplotlib.pyplot as plt %matplotlib inline print ("Package loaded") cwd = os.getcwd() print ("Current folder is %s" % (cwd) ) # 학습할 폴더 경로...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
**Principal Component Analysis (PCA)** is widely used in Machine Learning pipelines as a means to compress data or help visualization. This notebook aims to walk through the basic idea of the PCA and build the algorithm from scratch in Python. Before diving directly into the PCA, let's first talk about several import ...
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
[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
<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
# 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
``` 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
``` % 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
# 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
``` !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
# 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
``` 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
``` 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
``` 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
``` 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
... ***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
# 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
# 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
# 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
# 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
``` 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
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
``` %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
# 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
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
## 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
# 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
``` 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