code
stringlengths
2.5k
150k
kind
stringclasses
1 value
``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline train = pd.read_csv('titanic_train.csv') test = pd.read_csv('titanic_test.csv') train.head(5) train.info() sns.heatmap(train.isnull(), yticklabels=False, cmap='viridis', cbar=False) sns.heatmap(test.isnul...
github_jupyter
## 4. Training In this part of notebook we will try to train the model using feature extracted dataset and do model evaluation to see how well it predicts churn ### Setup Prerequisite ``` !pip install pyspark from google.colab import drive drive.mount('/content/drive') ``` ### Import Needed Library, Initialize Spar...
github_jupyter
# PyCitySChools Solution * Submitted by: Farshad Esnaashari * Data Analytics Bootcap * M-W session ``` # Dependencies and Setup import pandas as pd # File to Load (Remember to Change These) school_data_to_load = "Resources/schools_complete.csv" student_data_to_load = "Resources/students_complete.csv" # Read ...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from ipywidgets import interact, fixed import ipywidgets as widgets ``` Zasymuluj wahadlo matematyczne rozwiazując numerycznie rownanie różniczkowe je opisujace (rownież dla dużych wychyleń). $$ \frac{d^2x}{dt^2} + \frac{g}{l} sin(x) = 0 $$ ``` g = 9.81 l = 1 d...
github_jupyter
# 基本程序设计 - 一切代码输入,请使用英文输入法 ``` print('joker is bad man') ``` ## 编写一个简单的程序 - 圆公式面积: area = radius \* radius \* 3.1415 ### 在Python里面不需要定义数据的类型 ``` radius = 100 # 定义变量 area = radius * radius * 3.14 # 普通代码,* 代表乘法 print(area) # 最后打印出结果 ``` ## 控制台的读取与输入 - input 输入进去的是字符串 - eval - 在jupyter用shift + tab 键可以跳出解释文档 ``` ...
github_jupyter
``` import musicntd.scripts.hide_code as hide ``` # From padding to subdivision As evoked in the 1st notebook, in previous experiments, every bar of the tensor was zero-padded if it was shorter than the longest bar of the song. This fix is not satisfactory, as it creates null artifacts at the end of most of the slic...
github_jupyter
``` ####################################################################### # Copyright (C) # # 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) # # 2016 Tian Jun(tianjun.cpp@gmail.com) # # 2016 Artem Oboturov(obotur...
github_jupyter
## inference in simple model using synthetic data population size 10^6, inference window 2x4 = 8 days, to be compared with ``-win5`` analogous notebook ``` %env OMP_NUM_THREADS=1 %matplotlib inline import numpy as np import os import pickle import pprint import time import pyross import matplotlib.pyplot as plt impor...
github_jupyter
``` ''' Notebook to specifically study correlations between ELG targets and Galactic foregrounds Much of this made possible and copied from script shared by Anand Raichoor Run in Python 3; install pymangle, fitsio, healpy locally: pip install --user fitsio; pip install --user healpy; git clone https://github.com/eshe...
github_jupyter
``` from IPython.display import HTML HTML('''<script> code_show=true; function code_toggle() { if (code_show){ $('div.input').hide(); $('div.prompt').hide(); } else { $('div.input').show(); $('div.prompt').show(); } code_show = !code_show } $( document ).ready(code_toggle); </script> <form action="javascript:...
github_jupyter
# First Last - Homework 4 * Use the `Astropy` units and constants packages to solve the following problems. * Do not hardcode any constants! * Unless asked, your units should be in the simplest SI units possible ``` import numpy as np from astropy import units as u from astropy import constants as const from astropy...
github_jupyter
# Swish-based classifier with data augmentation and stochastic weght-averaging - Swish activation, 4 layers, 100 neurons per layer - Data is augmentaed via phi rotations, and transvers and longitudinal flips - Model uses a running average of previous weights - Validation score use ensemble of 10 models weighted by loss...
github_jupyter
# 탐구실험용 toy 코드 (Facebook 바비 Question-Answer) <p> &nbsp; # +++++++++++++++++++++++++++++++++++++++++++++ # toy 코드의 한계 및 약점은 ? 약점을 보강할 수 있는 방법 ? <p> # 영어와 한글 데이터의 부족을 한영 번역기로 try 하며 탐구 <p> &nbsp; ## +++++++++++++++++++++++++++++++++++++++++++++++++++ <p> &nbsp; ## toy 코드를 통해 약점을 알아내고, 데이터를 조작하며...
github_jupyter
``` import csv import numpy as np import os import pandas as pd import scipy.interpolate import sklearn.metrics import sys sys.path.append("../src") import localmodule if sys.version_info[0] < 3: from StringIO import StringIO else: from io import StringIO from matplotlib import pyplot as plt %matplotlib in...
github_jupyter
# Skip-gram Word2Vec In this notebook, I'll lead you through using PyTorch to implement the [Word2Vec algorithm](https://en.wikipedia.org/wiki/Word2vec) using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language processing. This will come in handy when dealin...
github_jupyter
``` import os from os.path import join, pardir from collections import Counter from copy import deepcopy import numpy as np from deap import base, creator, algorithms, tools from dssg_challenge import compute_cost, check_keyboard RNG_SEED = 0 DATA_DSSG = join(pardir, 'data', 'processed') rng = np.random.RandomState(R...
github_jupyter
# Problem Statement Customer churn and engagement has become one of the top issues for most banks. It costs significantly more to acquire new customers than retain existing. It is of utmost important for a bank to retain its customers. We have a data from a MeBank (Name changed) which has a data of 7124 customers. ...
github_jupyter
# **Lab Session : Feature extraction II** Author: Vanessa Gómez Verdejo (http://vanessa.webs.tsc.uc3m.es/) Updated: 27/02/2017 (working with sklearn 0.18.1) In this lab session we are going to work with some of the kernelized extensions of most well-known feature extraction techniques: PCA, PLS and CCA. As in the p...
github_jupyter
Practical 1: Sentiment Detection of Movie Reviews ======================================== This practical concerns sentiment detection of movie reviews. In [this file](https://gist.githubusercontent.com/bastings/d47423301cca214e3930061a5a75e177/raw/5113687382919e22b1f09ce71a8fecd1687a5760/reviews.json) (80MB) you will...
github_jupyter
``` from keras.models import Sequential from keras.layers import Dense, Activation from keras.layers import LSTM from keras.optimizers import RMSprop from keras.utils.data_utils import get_file import numpy as np import random import sys path = get_file('nietzsche.txt', origin='https://s3.amazonaws.com/text-datasets/ni...
github_jupyter
``` from google.colab import files files.upload() !mkdir -p ~/.kaggle !cp kaggle.json ~/.kaggle/ !pip install kaggle !chmod 600 /root/.kaggle/kaggle.json !kaggle competitions download -c home-credit-default-risk !unzip \*.zip -d dataset !rm -R sample_data !rm *zip *csv import os import gc import numpy as np import pand...
github_jupyter
- 广发证券之《深度学习之股指期货日内交易策略》 - 《宽客人生》 - 《主动投资组合管理》 - ------------------------------------------------------- 量化研报只是应付客户而做的产物,对于实际交易用处不大 策略对于市场的参数时刻都在变化 策略+相应的参数调整才是完整的 策略本身也需要非常强的主观调整 ----------周杰 拿到一个静态的策略并不是一个万能钥匙,对于细节处没多大用处,挣钱完全是靠细节 世界不存在一种一成不变的交易体系能让你永远的挣钱 ---------------------------------...
github_jupyter
## Passing Messages to Processes As with threads, a common use pattern for multiple processes is to divide a job up among several workers to run in parallel. Effective use of multiple processes usually requires some communication between them, so that work can be divided and results can be aggregated. A simple way to ...
github_jupyter
``` import urllib.request as urlreq import urllib.error as urlerr import urllib.parse as urlparse import urllib.robotparser as urlrp from bs4 import BeautifulSoup import re import datetime import time import sys sys.path.append('../') from common.utils import * url = "http://example.webscraping.com/places/default/view...
github_jupyter
# End-to-end quantum chemistry VQE using Qu & Co Chemistry In this tutorial we show how to solve the groundstate energy of a hydrogen molecule using VQE, as a function of the spacing between the atoms of the molecule. For a more detailed discussion on MolecularData generation or VQE settings, please refer to our other ...
github_jupyter
# Random Forest Project For this project we will be exploring publicly available data from [LendingClub.com](www.lendingclub.com). Lending Club connects people who need money (borrowers) with people who have money (investors). Hopefully, as an investor you would want to invest in people who showed a profile of having...
github_jupyter
``` import photonqat as pq import numpy as np import matplotlib.pyplot as plt ``` ## Photonqat 基本的なゲート動作と測定を一通り行っています。 ``` G = pq.Gaussian(2) # two qumode [0, 1] G.D(0, 2) # Displacement gate, x to x+2 G.S(0, 1) # X squeeIng gate, r=1 G.R(0, np.pi/4) # pi/4 rotation gate G.BS(0, 1, np.pi/4) # 50:50 beam splitter x =...
github_jupyter
### Simple housing version * State: $[w, n, M, e, \hat{S}, z]$, where $z$ is the stock trading experience, which took value of 0 and 1. And $\hat{S}$ now contains 27 states. * Action: $[c, b, k, q]$ where $q$ only takes 2 value: $1$ or $\frac{1}{2}$ ``` from scipy.interpolate import interpn from multiprocessing impor...
github_jupyter
# Chainer MNIST Model Deployment * Wrap a Chainer MNIST python model for use as a prediction microservice in seldon-core * Run locally on Docker to test * Deploy on seldon-core running on minikube ## Dependencies * [Helm](https://github.com/kubernetes/helm) * [Minikube](https://github.com/kubernetes/miniku...
github_jupyter
# An Introduction to SageMaker LDA ***Finding topics in synthetic document data using Spectral LDA algorithms.*** --- 1. [Introduction](#Introduction) 1. [Setup](#Setup) 1. [Training](#Training) 1. [Inference](#Inference) 1. [Epilogue](#Epilogue) # Introduction *** Amazon SageMaker LDA is an unsupervised learning ...
github_jupyter
``` from __future__ import print_function import argparse import os import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from data import get_eval_set from functools import reduce import scipy.io as sio import time import imageio impo...
github_jupyter
``` # Enable importing of utilities import sys sys.path.append('..') %matplotlib inline ``` # Cleaning up imagery for pre and post rainy season The [previous tutorial](igarrs_chad_01.ipynb) addressed the identifying the extent of the rainy season near Lake Chad. This tutorial will focus on cleaning up optical imagery...
github_jupyter
<a href="https://colab.research.google.com/github/SaashaJoshi/pennylane-demo-cern/blob/main/1_classical_ml_with_automatic_differentiation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` %%capture # Comment this out if you don't want to install...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from functions import * %matplotlib inline ``` Per trovare i materiali che compongono i cluster scegliamo di **non eseguire un fit su ogni spettro all'interno di un determinato cluster**, ma **p...
github_jupyter
# Teste para Duas Médias - ANOVA (Analysis of Variance) Análise de variância é a técnica estatística que permite avaliar afirmações sobre as médias de populações. A análise visa, fundamentalmente, verificar se existe uma diferença significativa entre as médias e se os fatores exercem influência em alguma variável depe...
github_jupyter
# Import development libraries ``` import bw2data as bd import bw2calc as bc import bw_processing as bwp import numpy as np import matrix_utils as mu ``` # Create new project ``` bd.projects.set_current("Multifunctionality") ``` Our existing implementation allows us to distinguish activities and prodducts, though n...
github_jupyter
___ <a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a> ___ <center><em>Copyright Pierian Data</em></center> <center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center> # DataFrames DataFrames are the workhorse of pandas and are ...
github_jupyter
``` # general tools import warnings import requests import pickle import math import re # visualization tools import matplotlib.pyplot as plt from tqdm.auto import tqdm import seaborn as sns # data preprocessing tools import pandas as pd from shapely.geometry import Point import numpy as np from scipy.spatial.distanc...
github_jupyter
# Intro to Hidden Markov Models (optional) --- ### Introduction In this notebook, you'll use the [Pomegranate](http://pomegranate.readthedocs.io/en/latest/index.html) library to build a simple Hidden Markov Model and explore the Pomegranate API. <div class="alert alert-block alert-info"> **Note:** You are not require...
github_jupyter
# Teste Técnico para Ciência de Dados da Keyrus ## 1ª parte: Análise Exploratória - [x] Tipos de variáveis - [x] Medidas de posição - [x] Medidas de dispersão - [x] Tratamento de Missing Values - [x] Gráficos - [x] Análise de Outliers ## 2ª parte: Estatística - [x] Estatística descritiva - [x] Identificação das dis...
github_jupyter
# Testing Web Applications In this chapter, we explore how to generate tests for Graphical User Interfaces (GUIs), notably on Web interfaces. We set up a (vulnerable) Web server and demonstrate how to systematically explore its behavior – first with hand-written grammars, then with grammars automatically inferred fro...
github_jupyter
## Ensembl to RefSeq Mapping The constraint table from gnomAD has duplicate gene ID's - in the example of TUBB3 one gene ID is missannotated. Given out analysis is by transcript, it is probably better to use the transcript table from gnomAD. Howver, gnomAD used ENSEMBL transcripts and we used RefSeq Transcripts. Can m...
github_jupyter
练习 1:求n个随机整数均值的平方根,整数范围在m与k之间。 ``` import random, math def test(): i = 0 total = 0 average = 0 number = random.randint(m, k) while i < n: i += 1 total += number number = random.randint(m, k) print('随机数是:', number) average = int(total/n) ret...
github_jupyter
<a href="https://colab.research.google.com/github/parthsaxena1909/Image-Classifer-using-CIFRA10/blob/master/CNN_Keras_imageClassfier.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import tensorflow as tf import os import numpy as np from matp...
github_jupyter
# Locality Sensitive Hashing ``` import numpy as np import pandas as pd from scipy.sparse import csr_matrix from sklearn.metrics.pairwise import pairwise_distances import time from copy import copy import matplotlib.pyplot as plt %matplotlib inline '''compute norm of a sparse vector Thanks to: Jaiyam Sharma''' def...
github_jupyter
# Classification ``` from nltk.corpus import reuters import spacy import re import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.preprocessing import MultiLabelBinarizer from sklearn.svm import LinearSVC from sklearn.multiclass import OneVsRestClassifier from sklearn.metrics imp...
github_jupyter
This notebook contains Hovmoller plots that compare the model output over many different depths to the results from the ORCA Buoy data. ``` import sys sys.path.append('/ocean/kflanaga/MEOPAR/analysis-keegan/notebooks/Tools') import numpy as np import matplotlib.pyplot as plt import os import pandas as pd import netCDF...
github_jupyter
``` import torch import torch.utils.data from torch.autograd import Variable import torch.nn as nn import torch.optim as optim import numpy as np import h5py from data_utils import get_data import matplotlib.pyplot as plt from solver_pytorch import Solver # Load data from all .mat files, combine them, eliminate EOG sig...
github_jupyter
``` from sklearn import datasets #sklearn é uma das lib mais utilizadas em ML, ela contém, além dos #datasets, várias outras funções úteis para a análise de dados # essa lib será sua amiga durante toda sua carreira import pandas as pd # importa a lib Pandas. Ess...
github_jupyter
# Blue Food Visualizing protein supply and how the practices generating that protein supply affect the ocean using a heirarchical relationship. Note that this is a parameterized widget; the specification passed to the API will not be renderable without the geostore identifier being inserted. *Author: Rachel Thoms <b...
github_jupyter
Rossler performance experiments ``` import numpy as np import torch import sys sys.path.append("../") import utils as utils import NMC as models import importlib ``` ## SVAM ``` # LiNGAM / SVAM performance with sparse data import warnings warnings.filterwarnings("ignore") for p in [10, 50]: perf = [] for i...
github_jupyter
#### Copyright 2019 The TensorFlow Hub Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` # Copyright 2019 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. #...
github_jupyter
# Polynomial Regression and Cross Validation For the first assignment we will do something that might seem familiar from *Probability Theory for Machine Learning*; try to fit a polynomial function to a provided dataset. Fitting a function is a quintessential example of *supervised learning*, specifically *regression*,...
github_jupyter
# Exploring Reddit with the pushshift API This notebook give you examples of how to use the pushshift API for querying Reddit data. * Pushshift doc: https://github.com/pushshift/api * FAQ about Pushshift: https://www.reddit.com/r/pushshift/comments/bcxguf/new_to_pushshift_read_this_faq/ ``` import requests import pa...
github_jupyter
# CME Smart Stream on Google Cloud Platform Tutorials ## Getting CME Binary Data from CME Smart Stream on Google Cloud Platform (GCP) This workbook demonstrates the ability to quickly use the CME Smart Stream on GCP solution. Through the examples, we will - Authenticate using GCP IAM information - Configure which CM...
github_jupyter
``` from __future__ import division %matplotlib inline import sys import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import scipy.io as io import pickle import scipy.stats SBJ = 'colin_test2' prj_dir = '/Volumes/hoycw_clust/PRJ_Error_eeg/'#'/Users/sheilasteiner/Desk...
github_jupyter
#### _Speech Processing Labs 2021: SIGNALS 1: Digital Signals: Sampling and Superposition_ ``` ## Run this first! %matplotlib inline import sys import matplotlib.pyplot as plt import numpy as np import cmath from matplotlib.animation import FuncAnimation from IPython.display import HTML plt.style.use('ggplot') from ...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np from collections import namedtuple class planet(): "A planet in our solar system" def __init__(self,semimajor,eccentricity): self.x = np.zeros(2) #x and y position self.v = np.zeros(2) #x and y velocity self.a_g = ...
github_jupyter
<img src="../../img/logo_amds.png" alt="Logo" style="width: 128px;"/> # AmsterdamUMCdb - Freely Accessible ICU Database version 1.0.2 March 2020 Copyright &copy; 2003-2020 Amsterdam UMC - Amsterdam Medical Data Science ## Sequential Organ Failure Assessment (SOFA) The sequential organ failure assessment score (SOF...
github_jupyter
<a href="https://colab.research.google.com/github/aubricot/computer_vision_with_eol_images/blob/master/object_detection_for_image_cropping/chiroptera/chiroptera_train_tf2_ssd_rcnn.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Train Tensorflow Fa...
github_jupyter
Copyright (c) 2021, 2022 Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ ## Unix Operations _Important: The ocifs SDK isn't a one-to-one adaptor of OCI Object Storage and UNIX filesystem operations. It's a set of convenient wrappings...
github_jupyter
## **Yolov3 Algorithm** ``` import struct import numpy as np import pandas as pd import os from keras.layers import Conv2D from keras.layers import Input from keras.layers import BatchNormalization from keras.layers import LeakyReLU from keras.layers import ZeroPadding2D from keras.layers import UpSampling2D from kera...
github_jupyter
``` ################################ NOTES ##############################ex # Lines of code that are to be excluded from the documentation are #ex # marked with `#ex` at the end of the line. #ex # #ex # To ensure ...
github_jupyter
<a href="https://colab.research.google.com/github/bluesky0960/AI_Study/blob/master/AutoEncoder_Conv(TensorFlow_2).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # 오토인코더 (TensorFlow 2) 텐서플로우 2에서 제공하는 고수준 API인 케라스를 이용해, 오토인코더(autoencoder)를 구현한다. * Go...
github_jupyter
# Content with notebooks You can also create content with Jupyter Notebooks. This means that you can include code blocks and their outputs in your book. ## Markdown + notebooks As it is markdown, you can embed images, HTML, etc into your posts! ![](https://myst-parser.readthedocs.io/en/latest/_static/logo.png) ![]...
github_jupyter
``` import numpy as np from datetime import datetime, timedelta import time # some probabilities should be dynamics, for example: # buying probability depends on the number of available items # listing probability increases if user has sold something in the past # probability of churn increases if user hasn't listed + ...
github_jupyter
# Introduction to Spark and Python Let's learn how to use Spark with Python by using the pyspark library! Make sure to view the video lecture explaining Spark and RDDs before continuing on with this code. This notebook will serve as reference code for the Big Data section of the course involving Amazon Web Services. ...
github_jupyter
# Recognize named entities on Twitter with LSTMs In this assignment, you will use a recurrent neural network to solve Named Entity Recognition (NER) problem. NER is a common task in natural language processing systems. It serves for extraction such entities from the text as persons, organizations, locations, etc. In t...
github_jupyter
<center><img src="http://www.exalumnos.usm.cl/wp-content/uploads/2015/06/Isotipo-Negro.gif" title="Title text" width="30%" /></center> <hr style="height:2px;border:none"/> <h1 align='center'> INF-398 Aprendizaje Automático </h1> <H3 align='center'> Tarea/Taller 1 </H3> <hr style="height:2px;border:none"/> # Temas *...
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
# "Monte Carlo 6: Off-Policy Control with Importance Sampling in Reinforcement Learning" > Find the optimal policy using Weighted Importance Sampling - toc: true - branch: master - badges: false - comments: true - hide: false - search_exclude: true - metadata_key1: metadata_value1 - metadata_key2: metadata_value2 - im...
github_jupyter
``` import pandas as pd from sklearn.model_selection import train_test_split ''' NOTE: This was done in Google Colab The data (Minimum Daily Temperatures Dataset) is from Jason Brownlee's "7 Time Series Datasets for Machine Learning" article: https://machinelearningmastery.com/time-series-datasets-for-machine-learnin...
github_jupyter
## This notebook: - Try deep learning method on content based filtering ---------------------- ### 1. Read files into dataframe ### 2. concat_prepare(f_df, w_df) - Concat f_21, w_21 ### 3. store_model(df) - only once for a new dataframe - Train a SentenceTransformer model - Save embedder, embeddings, and corpus ###...
github_jupyter
# GRANDMA/Kilonova-catcher --- KN-Mangrove The purpose of this notebook is to inspect the ZTF alerts that were selected by the Fink KN-Mangrove filter as potential Kilonova candidates in the period 2021/04/01 to 2021/08/31, and forwarded to the GRANDMA/Kilonova-catcher project for follow-up observations. With the oth...
github_jupyter
# The Perceptron ``` import mxnet as mx from mxnet import nd, autograd import matplotlib.pyplot as plt import numpy as np mx.random.seed(1) ``` ## A Separable Classification Problem ``` # generate fake data that is linearly separable with a margin epsilon given the data def getfake(samples, dimensions, epsilon): ...
github_jupyter
# Lecture 2: Introducing Python CSCI 1360E: Foundations for Informatics and Analytics ## Overview and Objectives In this lecture, I'll introduce the Python programming language and how to interact with it; aka, the proverbial [Hello, World!](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program) lecture. By the ...
github_jupyter
``` import numpy as np import itertools import math import scipy from scipy import spatial import matplotlib.pyplot as plt import matplotlib import matplotlib.patches as patches from matplotlib import animation from matplotlib import transforms from mpl_toolkits.axes_grid1 import make_axes_locatable import xarray as xr...
github_jupyter
<a href="https://colab.research.google.com/github/JaccoVeldscholten/SmartDispenser/blob/main/BAVA_Temp_Predictions.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <div> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABpQAAAIHCAYAAACR5L9TAAAA...
github_jupyter
## 1. The World Bank's international debt data <p>It's not that we humans only take debts to manage our necessities. A country may also take debt to manage its economy. For example, infrastructure spending is one costly ingredient required for a country's citizens to lead comfortable lives. <a href="https://www.worldba...
github_jupyter
``` import pandas as pd import numpy as np HUES64_rep1_tfxn1_fs = ["../../../data/02__mpra/01__counts/07__HUES64_rep6_lib1_BARCODES.txt", "../../../data/02__mpra/01__counts/07__HUES64_rep6_lib2_BARCODES.txt"] HUES64_rep1_tfxn2_fs = ["../../../data/02__mpra/01__counts/08__HUES64_rep7_lib1_BARCODE...
github_jupyter
# Preparing and loading your data This tutorial introduces how SchNetPack stores and loads data. Before we can start training neural networks with SchNetPack, we need to prepare our data. This is because SchNetPack has to stream the reference data from disk during training in order to be able to handle large datasets. ...
github_jupyter
``` ### ATOC5860 Application Lab #6 - supervised machine learning ### Coded by Eleanor Middlemas (Jupiter, formerly University of Colorado, elmiddlemas at gmail.com) ### Additional code/commenting by Jennifer Kay (University of Colorado) ### Last updated April 6, 2022 import pandas as pd import numpy as np import dat...
github_jupyter
# Q-PART C-15 ``` from pulp import * import pyomo.environ as pe import logging logging.getLogger('pyomo.core').setLevel(logging.ERROR) from pyomo.environ import * from math import pi import warnings warnings.filterwarnings('ignore') m = ConcreteModel() m.a = pe.Set(initialize=[1, 2, 3, 4]) m.demand = pe.Var(m.a, bou...
github_jupyter
# Building our operators: the Face Divergence The divergence is the integral of a flux through a closed surface as that enclosed volume shrinks to a point. Since we have discretized and no longer have continuous functions, we cannot fully take the limit to a point; instead, we approximate it around some (finite!) volu...
github_jupyter
# Synthetic seismogram This notebook looks at the convolutional model of a seismic trace. For a fuller example, see [Bianco, E (2004)](https://github.com/seg/tutorials-2014/blob/master/1406_Make_a_synthetic/how_to_make_synthetic.ipynb) in *The Leading Edge*. First, the usual preliminaries. ``` import numpy as np im...
github_jupyter
<a href="https://colab.research.google.com/github/Serbeld/RX-COVID-19/blob/master/Detection5C_NormNew_v2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !pip install lime from tensorflow.keras.preprocessing.image import ImageDataGenerator from t...
github_jupyter
# Models selection Maintenant que nous avons créé des features grâce à l'étude du domaine métier et à l'EDA, et que nous les avons sélectionnées grâce à Boruta, nous pouvons passer à la phase de sélection du ou des modèles les plus adaptées à notre dataset. L'EDA soulève quelques interrogations à ce sujet mais le mei...
github_jupyter
_Lambda School Data Science — Tree Ensembles_ # Decision Trees ### Links - A Visual Introduction to Machine Learning, [Part 1: A Decision Tree](http://www.r2d3.us/visual-intro-to-machine-learning-part-1/), and [Part 2: Bias and Variance](http://www.r2d3.us/visual-intro-to-machine-learning-part-2/) - [Decision Trees...
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
# RidgeRegression with Scale & Power Transformer This Code template is for the regression analysis using simple Ridge Regression with Feature Rescaling technique Scale and Feature Transformation technique PowerTransformer in a pipeline. Ridge Regression is also known as Tikhonov regularization. ### Required Packages...
github_jupyter
# Understanding Principal Component Analysis **Outline** * [Introduction](#intro) * [Assumption and derivation](#derive) * [PCA Example](#example) * [PCA Usage](#usage) ``` %load_ext watermark %matplotlib inline # %config InlineBackend.figure_format='retina' from matplotlib import pyplot as plt import pandas as pd ...
github_jupyter
# Chatbot using Seq2Seq LSTM models In this notebook, we will assemble a seq2seq LSTM model using Keras Functional API to create a working Chatbot which would answer questions asked to it. Chatbots have become applications themselves. You can choose the field or stream and gather data regarding various questions. We c...
github_jupyter
``` from config import * import mPyPl as mp from mPyPl.utils.flowutils import * from mpyplx import * from pipe import Pipe from functools import partial import numpy as np import cv2 import itertools from moviepy.editor import * import pickle import functools from config import * test_names = ( from_json(os.path....
github_jupyter
``` #default_exp torch_core #export from local.test import * from local.imports import * from local.torch_imports import * from local.core import * from local.notebook.showdoc import show_doc #export if torch.cuda.is_available(): torch.cuda.set_device(int(os.environ.get('DEFAULT_GPU') or 0)) ``` # Torch Core > Basic ...
github_jupyter
# COMP551: Project 4 ``` import pandas as pd import torch import torchvision from PIL import Image import torchvision.transforms as transforms import numpy as np from torch.utils.data import DataLoader, Dataset, TensorDataset # Load the Drive helper and mount from google.colab import drive # This will prompt for auth...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W2D4_DynamicNetworks/W2D4_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 1: Neural Rate Models **Week 2, Day 4: Dynamic Ne...
github_jupyter
# Find \*.tifs with no matching \*.jpg #### Created on Cinco de Mayo in 2020 by Jeremy Moore and David Armstrong to identify \*.tif images that don't have a matching \*.jpg image for the Asian Art Museum of San Francisco 1. Manually set root_dir_path to the full path of the directory containing your *all_jpgs* and *a...
github_jupyter
# Computer Vision Nanodegree ## Project: Image Captioning --- In this notebook, you will learn how to load and pre-process data from the [COCO dataset](http://cocodataset.org/#home). You will also design a CNN-RNN model for automatically generating image captions. Note that **any amendments that you make to this no...
github_jupyter
# Automated Machine Learning **Continuous retraining using Pipelines and Time-Series TabularDataset** ## Contents 1. [Introduction](#Introduction) 2. [Setup](#Setup) 3. [Compute](#Compute) 4. [Run Configuration](#Run-Configuration) 5. [Data Ingestion Pipeline](#Data-Ingestion-Pipeline) 6. [Training Pipeline](#Training...
github_jupyter
<a href="https://colab.research.google.com/github/pingao2019/DS-Unit-2-Kaggle-Challenge/blob/master/h3Copy_of_LS_DS_223_assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Lambda School Data Science *Unit 2, Sprint 2, Module 3* --- # Cross...
github_jupyter