text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# COVID-19 exploratory data analysis
ver. A.L. 20200512
**Slightly modified from Greg Rafferty's** https://github.com/raffg/covid-19; <br>see also his
dashboard to monitor the COVID-19 pandemic https://covid-19-raffg.herokuapp.com and his [portfolio](https://github.com/raffg/portfolio/blob/master/README.md)
### Use... | github_jupyter |
# Script to create vector tiles for direct usage in LPVIS
- Input: AMA produced shapefiles with parcels and physical blocks downloaded from https://www.data.gv.at/katalog/dataset/invekos-schlaege-oesterreich/resource/26e5b6c4-6e47-45d3-ac65-728c631fd515 and https://www.data.gv.at/katalog/dataset/invekos-referenzen-oest... | github_jupyter |
# Maximum Likelihood and Maximum A Posterior
* We looked at the regularization term as a *penalty* term in the objective function. There is another way to interpret the regularization term as well. Specifically, there is a *Bayesian* interpretation.
\begin{eqnarray}
\min E^{\ast}(\mathbf{w}) &=& \max -E^{\ast}(\ma... | github_jupyter |
# Collaborative filtering
> Using the fastai library for collaborative filtering.
```
from fastai2.tabular.all import *
from fastai2.collab import *
# all_slow
```
This tutorial highlights how quickly build a `Learner` and train a model on collaborative filtering tasks.
## Training a model
For this tutorial, we wi... | github_jupyter |
```
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
```
# Summary
## scikit-learn API
``X`` : data, 2d numpy array or scipy sparse matrix of shape (n_samples, n_features)
``y`` : targets, 1d numpy array of shape (n_samples,)
<table>
<tr style="border:None; font-size:20px; padding:10px;"><th c... | github_jupyter |
# Build and deploy the docker container
Ensure this notebook is running above the "container" folder containing the dockerfile.
```
%%sh
# The name of our algorithm
algorithm_name=sagemaker-word2vec
cd container
chmod +x decision_trees/train
chmod +x decision_trees/serve
account=$(aws sts get-caller-identity --que... | github_jupyter |
```
print('Hello world')
from IPython.display import Image
from IPython.core.display import HTML
```
# Tervetuloa opintojaksolle Johdanto datatieteeseen
Tiedot opintojakson suorittamisesta löytyy <a href="https://jodatut.github.io/2020/">GitHub:sta</a>.
Luennoijana toimii <a href="https://www.tuni.fi/fi/jukka-huhtam... | 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 |
# Generative Adversarial Network
In this notebook, we'll be building a generative adversarial network (GAN) trained on the MNIST dataset. From this, we'll be able to generate new handwritten digits!
GANs were [first reported on](https://arxiv.org/abs/1406.2661) in 2014 from Ian Goodfellow and others in Yoshua Bengio'... | github_jupyter |
# Creates transformation files
This notebook creates the transformation files from raw MRI space to normalized SPM space
# Imports
```
import sys
import os
```
The following line permits to import deep_folding even if this notebook is executed from the notebooks subfolder (and no install has been launched):
/note... | github_jupyter |
# Lists and Tuples
## Lists Recap
A list is a sequence of values. These values can be anything: strings, numbers, booleans, even other lists.
To make a list you put the items separated by commas between brackets []
```
sushi_order = ['unagi', 'hamachi', 'otoro']
prices = [6.50, 5.50, 15.75]
print(sushi_order)
print... | github_jupyter |
# Tokenizing text
```
from nb_200 import *
```
## Preprocessing the dataset
```
path = untar_data(URLs.IMDB)
# export
from multiprocessing import Process, Queue
import spacy,html
from spacy.symbols import ORTH
from fastprogress import progress_bar,master_bar
import pickle,random
```
Before even tokenizing, we will ... | github_jupyter |
# T81-558: Applications of Deep Neural Networks
**Module 4: Training for Tabular Data**
* Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), McKelvey School of Engineering, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx)
* For more information visit the [clas... | github_jupyter |
### Introduction
This script finds the optimal band gaps of mechanical stack III-V-Si solar cells. I uses a detailed balance approach to calculate the I-V of individual subcells. For calculating efficiency, I add up the maximum power of individual subcell and divide it by the total illumination power.
Details of how th... | github_jupyter |
# Import Packages
```
import warnings
warnings.filterwarnings("ignore")
#Basic
import pandas as pd
import gensim
import nltk
import re
import numpy as np
import math
import rpy2.robjects as robjects
from rpy2.robjects import pandas2ri
import rpy2.robjects.packages as rpackages
#For Visualization
import matplotlib.py... | github_jupyter |
### Please read the 'Model Test' section in `verifyml/DEVELOPMENT.md` before going through this notebook.
Toy example that shows how a new model test can be created and used.
```
"""ListLength test - test passed if the length of a given list is greater than a specified threshold"""
from __future__ import annotations... | github_jupyter |
# Water heating
An insulated, rigid tank contains 4 kg of water at 100 kPa, where initially 0.25 of the mass is liquid. An electric heater turns on and operates until all of the liquid has vaporized. (Neglect the heat capacity of the tank and heater.)

**Problem:**
- De... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import numpy as np
import seaborn as sns
import itertools
import matplotlib as mpl
import matplotlib.pyplot as plt
rc={'font.size': 10, 'axes.labelsize': 10, 'legend.fontsize': 10.0,
'axes.titlesize': 32, 'xtick.labelsize': 20, 'ytick.labelsize': 16}
plt.rcParams.update(**... | github_jupyter |
```
from sklearn.model_selection import cross_val_score, cross_val_predict, GridSearchCV, train_test_split
from sklearn.metrics import precision_score, recall_score, f1_score, classification_report
import pandas as pd
import numpy as np
from time import time
from sklearn.preprocessing import MinMaxScaler
from sklearn.... | github_jupyter |
# Salary recommandation using a score
Author: Florian Gauthier
The purpose of this Notebook is to find the best score in order to select the optimal salary change in the salary-based recommendation.
The best score will be the one that allows the best compromise between a salary decrease and a raise in job offers, ... | github_jupyter |
<center> <font size=5> <h1>Define working environment</h1> </font> </center>
The following cells are used to:
- Import needed libraries
- Set the environment variables for Python, Anaconda, GRASS GIS and R statistical computing
- Define the ["GRASSDATA" folder](https://grass.osgeo.org/grass73/manuals/helptext.html),... | github_jupyter |
### Imports
```
import torch
from tqdm import tqdm
import numpy as np
from rdkit import Chem
from rdkit import RDLogger
RDLogger.DisableLog('rdApp.*')
from rdkit.Chem... | github_jupyter |
# SLE-GAN

This example demonstrates [SLE-GAN](https://arxiv.org/abs/2101.04775), which learns to generate images from small datasets.
# Preparation
Let's start by installing nnabla and accessing [nnabl... | github_jupyter |
# Automatic peak finding and calibration tools in Becquerel
`Becquerel` contains tools for obtaining a rough first calibration for an uncalibrated `Spectrum`.
First, some imports:
```
%matplotlib inline
import os
import matplotlib.pyplot as plt
import numpy as np
import becquerel as bq
```
Also some function defini... | github_jupyter |
# Adadelta
:label:`sec_adadelta`
Adadelta是AdaGrad的另一种变体( :numref:`sec_adagrad`),
主要区别在于前者减少了学习率适应坐标的数量。
此外,广义上Adadelta被称为没有学习率,因为它使用变化量本身作为未来变化的校准。
Adadelta算法是在 :cite:`Zeiler.2012`中提出的。
## Adadelta算法
简而言之,Adadelta使用两个状态变量,$\mathbf{s}_t$用于存储梯度二阶导数的漏平均值,$\Delta\mathbf{x}_t$用于存储模型本身中参数变化二阶导数的泄露平均值。请注意,为了与其他出版物和实现的兼容性,... | github_jupyter |
# k-Nearest Neighbor (kNN) exercise
*Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For more details see the [assignments page](http://vision.stanford.edu/teaching/cs231n/assignments.html) on the course website.*
... | github_jupyter |
## ISA Create - Sample Assay Plan as a Graph: Mass Spectrometry
Here I am showing how from a JSON-like dictionary describing an MS experiment you can create a full SampleAssayPlan as a graph and visualize how this looks like
```
from isatools.model import *
from isatools.create.models import *
import networkx as nx
im... | github_jupyter |
### Introduction
An example of implementing the Metapath2Vec representation learning algorithm using components from the `stellargraph` and `gensim` libraries.
**References**
**1.** Metapath2Vec: Scalable Representation Learning for Heterogeneous Networks. Yuxiao Dong, Nitesh V. Chawla, and Ananthram Swami. ACM SIG... | github_jupyter |
# Using Astropy Quantities and Units for astrophysical calculations
## Authors
Ana Bonaca, Erik Tollerud, Jonathan Foster, Lia Corrales, Kris Stern, Stephanie T. Douglas
## Learning Goals
* Use `Quantity` objects to estimate a hypothetical galaxy's mass
* Take advantage of constants in the `astropy.constants` library... | github_jupyter |
# Regularization
欢迎来到这次的算法优化实验,我们知道过拟合是深度学习训练中十分常见的问题,解决该问题的办法有许多中,例如增加数据量、Dropout、Regularization等方法,在本实验中你将会使用Regularization正则化的方式来优化我们的模型,解决过拟合问题。
## 1 - 引用库
首先,载入几个需要用到的库:
```
import numpy as np
import matplotlib.pyplot as plt
from reg_utils import sigmoid, relu, plot_decision_boundary, initialize_parameters, lo... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/drive')
import torch.nn as nn
import torch.nn.functional as F
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import Dataset, DataLoader
fro... | github_jupyter |
#### Objective
In this notebook I introduce a function to despike logs using rolling statistics to define the what constitutes a spike, and what does not.
I will apply the despiking to the P-wave velocity from one of the wells already used in the [Backusfrom dataframe notebook](https://github.com/mycarta/in-bruges/bl... | github_jupyter |
# Training Roboschool agents using distributed RL training across multiple nodes with Amazon SageMaker
This notebook is an extension of `rl_roboschool_ray.ipynb` showcasing horizontal scaling of Reinforcement learning using Ray and TensorFlow.
## Pick which Roboschool problem to solve
Roboschool is an [open source](... | github_jupyter |
# Get patients image size and mask boundings into CSV
* Each script uses only a single GPU, so we will distribute patients among shards in order to distribute or paralellize execution
* For each shard, duplicate this script, set a unique SHARD_ID and execute it
* This script:
* Creates a directory named "patients-[s... | github_jupyter |
# Sharp edges in Differentiable Swift
Differentiable Swift has come a long way in terms of usability. Here is a heads-up about the parts that are still a little un-obvious. As progress continues, this guide will become smaller and smaller, and you'll be able to write differentiable code without needing special syntax.
... | github_jupyter |
## About how to train your own dataset
It's optional to use lmdb format or ordinary format.
### Ordinary format
Please copy the code of '/data/BSD/py' to create your dataset file '[dataset].py' and modify '\_generate_samples()' function according to your directory structure.
### Lmdb format
Here, we take GOPRO-DS ... | github_jupyter |
# Linear regression with Variational Bayes
### Imports
```
import matplotlib.pyplot as plt
%matplotlib notebook
import numpy as np
from scipy.stats import multivariate_normal
```
### Define model and generate data
```
N = 10 # No. data points
w0 = 1. # The offset in the line y = w0 + w1 * x
w1 = .5 # The inc... | github_jupyter |
```
import json
import numpy as np
import sys
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
from scipy import stats
import pandas as pd
from tqdm import tqdm
from itertools import islice
from nltk.corpus import stopwords
from sklearn.manifold import TSNE
from sklearn.decomposition... | github_jupyter |

# Ejercicios Python Basics II
## Ejercicio 1
* Crea dos variables numericas: un `int` y un `float`
* Comprueba sus tipos
* Sumalas en otra nueva
* ¿De qué tipo es la nueva variable?
* Elimina las dos primeras variables creadas
```
var1 = 4
var2 = 6.0
print(type(var1))
print(t... | github_jupyter |
# Chapter 5 - Image Classification
> Deep Learning For Coders with fastai & Pytorch - Image Classification, In this notebook I followed both Jeremy Howard's Lesson on fast.ai and Weigh and Biases reading group videos. Lots of notes added, some cell's order changed some are added to make the topic more understandable fo... | github_jupyter |
# CNN WITH TF-SLIM
#### ALL CODES ARE FROM [HWALSUKLEE](https://github.com/hwalsuklee/tensorflow-mnist-cnn)
```
import gzip
import os
from scipy import ndimage
from six.moves import urllib
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
print ("PACKAGES LOADED")
```
# CNN MODEL WITH ... | github_jupyter |
### Tokenize and Lemmatize inputs
Source: lecture notebooks + https://gist.github.com/4OH4/f727af7dfc0e6bb0f26d2ea41d89ee55
```
import pandas as pd
import json
from sklearn.feature_extraction.text import CountVectorizer
import nltk
from nltk import word_tokenize
from nltk.stem import WordNetLemmatizer
from... | github_jupyter |
# Processing Oscilloscope Point Scan
The samples from our oscilloscope connected to our microphone (since our sound card doesn't support going up to 28kHz) will be useful for visualizing the acoustics of our system.
We will have to know beforehand which frequency we want to detect.
This depends on the oscilloscope set... | github_jupyter |
## Concept
The two main structures to work with DQ0 quarantine via the DQ0 SDK are
* Project - the current model environment, a workspace and directory the user can define models in. Project also provides access to trained models.
* Experiment - the DQ0 runtime to execute training runs in the remote quarantine.
Start ... | github_jupyter |
## 读取数据
```
import pandas as pd
train_labeled_cn = pd.read_csv('../data/raw/cn_train.csv', encoding='utf-8')
dev_cn = pd.read_csv('../data/raw/cn_dev.csv', encoding='utf-8')
train_labeled_cn.shape
train_labeled_cn.columns
train_labeled_cn.head(5)
```
## 统计重复的句子
```
dup_sentence = train_labeled_cn[train_labeled_cn['... | github_jupyter |
# Labeled Stream Creator
## Environment
```
import nuclio
import os
base_path = os.path.abspath('../')
base_stream_path = f'/users/' + os.environ['V3IO_USERNAME']+ f'{base_path[5:]}'
data_path = os.path.join(base_path, 'data')
src_path = os.path.join(base_path, 'src')
streaming_path = os.path.join(base_stream_path, ... | github_jupyter |
*This notebook assumes to be launched inside the source root and it uses relative path to obtain other resources.*
Test MapD->PyGDF->matrix
```
PWD = !pwd
import sys
import os.path
from pprint import pprint
```
Add import path to MapD Thrift binding and Arrow schema
```
thirdparty_path = os.path.join(PWD[0], '..', ... | github_jupyter |
# Geometries
Geometry entities are child elements of `<visual>` or `<collision>` elements.
```
# Import the element creator
from pcg_gazebo.parsers.sdf import create_sdf_element
```
## Basic entities
Demonstration of the basic SDF elements that can be generated with and without the optional parameters.
### Geometri... | github_jupyter |
# Gym Crowdedness Analysis with PCA
> # Objective :
To **predict** how crowded a university gym would be at a given time of day (and some other features, including weather)
> # Data Decription :
The dataset consists of 26,000 people counts (about every 10 minutes) over one year. The dataset also contains informatio... | github_jupyter |
### does training on clinvar predict disease better than single mpc? - rasopathies (noonan syndrome)
* rm testing data from clinvar
```
import pandas as pd
import numpy
from scipy.stats import entropy
import pydot, pydotplus, graphviz
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
from ... | github_jupyter |
## Installieren aller Pakete
```
import warnings
warnings.filterwarnings('ignore')
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
!pip3 install -r ../requirements.txt
import torch
from torch import nn
from torchvision import transforms as T
from PIL import Image
import numpy as np
from pathlib import Path
from c... | github_jupyter |
# Summary of the extracted data
This notebook contains the code to perform a summary of the initial tweets extracted.
It includes:
- number of user
- number of tweets per user (average)
- barplot with tweets per year and category
- pie chart with % of tweets per category
**Note that to obtain these numbers and perf... | github_jupyter |
## Author : Syed Arsalan Amin
## Data Science and Business Intelligence Internship - The Sparks Foundation
### Task-2 : Prediction using Unsupervised ML (K-means clustering)
From the given ‘Iris’ dataset, predict the optimum number of clusters
and represent it visually.
#### Github repository : [DataScience-and-Busines... | github_jupyter |
# Introduction
If you think quantum mechanics sounds challenging, you are not alone. All of our intuitions are based on day-to-day experiences, and so are better at understanding the behavior of balls and bananas than atoms or electrons. Though quantum objects can seem random and chaotic at first, they just follow a d... | github_jupyter |
# Scientific Thinking
> <p><small><small>Copyright 2021 DeepMind Technologies Limited.</p>
> <p><small><small> 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 </p>
> <p><small><small> <a href="https... | github_jupyter |
```
from zipline import run_algorithm
from zipline.api import order_target_percent, symbol, order, record
from datetime import datetime
import pytz
import matplotlib.pyplot as plt
from trading_calendars.exchange_calendar_binance import BinanceExchangeCalendar
import pandas as pd
from trading_calendars import get_calend... | github_jupyter |
# Simulation to extend Hanna & Olken (2018)
## Universal Basic Incomes versus Targeted Transfers: Anti-Poverty Programs in Developing Countries
Consider different budget levels, and a mix of UBI and targeted transfers.
Simulation notebook.
## Setup
```
def import_or_install(package, pip_install=None):
""" Try t... | github_jupyter |
# Harmonizome ETL: BioGPS (Human Cell Line)
Created by: Charles Dai <br>
Credit to: Moshe Silverstein
Data Source: http://biogps.org/downloads/
```
# appyter init
from appyter import magic
magic.init(lambda _=globals: _())
import sys
import os
from datetime import date
import numpy as np
import pandas as pd
impor... | github_jupyter |
# Deterministic methods
## Point estimates
If we just want to find the parameter value that maximizes the posterior probability, we can just use numerical optimization over $p(y \mid \theta)p(\theta)$. The value found is known as the Maximum a Posteriori (or MAP), and is the Bayesian counterpart of the Maximum Likeli... | github_jupyter |
```
%matplotlib inline
import matplotlib.pyplot as plt
import fitsio as ft
import numpy as np
import sys
sys.path.append('/Users/mehdi/github/LSSutils')
from LSSutils import utils, catalogs
nside= 128
data = ft.read(f'/Users/mehdi/Dropbox/LRG_density_maps/heapix_map_lrg_ir_nominal_20191024_clean_combined_{nside}.fits',... | 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 |
# Comparing drift detectors
We take the image classifier example and use it to compare drift detectors.
We will give an opinionated take here. This is not to take shots at the research that enables TorchDrift, but reflects that the typical application in the wild may be dissimilar to the systematic, controlled experi... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
data = pd.read_csv('TSLA.csv')
data.head()
plt.figure(figsize=(12,8))
plt.plot(data['Open'], color='blue', label='Tesla Open Stock Price')
plt.title('Tesla Stock Market Open Price vs Time')
plt.xlabel('Date')
plt.ylabel('Tesla Stock Pric... | github_jupyter |
# Name
Gather training data by querying BigQuery
# Labels
GCP, BigQuery, Kubeflow, Pipeline
# Summary
A Kubeflow Pipeline component to submit a query to BigQuery and store the result in a Cloud Storage bucket.
# Details
## Intended use
Use this Kubeflow component to:
* Select training data by submitting ... | github_jupyter |
```
import pandas as pd
#Loading data from Github repository
filename = 'https://raw.githubusercontent.com/PacktWorkshops/The-Data-Science-Workshop/master/Chapter16/Dataset/processed.cleveland.data'
# Loading the data using pandas
heartData = pd.read_csv(filename,sep=",",header = None,na_values = "?")
heartData.head(... | github_jupyter |
## Import
```
# Matplotlib
import matplotlib.pyplot as plt
# Tensorflow
import tensorflow as tf
# Numpy and Pandas
import numpy as np
import pandas as pd
# Ohter import
import sys
from sklearn.preprocessing import StandardScaler
```
## Be sure to used Tensorflow 2.0
```
assert hasattr(tf, "function") # Be sure to ... | github_jupyter |
# Amazon Augmented AI (Amazon A2I) integration with Tabular Data [Example]
1. [Introduction](#Introduction)
2. [Prerequisites](#Prerequisites)
1. [Workteam](#Workteam)
2. [Permissions](#Notebook-Permission)
3. [Client Setup](#Client-Setup)
4. [Create Control Plane Resources](#Create-Control-Plane-Resources)
... | github_jupyter |
<a href="https://colab.research.google.com/github/google/applied-machine-learning-intensive/blob/master/content/00_prerequisites/01_intermediate_python/00-objects.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#### Copyright 2019 Google LLC.
```
#... | github_jupyter |
```
import numpy as np
import librosa
import glob
import os
from random import randint
import torch
import torch.nn as nn
from torch.utils import data
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.data import sampler
import matplotlib.pyplot as plt
%matplotlib inline
import torch... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Deep Learning
## Project: Build a Traffic Sign Recognition Classifier
In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is required that cannot be included i... | github_jupyter |
<img src="https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left">
# _*Exercises*_
The latest version of this notebook is available on https... | github_jupyter |
# LassoLars with Quantile Transformer
This Code template is for the regression analysis using a simple LassoLars Regression with Feature Transformation technique QuantileTransformer in a pipeline. It is a lasso model implemented using the LARS algorithm.
### Required Packages
```
import warnings
import numpy as np ... | github_jupyter |
This notebook contains a short guide on using the solvers w/o backprop or computing gradients. Some issues of interest include:
1. How to define and solve SDEs with this codebase
1. How to run things on a GPU
1. How to gain control over the randomness and enforce deterministic behavior with fixed seeds (e.g. when testi... | github_jupyter |
# Batch Scoring on IBM Cloud Pak for Data (ICP4D)
We are going to use this notebook to create and/or run a batch scoring job against a model that has previously been created and deployed to the Watson Machine Learning (WML) instance on Cloud Pak for Data (CP4D).
## 1.0 Install required packages
There are a couple o... | github_jupyter |
<a href="https://www.pieriandata.com"><img src="../Pierian_Data_Logo.PNG"></a>
<strong><center>Copyright by Pierian Data Inc.</center></strong>
<strong><center>Created by Jose Marcial Portilla.</center></strong>
# Convolutional Neural Networks for Image Classification
```
import pandas as pd
import numpy as np
from t... | github_jupyter |
```
import os
import json
import random
import re
## S3 Access
import boto3
from sagemaker import get_execution_role
role = get_execution_role()
bucket='devopstar'
data_key = 'resources/fbmsg-analysis-gpt-2/facebook.zip'
s3 = boto3.resource('s3')
with open('facebook.zip', 'wb') as data:
s3.Bucket(bucket).download_... | github_jupyter |
# Augmentations in NLP
Data Augmentation techniques in NLP show substantial improvements on datasets with less than 500 observations, as illustrated by the original paper.
https://arxiv.org/abs/1901.11196
The Paper Considered here is EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classifica... | github_jupyter |
# Variational Quantum Regression
$$
\newcommand{\ket}[1]{\left|{#1}\right\rangle}
\newcommand{\bra}[1]{\left\langle{#1}\right|}
\newcommand{\braket}[2]{\left\langle{#1}\middle|{#2}\right\rangle}
$$
## Introduction
Here we create a protocol for linear regression which can exploit the properties of a quantum computer.... | github_jupyter |
# Cyberbullying model using XGBoost, Random Forest and SVC
```
import pandas as pd
import numpy as np
import string
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
from nltk.corpus import wordnet
from nltk import pos_tag
from nltk.tokenize import word_tokenize
from sklearn.feature... | github_jupyter |
```
import cupy as cp
import cusignal
from scipy import signal
import numpy as np
```
### Generate Sinusodial Signals with N Carriers
**On CPU where**:
* fs = sample rate of signal
* freq = list of carrier frequencies
* N = number of points in signal
```
def cpu_gen_signal(fs, freq, N):
T = 1/fs
sig = 0
... | github_jupyter |
# Node elevations and edge grades
Author: [Geoff Boeing](https://geoffboeing.com/)
- [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)
- [GitHub repo](https://github.com/gboeing/osmnx)
- [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)
- [Documentation](h... | github_jupyter |
# Bayesian Estimation Supersedes the T-Test
```
%matplotlib inline
import numpy as np
import pymc3 as pm
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn-darkgrid')
print('Running on PyMC3 v{}'.format(pm.__version__))
```
This model replicates the example used in:
Kruschke, John. (2012) **Ba... | github_jupyter |
# MSTICpy - Data Uploaders
### Description
This notebook provides a guided example of using the Log Analytics and Splunk Data Uploader included with MSTICpy.<br><br>
Contents:
- How to instanciate Uploaders
- Uploading DataFrames
- Uploading Files
- Uploading Folders
```
#Setup
from msticpy.nbtools import nbinit
extr... | github_jupyter |
# Vocabulary Tree for Image Descriptors with Binary Descriptors
## Introduction
This notebook describes how to implement a scalable image search with vocabulary tree.
The work is largerly based on the article: **Scalable Recognition with a vocabulary tree**, David Nister and Henrik Stewenius
link to paper: http://ww... | github_jupyter |
# Machine Learning
Machine learning is the application of algorithms to extract information from datasets by way of understanding it. This "understanding" usually means fitting a model on the dataset. It overlaps considerably with data mining, where one is usually more concerned with getting the information than with ... | github_jupyter |
# Example Object-Oriented Access to the PEST Control File
The `pst_handler` module with `pyemu.pst` contains the `Pst` class for dealing with pest control files. It relies heavily on `pandas` to deal with tabular sections, such as parameters, observations, and prior information. This jupyter notebook shows how to cr... | github_jupyter |
# [ATM 623: Climate Modeling](../index.ipynb)
[Brian E. J. Rose](http://www.atmos.albany.edu/facstaff/brose/index.html), University at Albany
# Lecture 7: Elementary greenhouse models
## Warning: content out of date and not maintained
You really should be looking at [The Climate Laboratory book](https://brian-rose.... | github_jupyter |
Using pickle to predict unknown data.
```
#Main program
#clean the memory
#in ipython
%reset -f
#in python
import gc
gc.collect()
# data analysis and wrangling
import pandas as pd
import numpy as np
import random as rnd
from scipy import stats
# visualization
import seaborn as sns
import matplotlib.pyplot as plt
... | github_jupyter |
# <b>Object Detection with AutoML Vision</b>
<br>
## <b>Learning Objectives</b> ##
1. Learn how to create and import an image dataset to AutoML Vision
1. Learn how to train an AutoML object detection model
1. Learn how to evaluate a model trained with AutoML
1. Learn how to deploy a model trained with AutoML
1. Learn... | github_jupyter |
```
# Copyright 2021 NVIDIA Corporation. 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | github_jupyter |
# Import libs
```
import sys
import os
sys.path.append('..')
from eflow.foundation import DataPipeline,DataFrameTypes
from eflow.data_analysis import FeatureAnalysis, NullAnalysis
from eflow.model_analysis import ClassificationAnalysis
from eflow.data_pipeline_segments import FeatureTransformer, DataEncoder
from eflow... | github_jupyter |
# Dataset tests of Autometacal Proof-of-Concept
This is a modified version of the Fourier proof-of-concept notebook that repeats the same steps, side by side with the original nb and an example from the dataset.
The database example has:
- example['gal_image'] # the observation of the galaxy, convolved with the psf... | github_jupyter |
# Digit Classification using Naive Bayes, Random Forest and SVM
### - Yash Pasar
#### This project deals with predicting handwritten digits by building classifiers using Naive Bayes, K-Nearest Neighbor and Support Vec... | github_jupyter |
```
# https://raw.githubusercontent.com/fchollet/keras/master/examples/lstm_text_generation.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# tensorflow
import tensorflow as tf
import tensorflow.contrib.rnn as rnn
import tensorflow.contrib.learn as tflear... | github_jupyter |
## Model 1: Policy simulation
The objective of this model-based simulation is to analyse the impact of policy, technology, and commodity changes on consumer price inflation in selected countries. The simulation environment is learnt from real data, after which simulations using synthetic data are used to do policy ana... | github_jupyter |
<a href="https://colab.research.google.com/github/camminady/sPYnning/blob/master/visworld_colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
!pip install randomcolor
import randomcolor # see: https://pypi.org/project/randomcolor/
!pip instal... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Terrain/srtm.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" href="... | github_jupyter |
## Image classification vs Object detection vs Image segmentation
<img src="https://media.discordapp.net/attachments/763819251249184789/857822034045567016/image.png">
<br><br>
## Image annotation: assigning labels
<br>
## Popular datasets: ImageNet, COCO, Google Open Images
## Tensorflow hub has pre-train models
## ... | github_jupyter |
```
import pandas as pd
import numpy as np
import itertools as it
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.patheffects as path_effects
import matplotlib.ticker as mtick
pd.set_option('display.max_columns',50)
plt.rc('axes', axisbelow=True)
plt.rcParams['figure.facecolor'] = 'white'
plt... | github_jupyter |
```
from sklearn.ensemble import VotingClassifier
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model.stochastic_gradient import SGDClassifier
from sklearn.metrics import accuracy_score
from sklearn.model_selection import cross_val_score
from s... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.