code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
```
# Copyright 2020 Google LLC
#
# 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 agreed to in writi... | github_jupyter |
# GRU 236
* Operate on 16000 GenCode 34 seqs.
* 5-way cross validation. Save best model per CV.
* Report mean accuracy from final re-validation with best 5.
* Use Adam with a learn rate decay schdule.
```
NC_FILENAME='ncRNA.gc34.processed.fasta'
PC_FILENAME='pcRNA.gc34.processed.fasta'
DATAPATH=""
try:
from google... | github_jupyter |
```
import numpy as np
import pandas as pd
import holoviews as hv
import networkx as nx
hv.extension('bokeh')
%opts Graph [width=400 height=400]
```
Visualizing and working with network graphs is a common problem in many different disciplines. HoloViews provides the ability to represent and visualize graphs very sim... | github_jupyter |
# How have Airbnb prices changed due to COVID-19?
## Business Understanding
This is the most recent data (Oct, 2020) taken from the official website Airbnb http://insideairbnb.com/get-the-data.html
In this Notebook, we'll look at this data, clean up, analyze, visualize, and model.
And we will answer the following q... | github_jupyter |
<img src="http://akhavanpour.ir/notebook/images/srttu.gif" alt="SRTTU" style="width: 150px;"/>
[](https://notebooks.azure.com/import/gh/Alireza-Akhavan/class.vision)
# <div style="direction:rtl;text-align:right;font-family:B Lotus, B Nazanin, Tahoma"> تولید مت... | github_jupyter |
## Swarm intelligence agent
Last checked score: 1062.9
```
def swarm(obs, conf):
def send_scout_carrier(x, y):
""" send scout carrier to explore current cell and, if possible, cell above """
points = send_scouts(x, y)
# if cell above exists
if y > 0:
cell_above_points =... | github_jupyter |
# Getting to know LSTMs better
Created: September 13, 2018
Author: Thamme Gowda
Goals:
- To get batches of *unequal length sequences* encoded correctly!
- Know how the hidden states flow between encoders and decoders
- Know how the multiple stacked LSTM layers pass hidden states
Example: a simple bi-directional... | github_jupyter |
## Differential Privacy - Simple Database Queries
The database is going to be a VERY simple database with only one boolean column. Each row corresponds to a person. Each value corresponds to whether or not that person has a certain private attribute (such as whether they have a certain disease, or whether they are abo... | github_jupyter |
```
import os
from tqdm import tqdm
from typing import Optional, List, Dict
from dataclasses import dataclass, field
import torch
from transformers import AutoModel, AutoTokenizer
# bluebert models
BlueBERT_MODELCARD = [
'bionlp/bluebert_pubmed_mimic_uncased_L-12_H-768_A-12',
'bionlp/bluebert_pubmed_mimic_unc... | github_jupyter |
# Lesson 9 Practice: Supervised Machine Learning
Use this notebook to follow along with the lesson in the corresponding lesson notebook: [L09-Supervised_Machine_Learning-Lesson.ipynb](./L09-Supervised_Machine_Learning-Lesson.ipynb).
## Instructions
Follow along with the teaching material in the lesson. Throughout the ... | github_jupyter |
```
import numpy as np
import time
import tensorflow as tf
from tensorflow.keras.datasets import mnist
from tensorflow.keras import models, layers
from tensorflow.keras.models import Sequential
from tensorflow.keras import optimizers
from tensorflow.keras.layers import Dense
```
Much as any computer program... | github_jupyter |
```
import numpy as np
import pandas as pd
from tqdm import tqdm
from utils import clean_target
from categorical_ordinal import get_categorical_ordinal_columns
from categorical_nominal import get_categorical_nominal_columns
from columns_transformers import ColumnSelector
from sklearn.pipeline import Pipeline, FeatureUn... | github_jupyter |
```
# importing all the required libraries
import pandas as pd
from google.colab import files
import io
import spacy
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
import keras
from keras.utils impo... | github_jupyter |
# Time handling
Last year in this course, people asked: "how do you handle times?" That's a good question...
## Exercise
What is the ambiguity in these cases?
1. Meet me for lunch at 12:00
2. The meeting is at 14:00
3. How many hours are between 01:00 and 06:00 (in the morning)
4. When does the new year start?
Lo... | github_jupyter |
### Hyper Parameter Tuning
One of the primary objective and challenge in machine learning process is improving the performance score, based on data patterns and observed evidence. To achieve this objective, almost all machine learning algorithms have specific set of parameters that needs to estimate from dataset which... | github_jupyter |
```
#@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 agreed to in writing, software
# distributed u... | github_jupyter |
```
from time import time
import secrets
import flickrapi
import requests
import os
import pandas as pd
import pickle
import logging
def get_photos(image_tag):
# setup dataframe for data
raw_photos = pd.DataFrame(columns=['latitude', 'longitude','farm','server','id','secret'])
# initialize api
f... | github_jupyter |
```
import numpy as np
import pandas as pd
from os import makedirs
from os.path import join, exists
#from nilearn.input_data import NiftiLabelsMasker
from nilearn.connectome import ConnectivityMeasure
from nilearn.plotting import plot_anat, plot_roi
import bct
#from nipype.interfaces.fsl import InvWarp, ApplyWarp
impor... | github_jupyter |
# Notebook 2: Gradient Descent
## Learning Goal
The goal of this notebook is to gain intuition for various gradient descent methods by visualizing and applying these methods to some simple two-dimensional surfaces. Methods studied include ordinary gradient descent, gradient descent with momentum, NAG, ADAM, and RMSPr... | github_jupyter |
____
<center> <h1 style="background-color:#975be5; color:white"><br>01-Linear Regression Project<br></h1></center>
____
<div align="right">
<b><a href="https://keytodatascience.com/">KeytoDataScience.com </a></b>
</div>
Congratulations !!
KeytoDataScience just got some contract work with an Ecommerce company... | github_jupyter |
# 3. laboratorijska vježba
```
# učitavanje potrebnih biblioteka
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as ss
#@title pomoćna funkcija
# izvršite ovu ćeliju ali se ne opterećujte detaljima implementacije
def plot_frequency_response(f, Hm, fc=None, ylim_min=None):
"""Grafički prika... | github_jupyter |
# **EXPERIMENT 1**
Aim: Exploring variable in a dataset
Objectives:
Exploring Variables in a Dataset
Learn how to open and examine a dataset.
Practice classifying variables by their type: quantitative or categorical.
Learn how to handle categorical variables whose values are numerically coded.
Link to experiment... | github_jupyter |
# Example Map Plotting
### At the start of a Jupyter notebook you need to import all modules that you will use
```
import pandas as pd
import xarray as xr
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import griddata
import cartopy
import cartopy.crs as ccrs # For plotting ... | github_jupyter |
# Description
This notebook documents allows the following on a group seven LIFX Tilechain with 5 Tiles
laid out horizontaly as following
T1 [0] [1] [2] [3] [4]
T2 [0] [1] [2] [3] [4]
T3 [0] [1] [2] [3] [4]
T4 [0] [1] [2] [3] [4]
T5 [0] [1] [2] [3] [4]
T6 [0] [1] [2] [3] [4]
T7 [0] [1] [2] [3] [4... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
```
# Import Risk INFORM index
```
path = "C:\\batch8_worldbank\\datasets\\tempetes\\INFORM_Risk_2021.xlsx"
xl = pd.ExcelFile(path)
xl.sheet_names
inform_df = xl.parse(xl.sheet_names[2])
inform_df.columns = info... | github_jupyter |
# Db2 Jupyter Notebook Extensions Tutorial
The SQL code tutorials for Db2 rely on a Jupyter notebook extension, commonly refer to as a "magic" command. The beginning of all of the notebooks begin with the following command which will load the extension and allow the remainder of the notebook to use the %sql magic comm... | github_jupyter |
# Welcome to the matched filtering tutorial!
### Installation
Make sure you have PyCBC and some basic lalsuite tools installed. You can do this in a terminal with pip:
```
! pip install lalsuite pycbc
```
<span style="color:gray">Jess notes: this notebook was made with a PyCBC 1.8.0 kernel. </span>
### Learning ... | github_jupyter |
<a href="https://www.bigdatauniversity.com"><img src="https://ibm.box.com/shared/static/qo20b88v1hbjztubt06609ovs85q8fau.png" width="400px" align="center"></a>
<h1 align="center"><font size="5">RESTRICTED BOLTZMANN MACHINES</font></h1>
<h3>Introduction</h3>
<b>Restricted Boltzmann Machine (RBM):</b> RBMs are shallow... | github_jupyter |
<a href="https://colab.research.google.com/github/terrainthesky-hub/DS-Unit-2-Kaggle-Challenge/blob/master/module4-classification-metrics/Lesley_Rich_224_assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#Confusion matrix is at the bo... | github_jupyter |
### Question 1
#### Create a function that takes a number as an argument and returns True or False depending
#### on whether the number is symmetrical or not. A number is symmetrical when it is the same as
#### its reverse.
#### Examples
#### is_symmetrical(7227) ➞ True
#### is_symmetrical(12567) ➞ False
#### is_symmet... | github_jupyter |
```
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import StandardScaler
df_train = pd.read_excel('wpbc.train.xlsx')
df_test = pd.read_excel('wpbc.test.xlsx')
train = df_train
test = df_test
train.shape
test.shape
train.describe()
import seaborn
import m... | github_jupyter |
<a href="https://colab.research.google.com/github/Max-FM/IAA-Social-Distancing/blob/master/Differential_Imaging.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#Differential Imaging
**Warning:** This notebook will likely cause Google Colab to crash... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import torch
import pandas as pd
from scipy.misc import derivative
import time
data= pd.read_csv("Thurber_Data.txt",names=['y','x'], sep=" ")
data
y = torch.from_numpy(data['y'].to_numpy(np.float64))
x = torch.from_numpy(data['x'].to_numpy(np.float64))
# b = torc... | github_jupyter |
# oneDPL- Gamma Correction example
#### Sections
- [Gamma Correction](#Gamma-Correction)
- [Why use buffer iterators?](#Why-use-buffer-iterators?)
- _Lab Exercise:_ [Gamma Correction](#Lab-Exercise:-Gamma-Correction)
- [Image outputs](#Image-outputs)
## Learning Objectives
* Build a sample __DPC++ application__ to p... | github_jupyter |
# DECOMON tutorial #3
## Local Robustness to Adversarial Attacks for classification tasks
## Introduction
After training a model, we want to make sure that the model will give the same output for any images "close" to the initial one, showing some robustness to perturbation.
In this notebook, we start from a class... | github_jupyter |
```
import argparse
import copy
import sys
sys.path.append('../../')
import sopa.src.models.odenet_cifar10.layers as cifar10_models
from sopa.src.models.odenet_cifar10.utils import *
parser = argparse.ArgumentParser()
# Architecture params
parser.add_argument('--is_odenet', type=eval, default=True, choices=[True, Fals... | github_jupyter |
```
%matplotlib inline
# Write your imports here
import sympy as sp
import math
import numpy as np
import matplotlib.pyplot as plt
```
# High-School Maths Exercise
## Getting to Know Jupyter Notebook. Python Libraries and Best Practices. Basic Workflow
### Problem 1. Markdown
Jupyter Notebook is a very light, beautif... | github_jupyter |
1/14 최초 구현 by 소연
수정 및 테스트 시 본 파일이 아닌 사본 사용을 부탁드립니다.
```
import os, sys
from google.colab import drive
drive.mount('/content/drive')
%cd /content/drive/Shareddrives/KPMG_Ideation
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
from pprint import pprint
from krwordra... | github_jupyter |
## Networks and Simulation
### Packages
```
%%writefile magic_functions.py
from tqdm import tqdm
from multiprocess import Pool
import scipy
import networkx as nx
import random
import pandas as pd
import numpy as np
import rpy2.robjects as robjects
from rpy2.robjects import pandas2ri
from sklearn.metrics.pairwise imp... | github_jupyter |
I started this competition investigating neural networks with this kernel https://www.kaggle.com/mulargui/keras-nn
Now switching to using ensembles in this new kernel. As of today V6 is the most performant version.
You can find all my notes and versions at https://github.com/mulargui/kaggle-Classify-forest-types
```
#... | github_jupyter |
## DATASET GENERATION
```
import numpy as np
import os
from scipy.misc import imread, imresize
import matplotlib.pyplot as plt
%matplotlib inline
cwd = os.getcwd()
print ("PACKAGES LOADED")
print ("CURRENT FOLDER IS [%s]" % (cwd) )
```
### CONFIGURATION
```
# FOLDER LOCATIONS
paths = ["../../img_dataset/celebs/Arno... | github_jupyter |
```
from pynq import Overlay
from pynq import PL
from pprint import pprint
pprint(PL.ip_dict)
print(PL.timestamp)
ol2 = Overlay('base.bit')
ol2.download()
pprint(PL.ip_dict)
print(PL.timestamp)
PL.interrupt_controllers
PL.gpio_dict
a = PL.ip_dict
for i,j in enumerate(a):
print(i,j,a[j])
a['SEG_rgbled_gpio_Reg']
b =... | github_jupyter |
# Classifying Fashion-MNIST
Now it's your turn to build and train a neural network. You'll be using the [Fashion-MNIST dataset](https://github.com/zalandoresearch/fashion-mnist), a drop-in replacement for the MNIST dataset. MNIST is actually quite trivial with neural networks where you can easily achieve better than 9... | github_jupyter |
```
import cirq
from cirq_iqm import Adonis, circuit_from_qasm
from cirq_iqm.iqm_gates import IsingGate, XYGate
```
# The Adonis architecture
Qubit connectivity:
```
QB1
|
QB4 - QB3 - QB2
|
QB5
```
Construct an `IQMDevice` instance representing the Adonis architecture
```
adonis = Adonis()
... | github_jupyter |
# Advanced Lane Finding Project
## The goals / steps of this project are the following:
* Compute the camera calibration matrix and distortion coefficients given a set of chessboard images.
* Apply a distortion correction to raw images.
* Use color transforms, gradients, etc., to create a thresholded binary image.
* Ap... | github_jupyter |
# Capsule Networks (CapsNets)
Based on the paper: [Dynamic Routing Between Capsules](https://arxiv.org/abs/1710.09829), by Sara Sabour, Nicholas Frosst and Geoffrey E. Hinton (NIPS 2017).
Inspired in part from Huadong Liao's implementation: [CapsNet-TensorFlow](https://github.com/naturomics/CapsNet-Tensorflow).
# In... | github_jupyter |
# Detecting depression in Tweets using Baye's Theorem
# Installing and importing libraries
```
!pip install wordcloud
!pip install nltk
import nltk
nltk.download('punkt')
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
import matplotlib.pyplot as plt
from ... | github_jupyter |
<a href="https://colab.research.google.com/github/Anmol42/IDP-sem4/blob/main/notebooks/Sig-mu_vae.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import torch
import torchvision
import torch.nn as nn
import matplotlib.pyplot as plt
import torch.... | github_jupyter |
# MicroGrid Energy Management
## Summary
The goal of the Microgrid problem is to compute an optimal power flow within the distributed sources, loads, storages and a main grid. On a given time horizon $H$, the optimal power flow poblem aims to find the optimal command of the components, e.g.charging/discharging for st... | github_jupyter |
# Analyzing interstellar reddening and calculating synthetic photometry
## Authors
Kristen Larson, Lia Corrales, Stephanie T. Douglas, Kelle Cruz
Input from Emir Karamehmetoglu, Pey Lian Lim, Karl Gordon, Kevin Covey
## Learning Goals
- Investigate extinction curve shapes
- Deredden spectral energy distributions an... | github_jupyter |
```
# Checkout www.pygimli.org for more examples
%matplotlib inline
```
# 2D ERT modeling and inversion
```
import matplotlib.pyplot as plt
import numpy as np
import pygimli as pg
import pygimli.meshtools as mt
from pygimli.physics import ert
```
Create geometry definition for the modelling domain.
worldMarker=Tr... | github_jupyter |
### N-gram language models or how to write scientific papers (4 pts)
We shall train our language model on a corpora of [ArXiv](http://arxiv.org/) articles and see if we can generate a new one!

loaded_set['Sentence']
from transformers import AutoModel, AutoTokenizer
# german tokens for bert
tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-german-cased")
#model = AutoMode... | github_jupyter |
This page was created from a Jupyter notebook. The original notebook can be found [here](https://github.com/klane/databall/blob/master/notebooks/parameter-tuning.ipynb). It investigates tuning model parameters to achieve better performance. First we must import the necessary installed modules.
```
import itertools
imp... | github_jupyter |
### What is DCT (discrete cosine transformation) ?
- This notebook creates arbitrary consumption functions at both 1-dimensional and 2-dimensional grids and illustrate how DCT approximates the full-grid function with different level of accuracies.
- This is used in [DCT-Copula-Illustration notebook](DCT-Copula-Illust... | github_jupyter |
```
import pymongo
import pandas as pd
import numpy as np
from pymongo import MongoClient
from bson.objectid import ObjectId
import datetime
import matplotlib.pyplot as plt
from collections import defaultdict
%matplotlib inline
import json
plt.style.use('ggplot')
import seaborn as sns
from math import log10, fl... | github_jupyter |
## Analysis of stock prices using PCA / Notebook 3
In this notebook we will study the dimensionality of stock price sequences, and show that they lie between the 1D of smooth functions and 2D of rapidly varying functions.
The mathematicians Manuel Mandelbrot and Richard Hudson wrote a book titled [The Misbehavior of ... | github_jupyter |
# PySDDR: An Advanced Tutorial
In the beginner's guide only tabular data was used as input to the PySDDR framework. In this advanced tutorial we show the effects when combining structured and unstructured data. Currently, the framework only supports images as unstructured data.
We will use the MNIST dataset as a sour... | github_jupyter |
<center>
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-ML0101EN-SkillsNetwork/labs/Module%202/images/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# Simple Linear Regression
Estimated time needed: **15** minutes
## Objectives
After ... | github_jupyter |
```
# Copyright 2021 Google LLC
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
# Author(s): Kevin P. Murphy (murphyk@gmail.com) and Mahmoud Soliman (mjs@aucegypt.edu)
```
<a href="https://opensource.org/licenses/MIT" t... | github_jupyter |
# Inference and Validation
Now that you have a trained network, you can use it for making predictions. This is typically called **inference**, a term borrowed from statistics. However, neural networks have a tendency to perform *too well* on the training data and aren't able to generalize to data that hasn't been seen... | github_jupyter |
# TimeEval shared parameter optimization result analysis
```
# Automatically reload packages:
%load_ext autoreload
%autoreload 2
# imports
import json
import warnings
import pandas as pd
import numpy as np
import scipy as sp
import plotly.offline as py
import plotly.graph_objects as go
import plotly.figure_factory as ... | github_jupyter |
## Tacotron 2 inference code
Edit the variables **checkpoint_path** and **text** to match yours and run the entire code to generate plots of mel outputs, alignments and audio synthesis from the generated mel-spectrogram using Griffin-Lim.
#### Import libraries and setup matplotlib
```
import matplotlib
%matplotlib i... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#label-identity-hairstyle" data-toc-modified-id="label-identity-hairstyle-1"><span class="toc-item-num">1 </span>label identity hairstyle</a></span></li><li><span><a href=... | github_jupyter |
```
import numpy as np
import pandas as pd
```
### loading dataset
```
data = pd.read_csv("student-data.csv")
data.head()
data.shape
type(data)
```
### Exploratory data analysis
```
import matplotlib.pyplot as plt
import seaborn as sns
a = data.plot()
data.info()
data.isnull().sum()
a = sns.heatmap(data.isnull(),cm... | github_jupyter |
### k-means clustering
```
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
import scipy as sc
import scipy.stats as stats
from scipy.spatial.distance import euclidean
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
plt.style.use('fivethi... | github_jupyter |
#1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
```
!pip install git+https://github.com/google/starthinker
```
#2. Get Cloud Project ID
To run this recipe [requires a Google Cloud Project](https://github.com/google/starthinker/blob/mast... | github_jupyter |
<a href="https://colab.research.google.com/github/NataliaDiaz/colab/blob/master/MI203-td2_tree_and_forest.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# TD: prédiction du vote 2016 aux Etats-Unis par arbres de décisions et méthodes ensemblistes
... | github_jupyter |
Osnabrück University - Machine Learning (Summer Term 2018) - Prof. Dr.-Ing. G. Heidemann, Ulf Krumnack
# Exercise Sheet 08
## Introduction
This week's sheet should be solved and handed in before the end of **Sunday, June 3, 2018**. If you need help (and Google and other resources were not enough), feel free to conta... | github_jupyter |
<a href="https://colab.research.google.com/github/Laelapz/Some_Tests/blob/main/BERTimbau.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Tem caracteres em chinês? Pq eles pegam a maior distribuição do dataset???
Tirado do Twitter? (Alguns nomes/sob... | github_jupyter |
# The Binomial Distribution
This notebook is part of [Bite Size Bayes](https://allendowney.github.io/BiteSizeBayes/), an introduction to probability and Bayesian statistics using Python.
Copyright 2020 Allen B. Downey
License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativ... | github_jupyter |
# A/B testing, traffic shifting and autoscaling
### Introduction
In this lab you will create an endpoint with multiple variants, splitting the traffic between them. Then after testing and reviewing the endpoint performance metrics, you will shift the traffic to one variant and configure it to autoscale.
### Table of... | github_jupyter |
# Class Coding Lab: Introduction to Programming
The goals of this lab are to help you to understand:
1. the Jupyter and IDLE programming environments
1. basic Python Syntax
2. variables and their use
3. how to sequence instructions together into a cohesive program
4. the input() function for input and print() functio... | github_jupyter |
# Before your start:
- Read the README.md file
- Comment as much as you can and use the resources (README.md file)
- Happy learning!
```
#import numpy and pandas
```
# Challenge 1 - The `stats` Submodule
This submodule contains statistical functions for conducting hypothesis tests, producing various distributions an... | github_jupyter |
```
# Import libraries
import numpy as np
import pandas as pd
import sklearn as sk
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties # for unicode fonts
import psycopg2
import sys
import datetime as dt
import mp_utils as mp
from sklearn.pipeline import Pipeline
# use... | github_jupyter |
# Fairseq in Amazon SageMaker: Pre-trained English to French translation model
In this notebook, we will show you how to serve an English to French translation model using pre-trained model provided by the [Fairseq toolkit](https://github.com/pytorch/fairseq)
## Permissions
Running this notebook requires permissions... | github_jupyter |
```
import codecs
from itertools import *
import numpy as np
from sklearn import svm
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import GaussianNB
from sklearn import tree
from sklearn import model_selection
from sklearn.model_selection import train_test_split
from sklearn.ensemble impo... | github_jupyter |
# SSD Evaluation Tutorial
This is a brief tutorial that explains how compute the average precisions for any trained SSD model using the `Evaluator` class. The `Evaluator` computes the average precisions according to the Pascal VOC pre-2010 or post-2010 detection evaluation algorithms. You can find details about these ... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W0D4_Calculus/W0D4_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>[](http... | github_jupyter |
# K-means clustering demo
## 1. Different distance metrics
```
from math import sqrt
def manhattan(v1,v2):
res=0
dimensions=min(len(v1),len(v2))
for i in range(dimensions):
res+=abs(v1[i]-v2[i])
return res
def euclidean(v1,v2):
res=0
dimensions=min(len(v1),len(v2))
for i in ra... | github_jupyter |
```
# -*- coding: utf-8 -*-
"""
EVCで変換する.
詳細 : https://pdfs.semanticscholar.org/cbfe/71798ded05fb8bf8674580aabf534c4dbb8bc.pdf
Converting by EVC.
Check detail : https://pdfs.semanticscholar.org/cbfe/71798ded05fb8bf8674580abf534c4dbb8bc.pdf
"""
from __future__ import division, print_function
import os
from shutil imp... | github_jupyter |
<CENTER>
<header>
<h1>Pandas Tutorial</h1>
<h3>EuroScipy, Erlangen DE, August 24th, 2016</h3>
<h2>Joris Van den Bossche</h2>
<p></p>
Source: <a href="https://github.com/jorisvandenbossche/pandas-tutorial">https://github.com/jorisvandenbossche/pandas-tutorial</a>
</header>
</CENTER>
Two data files a... | github_jupyter |
# Using Named Entity Recognition (NER)
**Named entities** are noun phrases that refer to specific locations, people, organizations, and so on. With **named entity recognition**, you can find the named entities in your texts and also determine what kind of named entity they are.
Here’s the list of named entity types f... | github_jupyter |
# Closed-Loop Evaluation
In this notebook you are going to evaluate Urban Driver to control the SDV with a protocol named *closed-loop* evaluation.
**Note: this notebook assumes you've already run the [training notebook](./train.ipynb) and stored your model successfully (or that you have stored a pre-trained one).**
... | github_jupyter |
<a href="https://colab.research.google.com/github/AmanPriyanshu/Reinforcement-Learning/blob/master/DQN_practice.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import torch
import numpy as np
from matplotlib import pyplot as plt
torch.manual_s... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from quantumnetworks import MultiModeSystem, plot_full_evolution
import numpy as np
```
# Trapezoidal Method
```
# params stored in txt
sys = MultiModeSystem(params={"dir":"data/"})
x_0 = np.array([1,0,0,1])
ts = np.linspace(0, 10, 101)
X = sys.trapezoidal(x_0, ts)
fig, ax = plo... | github_jupyter |
# Getting Started with Azure Machine Learning
Azure Machine Learning (*Azure ML*) is a cloud-based service for creating and managing machine learning solutions. It's designed to help data scientists leverage their existing data processing and model development skills and frameworks, and help them scale their workloads... | github_jupyter |
# Introduction
Implementation of the cTAKES BoW method with relation pairs (f.e. CUI-Relationship-CUI) (added to the BoW cTAKES orig. pairs (Polarity-CUI)), evaluated against the annotations from:
> Gehrmann, Sebastian, et al. "Comparing deep learning and concept extraction based methods for patient phenotyping from c... | github_jupyter |
___
<a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
___
# Principal Component Analysis
Let's discuss PCA! Since this isn't exactly a full machine learning algorithm, but instead an unsupervised learning algorithm, we will just have a lecture on this topic, but no full machine learnin... | github_jupyter |
### The **operator** Module
```
import operator
dir(operator)
```
#### Arithmetic Operators
A variety of arithmetic operators are implemented.
```
operator.add(1, 2)
operator.mul(2, 3)
operator.pow(2, 3)
operator.mod(13, 2)
operator.floordiv(13, 2)
operator.truediv(3, 2)
```
These would have been very handy in ou... | github_jupyter |
## This is the basic load and clean stuff
```
# %load ~/dataviz/ExplorePy/clean-divvy-explore.py
import pandas as pd
import numpy as np
import datetime as dt
import pandas.api.types as pt
import pytz as pytz
from astral import LocationInfo
from astral.sun import sun
from astral.geocoder import add_locations, database... | github_jupyter |
## osumapper: create osu! map using Tensorflow and Colab
### -- For osu!mania game mode --
For mappers who don't know how this colaboratory thing works:
- Press Ctrl+Enter in code blocks to run them one by one
- It will ask you to upload .osu file and audio.mp3 after the third block of code
- .osu file needs to have ... | github_jupyter |
```
#setup
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt
import plotly
import seaborn as sns
import plotly.express as px
import plotly.graph_objects as go
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
p... | github_jupyter |
```
from pandas.io.json import json_normalize
from pymongo import MongoClient
from sklearn import linear_model
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
import numpy as np
import pprint
course_cluster_uri = "mongodb://agg-student:agg-password@cluster0-shard-00-0... | github_jupyter |
# Evaluate a privacy policy
Today, virtually every organization with which you interact will collect or use some about you. Most typically, the collection and use of these data will be disclosed according to an organization's privacy policy. We encounter these privacy polices all the time, when we create an account on... | github_jupyter |
<a href="https://colab.research.google.com/github/magenta/ddsp/blob/master/ddsp/colab/tutorials/0_processor.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
##### Copyright 2020 Google LLC.
Licensed under the Apache License, Version 2.0 (the "Licen... | github_jupyter |
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_context('talk')
sns.palplot(sns.color_palette("gray", 100))
new_gray=sns.color_palette("gray",4)
new_gray=[(0, 0, 0), (0.85, 0.85, 0.85)]
```
## Brazil
```
plot_bra2 = pd.read_csv('sensi_withhold_bra.csv')
eff_new... | github_jupyter |
### Tutorial: Parameterized Hypercomplex Multiplication (PHM) Layer
#### Author: Eleonora Grassucci
Original paper: Beyond Fully-Connected Layers with Quaternions: Parameterization of Hypercomplex Multiplications with 1/n Parameters.
Aston Zhang, Yi Tay, Shuai Zhang, Alvin Chan, Anh Tuan Luu, Siu Cheung Hui, Jie Fu.... | github_jupyter |
```
from sklearn import linear_model
import numpy as np
from collections import namedtuple
tokenized_row = namedtuple('tokenized_row', 'sent_count sentences word_count words')
from sklearn.feature_extraction.text import CountVectorizer
import pickle
import csv
def train_sgd(train_targets, train_regressors):
sgd =... | github_jupyter |
# Explore feature-to-feature relationship in Boston
```
import pandas as pd
import seaborn as sns
from sklearn import datasets
import discover
import matplotlib.pyplot as plt
# watermark is optional - it shows the versions of installed libraries
# so it is useful to confirm your library versions when you submit bug re... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.