code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# NLP Intent Recognition
Hallo und herzlich willkommen zum codecentric.AI bootcamp!
Heute wollen wir uns mit einem fortgeschrittenen Thema aus dem Bereich _natural language processing_, kurz _NLP_, genannt, beschäftigen:
> Wie bringt man Sprachassistenten, Chatbots und ähnlichen Systemen bei, die Absicht eines Nutze... | github_jupyter |
# Tutorial de RISE - parte 1
> Aspectos básicos para hacer presentaciones interactivas con jupyter notebooks
- featured: false
- hide: false
- toc: true
- badges: true
- comments: true
- categories: [jupyter, rise]
- image: images/preview/rise.gif
- permalink: /tutorial-rise-1/
Esta es la parte 1 de 3 del [tutorial d... | github_jupyter |
### Imports
```
# Import the dependencies.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from citipy import citipy
```
### Get Random Coordinates
```
# Create a set of random latitude and longitude combinations.
lats = np.random.uniform(low=-90.000, high=90.000, size=2000)
lngs = np.random.u... | github_jupyter |
<!--BOOK_INFORMATION-->
<img align="left" style="padding-right:10px;" src="fig/cover-small.jpg">
*This notebook contains an excerpt from the [Whirlwind Tour of Python](http://www.oreilly.com/programming/free/a-whirlwind-tour-of-python.csp) by Jake VanderPlas; the content is available [on GitHub](https://github.com/jake... | github_jupyter |
<a href="https://colab.research.google.com/github/egy1st/denmune-clustering-algorithm/blob/main/colab/validation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import pandas as pd
import time
import os.path
import warnings
warnings.filterwarni... | github_jupyter |
Copyright 2018 Google Inc.
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 distribut... | github_jupyter |
##### Copyright 2018 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
<a href="https://colab.research.google.com/github/masvgp/math_3280/blob/main/CS246_Colab_5.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# CS246 - Colab 5
## PageRank
### Setup
First of all, we authenticate a Google Drive client to download the ... | github_jupyter |
## Activity 4.06: Visualizing the Impact of Education on Annual Salary and Weekly Working Hours
You're asked to get insights whether the education of people has an influence on the annual salary and weekly working hours. You ask 500 people in the state of New York about their age, annual salary, weekly working hours, a... | github_jupyter |
# Lab 2: networkX Drawing and Network Properties
```
import matplotlib.pyplot as plt
import pandas as pd
from networkx import nx
```
## TOC
1. [Q1](#Q1)
2. [Q2](#Q2)
3. [Q3](#Q3)
4. [Q4](#Q4)
```
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(11, 8))
ax = axes.flatten()
path = nx.path_graph(5)
nx.draw_networkx... | github_jupyter |
# Lesson 1 Experiments
This section just reproduces lesson 1 logic using my own code and with 30 tennis and 30 basketball player images. I chose all male players for simplicity.
```
# Put these at the top of every notebook, to get automatic reloading and inline plotting
%reload_ext autoreload
%autoreload 2
%matplotlib... | 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 |
# Tutorial
In this notebook, we will see how to pass your own encoder and decoder's architectures to your VAE model using pythae!
```
# If you run on colab uncomment the following line
#!pip install git+https://github.com/clementchadebec/benchmark_VAE.git
import torch
import torchvision.datasets as datasets
import ma... | github_jupyter |
# Chapter 3 : pandas
```
#load watermark
%load_ext watermark
%watermark -a 'Gopala KR' -u -d -v -p watermark,numpy,pandas,matplotlib,nltk,sklearn,tensorflow,theano,mxnet,chainer,seaborn,keras,tflearn,bokeh,gensim
```
# pandas DataFrames
```
import numpy as np
import scipy as sp
import pandas as pd
```
## Load the d... | github_jupyter |
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from ttim import *
```
### Theis
```
from scipy.special import exp1
def theis(r, t, T, S, Q):
u = r ** 2 * S / (4 * T * t)
h = -Q / (4 * np.pi * T) * exp1(u)
return h
def theisQr(r, t, T, S, Q):
u = r ** 2 * S / (4 * T * t)
... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
from sklearn.tree import DecisionTreeRegressor
from sklearn.model_selection import train_test_split
from sklearn.preproces... | github_jupyter |
<a href="https://colab.research.google.com/github/oughtinc/ergo/blob/notebooks-readme/notebooks/covid-19-inference.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Notes
* Switch to Italy
* Graph data and results
* Add variable for true initial infe... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import argparse
import sys
from time import sleep
import numpy as np
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
from rdkit.Chem.Crippen import MolLogP
from sklearn.metrics import accuracy_score, mean_squared_error
import torch
import torch.nn as nn
impo... | github_jupyter |
# Control
In this notebook we want to control the chaos in the Henon map. The Henon map is defined by
$$
\begin{align}
x_{n+1}&=1-ax_n^2+y_n\\
y_{n+1}&=bx_n
\end{align}.
$$
```
from plotly import offline as py
from plotly import graph_objs as go
py.init_notebook_mode(connected=True)
```
### Fixed points
First we ... | github_jupyter |
## Extracting Titanic Disaster Data From Kaggle
```
!pip install python-dotenv
from dotenv import load_dotenv, find_dotenv
# find .env automatically by walking up directories until it's found
dotenv_path = find_dotenv()
# load up the entries as environment variables
load_dotenv(dotenv_path)
# extracting environment va... | github_jupyter |
# Single model
```
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 SimulatedMinimumDistance as SMD
import figs
import funs
# Global modules
import numpy as np
import matplotlib... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Logistic-Regression" data-toc-modified-id="Logistic-Regression-1"><span class="toc-item-num">1 </span>Logistic Regression</a></span><ul class="toc-item"><li><span><a href="#Logistic-Function" dat... | github_jupyter |
# Low-Level API
## Prerequisites
If you've already completed the instructions on the **Installation** page, then let's get started.
```
import aiqc
from aiqc import datum
```
## 1. Ingest a `Dataset`
### Object Relational Model (ORM)
At the moment, AIQC supports the following types of Datasets:
* Single-file tab... | github_jupyter |
# CNTK 201A Part A: CIFAR-10 Data Loader
This tutorial will show how to prepare image data sets for use with deep learning algorithms in CNTK. The CIFAR-10 dataset (http://www.cs.toronto.edu/~kriz/cifar.html) is a popular dataset for image classification, collected by Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. ... | github_jupyter |
##### Copyright 2018 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
#@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 |
# MARATONA BEHIND THE CODE 2020
## DESAFIO 2: PARTE 1
### Introdução
Em projetos de ciência de dados visando a construção de modelos de *machine learning*, ou aprendizado estatístico, é muito incomum que os dados iniciais estejam já no formato ideal para a construção de modelos. São necessários vários passos interme... | github_jupyter |
```
import os
import time
import random
import pandas as pd
import numpy as np
import gc
import re
import torch
from torchtext import data
import spacy
from tqdm import tqdm_notebook, tnrange
from tqdm.auto import tqdm
from unidecode import unidecode
import random
tqdm.pandas(desc='Progress')
from collections import C... | github_jupyter |
# Discrete stochastic Erlang SEIR model
Author: Lam Ha @lamhm
Date: 2018-10-03
## Calculate Discrete Erlang Probabilities
The following function is to calculate the discrete truncated Erlang probability, given $k$ and $\gamma$:
\begin{equation*}
p_i =
\frac{1}{C(n^{E})}
\Bigl(\sum_{j=0}^{k-1}
\frac{e^{-(i-1)\g... | github_jupyter |
```
import numpy as np
import random
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
def GenerateData(c1, r1, c2, r2, N):
X = []
Y = []
for i in range(N):
r_1 = np.random.uniform(0, r1)
theta = np.random.uniform(0, 2*np.pi)
x1 = c1 + r_1... | github_jupyter |
# <div align="center">Random Forest Classification in Python</div>
---------------------------------------------------------------------
you can Find me on Github:
> ###### [ GitHub](https://github.com/lev1khachatryan)
<img src="asset/main.png" />
<a id="top"></a> <br>
## Notebook Content
1. [The random forests al... | github_jupyter |
# 01. GAN with MNIST
```
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import torchvision.datasets as dsets
import torchvision.transforms as transforms
import numpy as np
import os
import matplotlib.pyplot as plt
%matplotlib inline
# GPU 체크
device = torch.device('cuda' if torch.cu... | github_jupyter |
Aнализ данных в R
====================
---
Часть 3 - Анализ данных – карта смертности и заражений
--------------------
В связи с тем, что пандемия была спровоцирована вирусом COVID-19, который охватил целый мир, было бы логичным отобразить данные на карте мира.
<br><br>
Существенным элементом была разрисовка карты ... | github_jupyter |
## Traffic on the I-94 Interstate highway.

source:<a href=https://en.wikipedia.org/wiki/Interstate_94> https://en.wikipedia.org/wiki/Interstate_94 </a>
## Introducction to Interstate 94 (I-94)
Is ... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sn
usage = pd.read_csv('usage_data.csv')
usage.head()
usage.shape
usage.isna().sum()
duplicate = usage.duplicated()
duplicate.sum()
usage.drop_duplicates(inplace=True)
usage.shape
m_part_consumption = pd.read_csv('maintenance_p... | github_jupyter |
<a href="https://colab.research.google.com/github/zjzsu2000/CMPE297_AdvanceDL_Project/blob/main/Data_Preprocessing/Final_result.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import pandas as pd
import numpy as np
from google.colab import drive... | github_jupyter |
```
# hide
# all_tutorial
! [ -e /content ] && pip install -Uqq mrl-pypi # upgrade mrl on colab
```
# Tutorial - Conditional LSTM Language Models
>Training and using conditional LSTM language models
## LSTM Language Models
LSTM language models are a type of autoregressive generative model. This particular type of ... | github_jupyter |
# Isolation Forest (IF) Algorithm Documentation
The aim of this document is to explain the Isolation Forest algorithm in Seldon's outlier detection framework.
First, we provide a high level overview of the algorithm and the use case, then we will give a detailed explanation of the implementation.
## Overview
Outlie... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# Hyperparameter Tuning of the Online Anomaly Detection algorithm
## Introduction
In the previous notebook, you learned to leverage the AML SDK features for Machine Learning experimentation to test the performance of our onlin... | github_jupyter |
<center>
<img src="../../img/ods_stickers.jpg">
## Open Machine Learning Course
<center>Author: [Yury Kashnitsky](https://www.linkedin.com/in/festline)
First baseline in Kaggle Inclass [competition](https://www.kaggle.com/c/how-good-is-your-medium-article) "How good is your Medium article?"
Import libraries.
```
imp... | github_jupyter |
```
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow import keras
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)
print(physical_devices)
```
From https://www.tensorflow.org/api_docs/pyt... | github_jupyter |
# Decisiton Tree interpretability notebook
```
import os
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.tree import plot_tree
from dtreeviz.trees import *
from pycaret import classification
```
### Exploratory data analysis
Import to specify correctly the data path. Initally we can make an easy exp... | github_jupyter |
```
import os
#download face database.
if not os.path.isfile('./FaceDB.zip'):
!gdown --id 'replace this with google drive link'
#or download it from wherever you want it
#unzip the database.
if not os.path.isdir('./FaceDB'):
!unzip -oq FaceDB.zip -d "./FaceDB"
#create folder for trained models to be saved.
if no... | github_jupyter |
# OpenCV example. Show webcam image and detect face.
It uses Lena's face and add random noise to it if the video capture doesn't work for some reason.
https://gist.github.com/astanin/3097851
<table >
<tr>
<th></th>
<th>. All the code examples should work f... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
```
# Numerical Integration
The definite integral $\int_a^b f(x) dx$ can be computed exactly if the primitive $F$ of $f$ is known, e.g.
```
f = lambda x: np.divide(np.dot(x,np.exp(x)),np.power(x+1,2))
F = lambda x: np.divide(np.exp(x),(x+1))
... | github_jupyter |
```
! pip install datasets transformers
from huggingface_hub import notebook_login
notebook_login()
model_checkpoint = "xlm-roberta-large" # "xlm-roberta-base" # "xlm-roberta-large" # "bert-base-multilingual-uncased" # "distilbert-base-uncased"
batch_size = 4
from google.colab import drive
drive.mount('/content/drive... | github_jupyter |
# Principal Component Analysis (PCA)
We will implement the PCA algorithm. We will first implement PCA, then apply it (once again) to the MNIST digit dataset.
## Learning objective
1. Write code that implements PCA.
2. Write code that implements PCA for high-dimensional datasets
Let's first import the packages we need... | github_jupyter |
# 012_importing_datasets
[Source](https://github.com/iArunava/Python-TheNoTheoryGuide/)
```
# Required Imports
import pandas as pd
import sklearn as sk
import sqlite3
from pandas.io import sql
# Importing CSV files from local directory
# NOTE: Make sure the Path you use contains the dataset named 'whereisthatdataset.... | github_jupyter |
```
# install composer, hiding output to keep the notebook clean
! pip install mosaicml > /dev/null 2>&1
```
# Using the Functional API
In this tutorial, we'll see an example of using Composer's algorithms in a standalone fashion with no changes to the surrounding code and no requirement to use the Composer trainer. ... | github_jupyter |
# 3. Python modules
In the course, and in your general (data analytics and visualization) work with Python you will typically be using the __numpy__ and __matplotlib.pyplot__ Python 'modules'. A Python _module_ is a "library" with useful procedures (in practice either a file `library.py` or a folder `library/`). To ... | github_jupyter |
```
# default_exp distributed
#export
from fastai.basics import *
from fastai.callback.progress import ProgressCallback
from torch.nn.parallel import DistributedDataParallel, DataParallel
from fastai.data.load import _FakeLoader
```
# Distributed and parallel training
> Callbacks and helper functions to train in para... | github_jupyter |
```
import tensorflow.keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation
from keras.preprocessing.text import Tokenizer
import tensorflow as tf
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
from nltk.probability... | github_jupyter |
# Fully-Connected Neural Nets
In this notebook we will implement fully-connected networks using a modular approach. For each layer we will implement a `forward` and a `backward` function. The `forward` function will receive inputs, weights, and other parameters and will return both an output and a `cache` object stori... | github_jupyter |
```
import pandas as pd
import numpy as np
file = "Resources/purchase_data.csv"
purchase_data = pd.read_csv(file)
# Purchasing Analysis
total_revenue = (purchase_data["Price"]).sum()
total_number_players = len(purchase_data["SN"].value_counts())
unique_items = len(purchase_data["Item ID"].unique())
unique_items
a... | github_jupyter |
## How to Test
### Equivalence partitioning
Think hard about the different cases the code will run under: this is science, not coding!
We can't write a test for every possible input: this is an infinite amount of work.
We need to write tests to rule out different bugs. There's no need to separately test *equivalent... | github_jupyter |
# Description for Modules
pandas-> read our csv files
numpy-> convert the data to suitable form to feed into the classification data
seaborn and matplotlib-> For visualizations
sklearn-> To use logistic regression
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
% mat... | github_jupyter |
# sports-book-manager
## Example 1:
### Using the BookScraper class
Importing the scraper class and setting the domain and directory paths.
```
import sports_book_manager.book_scrape_class as bs
PointsBet = bs.BookScraper(domain=r'https://nj.pointsbet.com/sports',
directorie... | github_jupyter |
<a href="https://colab.research.google.com/github/jamestheengineer/data-science-from-scratch-Python/blob/master/Chapter_16.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
# Only do this once per VM, otherwise you'll get multiple clones and neste... | github_jupyter |
     
     
     
     
     
   
[Home Page](../../START_HERE.ipynb)
[Previous Notebook](Challenge.ipynb)
     
     
 &ems... | github_jupyter |
```
#example code
#import csv (comma seperated values) libary
import csv
#create and write ("w") in document (if exist will be overwriten)
file = open ("Stars.csv", "w")
newRecord = "Brian,73,Taurus\n"
file.write(str(newRecord))
file.close()
#append data points ("a") - means to add something
file = open ("Stars... | github_jupyter |
# Preprocessing Structured Data
Before we actually feed the data into any deep learning system we should look through it carefully. In addition to the kinds of big-picture problems that might arise in collecting data from a noisy world, we need to look out for missing values, strange outliers, and potential errors in ... | github_jupyter |
# Исследование объявлений о продаже квартир
В вашем распоряжении данные сервиса Яндекс.Недвижимость — архив объявлений о продаже квартир в Санкт-Петербурге и соседних населённых пунктов за несколько лет. Нужно научиться определять рыночную стоимость объектов недвижимости. Ваша задача — установить параметры. Это позвол... | github_jupyter |
<a href="https://cognitiveclass.ai"><img src = "https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/Logos/organization_logo/organization_logo.png" width = 400> </a>
<h1 align=center><font size = 5>Regression Models with Keras</font></h1>
## Introduction
As we discussed in the videos, des... | github_jupyter |
```
#danaderp July'19
#GenerativeLSTM
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.layers import Dot, Input, Dense, Reshape, LSTM, Conv2D, Flatten, MaxPooling1D, Dropout, MaxPooling2D
from tensorflow.keras.layers import Embedding, Multiply, Subtract
from tensorflow.keras.models impo... | github_jupyter |
# Decison Trees
First we'll load some fake data on past hires I made up. Note how we use pandas to convert a csv file into a DataFrame:
```
import numpy as np
import pandas as pd
from sklearn import tree
input_file = "PastHires.csv"
df = pd.read_csv(input_file, header = 0)
df.head()
```
scikit-learn needs everythin... | github_jupyter |
# UMAP on the PBMC dataset of Zheng
```
%load_ext autoreload
%autoreload 2
%env CUDA_VISIBLE_DEVICES=2
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import umap
from firelight.visualizers.colorization import get_distinct_colors
from matplotlib.colors import ListedColormap
import pic... | github_jupyter |
```
import numpy as np
from jax.config import config
config.update("jax_enable_x64", True)
config.update('jax_platform_name', 'gpu')
import jax.numpy as jnp
from jax import jit, vmap, lax, grad
from jax.test_util import check_grads
from jax.interpreters import ad, batching, xla
import jax
from caustics import ehrlich_... | github_jupyter |
```
print(3)
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
sess = tf.InteractiveSession()
image = np.array([[[[1],[2],[3]],[[4],[5],[6]],[[7],[8],[9]]]], dtype=np.float32)
print("image.shape", image.shape)
weight = tf.constant([[[[1.]],[[1.]]],[[[1.]],[[1.]]]])
print("weight.shpae", weigh... | github_jupyter |
# 深度卷积神经网络(AlexNet)
在LeNet提出后的将近20年里,神经网络一度被其他机器学习方法超越,如支持向量机。虽然LeNet可以在早期的小数据集上取得好的成绩,但是在更大的真实数据集上的表现并不尽如人意。一方面,神经网络计算复杂。虽然20世纪90年代也有过一些针对神经网络的加速硬件,但并没有像之后GPU那样大量普及。因此,训练一个多通道、多层和有大量参数的卷积神经网络在当年很难完成。另一方面,当年研究者还没有大量深入研究参数初始化和非凸优化算法等诸多领域,导致复杂的神经网络的训练通常较困难。
我们在上一节看到,神经网络可以直接基于图像的原始像素进行分类。这种称为端到端(end-to-end)的方法节省了很多中间步骤... | github_jupyter |
# Predict Blood Donation for Future Expectancy
Forecasting blood supply is a serious and recurrent problem for blood collection managers: in January 2019, "Nationwide, the Red Cross saw 27,000 fewer blood donations over the holidays than they see at other times of the year." Machine learning can be used to learn the pa... | github_jupyter |
## Homework: Multilingual Embedding-based Machine Translation (7 points)
**In this homework** **<font color='red'>YOU</font>** will make machine translation system without using parallel corpora, alignment, attention, 100500 depth super-cool recurrent neural network and all that kind superstuff.
But even without para... | github_jupyter |
# Ray Crash Course - Actors
© 2019-2021, Anyscale. All Rights Reserved

Using Ray _tasks_ is great for distributing work around a cluster, but we've said nothing so far about managing distributed _state_, one of the big challenges in distributed computing. Ray ta... | github_jupyter |
# Summarising the mean and the variance using the IMNN
For this example we are going use the IMNN and the LFI module to infer the unknown mean, $\mu$, and variance, $\Sigma$, of $n_{\bf d}=10$ data points of a 1D random Gaussian field, ${\bf d}=\{d_i\sim\mathcal{N}(\mu,\Sigma)|i\in[1, n_{\bf d}]\}$. This is an interes... | github_jupyter |
# Brand Names for Image Retrieval From Instagram
**Goal:** process data to get all brand names to search for images on instagram
### 1. Import dependencies
Install non-standard libraries: requests, BeautifulSoup
```
import os
import pandas as pd
import numpy as np
```
### 2. Get Brand Names from Data
```
# to spe... | github_jupyter |
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\rightarrow$Run All).
Make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE", as we... | github_jupyter |
<a href="https://colab.research.google.com/github/OSGeoLabBp/tutorials/blob/master/english/python/python_in_a_nutshell.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#Python in a Nutshell
##Introduction
Python is a widespread and popular script l... | github_jupyter |
# MultiAgentEnvironment: simple Map
```
#%autosave 30
import glob
import sys
from operator import itemgetter
import numpy as np
import random
import time
import math
import networkx as nx
from networkx.algorithms.shortest_paths.generic import shortest_path_length
import ray
from ray import tune
#from ray.tune.logger... | github_jupyter |
```
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import norm
# Plot normal distribution areas*
k=3 #Will plot areas below -k, above k and between -k and k
mean=0 #plotting will assume mean=0
std=1
plt.rcParams["figure.figsize"] = (35,35)
... | github_jupyter |
Jupyter notebooks can contain Markdown (formatted text) or Python code.
This is a Markdown cell.
Below are Python cells. You can perform standard arithmetic in Python cells.
```
3 + 7
7 * 4
```
You can assign values to variables using `=`. This doesn't print any values out.
```
age = 42
age
```
Values include int... | github_jupyter |
**Predicting IDC in Breast Cancer Histology Images**
Breast cancer is the most common form of cancer in women, and invasive ductal carcinoma (IDC) is the most common form of breast cancer. Accurately identifying and categorizing breast cancer subtypes is an important clinical task, and automated methods can be used t... | github_jupyter |
<a href="https://githubtocolab.com/giswqs/geemap/blob/master/examples/notebooks/57_cartoee_blend.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"/></a>
Uncomment the following line to install [geemap](https://geemap.org) and [cartopy](https://scitools.org.... | github_jupyter |
# Posture detection for team wellbeing app
* Ported to ONNX runtime
* Simplified processing from https://github.com/Daniil-Osokin/lightweight-human-pose-estimation.pytorch
* Added heatmap postprocessing & posture scoring (check out scripts/simplified_functions.py for details)
* Bonus: __Live demo at the end!__
```
im... | github_jupyter |
# Using the MANN Package to convert and prune an existing TensorFlow model
In this notebook, we utilize the MANN package on an existing TensorFlow model to convert existing layers to MANN layers and then prune the model.
```
# Load the MANN package and TensorFlow
import tensorflow as tf
import mann
# Load the data
(x... | github_jupyter |
# Demistifying GANs in TensorFlow 2.0
```
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow import keras
print(tf.__version__)
```
## Global Parameters
```
BATCH_SIZE = 256
BUFFER_SIZE = 60000
EPOCHES = 300
OUTPUT_DIR = "img" # The output directory where the images of the gen... | github_jupyter |
```
import re
from glob import glob
import requests
import pandas as pd
import os
from probml_utils.url_utils import is_dead_url,make_url_from_chapter_no_and_script_name, extract_scripts_name_from_caption
from TexSoup import TexSoup
```
## Get chapter names
```
chap_names = {}
for chap_no in range(1,24):
suppl = ... | github_jupyter |
# Landsat Collection 2 Level-2 Surface Reflectance
**Date modified:** 23 August 2021
## Product overview
### Background
Digital Earth Africa (DE Africa) provides free and open access to a copy of [Landsat Collection 2 Level-2](https://www.usgs.gov/core-science-systems/nli/landsat/landsat-collection-2-level-2-scienc... | github_jupyter |
## Association Rules Generation from Frequent Itemsets
Function to generate association rules from frequent itemsets
> from mlxtend.frequent_patterns import association_rules
## Overview
Rule generation is a common task in the mining of frequent patterns. _An association rule is an implication expression of the for... | github_jupyter |
```
import keras
keras.__version__
```
# A first look at a neural network
This notebook contains the code samples found in Chapter 2, Section 1 of [Deep Learning with Python](https://www.manning.com/books/deep-learning-with-python?a_aid=keras&a_bid=76564dff). Note that the original text features far more content, in ... | github_jupyter |
<a href="https://colab.research.google.com/github/jdclifton2/praiseanalysis/blob/main/praise_to_and_from.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# The first part of this notebook loads the data. It was done by @ygg_anderson
```
import panel... | github_jupyter |
<a href="https://colab.research.google.com/github/christianhidber/easyagents/blob/master/jupyter_notebooks/intro_cartpole.ipynb"
target="_parent">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a>
# CartPole Gym environment with TfAgents
## Install packages (gym, tf... | github_jupyter |
Tutorials table of content:
- [Tutorial 1: Run a first scenario](./Tutorial-1_Run_your_first_scenario.ipynb)
- [Tutorial 2: Add contributivity measurements methods](./Tutorial-2_Add_contributivity_measurement.ipynb)
- Tutorial 3: Use a custom dataset
# Tutorial 3 : Use homemade dataset
With this example, we dive d... | github_jupyter |
# Programming and Database Fundamentals for Data Scientists - EAS503
Python classes and objects.
In this notebook we will discuss the notion of classes and objects, which are a fundamental concept. Using the keyword `class`, one can define a class.
Before learning about how to define classes, we will first understa... | github_jupyter |
# Случайни ефекти върху генетичната структура на популации
***
Изследвани са основни популационни модели върху генетичната структура на популации, както са представени в курса във ФМИ ["Въведение в изчислителната биология", доц. П. Рашков (ИМИ-БАН)](http://www.math.bas.bg/nummeth/rashkov/teaching/), 2018-2019г
***
... | github_jupyter |
```
import twint
import os
import nest_asyncio
nest_asyncio.apply()
import logging
import pandas as pd
# logging.basicConfig(filename='twint_data_collection.log',level=logging.DEBUG)
# logging.debug('This message should go to the log file')
# logging.warning('And this, too')
pd.set_option('display.max_colwidth', None)
... | github_jupyter |
# BigQuery ML models with feature engineering
In this notebook, we will use BigQuery ML to build more sophisticated models for taxifare prediction.
This is a continuation of our [first models](../../02_bqml/solution/first_model.ipynb) we created earlier with BigQuery ML but now with more feature engineering.
## Lear... | github_jupyter |
# Exploratory Data Analysis
---
*By Ihza Gonzales*
This notebook aims to explore the data collected. A series of graphs specific for time series data will be used. The distribution of stats and salaries will also be explored.
## Import Libraries
---
```
import pandas as pd
import numpy as np
import matplotlib.pyplo... | github_jupyter |
```
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import scipy
import warnings
warnings.filterwarnings("ignore")
```
### Load data
Note the data files needed are large, and can be generated by the cells supplied in the experiement notebook. However, these will take ... | github_jupyter |
# Tutorial 11: Normalizing Flows for image modeling

**Filled notebook:**
[](https://github.com/ph... | github_jupyter |
```
!pip install beautifulsoup4
import urllib.request
import pandas as pd
import numpy as np
from bs4 import BeautifulSoup,Comment
import re
url = "http://www.hanban.org/hanbancn/template/ciotab_cn1.htm?v1"
response = urllib.request.urlopen(url)
#webContent = response.read().decode(response.headers.get_content_charset(... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.