code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Emily Harvey
## Research question/interests
It would be cool to see how much of the money made overall in Canada had to do with tourism from BC and the breakdown of which categories within tourism BC makes the most money in. As well as overall growth of tourism in Canada and BC from 2014-2017.
```
import pandas as... | github_jupyter |
```
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import numpy as np
from keras.models import load_model
import sys
import pickle
import time
from prepare_data import *
np.random.seed(7)
data = Data('l', shuffle_all_inputs=False)
content = data._read_content('data/SlovarIJS_BESEDE_utf8.lex')
dictio... | github_jupyter |
```
from linebot import LineBotApi
from linebot.exceptions import LineBotApiError
```
# 官方DEMO- Message Type :https://developers.line.me/en/docs/messaging-api/message-types/
# Doc : https://github.com/line/line-bot-sdk-python/blob/master/linebot/models/send_messages.py
```
CHANNEL_ACCESS_TOKEN = "YOUR CHANNEL TOKEN"... | github_jupyter |
```
import pandas as pd
import numpy as np
from pathlib import Path
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction import DictVectorizer
from sklearn.ensemble import RandomForestRegressor
from sklearn.impute import SimpleImputer
from sklearn.inspection imp... | github_jupyter |
# Heikin-Ashi PSAR Strategy
_Roshan Mahes_
In this tutorial, we implement the so-called _Parabolic Stop and Reverse (PSAR)_ strategy. Given any stock, currency or commodity, this indicator tells us whether to buy or sell the stock at any given time. The momentum strategy is based on the open, high, low and close price... | github_jupyter |
## 1. Introduction to pyLHD
pyLHD is a python implementation of the R package [LHD](https://cran.r-project.org/web/packages/LHD/index.html) by Hongzhi Wang, Qian Xiao, Abhyuday Mandal. As of now, only the algebraic construction of Latin hypercube designs (LHD) are implemented in this package. For search algorithms t... | github_jupyter |
# Update the Human Proteome Reference File and KinPred Final Data
This notebook shows the steps to upgrade from 2019-12-12 to 2020-2-26 reference humam proteome, and update the KinPred final data with the new reference human proteome.
```
# IMPORTS
import pandas as pd
import os
import sys
sys.path.append('../Preproce... | github_jupyter |
```
%matplotlib inline
import pyross
import numpy as np
import matplotlib.pyplot as plt
```
# Introduction: Forecast for SEAIRQ model with stochastic parameters
In this notebook, we consider the SEAIRQ model.
We assume that the parameters
* $\beta$ (probability of infection on contact),
* $\gamma_{E}$ (rate of pr... | github_jupyter |
```
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
from tensorflow import keras
tf.keras.backend.clear_session()
from src.models import places_ontop_model
from src import custom_losses, custom_metrics, optimizers
from src.data import data
batch_size = 128
n_... | github_jupyter |
```
from influxdb import InfluxDBClient
client = InfluxDBClient(host='localhost', port=8086)
print(client)
client.create_database('pyexample')
client.switch_database('pyexample')
json_body = [
{
"measurement": "brushEvents",
"tags": {
"user": "Carol",
"brushId": "6c89f539-71c... | github_jupyter |
# NEXUS tool: case study for the Souss-Massa basin - energy demand calculations
In this notebook a case study for the Souss-Massa basin is covered using the `nexustool` package. The water requirements for agricultural irrigation and domestic use were previously calculated using the Water Evaluation and Planning System... | github_jupyter |
# 시각 심화
- **Instructor**: Jongwoo Lim / Jiun Bae
- **Email**: [jlim@hanyang.ac.kr](mailto:jlim@hanyang.ac.kr) / [jiunbae.623@gmail.com](mailto:jiunbae.623@gmail.com)
## Machine Learnig Basic
In this example we will take a quick look at how machine learning works. The goals of this example are as follows:
- Understa... | github_jupyter |
<a href="https://colab.research.google.com/github/NicoleRichards1998/FinRL/blob/master/FinRL_Raytune_with_Alpaca_Paper_Trading.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
print("Setting up colab environment")
!pip uninstall -y -q pyarrow
!pi... | github_jupyter |
```
from __future__ import absolute_import
from __future__ import print_function
import autograd.numpy as np
from autograd import grad
from autograd.extend import notrace_primitive
@notrace_primitive
def resampling(w, rs):
"""
Stratified resampling with "nograd_primitive" to ensure autograd
takes no deriv... | github_jupyter |
[Sebastian Raschka](http://sebastianraschka.com), 2015
https://github.com/rasbt/python-machine-learning-book
# Python Machine Learning - Code Examples
# Chapter 13 - Parallelizing Neural Network Training with Theano
Note that the optional watermark extension is a small IPython notebook plugin that I developed to ma... | github_jupyter |
```
# HIDDEN
from datascience import *
%matplotlib inline
path_data = '../../../data/'
import matplotlib.pyplot as plots
plots.style.use('fivethirtyeight')
import numpy as np
```
### Confidence Intervals ###
We have developed a method for estimating a parameter by using random sampling and the bootstrap. Our method pr... | github_jupyter |
```
!pip install --upgrade tables
!pip install eli5
!pip install xgboost
!pip install hyperopt
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn.metrics import mean_absolute_error as mae
from sklearn.model_selection import cross_val_score, KFold
from hyperopt import hp, fmin, tpe, STATUS_OK
... | github_jupyter |
Interactive analysis with python
--------------------------------
Before starting this tutorial, ensure that you have set up _tangos_ [as described here](https://pynbody.github.io/tangos/) and the data sources [as described here](https://pynbody.github.io/tangos/data_exploration.html).
We get started by importing the... | github_jupyter |
n=b
```
# Binary representation ---> Microsoft
# Difficulty: School Marks: 0
'''
Write a program to print Binary representation of a given number N.
Input:
The first line of input contains an integer T, denoting the number of test cases. Each test case contains an integer N.
Output:
For each test case, print the b... | github_jupyter |
___
<a href='http://www.pieriandata.com'><img src='../Pierian_Data_Logo.png'/></a>
___
<center><em>Copyright Pierian Data</em></center>
<center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center>
# Introduction to Forecasting
In the previous section we fit ... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from tqdm import tqdm
from hiv_patient import HIVPatient
from buffer import Buffer
```
### Create dataset
```
patient = HIVPatient(clipping=False,logscale=False)
FQI_buffer = Buffer(50000)
for j in tqdm(range(30)):
s = patient.reset(mode="u... | github_jupyter |
# Generative models - variational auto-encoders
### Author: Philippe Esling (esling@ircam.fr)
In this course we will cover
1. A [quick recap](#recap) on simple probability concepts (and in TensorFlow)
2. A formal introduction to [Variational Auto-Encoders](#vae) (VAEs)
3. An explanation of the [implementation](#imple... | github_jupyter |
# Tutorial 3 - Boosting Search via Symmetry Breaking, Implied Constraints, Randomisation, and Restarts
revisit the exact parameters so that restars work)
**Please do not read untill you fully finish the first 2 tutorials**
Congratulations! you are now level one constraint programmer: you know the basics on how to mo... | 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 packa... | github_jupyter |
[View in Colaboratory](https://colab.research.google.com/github/3catz/DeepLearning-NLP/blob/master/Time_Series_Forecasting_with_EMD_and_Fully_Convolutional_Neural_Networks_on_the_IRX_data_set.ipynb)
# TIME SERIES FORECASTING -- using Empirical Mode Decomposition with Fully Convolutional Networks for One-step ahead for... | github_jupyter |
<a href="https://colab.research.google.com/github/mizoru/blog/blob/master/2022-05-24-thunder-speech-pronunciation-trainer.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Finetuning a pretrained QuartzNet on TIMIT
using [thunder-speech](https://git... | github_jupyter |
<a href="https://colab.research.google.com/github/unicamp-dl/IA025_2022S1/blob/main/ex07/Guilherme_Pereira/Aula_7_Guilherme_Pereira.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
nome = 'Guilherme Pereira'
print(f'Meu nome é {nome}')
```
# Ex... | github_jupyter |
# Network Training
## Includes
```
# mass includes
import os, sys, warnings
import ipdb
import torch as t
import torchnet as tnt
from tqdm.notebook import tqdm
# add paths for all sub-folders
paths = [root for root, dirs, files in os.walk('.')]
for item in paths:
sys.path.append(item)
from ipynb.fs.full.config ... | github_jupyter |
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# Challenge Notebook
## Problem: Implement breadth-first traversal on a binary tree.
* [Constraints](#Constraints)
* [Test Cases](#Test-C... | github_jupyter |
# Spatial merge census and precinct data
This notebook will join precincts with census data.
Spatial unit of analysis is the precinct.
The aim is to join census data to each precinct. The problem is the precinct and block group boundaries don't match up.
So, calculate census values for each precinct this way... | github_jupyter |
```
from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
%matplotlib inline
#Importamos nuestros módulos y clases necesarias
import Image_Classifier as img_clf
import Labeled_Image as li
import classifiers as clfs
from skimage import i... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import missingno as msno
pd.set_option('display.max_rows', 40)
pd.set_option('display.max_columns', 20)
pd.set_option('display.width', 200)
def explore_df(df):
print(df.shape)
... | github_jupyter |
# COMP90051 Workshop 3
## Logistic regression
***
In this workshop we'll be implementing L2-regularised logistic regression using `scipy` and `numpy`.
Our key objectives are:
* to become familiar with the optimisation problem that sits behind L2-regularised logistic regression;
* to apply polynomial basis expansion a... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
```
## Does nn.Conv2d init work well?
[Jump_to lesson 9 video](https://course.fast.ai/videos/?lesson=9&t=21)
```
#export
from exp.nb_02 import *
def get_data():
path = datasets.download_data(MNIST_URL, ext='.gz')
with gzip.open(path, 'rb') as f:
... | github_jupyter |
```
import numpy as np
import pandas as pd
from sklearn import *
import warnings; warnings.filterwarnings("ignore")
train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')
sub = pd.read_csv('../input/sample_submission.csv')
train.shape, test.shape, sub.shape
```
Wordplay in Column Names
====... | github_jupyter |
# Accessing the Trigger
In ATLAS all access to event trigger decision is via the Trigger Decision Tool (TDT). There is quite a bit of information attached to the trigger, and its layout is quite complex - for that reason one should use the TDT to access the data. It is not really possible for a human to navigate the d... | github_jupyter |
# Additive Secret Sharing
Author:
- Carlos Salgado - [email](mailto:csalgado@uwo.ca) - [linkedin](https://www.linkedin.com/in/eng-socd/) - [github](https://github.com/socd06)
## Additive Secret Sharing
Additive Secret Sharing is a mechanism to share data among parties and to perform computation on it.

- [pomegranite]()
- [r calculate AIC/BIC of model](https://rdrr.io/cran/HMMpa/man/AIC_HMM.html)
- [comparison between pomegranite and hmmlearn (with notebook)](https://kyso.io/share/pomegranate-vs-hmmlearn#files)
- [discussion of AIC... | github_jupyter |
# TensorFlow Tutorial #05
# Ensemble Learning
by [Magnus Erik Hvass Pedersen](http://www.hvass-labs.org/)
/ [GitHub](https://github.com/Hvass-Labs/TensorFlow-Tutorials) / [Videos on YouTube](https://www.youtube.com/playlist?list=PL9Hr9sNUjfsmEu1ZniY0XpHSzl5uihcXZ)
## Introduction
This tutorial shows how to use a so-... | github_jupyter |
#### _Speech Processing Labs 2020: Signals: Module 1_
```
## Run this first!
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import cmath
from math import floor
from matplotlib.animation import FuncAnimation
from IPython.display import HTML
plt.style.use('ggplot')
## some helper functions:
fro... | github_jupyter |
```
import pandas as pd
#This is the Richmond USGS Data gage
river_richmnd = pd.read_csv('JR_Richmond02037500.csv')
river_richmnd.dropna();
#Hurricane data for the basin - Names of Relevant Storms - This will be used for getting the storms from the larger set
JR_stormnames = pd.read_csv('gis_match.csv')
# Bring in the ... | github_jupyter |
# Scalable Recommendation with Poisson Factorization - Computation Statistics Project 1
#### The following notebook is an example of the use of the implementation of the mean-field variational algorithm for approximate posterior inference for the Hierarchical Poisson Factorization, by Gopalan et al. (2013).
The variat... | github_jupyter |
```
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O... | github_jupyter |
# Lecture 8: Fitting Generalized Linear Models (Part II)
```
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context('talk')
sns.set_style('white')
%matplotlib inline
```
## Objectives
+ Maximum Posterior Estimate
+ Bayesian Linear Regression
+ Evidence Approximation
+ Automatic Rele... | github_jupyter |
# Optimization of a Dissipative Quantum Gate
```
# NBVAL_IGNORE_OUTPUT
%load_ext watermark
import sys
import os
import qutip
import numpy as np
import scipy
import matplotlib
import matplotlib.pylab as plt
import krotov
import copy
from functools import partial
from itertools import product
%watermark -v --iversions
`... | github_jupyter |
# Working with Scikit-learn
This notebook shows how PySINDy objects interface with some useful tools from [Scikit-learn](https://scikit-learn.org/stable/).
## Setup
```
import numpy as np
from scipy.integrate import odeint
import pysindy as ps
```
Let's generate some training data from the [Lorenz system](https://e... | github_jupyter |
# An Introduction to Natural Language in Python using spaCy
## Introduction
This tutorial provides a brief introduction to working with natural language (sometimes called "text analytics") in Pytho, using [spaCy](https://spacy.io/) and related libraries.
Data science teams in industry must work with lots of text, one... | github_jupyter |
```
%load_ext watermark
%watermark -d -u -a 'Andreas Mueller, Kyle Kastner, Sebastian Raschka' -v -p numpy,scipy,matplotlib,scikit-learn
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
```
# SciPy 2016 Scikit-learn Tutorial
# In Depth - Support Vector Machines
SVM stands for "support vector m... | github_jupyter |
# Think Bayes
This notebook presents example code and exercise solutions for Think Bayes.
Copyright 2018 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
```
# Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignmen... | github_jupyter |
<img width="10%" alt="Naas" src="https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160"/>
# YahooFinance - Get Stock Update
<a href="https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/YahooFinance/YahooFinance_Get_Stock_Update.ipynb" ... | github_jupyter |
Before we begin, let's execute the cell below to display information about the CUDA driver and GPUs running on the server by running the `nvidia-smi` command. To do this, execute the cell block below by giving it focus (clicking on it with your mouse), and hitting Ctrl-Enter, or pressing the play button in the toolbar ... | github_jupyter |
## Face and Facial Keypoint detection
After you've trained a neural network to detect facial keypoints, you can then apply this network to *any* image that includes faces. The neural network expects a Tensor of a certain size as input and, so, to detect any face, you'll first have to do some pre-processing.
1. Detect... | github_jupyter |
# Recruitment Across Datasets
In this notebook, we further examine the capability of ODIF to transfer across datasets, building upon the prior FTE/BTE experiments on MNIST and Fashion-MNIST. Using the datasets found in [this repo](https://github.com/neurodata/LLF_tidy_images), we perform a series of experiments to eva... | github_jupyter |
```
# noexport
import os
os.system('export_notebook browser_libs.ipynb')
import os
if 'R_HOME' not in os.environ:
os.environ['R_HOME'] = '/usr/lib/R'
%load_ext rpy2.ipython
import json
import urllib.request as req
from memoize import memoize # pip install memoize2
from pymongo import MongoClient
from getsecret impor... | github_jupyter |
## Plot the throughput of experiment 1 of version 3
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import requests
import io
import glob
```
## Function Read CSV files of Throughput from Iperf log
```
def getDataframeThru(df,start_row,measurement_interval,header_range):
'''
This f... | github_jupyter |
$\newcommand{\xv}{\mathbf{x}}
\newcommand{\wv}{\mathbf{w}}
\newcommand{\Chi}{\mathcal{X}}
\newcommand{\R}{\rm I\!R}
\newcommand{\sign}{\text{sign}}
\newcommand{\Tm}{\mathbf{T}}
\newcommand{\Xm}{\mathbf{X}}
\newcommand{\Im}{\mathbf{I}}
\newcommand{\Ym}{\mathbf{Y}}
$
### ITCS8010
# G_np Simulation Experiment
I... | github_jupyter |
# Project 1: Babynames
## I. Characterise One File
### 1. Read the data
- Read the file yob2000.txt
- Name the columns
- Print the first 10 entries
```
import pandas as pd
from matplotlib import pyplot as plt
popular_names = pd.read_csv('yob2000.csv',
names = ['Names', 'Sex'... | github_jupyter |
## Classify Radio Signals from Space using Keras
In this experiment, we attempt to classify radio signals from space.
Dataset has been provided by SETI. Details can be found here:
https://github.com/setiQuest/ML4SETI/blob/master/tutorials/Step_1_Get_Data.ipynb
## Import necessary libraries
```
import pandas as pd
i... | github_jupyter |
### building a dask array without knowing sizes
#### from dask.dataframe
```
from dask import array as da, dataframe as ddf, delayed, compute
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
da.from_delayed
def get_chunk_df(array_size,n_cols):
col_names = [f"col_{i}" for i in range(n_cols)]... | github_jupyter |
## Linear Regression with PyTorch
#### Part 2 of "PyTorch: Zero to GANs"
*This post is the second in a series of tutorials on building deep learning models with PyTorch, an open source neural networks library developed and maintained by Facebook. Check out the full series:*
1. [PyTorch Basics: Tensors & Gradients](... | github_jupyter |
# Spin-polarized calculations with BigDFT
The goal of this notebook is to explain how to do a spin-polarized calculation with BigDFT (`nspin=2`).
We start with the molecule O$_2$ and a non-spin polarized calculation, which is the code default.
To do that we only have to specify the atomic positions of the molecule.
`... | github_jupyter |
<a href="https://colab.research.google.com/github/GoogleCloudPlatform/training-data-analyst/blob/master/courses/fast-and-lean-data-science/01_MNIST_TPU_Keras.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## MNIST on TPU (Tensor Processing Unit)<br... | github_jupyter |
```
import folium
from folium.plugins import MarkerCluster
import pandas as pd
import branca
import json
import numpy as np
import vincent
import os
from folium.plugins import Draw
import numpy as np
from folium.plugins import HeatMap
print(folium.__version__)#muestra la version actual de la libreria
```
#### conda i... | github_jupyter |
```
# This cell is for the Google Colaboratory
# https://stackoverflow.com/a/63519730
if 'google.colab' in str(get_ipython()):
# https://colab.research.google.com/notebooks/io.ipynb
import google.colab.drive as gcdrive
# may need to visit a link for the Google Colab authorization code
gcdrive.mount("/content/dr... | github_jupyter |
```
%pylab inline
import os
import keras
import metrics
import numpy as np
import pandas as pd
import seaborn as sns
import keras.backend as K
import glob
from scipy.io import loadmat
from IPython.display import display, clear_output
from time import time
from keras import callbacks
from keras.models import Model, ... | github_jupyter |
```
import numpy as np
import pandas as pd
df_can = pd.read_excel('https://ibm.box.com/shared/static/lw190pt9zpy5bd1ptyg2aw15awomz9pu.xlsx',
sheet_name='Canada by Citizenship',
skiprows=range(20),
skip_footer=2
)
print('Data dow... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import warnings
import pandas as pd
import numpy as np
import os
import sys # error msg, add the modules
import operator # sorting
from math import *
import matplotlib.pyplot as plt
sys.path.append('../../')
import read_trace
import cuda_timeline
# from avgblkmodel import *
from... | github_jupyter |
```
import numpy as np
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
import plotly.graph_objects as go
from tqdm import tqdm
from scipy.spatial.distance import cdist
from sklearn.metrics import roc_curve, roc_auc_score
timings = Path('timings/')
raw_data = Path('surface_data/raw/protein_s... | github_jupyter |
## Student Activity on Advanced Data Structure
In this activity we will have to do the following tasks
- Look up the definition of permutations, and dropwhile from [itertools documentation](https://docs.python.org/3/library/itertools.html) in Python
- Using permutations generate all possible three digit numbers that ... | github_jupyter |
# Using custom containers with Vertex AI Training
**Learning Objectives:**
1. Learn how to create a train and a validation split with BigQuery
1. Learn how to wrap a machine learning model into a Docker container and train in on Vertex AI
1. Learn how to use the hyperparameter tuning engine on Vertex AI to find the be... | github_jupyter |
---
**Universidad de Costa Rica** | Escuela de Ingeniería Eléctrica
*IE0405 - Modelos Probabilísticos de Señales y Sistemas*
### `PyX` - Serie de tutoriales de Python para el análisis de datos
# `Py5` - *Curvas de ajuste de datos*
> Los modelos para describir un fenómeno y sus parámetros pueden obtenerse a partir... | github_jupyter |
# This task is not quite ready as we don't have an open source route for simulating geometry that requires imprinting and merging. However this simulation can be carried out using Trelis.
# Heating Mesh Tally on CAD geometry made from Components
This constructs a reactor geometry from 3 Component objects each made fr... | github_jupyter |
# MDT Validation Notebook
Validated on Synthea +MDT population vs MEPS for Pediatric Asthma
```
import pandas as pd
import datetime as dt
import numpy as np
from scipy.stats import chi2_contingency
```
# Grab medication RXCUI of interest
Grabs the MEPS product RXCUI lists for filtering of Synthea to medicati... | github_jupyter |
---

---
# Operadores
Os operadores são usados para realizar operações sobre valores e variáveis. Os operadores manipulam e retornam valores de acordo com sua funcionalidade. Eles podem ser representados por palavras reservadas ou caracteres especiais (símbolos).
- [Operadores A... | github_jupyter |
# Face Generation
In this project, we will define and train a DCGAN on a dataset of faces. Our goal is to get a generator network to generate *new* images of faces that look as realistic as possible!
### Get the Data
You'll be using the [CelebFaces Attributes Dataset (CelebA)](http://mmlab.ie.cuhk.edu.hk/projects/C... | github_jupyter |
```
#default_exp transform
#export
from local.torch_basics import *
from local.test import *
from local.notebook.showdoc import show_doc
from PIL import Image
```
# Transforms
> Definition of `Transform` and `Pipeline`
The classes here provide functionality for creating a composition of *partially reversible functio... | github_jupyter |
```
import numpy as np
import pandas as pd
from tqdm import tqdm_notebook, tqdm
from scipy.spatial.distance import jaccard
from surprise import Dataset, Reader, KNNBasic, KNNWithMeans, SVD, SVDpp, accuracy
from surprise.model_selection import KFold, train_test_split, cross_validate, GridSearchCV
import warnings
warni... | github_jupyter |
<a href="https://colab.research.google.com/github/ArpitaChatterjee/Comedian-transcript-Analysis/blob/main/Exploratory_Data_Analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#To find the pattern of each comedian and find the reason of the lika... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
deforestation_df = pd.read_excel('data/Brazil_research/raw_data/savedrecs 1_1000.xls')
for i in range(1000, 43000, 1000):
temp_df = pd.read_excel(f'data/Brazil_research/raw_data/savedrecs {i+1}_{i+1000}.xls')
deforestation_df = pd.concat... | github_jupyter |
# Going deeper with Tensorflow
В этом семинаре мы начнем изучать [Tensorflow](https://www.tensorflow.org/) для построения deep learning моделей.
Для установки tf на свою машину
* `pip install tensorflow` версия с поддержкой **cpu-only** для Linux & Mac OS
* для автомагической поддержки GPU смотрите документацию [TF ... | github_jupyter |
<a href="https://colab.research.google.com/github/iued-uni-heidelberg/DAAD-Training-2021/blob/main/cord19download2text.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Downloading and reading CORD19 corpus
This notebook downloads and reads the free... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Project: **Finding Lane Lines on the Road**
***
In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j... | github_jupyter |
<link rel="stylesheet" href="../../styles/theme_style.css">
<!--link rel="stylesheet" href="../../styles/header_style.css"-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<table width="100%">
<tr>
<td id="image_td" width="15%" class="head... | github_jupyter |
```
import pandas as pd
import os
import time
import re
import numpy as np
import json
from urllib.parse import urlparse, urljoin
run_root = "/home/icejm/Code/OpenWPM/stockdp/page_ana/"
# gather all potent/black links
count = 0
for root, dirs, files in os.walk(os.path.abspath('.')):
if len(dirs)==0:
for i i... | github_jupyter |
# 3D Tic-Tac-Toe
## Objective and Prerequisites
Try this logic programming example to learn how to solve the problem of arranging X’s and O’s on a three-dimensional Tic-Tac-Toe board so as to minimize the number of completed lines or diagonals. This example will show you how a binary programming model can be used to ... | github_jupyter |
# Trust Scores applied to MNIST
It is important to know when a machine learning classifier's predictions can be trusted. Relying on the classifier's (uncalibrated) prediction probabilities is not optimal and can be improved upon. *Trust scores* measure the agreement between the classifier and a modified nearest neighb... | github_jupyter |
# CSAILVision semantic segmention models
This is a semantic segmentation notebook using an [ADE20K](http://groups.csail.mit.edu/vision/datasets/ADE20K/) pretrained model from the open source project [CSAILVision/semantic-segmentation-pytorch](https://github.com/CSAILVision/semantic-segmentation-pytorch).
For other de... | github_jupyter |
# In-Class Coding Lab: Functions
The goals of this lab are to help you to understand:
- How to use Python's built-in functions in the standard library.
- How to write user-defined functions
- The benefits of user-defined functions to code reuse and simplicity.
- How to create a program to use functions to solve a com... | github_jupyter |
```
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from tqdm import tqdm
%matplotlib inline
from torch.utils.data import Dataset, DataLoader
import torch
import torchvision
import torch.nn as nn
import torch.optim as optim
from torch.nn import functional as F
device = torch.device("cuda" i... | github_jupyter |
# Bayesian Camera Calibration
> Let's apply Bayesian analysis to calibrate a camera
- toc: true
- badges: true
- comments: true
- categories: [Bayesian, Computer Vision]
- image: images/2020-03-28-Bayesian-Camera-Calibration/header.jpg
```
import numpy as np
import matplotlib.pyplot as plt
import pymc3 as pm
plt.rc... | github_jupyter |
# Projet de Machine Learning : Test de classification bout en bout
## 1.Chargement des données
```
#importation des modules necessaires
import pyspark
from pyspark.sql import SparkSession
import joblib
#creation d'une session spark
mon_spark=SparkSession.builder.master("local").appName("MLproject").getOrCreate()
c... | github_jupyter |
# How to read data from varius file formats
some of the most basic things noone ever treaches you is how to actually access your data in various formats. This notebook shows a couple of examples on how to read data from a number of sources. Feel free to edit this notebook with more methods that you have worked with.
... | github_jupyter |
# Filtering Rows
```
# import pandas
import pandas as pd
# read movie data
movies = pd.read_csv("http://bit.ly/imdbratings")
# examine first few rows
movies.head()
```
## Filtering Movies with `for` Loop
```
booleans = []
for length in movies.duration:
if length >= 200:
booleans.append(True)
el... | github_jupyter |
```
import numpy as np
from scipy import linalg
from scipy import optimize
import sympy as sm
%matplotlib inline
import matplotlib.pyplot as plt
import ipywidgets as widgets
```
The following Model Project is based on the classic Solow model as we know it from Macroeconomics. First, we will model the Solow model in it... | github_jupyter |
```
from itertools import combinations
import qiskit
import numpy as np
import tqix
import sys
def generate_u_pauli(num_qubits):
lis = [0, 1, 2]
coms = []
if num_qubits == 2:
for i in lis:
for j in lis:
coms.append([i, j])
if num_qubits == 3:
for i in lis:
... | github_jupyter |
# Building a docker container for training/deploying our classifier
In this exercise we'll create a Docker image that will have the required code for training and deploying a ML model. In this particular example, we'll use scikit-learn (https://scikit-learn.org/) and the **Random Forest Tree** implementation of that l... | github_jupyter |
```
import cv2
record = False
cap = cv2.VideoCapture(0)
if (cap.isOpened() == False):
print("Unable to read camera feed")
frame_width = int(cap.get(3))
frame_height = int(cap.get(4))
out = cv2.VideoWriter('output.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 10, (frame_width,frame_height))
while(True):
ret, ... | github_jupyter |
# Simulate Artificial Physiological Signals
Neurokit's core signal processing functions surround electrocardiogram (ECG), respiratory (RSP), electrodermal activity (EDA), and electromyography (EMG) data. Hence, this example shows how to use Neurokit to simulate these physiological signals with customized parametric co... | github_jupyter |
```
# All necessary imports here
import oci
import os.path
import sys
import json
import logging
import pprint
import re
from collections import Counter
import ipaddr #pip3 install ipaddr
# Read config and create clients (identity,network,etc.)
config = oci.config.from_file()
identity_client = oci.identity.IdentityCl... | github_jupyter |
<a href="https://colab.research.google.com/github/cstorm125/abtestoo/blob/master/notebooks/frequentist_colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# A/B Testing from Scratch: Frequentist Approach
Frequentist A/B testing is one of the most... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.