text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
import pandas as pd
import numpy as np
import json
import datetime
import re
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import glob
pd.options.display.max_rows = 200
sns.set_style('whitegrid')
plt.style.use('Cole_2018.mplstyle')
```
# 1. Load raw data
### 1a. comments
```
df = pd... | github_jupyter |
## Dependencies
```
import json, warnings, shutil
from scripts_step_lr_schedulers import *
from tweet_utility_scripts import *
from tweet_utility_preprocess_roberta_scripts import *
from transformers import TFRobertaModel, RobertaConfig
from tokenizers import ByteLevelBPETokenizer
from tensorflow.keras.models import M... | github_jupyter |

[](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/streamlit_notebooks/GRAMMAR_EN.ipynb)
# **Extract Part of speech tags and p... | github_jupyter |
# The New Bechdel test!
Analysis on the new Bechdel test using the Cornell Movie-Dialog Corpus
## Sentiment analysis on the movie dialogues corpus
Sentiment Analysis happens at various levels:
1. Document-level Sentiment Analysis evaluate sentiment of a single entity (i.e. a product) from a review document.
2. Senten... | github_jupyter |
This is the installation guide to:
1. Install an IDE that is capable of compiling executing Python code. The IDE here is Jupyter Notebook.
2. Install the latest version of Tensorflow as well as other required packages for data science, machine learning and deep learning. As a disclaimer, the current latest version of T... | github_jupyter |
# 第5章 ロジスティック回帰とROC曲線:学習モデルの評価方法
## 「05-roc_curve」の解説
ITエンジニアための機械学習理論入門「第5章 ロジスティック回帰とROC曲線:学習モデルの評価方法」で使用しているサンプルコード「05-roc_curve.py」の解説です。
※ 解説用にコードの内容は少し変更しています。
はじめに必要なモジュールをインポートしておきます。
関数 multivariate_normal は、多次元の正規分布に従う乱数を生成するために利用します。
```
import numpy as np
import matplotlib.pyplot as plt
import pandas ... | github_jupyter |
# Serendipyty
## Setup: matplotlib
```
%matplotlib inline
#%matplotlib notebook
#%matplotlib notebook
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.animation as animation
from IPython.display import HTML
#mpl.rc('image', interpolation='none', origin='lowe... | github_jupyter |
# TextAttack Augmentation
[](https://colab.research.google.com/github/QData/TextAttack/blob/master/docs/2notebook/3_Augmentations.ipynb)
[](https://github.com/... | github_jupyter |
# Simplest Generative Model (Independent Features)
What's the simplest kind of generative model? When dealing with high-dimensional objects, probably the simplest one can do is to have a separate generative process for each independent dimension or, in the case of images, each pixels. For simplicity, we will also assu... | github_jupyter |
# トークトリアル 11 (イントロ)
# オンラインAPI/サービスを使った構造に基づくCADD
__Developed at AG Volkamer, Charité__
Dr. Jaime Rodríguez-Guerra, Dominique Sydow
## このトークトリアルの目的
Webサービスは、ユーザーのインストールの煩わしさを避けられるので、ソフトウェア利用の上で便利な方法です。Web UIは、通常ワークフローの自動化の可能性を犠牲にして、簡単に利用できるようにします。幸運にも、アクセスを自動化するためのAPI(アプリケーションプログラミングインターフェース / Application Programm... | github_jupyter |
<a href="https://colab.research.google.com/github/Tessellate-Imaging/Monk_Object_Detection/blob/master/application_model_zoo/Example%20-%20Elephant%20segmentation%20in%20the%20wild.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Table of contents
... | github_jupyter |
# <p style="text-align: center;"> TextXD 2018 Hack session<br><br>Word embedding models for charter schools:<br>Detecting discursive themes through querying neural nets
<p style="text-align: center;">Creator: Jaren Haber, PhD Candidate<br/>Institution: Department of Sociology, University of California, Berkeley<br/>Dec... | github_jupyter |
# Transfer Learning
Most of the time you won't want to train a whole convolutional network yourself. Modern ConvNets training on huge datasets like ImageNet take weeks on multiple GPUs. Instead, most people use a pretrained network either as a fixed feature extractor, or as an initial network to fine tune. In this not... | github_jupyter |
# SHFQA
Just like the driver for the HDAWG in the previous example, we now use the `tk.SHFQA` instrument driver.
```
import zhinst.toolkit as tk
shfqa = tk.SHFQA("shfqa", "dev12036", interface="1gbe", host="localhost")
shfqa.setup() # set up data server connection
shfqa.connect_device() # connect device t... | github_jupyter |
```
# Necessary imports
import pandas as pd
import numpy as np
import statsmodels.api as sm
import statsmodels.formula.api as smf
import patsy
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import RidgeCV
import datetime
%matplotlib inli... | github_jupyter |
# CMIP6 $\Delta P/\Delta T$ (2)
## Goal: update [Flaschner et al 2016](https://journals.ametsoc.org/doi/10.1175/JCLI-D-15-0351.1) [figure 1](https://journals.ametsoc.org/na101/home/literatum/publisher/ams/journals/content/clim/2016/15200442-29.2/jcli-d-15-0351.1/20160112/images/large/jcli-d-15-0351.1-f1.jpeg) with CMIP... | github_jupyter |
```
import numpy as np
import pandas as pd
import sys
import os
import pickle
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
from sklearn.metrics import log_loss
from sklearn.metrics import accuracy_score
from sklearn.metrics import f1_score
from sklearn.metrics import ... | github_jupyter |
# Fourier series
> Marcos Duarte
> Laboratory of Biomechanics and Motor Control ([http://demotu.org/](http://demotu.org/))
> Federal University of ABC, Brazil
## Sinusoids
The sine and cosine functions (with the same amplitude and frequency) are different only by a constant phase $(^\pi/_2)$:
$$\cos(t)=\sin(t... | github_jupyter |
<div>
<a href="https://www.audiolabs-erlangen.de/fau/professor/mueller"><img src="data_layout/PCP_Teaser.png" width=100% style="float: right;" alt="PCP Teaser"></a>
</div>
# NumPy Basics
Python has several useful built-in packages as well as additional external packages. One such package is **NumPy**, which adds supp... | github_jupyter |
# GDP and life expectancy
Richer countries can afford to invest more on healthcare, on work and road safety, and other measures that reduce mortality. On the other hand, richer countries may have less healthy lifestyles. Is there any relation between the wealth of a country and the life expectancy of its inhabitants?
... | github_jupyter |
# Text
## Strings
- Point index
- Interval index
- Negative index
- Stride
- Reversing a string
- Strings are immutable
```
s = "hello world"
s[0], s[6]
s[0:6]
s[-1], s[-3]
s[::2]
s[::-1]
try:
s[0] = 'H'
except TypeError as e:
print(e)
```
## The `string` module
- String constants
- String `capwords`
```
... | github_jupyter |
```
import numpy as np
import tensorflow as tf
import matplotlib as mpl
import matplotlib.pyplot as plt
from SCFInitialGuess.utilities.usermessages import Messenger as msg
msg.print_level = 1
mpl.style.use("seaborn")
```
# Fetch dataset
```
from SCFInitialGuess.utilities.dataset import make_butadien_dataset, extr... | github_jupyter |
```
import keras
from keras.models import Sequential, Model, load_model
from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda
from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, CuDNNLSTM, CuDNNGRU, BatchNormalization, LocallyConnected2D, ... | github_jupyter |
# Harmonizome ETL: Orphanet
Created by: Charles Dai
Data Source: http://www.orphadata.org/cgi-bin/index.php
```
# 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
import itertools
import xml.etree.ElementTr... | github_jupyter |
# Citrus Leaves Classification Problem Using SGD Optimizer
## Team Salvator Brothers
## Assignment 4-5
**----------------------------------------------------------------------------------------------**
## Importing Libraries
```
# Imports
import matplotlib.pyplot as plt
from matplotlib import gridspec
import numpy ... | github_jupyter |
##### Copyright 2020 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
# Grafici sui dati sul Corona Virus
## Se non vuoi vedere il codice, vai in basso e troverai le figure
Qui ci andrebbe una introduzione degna di questo nome xxx xxx xxxx
Importiamo le librerie necessarie a fare statistiche e grafici
```
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.p... | github_jupyter |
# cadCAD Tutorials: The Robot and the Marbles, part 2
In [Part 1](../robot-marbles-part-1/robot-marbles-part-1.ipynb) we introduced the 'language' in which a system must be described in order for it to be interpretable by cadCAD and some of the basic concepts of the library:
* State Variables
* Timestep
* State Update ... | github_jupyter |
# UAVSAR
```{admonition} Learning Objectives
*A 30 minute guide to UAVSAR data for SnowEX*
- overview of UAVSAR data (both InSAR and PolSAR products)
- demonstrate how to access and transform data
- use Python rasterio and matplotlib to display the data
```
<img src="../../img/UAVSAR_plane.jpg" alt="uavsar airplane" ... | github_jupyter |
```
import os
import functools
import cv2
import numpy as np
from tests.metaworld.envs.mujoco.sawyer_xyz.test_scripted_policies import ALL_ENVS, test_cases_latest_nonoise
def trajectory_generator(env, policy, act_noise_pct, res=(640, 480), camera='corner'):
action_space_ptp = env.action_space.high - env.action_sp... | github_jupyter |
<a href="https://colab.research.google.com/github/midhun1998/Plant-App-Flutter-Project/blob/master/Plant_Disease_Detection_(PROJECT).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
### **Importing the Librairies**
```
# Install nightly package for... | github_jupyter |
```
import pandas as pd
import keras
import numpy as np
from itertools import islice
from sklearn.model_selection import train_test_split
from stldecompose import decompose
from matplotlib import pyplot
from keras.models import model_from_json
#https://stackoverflow.com/questions/48356464/how-to-model-convolutional-rec... | github_jupyter |
# Домашка 1. Numpy
```
import numpy as np
```
### Прелесть numpy в массовых операциях, а значит все задания должны быть реализованы без циклов.
### Если в коде есть слово for или while задача не засчитывается
## (1 балл) Задание №1. Жорданова форма.
Дан лист из **3**-х действительных собственных чисел и их алгебр... | github_jupyter |
Lambda School Data Science
*Unit 2, Sprint 2, Module 4*
---
# Classification Metrics
- get and interpret the **confusion matrix** for classification models
- use classification metrics: **precision, recall**
- understand the relationships between precision, recall, **thresholds, and predicted probabilities**, to he... | github_jupyter |
# CSDMS 2021 Annual Meeting
### CLINIC: Thursday, May 20 11:00am - 1pm MST
## GCAM and Demeter: A global, integrated human-Earth systems perspective to modeling land projections
Researchers and decision makers are increasingly interested in understanding the many ways in which human and Earth systems interact with... | github_jupyter |
# DNN_UnderSampling_SMOTE
```
import types
import pandas as pd
from botocore.client import Config
import ibm_boto3
def __iter__(self): return 0
# @hidden_cell
# The following code accesses a file in your IBM Cloud Object Storage. It includes your credentials.
# You might want to remove those credentials before you ... | github_jupyter |
# Saving and Loading Models
In this notebook, I'll show you how to save and load models with PyTorch. This is important because you'll often want to load previously trained models to use in making predictions or to continue training on new data.
```
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
i... | github_jupyter |
<img src="../images/aeropython_logo.png" alt="AeroPython" style="width: 300px;"/>
# Introducción a la sintaxis de Python II: librerías
_En esta clase continuaremos con nuestra introducción a Python. Para ello, analizaremos unos datos almacenados en una serie de archivos csv. Estos datos corresponden a la evolución de... | github_jupyter |
# Lesson 2: Remote Data Science Demo!
<b><u> Instructors</b></u>: Ishan Mishra, Phil Culliton
## Concept 1: Lesson Introduction
Welcome to Lesson 2!
In the previous lesson, we learned about Remote Data Science, its motivations, key technical components, and main terminology.
In this lesson, we're going to jump ... | github_jupyter |
# Counterfactual policy simulations
```
from consav import runtools
runtools.write_numba_config(disable=0,threads=4)
%matplotlib inline
%load_ext autoreload
%autoreload 2
# Local modules
from Model import RetirementClass
import funs
import figs
import SimulatedMinimumDistance as SMD
# Global modules
import numpy as... | github_jupyter |

<a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=Health/CALM/CALM-moving-out-5.ipynb&dep... | github_jupyter |
```
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression, Ridge, Lasso, LogisticRegression
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.datasets import load_boston, loa... | github_jupyter |
# Exploring Sentinel-1 radar for Hurricane Harvey Flood Mapping
Motivated by:
Chini, Marco, Ramona Pelich, Luca Pulvirenti, Nazzareno Pierdicca, Renaud Hostache, and Patrick Matgen. “Sentinel-1 InSAR Coherence to Detect Floodwater in Urban Areas: Houston and Hurricane Harvey as A Test Case.” Remote Sensing 11, no. 2... | github_jupyter |
# TensorFlow Probability Interface
```
%load_ext lab_black
import gpjax
import gpjax.core as gpx
import gpviz as gpv
import jax.numpy as jnp
import jax.random as jr
import tensorflow_probability.substrates.jax as tfp
import matplotlib.pyplot as plt
from jax import grad, jit
tfd = tfp.distributions
key = jr.PRNGKey(12... | github_jupyter |
# Notebook 1 - Introduction to Jupyter, exploring/manipulating data with Pandas and plotting with Matplotlib
- Feature engineering: Date
## Introduction to Jupyter notebooks
*Optional*
You can add extended functionalities by installing `conda install -c conda-forge jupyter_contrib_nbextensions`. This will add a tab... | github_jupyter |
<img align="right" src="images/tf-small.png" width="128"/>
<img align="right" src="images/etcbc.png"/>
<img align="right" src="images/dans-small.png"/>
You might want to consider the [start](search.ipynb) of this tutorial.
Short introductions to other TF datasets:
* [Dead Sea Scrolls](https://nbviewer.jupyter.org/gi... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# AutoML 12: Retrieving Training SDK Versions
```
import logging
import os
import random
from matplotlib import pyplot as plt
from matplotlib.pyplot import imshow
import numpy as np
import pandas as pd
from sklearn import data... | github_jupyter |
**This notebook is an exercise in the [Feature Engineering](https://www.kaggle.com/learn/feature-engineering) course. You can reference the tutorial at [this link](https://www.kaggle.com/matleonard/categorical-encodings).**
---
# Introduction
In this exercise you'll apply more advanced encodings to encode the categ... | github_jupyter |
```
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
class Monad m => Writer m where
write :: String -> m ()
import qualified Control.Monad.Trans.Writer.Strict as WriterT
newtype W a = W (WriterT.Writer String a) deriving (Functor, Applicative, Monad)
instance Writer W where
write :: ... | github_jupyter |
```
# For Python 2 / 3 compatability
from __future__ import print_function
# Toy dataset.
# Format: each row is an example.
# The last column is the label.
# The first two columns are features.
# Feel free to play with it by adding more features & examples.
# Interesting note: I've written this so the 2nd and 5th examp... | github_jupyter |
### 1) Importing the Necessary Libraries
```
import pandas as pd
import numpy as np
import bs4
import urllib.request
```
### 2) Using urllib to read the html and using Beautiful Soup to parse it
```
url='http://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M'
html=urllib.request.urlopen(url).read()
soup=bs4.... | github_jupyter |
# PyTorch Exploration – Dataset & Data Loader
```
import audiomod
import ptmod
# from pymongo import MongoClient
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import torch
# import torchvision
# from torchvision import transforms, utils
import torch.utils.data as data_utils
from torch.autograd... | github_jupyter |
# Goals
### 1. Learn to implement Mobilenet V2 Linear Bottleneck Block using monk
- Monk's Keras
- Monk's Pytorch
- Monk's Mxnet
### 2. Use network Monk's debugger to create complex blocks
### 3. Understand how syntactically different it is to implement the same using
- Traditional Keras
- ... | github_jupyter |
## Pooling Layer
In this notebook, we add and visualize the output of a maxpooling layer in a CNN.
### Import the image
```
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
# TODO: Feel free to try out your own images here by changing img_path
# to a file path to another image on your computer!
img_pat... | github_jupyter |
<a href="https://colab.research.google.com/github/VMBoehm/DeNoPa/blob/master/TrainNVP_and_measure_Reconstruction_Noise.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import numpy as np
import os
import matplotlib
import matplotlib.pyplot as plt... | github_jupyter |
```
import pandas
import matplotlib as mpl
import xarray as xr
import numpy as np
from math import pi
import datetime as dt
import geopy.distance
def cal_dist(ds):
lons = ds.lon.values
lats = ds.lat.values
ilen_lats = len(lats)
dx=[0]*len(lats)
dy=[0]*len(lats)
dx_grid = np.empty([len(lats),len... | github_jupyter |
```
!wget https://datahack-prod.s3.amazonaws.com/train_file/train_LZdllcl.csv -O train.csv
!wget https://datahack-prod.s3.amazonaws.com/test_file/test_2umaH9m.csv -O test.csv
!wget https://datahack-prod.s3.amazonaws.com/sample_submission/sample_submission_M0L0uXE.csv -O sample_submission.csv
# Import the required pac... | github_jupyter |
# TP5 Kernel Methods for Machine Learning
```
# setup
import numpy as np
#import pandas as pd
from sklearn import linear_model as lm
from sklearn.kernel_approximation import Nystroem
from sklearn.model_selection import cross_val_score as cvs
from matplotlib import pyplot as plt
%matplotlib inline
import sys
print(sys.... | github_jupyter |
**Note**: Click on "*Kernel*" > "*Restart Kernel and Clear All Outputs*" in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) *before* reading this notebook to reset its output. If you cannot run this file on your machine, you may want to open it [in the cloud <img height="12" style="display: inline-block" src... | github_jupyter |
# Collecting the Bader charge of the active O and Ir atom
---
### Import Modules
```
import os
print(os.getcwd())
import sys
import time; ti = time.time()
import copy
import pickle
from pathlib import Path
import numpy as np
import pandas as pd
import math
from ase import io
# ####################################... | github_jupyter |
# 100 numpy exercises with hint
This is a collection of exercises that have been collected in the numpy mailing list, on stack overflow and in the numpy documentation. The goal of this collection is to offer a quick reference for both old and new users but also to provide a set of exercises for those who teach.
If y... | github_jupyter |
# Export errors and presentation problems
Now that you are done in pandas, you need to get the data back out into storage or downstream business intelligence databases. Much like importing data, exporting data has its own challenges.
```
import pandas as pd
import numpy as np
```
## Keeping the right data and formatt... | github_jupyter |
# Xarray-spatial
### User Guide: Pathfinding
-----
Xarray-spatial's Pathfinding provides a comprehensive tool for finding the shortest path from one point to another in a raster that can contain any level of complex boundaries or obstacles amidst an interconnected set of traversable path segments.
[A* Pathfinding](#A... | github_jupyter |
# Accern: Alpha One
In this notebook, we'll take a look at Accern's *Alpha One* dataset, available on [Quantopian](https://www.quantopian.com/store). This dataset spans August 26, 2012 through the current day. It contains comprehensive sentiment analysis related to equities from 20 million+ sources.
## Notebook Conte... | github_jupyter |
<a href="https://colab.research.google.com/github/mnansary/pytfBusterNet/blob/master/main.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# colab specific task
* mount google drive
* change working directory to git repo
* Check TF version
* ... | github_jupyter |
```
import numpy
import scipy
import everest
import matplotlib.pyplot as plt
from astropy.stats import sigma_clip
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('matplotlib')
logger.setLevel(logging.CRITICAL)
EPIC_id = 212521166
star = everest.Everest(EPIC_id)
t = numpy.dele... | github_jupyter |
# Overview
use PB2020 api data to create a training dataset
- add category labels for type of force
- use dataset with categories training data on logistic regression
- pickle trained model to upload
- **Presence**: police show up and their presence is enough to de-escalate. This is ideal
- **verbalization**: police ... | github_jupyter |
Check of 2x6 Wood Joist Design per O86-09
E.Durham - 16-Aug-2018
```
import pint
unit = pint.UnitRegistry(system='mks')
Q = unit.Quantity
# define synonyms for common units
inch = unit.inch; mm = unit.mm; m = unit.m; kPa = unit.kPa; MPa = unit.MPa;
psi = unit.psi; kN = unit.kN; N = unit.N; ksi = unit.ksi;
dimensi... | github_jupyter |
```
import datetime as dt
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
def random_dates(start, end, n=10):
start_u = start.value//10**9
end_u = end.value//10**9
return pd.to_datetime(np.random.randint(start_u, end_u, n), unit='s')
clientesdf = pd.DataFrame(columns =... | github_jupyter |
# Deploy Serverless endpoint - Object Detection (YOLO-v3)
---
***Note: 본 핸즈온에 사용된 추론 코드와 Dockerfile은 https://github.com/kts102121/lambda_container 에서 확인할 수 있으며, Lambda 추론에 대한 더 많은 예제들을 확인할 수 있습니다.***
## Overview
re:Invent 2020에 소개된 Lambda 컨테이너 기능 지원으로 기존 Lambda에서 수행하기 어려웠던 대용량 머신 모델에 대한 추론을 보다 수월하게 실행할 수 있게 되었습니다. L... | github_jupyter |
<a href="https://colab.research.google.com/github/martin-galajda/Localization-Manager-API/blob/master/notebooks/Evaluation_mAP.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from google.colab import drive
drive.mount('/content/drive')
THESIS_R... | github_jupyter |
## Label propagation implementation
Based on the paper: <i>Learning from Labeled and Unlabeled data with Label Propagation</i>.
```
import numpy as np
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
import networkx as nx
import warnings
warnings.filterwarnings("ignore")
```
### Cleaning data
```
... | github_jupyter |
# Artificial Intelligence Nanodegree
## Convolutional Neural Networks
## Project: Write an Algorithm for a Dog Identification App
---
In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete this project. You will not n... | github_jupyter |
# Data types and pattern matching
OCaml has a concise and expressive system for creating new datatypes. It also supports pattern matching to naturally express deconstruction of these data types.
## Type aliases
OCaml allows you to define aliases for existing types using the `type` keyword:
```
type int_pair = int *... | github_jupyter |
# Example using scikit-learn: Breast cancer prediction
## Methodology
The following data science techniques will be demonstrated:
1. Univariate feature reduction (remove low correlations with the target).
2. Feature reduction based on collinearity (for each highly correlated pair of features, leave only the feature... | github_jupyter |
# Gene Expression Monitoring Analysis
## Data Preparation
```
# Import all the libraries that we shall be using
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
from sklearn.preprocessing import StandardScaler
fro... | github_jupyter |
```
%matplotlib inline
import sys
print(sys.version)
import numpy as np
print(np.__version__)
import pandas as pd
print(pd.__version__)
import matplotlib.pyplot as plt
```
In this section we will be analyzing some financial data. Now pandas gives us access to some data through pandas.io.data
This is basically pandas ... | 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 |
# Stock Trading with Amazon SageMaker RL
In this notebook, we apply the deep Q-network method to train an agent that will trade a single share to maximize profit. The goal is to demonstrate how to go beyond the Atari games and apply RL to a different practical domain. Based on the setup in chapter 8 of [1], we use one... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
from typing import Iterable
import sys
def pytorch_init():
device_id = 1
torc... | github_jupyter |
# Data Collection and Signal Processing
# Getting in Data - Analog to Digital Converters
To discuss some of the basic considerations involved when converting a continuous process into a sampled, quantized process.
Many physiological signals are continuous function of time. In order to analyze such processes with a c... | github_jupyter |
# Medical image segmentation with TorchIO, MONAI & PyTorch Lightning
<!--
<img src="https://torchio.readthedocs.io/_static/torchio_logo_2048x2048.png" alt="TorchIO" width="100"/>
<img src="https://printables.space/files/uploads/download-and-print/large-printable-numbers/plus-a4-1200x1697.jpg" alt="Plus" width="50"/>
<... | github_jupyter |
# CIFAR-10: Part 1
In this two-part tutorial, we present an end-to-end example of training and using a convolutional neural network for a classic image recognition problem. We will use the CIFAR-10 benchmark dataset, which is a 10-class dataset consisting of 60,000 color images of size 32x32. We will use a .png version... | github_jupyter |
Deep Learning
=============
Assignment 6
------------
After training a skip-gram model in `5_word2vec.ipynb`, the goal of this notebook is to train a LSTM character model over [Text8](http://mattmahoney.net/dc/textdata) data.
```
# These are all the modules we'll be using later. Make sure you can import them
# befor... | github_jupyter |
# Chapter 7: Modeling the visual field (with FilterNet)
FilterNet is a part of the BMTK that simulates the effects of visual input onto cells in the LGN. It uses LGNModel as a backend, which uses neural-filters to simulate firing rates and spike-trains one may expect given a stimulus on (especially mouse) visual field... | github_jupyter |
```
############# NOTEBOOK PARAMETERS ##############
parameters = dict()
parameters['file'] = None # set to None for file prompt
parameters['cmap'] = 'viridis'
parameters['length_x'] = 40e-6
parameters['length_y'] = 40e-6
parameters['node_area'] = 5e-6 * 5e-6
parameters['density'] = 1000
parameters['sound_speed'] = 15... | github_jupyter |

[](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/jupyter/annotation/english/spark-nlp-basics/playground-dataFrames.ipynb)
## 0. Colab Se... | github_jupyter |
```
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import clear_output
import time
```
### Building a dataset
```
Sx = np.array([0, 1, 2.5, 3, 4, 5], dtype=np.float32)
Sy = np.array([0.6, 0, 2, 2.2, 4.7, 5], dtype=np.float32)
# Plotting in graph
plt.scatter(Sx, Sy)
#... | github_jupyter |
# Filters
This example shows how to control map filters and listen to map filter change events with Unfolded Map SDK.
Let's again create a local map and add data to it:
```
from unfolded.map_sdk import UnfoldedMap
unfolded_map = UnfoldedMap()
from sidecar import Sidecar
sc = Sidecar(title='Unfolded map', anchor='spl... | github_jupyter |
# Character-level Language Modeling with LSTMs
This notebook is adapted from [Keras' lstm_text_generation.py](https://github.com/fchollet/keras/blob/master/examples/lstm_text_generation.py).
Steps:
- Download a small text corpus and preprocess it.
- Extract a character vocabulary and use it to vectorize the text.
- ... | github_jupyter |
```
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from IPython.display import HTML
from matplotlib import cm
from mpl_toolkits import mplot3d
from PIL import Image
def kappa(x,y):
#if ((x-0.05)**2.0+(y-0.05)**2.0-0.03**2.0<0.0): return 1.9e-6
if (x<1.0): return 5.0e-4... | github_jupyter |
```
### This one uses a lot of custom matlab code. Might be better
### to write a python tutorial that utilizes toolboxes and common functinos
import scipy.io as si
import numpy as np
import matplotlib.pyplot as plt
import nilearn as ni
import xarray as xr
%matplotlib inline
import numpy as np
from nipy.core.api import... | github_jupyter |
### Step 1: Importing important libraries. *Numpy:* Linear Algebra and manipulation of data. *Keras:* High-level API built on top of Tensorflow. *SKLearn:* Machine Learning libraries that holds datasets, models and other useful functions.
```
import numpy as np
import keras
from keras.models import Sequential
from ker... | github_jupyter |
An application of the different [Manifold learning](http://scikit-learn.org/stable/modules/manifold.html#manifold) techniques on a spherical data-set. Here one can see the use of dimensionality reduction in order to gain some intuition regarding the manifold learning methods. Regarding the dataset, the poles are cut fr... | github_jupyter |
# Some useful modules for RNNs in pytorch
## Imports
```
import writefile_run
filename = '../package/pytorch_utils/wrapped_lstm.py'
%%writefile_run $filename
"""
Module which wraps an input and output module around an LSTM.
"""
import torch
import torch.nn as nn
import torch.nn.utils.rnn as utils
```
## Modules
... | github_jupyter |
Contributed by Sam Mason. From his email:
"I've done a very naive thing in a gaussian process regression. I use the GPy toolbox:
http://sheffieldml.github.io/GPy/ which is a reasonably nice library for doing this sort of thing. GPs have n^2 complexity in the number of data points, so scaling beyond a few hundred ... | github_jupyter |
# Utility graph plot matrix
```
import matplotlib.pyplot as plt
def draw_graph(G, node_names={}, nodes_label=[], node_size=900):
pos_nodes = nx.spring_layout(G)
col = {0:"steelblue",1:"red",2:"green"}
colors = [col[x] for x in nodes_label]
nx.draw(G, pos_nodes, with_labels=True, node_co... | github_jupyter |
# Deep Crossentropy method
In this section we'll extend your CEM implementation with neural networks! You will train a multi-layer neural network to solve simple continuous state space games. __Please make sure you're done with tabular crossentropy method from the previous notebook.__
![img](https://tip.duke.edu/inde... | github_jupyter |
# Adam
:label:`sec_adam`
In the discussions leading up to this section we encountered a number of techniques for efficient optimization. Let us recap them in detail here:
* We saw that :numref:`sec_sgd` is more effective than Gradient Descent when solving optimization problems, e.g., due to its inherent resilience to... | github_jupyter |
This notebook checks mavenn's new feature where if user supplies only single mutants, then mavenn requires
that ge_nonlinearity_type == 'linear', and gpmap_type == 'additive', and ge_noise_model_type == 'Gaussian'. Errors are thrown when set_data is called.
```
# Standard imports
import pandas as pd
import matplotlib... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.