text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` from PIL import Image , ImageDraw, ImageFont def certi_gen(Title,Sub_Title,Name,Text_below_the_name,name_1,designation_1,organization_1,name_2,designation_2,organization_2): def calci(x1, y1, x2, y2,w,h): x = (x2 - x1 - w)/2 + x1 y = (y2 - y1 - h)/2 + y1 arr=[x,y] return arr ...
github_jupyter
# Using Geopandas to read Electronic Nautical Charts This is a brief experiment to learn how to use Geopandas and fiona python packages to read S-57 format nautical charts. Geopandas is a package that blends GDAL and PROJ, which are modules that handle geographic and projected coordinates of vector and raster data, wi...
github_jupyter
POPULATION IN POLAND: ``` library(data.table) library(dplyr) ``` We have 4 datasets: 1) DEATHS DATA SET: ``` deaths <- read.csv("~/Desktop/Micro project/Data/Deaths by Voivodeship.csv", sep=";") ``` There are 51 rows: 2-17: Deaths by Voivodships (2: total) ``` deaths1 <- rbind(deaths[1:17,]) ``` It would be bet...
github_jupyter
# Grove LED Bar example ---- * [Introduction](#Introduction) * [Setup the board](#Setup-the-board) * [Setup and read from the sensor](#Setup-and-read-from-the-sensor) * [Display a graph](#Display-a-graph) ---- ## Introduction This examples shows how to use the Grove LED bar on the PYNQ-Z1 board. A [Grove LED Bar](h...
github_jupyter
# Introduction to Deep Learning with PyTorch In this notebook, you'll get introduced to [PyTorch](http://pytorch.org/), a framework for building and training neural networks. PyTorch in a lot of ways behaves like the arrays you love from Numpy. These Numpy arrays, after all, are just tensors. PyTorch takes these tenso...
github_jupyter
This notebook demonstrates some basic post-processing tasks that can be performed with the Python API, such as plotting a 2D mesh tally and plotting neutron source sites from an eigenvalue calculation. The problem we will use is a simple reflected pin-cell. ``` %matplotlib inline from IPython.display import Image impo...
github_jupyter
[![AnalyticsDojo](https://github.com/rpi-techfundamentals/spring2019-materials/blob/master/fig/final-logo.png?raw=1)](http://rpi.analyticsdojo.com) <center><h1> Bag of Words</h1></center> <center><h3><a href = 'http://rpi.analyticsdojo.com'>rpi.analyticsdojo.com</a></h3></center> This is adopted from: [Bag of Words Me...
github_jupyter
``` from mvtrajectories import * import numpy as np import pandas as pd import matplotlib.pyplot as plt import random import math from copy import deepcopy import itertools %matplotlib inline #works for k=5 where actual clusters are equal to truths def assess_clusters(ca): truths = np.tile(np.arange(0,4,1),len(c...
github_jupyter
### Keras implementation of Brain CNN ``` import tensorflow as tf import numpy as np import sklearn.metrics from keras.utils.np_utils import to_categorical from keras.models import Sequential from keras.layers import Dense, Activation, Flatten from keras.layers.convolutional import Convolution2D, Conv2D from keras.l...
github_jupyter
#### Contest entry by Wouter Kimman Strategy: ---------------------------------------------- ``` from numpy.fft import rfft from scipy import signal import numpy as np import matplotlib.pyplot as plt import plotly.plotly as py import pandas as pd import timeit from sqlalchemy.sql import text from sklearn import...
github_jupyter
``` from bayes_opt import BayesianOptimization from bayes_opt import UtilityFunction import numpy as np from scipy.stats import norm import matplotlib.pyplot as plt from matplotlib import gridspec %matplotlib inline RHO_DEFAULT = 0.01 M_DEFAULT = 1 #Problem one def target(x, y): return np.array([np.sin(x) + y]) ...
github_jupyter
``` import pyspark sc = pyspark.SparkContext(master="spark://10.0.0.3:6060") from pyspark.sql import SQLContext sqlContext = SQLContext(sc) ``` http://10.0.0.3:4040/ ``` import numpy as np #maths visualFeatureVocabulary = None visualFeatureVocabularyList = None with open("data/ORBvoc.txt", "r") as fin: extractedF...
github_jupyter
<a href="https://colab.research.google.com/github/ArpitaChatterjee/Comedian-transcript-Analysis/blob/main/Data_Cleaning.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Data Cleaning ## Problem Statement The goal is to look at transcripts of vari...
github_jupyter
# The `MultiDataSet` object: a dictionary of `DataSet`s Sometimes it is useful to deal with several sets of data all of which hold counts for the *same* set of operation sequences. For example, colleting data to perform GST on Monday and then again on Tuesday, or making an adjustment to an experimental system and re-...
github_jupyter
# Задание 2.1 - Нейронные сети В этом задании вы реализуете и натренируете настоящую нейроную сеть своими руками! В некотором смысле это будет расширением прошлого задания - нам нужно просто составить несколько линейных классификаторов вместе! <img src="https://i.redd.it/n9fgba8b0qr01.png" alt="Stack_more_layers" wi...
github_jupyter
# Matrices OCR training This tutorial shows how you can train the OCR module of the [Matrices repository](https://github.com/merialdo/research.matrices) in your Google Colab. ## 1 Disclaimer This colab loads and saves data from/into your Google Drive main folder. Please make sure that you have your dataset in your ...
github_jupyter
# 1D Thermal Boundary Conduction: Boundary Conditions, Plans, Cylindrical and Spherical Conduction, Thermal Resistance Local heat flux is measured by the phenomenological <b>Fourier's Law</b>: $$ \vec{q}''=-k\vec{\nabla}T $$ where $k$ is the local thermal conduction, W/(m.K), and the gradient of temperature $\vec{\nab...
github_jupyter
# Project: Part of Speech Tagging with Hidden Markov Models --- ### Introduction Part of speech tagging is the process of determining the syntactic category of a word from the words in its surrounding context. It is often used to help disambiguate natural language phrases because it can be done quickly with high accu...
github_jupyter
# 神经莫扎特——MIDI音乐的学习与生成 在这节课中,我们学习了如何通过人工神经网络学习一个MIDI音乐,并记忆中音符时间序列中的模式,并生成一首音乐 首先,我们要学习如何解析一个MIDI音乐,将它读如进来;其次,我们用处理后的MIDI序列数据训练一个LSTM网络,并让它预测下一个音符; 最后,我们用训练好的LSTM生成MIDI音乐 本程序改造自 本文件是集智学园http://campus.swarma.org 出品的“火炬上的深度学习”第VI课的配套源代码 ``` !pip install mido # 导入必须的依赖包 # 与PyTorch相关的包 import torch import torch.utils....
github_jupyter
# Section 4.2 Single Model Visualizations ``` import os import arviz as az import numpy as np import pandas as pd import matplotlib.pyplot as plt # Change working directory if os.path.split(os.getcwd())[-1] != "notebooks": os.chdir(os.path.join("..")) np.random.seed(0) az.style.use('arviz-white') ``` ## Activit...
github_jupyter
# Balanced Network De-embedding Demonstration of *balanced*, i.e. 2N-port, network de-embedding. ## Setup ``` import numpy as np import skrf as rf from skrf.media import CPW rf.stylely() import matplotlib.pyplot as plt # base parameters freq = rf.Frequency(1e-3,10,1001,'ghz') cpw = CPW(freq, w=0.6e-3, s=0.25e-3, ...
github_jupyter
# Advanced Expectation Values and Measurement Reduction This notebook is an advanced follow-up to the "expectation_value_example" notebook, focussing on reducing the number of circuits required for measurement.<br> <br> When calculating the expectation value $\langle \psi \vert H \vert \psi \rangle$ of some operator $...
github_jupyter
# Insurance cost prediction using linear regression In this assignment we're going to use information like a person's age, sex, BMI, no. of children and smoking habit to predict the price of yearly medical bills. This kind of model is useful for insurance companies to determine the yearly insurance premium for a perso...
github_jupyter
<h3>Strings</h3> ``` # multiline string: multilinestr = '''here this is a mulitline string i can write in the nexxt line too. ''' b =" some string b " # strip is to remove while spaces in the beginning and the end of a string b = b.strip() # string behave as an array print(b[2:5]) print(b.upper()) print(b.lower()) p...
github_jupyter
# Chapter 9 - Support Vector Machines - [Lab: 9.6.1 Support Vector Classifier](#9.6.1-Support-Vector-Classifier) - [Lab: 9.6.2 Support Vector Machine](#9.6.2-Support-Vector-Machine) - [Lab: 9.6.3 ROC Curves](#9.6.3-ROC-Curves) - [Lab: 9.6.4 SVM with Multiple Classes](#9.6.4-SVM-with-Multiple-Classes) - [Lab: 9.6.5 App...
github_jupyter
# Improving the resolution of population coding by the use of multiple layers Ricardo de Azambuja - CRNS - Plymouth University ## Abstract A population code scheme as used in [Joshi and Maass, “Movement Generation with Circuits of Spiking Neurons.” and ???] simplifies the process of converting real values to a neural...
github_jupyter
``` # Import libraries and modules import datetime import math import matplotlib.pyplot as plt import numpy as np import os import sys import tensorflow as tf print(np.__version__) print(tf.__version__) module_path = os.path.abspath(os.path.join("..")) if module_path not in sys.path: sys.path.append(module_path) ...
github_jupyter
``` import os import numpy as np import pandas as pd client_id = os.getenv('PF_CLIENT_ID', 'default') client_secret = os.getenv('PF_CLIENT_SECRET', 'default') import requests import json from pandas.io.json import json_normalize #for reading current state state_info = pd.read_csv('state_info.csv') current_state = state...
github_jupyter
# Interactive Tables and their API The table UI allows column drag/drop, hide, sorting, formatting, searching, selecting/export as CSV. This makes it easy to paste into a spreadsheet like Excel. There is a menu in the top-left for the whole table, and each column has a menu that appears on hover. There are also key...
github_jupyter
``` import pandas as pd import seaborn as sns import numpy as np ls df = pd.read_csv('diabetes.csv') df.head() df.isnull().sum() df_new = df.copy() df['Outcome']= np.where(df['Outcome']==1,'Diabetic','Non Diabetic') df.head() sns.pairplot(df, hue='Outcome') df_new.head() X = df_new.drop('Outcome', axis=1).values # inde...
github_jupyter
<!--NAVIGATION--> _______________ Este documento puede ser utilizado de forma interactiva en las siguientes plataformas: - [Google Colab](https://colab.research.google.com/github/masdeseiscaracteres/ml_course/blob/master/material/06_boosted_trees.ipynb) - [MyBinder](https://mybinder.org/v2/gh/masdeseiscaracteres/ml_...
github_jupyter
``` %matplotlib inline ``` ============================================================= Receiver Operating Characteristic (ROC) with cross validation ============================================================= Example of Receiver Operating Characteristic (ROC) metric to evaluate classifier output quality using cr...
github_jupyter
``` import numpy as np from sklearn.datasets import make_blobs import matplotlib.pyplot as plt %matplotlib inline from sklearn.datasets import make_gaussian_quantiles X, y = make_gaussian_quantiles(n_samples=200, n_features=2, n_classes=2, mean=[1,2],cov=2,random_state=222) plt.scatter(X[:, 0], X[:, 1], marker='o', c=y...
github_jupyter
# Basic modelling in AuTuMN This notebook provides a brief overview the interface to running and interacting with models in AuTuMN ``` # Start with imports # These should always live at the top of a notebook # Import commonly used external libraries - you won't always need these, but most of the time you will import...
github_jupyter
``` import os import numpy as np import theano as th import theano.tensor as tt import matplotlib import matplotlib.pyplot as plt from thermomc import continuous_temp, discrete_temp, control_funcs, hmc import seaborn as sns %matplotlib inline ``` ## Create experiment directory ``` base_dir = os.path.dirname(os.getcwd...
github_jupyter
``` # set tf 1.x for colab %tensorflow_version 1.x ``` # Generating names with recurrent neural networks This time you'll find yourself delving into the heart (and other intestines) of recurrent neural networks on a class of toy problems. Struggle to find a name for the variable? Let's see how you'll come up with a ...
github_jupyter
# Examples of Full-text queries in the COVID-19-Net Knowledge Graph [Work in progress] This notebook demonstrates how to run full-text [Lucene queries](https://lucene.apache.org/core/5_5_0/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Overview) in the Knowledge Graph. COVID-19-Net KG support...
github_jupyter
``` import pandas as pd import numpy as np import xgboost as xgb from sklearn.model_selection import StratifiedShuffleSplit from sklearn.metrics import mean_absolute_error from sklearn.feature_extraction.text import CountVectorizer from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import MinM...
github_jupyter
## Quiz #0502 (Solution) ### "Human Activity Recognition" #### Answer the following questions by providing Python code: #### Objectives: - Carry out the EDA. - Carry out the data pre-processing. - Optimize and test a predictive model of your choice. ``` import numpy as np import pandas as pd import matplotlib.pyplot...
github_jupyter
# Retriever - Experimento O objetivo deste componente é elencar a probabilidade de um conjunto de contextos conter a resposta a uma dada pergunta. Este componente utiliza diferentes modelos de similaridade entre textos para a sua inferência.<br> A tabela de dados de entrada deve possuir uma coluna de contextos, em q...
github_jupyter
# Tensor Flow In this lesson we will learn the basics of deep learning using the TensorFlow package. <img src="figures/TensorFlow.png" width=300> ## Deep Learning vs. Machine Learning We use a **machine algorithm** to parse data, learn from that data, and make informed decisions based on what it has learned. Basicall...
github_jupyter
``` import warnings warnings.filterwarnings("ignore") import os import numpy as np import tensorflow as tf import tensorflow.contrib.layers as layers import far_ho as far import far_ho.examples as far_ex tf.logging.set_verbosity(tf.logging.ERROR) import matplotlib.pyplot as plt %matplotlib inline from IPython.display ...
github_jupyter
``` # import libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import datasets from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score # get the dataset iris = datasets.load_iris() X = iris.data y = iris.target flower_names = list(iris...
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
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Reading-and-Writing-Data-in-Text-Format" data-toc-modified-id="Reading-and-Writing-Data-in-Text-Format-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Reading and Writing Data in Text Format</a></span><ul...
github_jupyter
# TFIDF Featurization and Modeling ``` import pandas as pd import numpy as np import re from tqdm import tqdm import warnings from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import accuracy_score, confusion_matrix, classification_report from sklearn.naive_bayes import MultinomialNB fro...
github_jupyter
# LiDAR Point clouds to 3D surfaces ✨➡️🏔️ In this tutorial, let's use PyGMT to perform a more advanced geoprocessing workflow 😎 Specifically, we'll learn to filter and interpolate a LiDAR point cloud onto a regular grid surface 🏁 At the end, we'll also make a 🚠 3D perspective plot for the Digital Surface Model (...
github_jupyter
# Test the parameter set of the Enertech cells In this notebook, we show how to use pybamm to reproduce the experimental results for the Enertech cells (LCO-G). To see all of the models and submodels available in PyBaMM, please take a look at the documentation [here](https://pybamm.readthedocs.io/en/latest/source/model...
github_jupyter
# Collection of Helpful Functions for [Class](https://sites.wustl.edu/jeffheaton/t81-558/) This is a collection of helpful functions that I will introduce during this course. ``` import base64 import os import matplotlib.pyplot as plt import numpy as np import pandas as pd import requests from sklearn import preproc...
github_jupyter
##### Copyright 2018 The TF-Agents 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 a...
github_jupyter
``` import numpy as np import os import pandas as pd import scipy.interpolate import sklearn.metrics import sys sys.path.append("../src") import localmodule from matplotlib import pyplot as plt %matplotlib inline # Define constants. n_eval_trials = 1 dataset_name = localmodule.get_dataset_name() models_dir = localmo...
github_jupyter
``` import matplotlib.pyplot as plt import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"]="" from sklearn.pipeline import make_pipeline from sklearn.preprocessing import FunctionTransformer, LabelBinarizer, Normalizer from sklearn.model_selection import Stratified...
github_jupyter
<img src="../images/QISKit-c.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="250 px" align="left"> # _*Quantum algorithm for linear system of equations*_ *** *** ### Contributors Shan Jin, Xi He, Xiaokai Hou, Li Sun, Dingding Wen, Shaojun W...
github_jupyter
``` import pandas as pd ``` ## Exercise 2.02 ``` data = pd.read_csv("energydata_complete.csv") data = data.drop(columns=["date"]) data.head() cols = data.columns num_cols = data._get_numeric_data().columns list(set(cols) - set(num_cols)) data.isnull().sum() outliers = {} for i in range(data.shape[1]): min_t = d...
github_jupyter
<a href="https://colab.research.google.com/github/ziatdinovmax/MRS2021/blob/main/06_im2spec_VED.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # *im2spec*: Predicting functional response from structural data --- This notebook demonstrates how on...
github_jupyter
# Working with Probability Distributions `deeplenstronomy` has several built-in probability distributions directly callable from the configuration file. Sometimes these are enough, and sometimes not. If you find you need more flexibility than the built-in distributions, you can supply any distribution you want as a te...
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
``` !jupyter nbconvert --to script Untitled2.ipynb import unicodedata import datetime import os import json from os import listdir import pandas as pd pd.set_option('display.width', 10000) import dateutil.parser import metadata_funs import xlrd import datetime from os.path import isfile, join import ntpath import uuid ...
github_jupyter
TSG046 - Knox gateway logs ========================== Description ----------- Knox gives a 500 error to the client, and removes details (the stack) pointing to the cause of the underlying issue. Therefore use this TSG to get the Knox logs from the cluster. Steps ----- ### Parameters ``` import re tail_lines = 200...
github_jupyter
``` import warnings import numpy as np import pandas as pd import xarray as xr import fsspec warnings.simplefilter('ignore') # filter some warning messages xr.set_options(display_style="html") #display dataset nicely file_opendap = 'https://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/GDS2/L4/GLOB/JPL/MUR/...
github_jupyter
``` #%matplotlib plot %matplotlib notebook import numpy as np import logging import sys import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from moopt import nise, monise, nc, pgen, rennen, xnise, random_weights logging.disable(logging.NOTSET) logger = logging.getLogger() logger.setLevel(level=lo...
github_jupyter
``` # Download a natural image patches dataset %matplotlib inline import os import numpy as np import theano from scipy.io import loadmat #os.system('wget http://cs.stanford.edu/~jngiam/data/patches.mat') import matplotlib.pyplot as plt from sklearn.datasets import fetch_mldata from keras.models import Sequential, Gr...
github_jupyter
# Sim-launcher This script show how to launch basecase sims ### 1. Package imports ``` import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from dotenv import load_dotenv from pathlib import Path # Python 3.6+ only import os import psycopg2 from psycopg2.extras import execute_values import rando...
github_jupyter
### III. Data Preparation (test) In this notebook we shall undertake data preparation for the training test. Below code is the same that training data has gone through to be able to train a model. Once data (test) will be prepared, it shall be saved for testing. **a) Importing libraries and data** ``` # import li...
github_jupyter
# Introduction This is a map-reduce version of expectation maximization algo for a mixture of Gaussians model. There are two mrJob MR packages, mr_GMixEmIterate and mr_GMixEmInitialize. The driver calls the mrJob packages and manages the iteration. ##E Step: Given priors, mean vector and covariance matrix, calculate...
github_jupyter
<a href="https://colab.research.google.com/github/spyrosviz/Injury_Prediction_MidLong_Distance_Runners/blob/main/Preprocessing/Runners_Injury_Prediction_Preprocessing_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **1. PREPROCESSING** ## We ...
github_jupyter
<img src="../static/aeropython_name_mini.png" alt="AeroPython" style="width: 300px;"/> # Clase 2a: Introducción a NumPy _Hasta ahora hemos visto los tipos de datos más básicos que nos ofrece Python: integer, real, complex, boolean, list, tuple... Pero ¿no echas algo de menos? Efectivamente, los __arrays__. _ _Duran...
github_jupyter
``` # Ricordati di eseguire questa cella con Shift+Invio import sys sys.path.append('../') import jupman ``` # Dizionari 2 - operatori ## [Scarica zip esercizi](../_static/generated/dictionaries.zip) [Naviga file online](https://github.com/DavidLeoni/softpython-it/tree/master/dictionaries) Per manipolare i dizion...
github_jupyter
``` %matplotlib inline import arviz as az import matplotlib.pyplot as plt import numpy as np import pandas as pd import pymc3 as pm import scipy as sp import seaborn as sns sns.set(context='notebook', font_scale=1.2, rc={'figure.figsize': (12, 5)}) plt.style.use(['seaborn-colorblind', 'seaborn-darkgrid']) RANDOM_SEE...
github_jupyter
# Grama: Fitting Univariate Distributions *Purpose*: As we've seen through studying a lot of datasets, many physical systems exhibit variability and other forms of uncertainty. Thus, it is beneficial to be able to *model* uncertainty using distributions. In this two-part exercise, we'll first learn how to fit a distri...
github_jupyter
# Lesson 2 - Bayesian Optimization ## Lesson Video: ``` #hide_input from IPython.lib.display import YouTubeVideo from datetime import timedelta start = int(timedelta(minutes=48, seconds=7).total_seconds()) YouTubeVideo('-aCtDIgbxMw', start=start) #hide #Run once per session !pip install fastai wwf bayesian-optimizati...
github_jupyter
# Exploratory Data Analysis **Q&A:** Why is exploratory data analysis important? In the last session, we learned about `NumPy`, a popularly used data science tool. In this session, we will be learning about `Pandas`, Python Data Analysis Library, an even more popularly used data science tool for data exploration and...
github_jupyter
## KAIM 2019 ## Understanding Deep Neural Networks Through Compositional Pattern-Producing Networks (CPPN) ### -Anand Krish ``` import torch import matplotlib.pyplot as plt from torch import nn import torch.nn.functional as F from PIL import Image import numpy as np class CPPN(nn.Module): def __init__(self, batc...
github_jupyter
``` import pandas import csv import numpy as np from datasketch import MinHash, MinHashLSH import matplotlib import matplotlib.pyplot as plt %matplotlib inline # Shingle generators # Arguments : Message string, shingle size {in words} # Returns : All shingles formed with k words def shingle_generator(message, k): ...
github_jupyter
# Residual Networks Welcome to the second assignment of this week! You will learn how to build very deep convolutional networks, using Residual Networks (ResNets). In theory, very deep networks can represent very complex functions; but in practice, they are hard to train. Residual Networks, introduced by [He et al.](h...
github_jupyter
## Step 1: Computational Inductive Exploration Analysis 2: Structural Topic Model The below code produces the output for Table 3 and Table 4 1. [Compare models](#compare) 2. [Explore topics by organization](#explore) <a id='compare'></a> ## Compare Models First, read in the Structural Topic Model data containing ...
github_jupyter
``` #import libraries import pandas as pd import numpy as np import statsmodels.tools.tools as stattools from sklearn import model_selection from sklearn.tree import DecisionTreeClassifier, export_graphviz from graphviz import Digraph, Source, render #Please download the dataset through: https://gofile.io/?c=EDn86R (P...
github_jupyter
# Transformer Chatbot <table class="tfo-notebook-buttons" align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/bryanlimy/tf2-transformer-chatbot/blob/master/tf2_tpu_transformer_chatbot.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" />Run in Google Colab</a...
github_jupyter
At the moment there are 5 transformer-based algorithms available. Here are examples of how to use them Perhaps the main comment is that when using transformer-based models, the data preparation is a bit different than in other models. Therefore one needs to know the set up at pre-processing stage. Let's have a loo...
github_jupyter
# FloPy shapefile export demo The goal of this notebook is to demonstrate ways to export model information to shapefiles. This example will cover: * basic exporting of information for a model, individual package, or dataset * custom exporting of combined data from different packages * general exporting and importing of...
github_jupyter
# Preprocessing * Null Values * Encoding Categorical Columns. * Standardisation and Normalisation. * Feature Generation. * Feature Selection – (Multicolinearity, Dimensionality Reduction). * Handling Noisy Data – (Binning, CLustering) * Handling Class Imbalance - Covered in CLassification. ## A. Null Values Types of...
github_jupyter
# Income prediction based on Seldon's implementation https://github.com/SeldonIO/alibi/blob/master/examples/anchor_tabular_adult.ipynb and https://github.com/SeldonIO/alibi/blob/5aec3ab4ce651ca2249bf849ecb434371c9278e4/alibi/datasets.py#L183 ``` !pip install pandas --upgrade --user !pip install scikit-learn --upgrade ...
github_jupyter
``` !python --version !wget http://geneontology.org/gene-associations/gene_association.sgd.gz -O ./data/gene_association.sgd.gz !wget http://purl.obolibrary.org/obo/go.obo -O ./data/go.obo !wget http://chianti.ucsd.edu/\~kono/ci/data/deep-cell/raw-interactions_clixo_intTable_kei_pm_ranks.txt -O ./data/interaction-table...
github_jupyter
# Image Classification from scratch with TPUs on Cloud ML Engine using ResNet This notebook demonstrates how to do image classification from scratch on a flowers dataset using TPUs and the resnet trainer. ``` import os PROJECT = 'cloud-training-demos' # REPLACE WITH YOUR PROJECT ID BUCKET = 'cloud-training-demos-ml' ...
github_jupyter
# Validation Playground **Watch** a [short tutorial video](https://greatexpectations.io/videos/getting_started/integrate_expectations) or **read** [the written tutorial](https://docs.greatexpectations.io/en/latest/tutorials/validate_data.html?utm_source=notebook&utm_medium=validate_data) #### This notebook assumes th...
github_jupyter
``` from Music_Style_Transfer_master.project.utils import runs_management, dataset_import, focal_loss, partial_focal_loss, partial_loss_mixup, \ binary_crossentropy_mixup, partial_binary_accuracy,\ current_l_b...
github_jupyter
# TensorFlow Tutorial #05 # Ensemble Learning by [Magnus Erik Hvass Pedersen](http://www.hvass-labs.org/) / [GitHub](https://github.com/Hvass-Labs/TensorFlow-Tutorials) / [Videos on YouTube](https://www.youtube.com/playlist?list=PL9Hr9sNUjfsmEu1ZniY0XpHSzl5uihcXZ) ## Introduction This tutorial shows how to use a so-...
github_jupyter
# Import Modules **Run the cell below to import the relevant modules by running the cell. Select it and type ``shift`` + ``enter``.** ``` import os import sys ROOT_DIR = os.getcwd()[:os.getcwd().rfind('quantum_HEOM')] + 'quantum_HEOM' if ROOT_DIR not in sys.path: sys.path.append(ROOT_DIR) from quantum_heom impo...
github_jupyter
``` import qiskit import numpy as np, matplotlib.pyplot as plt import sys sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.nqubit, qtm.onequbit, qtm.custom_gate num_qubits = 3 num_layers = 1 thetas_origin = np.random.uniform(low = 0, high = 2*np.pi, size = num_qubits*num_layers*5) theta = np.random.uniform(...
github_jupyter
# backtesting with grid search using fastquant ## backtest SMAC `fastquant` offers a convenient way to backtest several trading strategies. To backtest using Simple Moving Average Crossover (`SMAC`), we do the following. ```python backtest('smac', dcv_data, fast_period=15, slow_period=40) ``` `fast_period` and `slo...
github_jupyter
Lo siguiente está basado en el libro de B. Rumbos, Pensando Antes de Actuar: Fundamentos de Elección Racional, 2009 y de G. J. Kerns, Introduction to Probability and Statistics Using R, 2014. El libro de G. J. Kerns tiene github: [jkerns/IPSUR](https://github.com/gjkerns/IPSUR) **Notas:** * Se utilizará el paquete ...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of the License at...
github_jupyter
``` import os import pandas as pd import re import numpy as np from sklearn.feature_extraction import text import gensim import seaborn as sns import matplotlib.pyplot as plt taz = pd.read_csv("TAZ.csv") taz.drop(columns="Unnamed: 0", inplace=True) taz['speaker'] = taz.speaker.str.lower().str.strip() taz['lines'] = taz...
github_jupyter
<b> This notebook aggregates the results from 100 iterations of random forest. </b> Notebook by YB & RM Environment (Qiime2 2018.11) ``` %matplotlib inline import numpy as np, pandas as pd, qiime2 as q2, seaborn as sns import os from skbio import DistanceMatrix from scipy.spatial import procrustes from skbio.st...
github_jupyter
# Google form analysis tests Purpose: determine in what extent the current data can accurately describe correlations, underlying factors on the score. Especially concerning the answerTemporalities[0] groups: are there underlying groups explaining the discrepancies in score? Are those groups tied to certain questions? ...
github_jupyter
# Madrid Distric Geometries In this notebook we will try to igure out how to manipulate the district geographical data provided by the Madrid city council so that we can apply it to the city simulation. We will be using geopandas to read the data, which uses the well know library shapely to interpret the data. ``` i...
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/enterprise/healthcare/EntityResolution_ICD10_RxNorm_Prescriptions.ipynb) # ICD10CM-RxNorm Entity Resolution - version 2.5.0 ``` import json with op...
github_jupyter
![MIT Deep Learning](https://deeplearning.mit.edu/files/images/github/mit_deep_learning.png) <table align="center"> <td align="center"><a target="_blank" href="https://deeplearning.mit.edu"> <img src="https://deeplearning.mit.edu/files/images/github/icon_mit.png" style="padding-bottom:5px;" /> Visit MI...
github_jupyter
# Use Tensorflow to recognize hand-written digits with `ibm-watson-machine-learning` This notebook facilitates Tensorflow and Watson Machine Learning service. It contains steps and code to work with [ibm-watson-machine-learning](https://pypi.python.org/pypi/ibm-watson-machine-learning) library available in PyPI repos...
github_jupyter
``` import logging import pickle import numpy as np import pandas as pd from sklearn.decomposition import PCA from tqdm import tqdm_notebook from IPython.core.display import Image, display from random import randint from commons.config import CIMRI_CSV, DIM_RED_MODEL_PATH from feature_extraction.image_vectorization ...
github_jupyter