text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
<img src='https://bit.ly/2VnXWr2' width='100' align='left'>
# Final project: NLP to predict Myers-Briggs Personality Type
### Imports
```
!pip freeze > requirements4.txt
# Data Analysis
import pandas as pd
import numpy as np
# Data Visualization
import seaborn as sns
import matplotlib.pyplot as plt
# Ignore noise... | github_jupyter |
# Linear models in practice
In this lab session we will go over some important aspects of using linear models (and to some degree also neighborhood based models) in practice.
In particular, we will do some simple preprocessing and feature engineering. We will use the Boston housing dataset for this again.
## Data Scal... | github_jupyter |
# 100 pandas puzzles
Inspired by [100 Numpy exerises](https://github.com/rougier/numpy-100), here are 100* short puzzles for testing your knowledge of [pandas'](http://pandas.pydata.org/) power.
Since pandas is a large library with many different specialist features and functions, these excercises focus mainly on the... | github_jupyter |
# TensorFlow Tutorial #03
# PrettyTensor
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
The previous tutorial showed how to imple... | github_jupyter |
```
import os
from google.colab import drive
drive.mount('/content/gdrive')
%cd '/content/gdrive/My Drive/machine'
import pandas as pd
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import RandomizedSearchCV
from ... | github_jupyter |
# Сегментация тетрадей
## Detectron2 baseline
В данном ноутбуке представлен baseline модели сегментации текста в школьных тетрадях с помощью фреймворка detectron2. Вы можете (и это даже лучше) использовать другие модели (например UNET, mmdet), или написать полностью свою.
# 0. Установка библиотек
Установка библиоте... | github_jupyter |
```
import numpy as np
import scipy.misc
import pylab
import torch
from datetime import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from mpl_toolkits.axes_grid1 import make_axes_locatable
from wavelets_pytorch_2.alltorch.wavelets import Morlet, Ricker, DOG, Paul
from wavelets_pytor... | github_jupyter |
```
import sys
sys.path.insert(0, '../..')
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import torch
from tqdm import tnrange, tqdm_notebook
from causal_meta.utils.data_utils import generate_data_categorical
from causal_meta.bivariate.categorical import StructuralModel
N = 10
model = Structura... | github_jupyter |
```
!pip install dynet
!git clone https://github.com/neubig/nn4nlp-code.git
from __future__ import print_function
import time
start = time.time()
from collections import Counter, defaultdict
import random
import math
import sys
import argparse
import dynet as dy
import numpy as np
# format of files: each line is "wo... | github_jupyter |
---
_You are currently looking at **version 1.3** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-machine-learning/resources/bANLa) course resource._
---
# Assignment 1 - I... | github_jupyter |
the main figure of the paper.
```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
pd.options.display.max_rows = 999
from tang_jcompneuro.model_fitting_postprocess import load_data_generic
cnn_mapping_dict = {
'b.9': 'R_max',
'b.2': 'R_max_Q',
'b.5': 'R_max_HALF',
... | github_jupyter |
```
""" Script that evaluates reaction coordinates using the SGOOP method.
Probabilites are calculated using MD trajectories. Transition rates are
found using the maximum caliber approach.
For unbiased simulations use rc_eval().
For biased simulations calculate unbiased probabilities and analyze then with sgoop().
... | github_jupyter |
# AUTO-DROP HIGHLY CORRELATED COLUMNS - GANESH RAM GURURAJAN
**Explanation** :
Steps:
1. First pass data frame into the function
2. Get Corr() data frame using **' pearson method '**
3. Filter with condition **df[ df [ columns > 0.85 ]**
4. **Set the diagonal to np.nan, because diagonal of corr() is always 1.0**
5. **... | github_jupyter |
# Independent component analysis
Here we'll learn about indepednent component analysis (ICA), a matrix decomposition method that's an alternative to PCA.
```
import ipywidgets
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy import signal
from scipy.spatial import distance
import seab... | github_jupyter |
# Graph exploration and sampling
Here we experiment network exploration using the main graph samplers that can be found in the literature. The principle is the following: The initial graph is too large to be handled and we need to extract a representative part of it for analysis. We hope this reduced subgraph is repre... | github_jupyter |
```
#loading packages
import nltk
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#nltk.download()
#loading text data
text=pd.read_csv("C:/Users/Admin/Desktop/text.csv")
print(text.head())
#count Words
text['word_count'] = text['text'].apply(lambda x: len(str(x).split(" ")))
text[['text','word_co... | github_jupyter |
# Essentiality analysis
The goal of this analysis is to ensure the model correctly predicts the presence or absence of cell growth for well known mutants. Unlike for _E. coli_, extensive mutant libraries have not been charcterized for C. therm. Rather, a few mutants of biotechnological relevance have been relatively w... | github_jupyter |
```
import os
import cv2
import numpy as np
import argus
from argus import Model
from argus.callbacks import MonitorCheckpoint, EarlyStopping, LoggingToFile
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.transforms import ToTensor
from torch.utils.data import DataLoader
from src.... | github_jupyter |
# Search Terms
This project starts with curated collections of terms, including ERP terms, and potential associations, such as cognitive and disease terms. Automated literature collection then collects information from papers using those terms, using [LISC](https://lisc-tools.github.io/).
Current analysis takes two ... | github_jupyter |
```
import pandas as pd
import requests
import tweepy
import yaml
import os
import json
import numpy as np
```
# Read PitchBook data in
## Start with companies that HAVE received VC funding. These are the 1 companies (VC investment =1)
```
vc_general_info_df = pd.read_excel("../data/raw/CA_VC_PitchBook/Company_Gener... | github_jupyter |
<a href="https://colab.research.google.com/github/seopbo/nlp_tutorials/blob/main/single_text_classification_(nsmc)_BERT.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Single text classification - BERT
- pre-trained language model로는 `klue/bert-bas... | github_jupyter |
```
import utilities as utils
# This code is used to scale to processing numerous datasets
data_path_1: str = '../../../Data/phase1/'
data_set_1: list = [ 'Darknet_reduced_features.csv' ]
data_set: list = data_set_1
file_path_1 = utils.get_file_path(data_path_1)
file_set: list = list(map(file_path_1, data_... | github_jupyter |
# Day 18
## Part I
Ok,本日考的是Token解析和栈处理。首先需要解析整个表达式,这里有三种情况,可能是数字,可能是运算符加和乘,还可能是左右括号。还是为了代码清晰易读,用了枚举来代表解析出来的Token的类型,以及后续运算的状态,此处运算的状态只有两种,加法和乘法。
多说一句,在Python中写枚举的体验比起Rust差的太远,没法携带值,导致后续读取解析token的函数需要返回一个三元组,心塞。
```
from enum import Enum
TokenType = Enum('TokenType', ('digit', 'operator', 'parentheses'))
Calculate... | github_jupyter |
# Fine-tuning Transformer models and test prediction for GLUE tasks, using *torchdistill*
## 1. Make sure you have access to GPU/TPU
Google Colab: Runtime -> Change runtime type -> Hardware accelarator: "GPU" or "TPU"
```
!nvidia-smi
```
## 2. Clone torchdistill repository to use its example code and configuration f... | github_jupyter |
### Tutorial 5 (Date 18 Sep, 2019)
Today's Attendance: https://forms.gle/uSf8JqubE4nDT65d9
Today's Notebook link: https://bit.ly/2lUP3EK
Topics
- Semantic Role Labelling
- PropBank, FrameNet
- PredPatt
- Semantic Parsers
- Other tasks - WSD, Coreference resolution
A lot of theory content and most of the SRL example... | github_jupyter |
```
import os
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from tensorflow import keras
mnist = tf.keras.datasets.fashion_mnist
(training_images, training_labels),(test_images, test_labels) = mnist.load_data()
first_train_image = training_images[0]
plt.imshow(first_train_image)
np.se... | github_jupyter |
# gis-utils demo
This notebook illustrates some of the basic functionality of ``gis-utils``
```
from pathlib import Path
import numpy as np
import pandas as pd
import geopandas as gp
import rasterio
import gisutils
import matplotlib.pyplot as plt
```
## Working with shapefiles
```
#nhdplus_path = Path.home() / 'Docu... | github_jupyter |
Table of Contents
=================
* [numpy array](#numpy-array)
* [arange](#arange)
* [linspace](#linspace)
* [eye](#eye)
* [random](#random)
* [rand](#rand)
* [randn](#randn)
* [randint](#randint)
* [reshape](#reshape)
* [dtype](#dtype)
* [numpy... | github_jupyter |
# Introduction to Python
In this lesson we will learn the basics of the Python programming language (version 3). We won't learn everything about Python but enough to do some basic machine learning.
<img src="figures/python.png" width=350>
# Variables
Variables are objects in Python that can hold anything with numb... | github_jupyter |
# Hyper-Param and Iterative jobs
MLRun support iterative tasks for automatic and distributed execution of many tasks with variable parameters, this can be used for various tasks such as:
* Parallel loading and preparation of many data objects
* Model training with different parameter sets and/or algorithms
* Parallel ... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "1"
import torch
from torch import nn
import numpy as np
from tqdm.auto import tqdm
from matplotlib import pyplot as plt
from sparse_causal_model_learner_rl.learners import rl_learner
from sparse_causal_model_learner_rl.config import ... | github_jupyter |
# Loading a PyTorch Model in C++
```
import torch
import torchvision
```
## Step 1: Converting Your PyTorch Model to Torch Script
```
# An instance of your model.
model = torchvision.models.resnet18()
# An example input you would normally provide to your model's forward() method.
example = torch.rand(1, 3, 224, 224)... | github_jupyter |
# Project 3: Smart Beta Portfolio and Portfolio Optimization
## Overview
Smart beta has a broad meaning, but we can say in practice that when we use the universe of stocks from an index, and then apply some weighting scheme other than market cap weighting, it can be considered a type of smart beta fund. A Smart Bet... | github_jupyter |
```
# Copyright 2021 NVIDIA Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | github_jupyter |
```
import os
os.chdir('../')
import DeepPurpose.DTI as models
from DeepPurpose.utils import *
from DeepPurpose.dataset import *
X_drug, X_target, y = load_process_DAVIS('./data/', binary=False)
drug_encoding = 'Morgan'
target_encoding = 'CNN'
train, val, test = data_process(X_drug, X_target, y,
... | github_jupyter |
# 유튜브 크롤링 하기
> ## 1. 유튜브 API 호출하기
[유튜브크롤링 - 참고자료 - API호출하기](https://blog.naver.com/doublet7411/221511344483)
- (1단계) GCP (Google Cloud Platform) 접속
- https://console.developers.google.com
- (2단계) API 라이브러리에서 "Youtube Data API v3" 선택
- 사용 클릭
- 좌측 열쇄모양 아이콘(사용자 인증정보) 클릭
- 상단 `+사용자 인증정보 만들기` 버튼 ... | github_jupyter |
```
# import the required libraries
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import os
import cv2
import tensorflow as tf
from tensorflow.keras import layers, optimizers
from tensorflow.keras.layers import *
from tensorflow.keras.models import Model, load_model
from tensorflo... | github_jupyter |
<small><small><i>
All the IPython Notebooks in this lecture series by Dr. Milan Parmar are available @ **[GitHub](https://github.com/milaan9/02_Python_Datatypes/tree/main/002_Python_String_Methods)**
</i></small></small>
# Python String `endswith()`
The **`endswith()`** method returns True if a string ends with the s... | github_jupyter |
```
import sys
sys.path.append('../scripts/')
from mcl import *
from kf import *
class EstimatedLandmark(Landmark):
def __init__(self):
super().__init__(0,0)
self.cov = None #変更
def draw(self, ax, elems):
if self.cov is None:
return
##推定位置に青い星を描く... | github_jupyter |
### Anomaly Detection
* What are Outliers ?
* Statistical Methods for Univariate Data
* Using Gaussian Mixture Models
* Fitting an elliptic envelope
* Isolation Forest
* Local Outlier Factor
* Using clustering method like DBSCAN
### 1. Outliers
* New data which doesn't belong to general trend (or distribution) of enti... | github_jupyter |
```
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import torch
from scipy.io import loadmat
from tqdm import tqdm_notebook as tqdm
%matplotlib inline
use_cuda = torch.cuda.is_available()
device = torch.device('cuda:0' if use_cuda else 'cpu')
# Add new methods here.
# methods = ['h... | github_jupyter |
```
%pylab inline
import pandas as pd
import tensorflow as tf
import glob
from tensorflow.contrib.tensor_forest.python import tensor_forest
from tensorflow.python.ops import resources
from tqdm import tqdm_notebook
from multiprocessing import Pool
import os
os.environ["CUDA_VISIBLE_DEVICES"] = ""
np.random.seed(42)
fro... | 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 |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Model-Zoo----Convolutional-Neural-Network-(VGG16)" data-toc-modified-id="Model-Zoo----Convolutional-Neural-Network-(VGG16)-1"><span class="toc-item-num">1 </span>Model Zoo -- Convolutional Neural... | github_jupyter |
```
#%cd ..
#!mkdir .kaggle
#from google.colab import files
#up = files.upload()
#!chmod 600 /root/.kaggle/kaggle.json
#!kaggle competitions download -c web-traffic-time-series-forecasting
#!unzip train_1.csv.zip
!ls
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import se... | github_jupyter |
# Xarray Oceanography Example
## El Niño / Southern Oscillation (ENSO) from Sea Surface Temperature (SST)
**Author:** [Ryan Abernathey](http://rabernat.github.io)
According to [NOAA](https://www.esrl.noaa.gov/psd/enso/):
> El Niño and La Niña, together called the El Niño Southern Oscillation (ENSO), are periodic dep... | github_jupyter |
# Installing the NAG library and running this notebook
This notebook depends on the NAG library for Python to run. Please read the instructions in the [Readme.md](https://github.com/numericalalgorithmsgroup/NAGPythonExamples/blob/master/local_optimization/Readme.md#install) file to download, install and obtain a licen... | github_jupyter |
## Linear and Polynomial Regression for Pumpkin Pricing - Lesson 3
Load up required libraries and dataset. Convert the data to a dataframe containing a subset of the data:
- Only get pumpkins priced by the bushel
- Convert the date to a month
- Calculate the price to be an average of high and low prices
- Convert th... | github_jupyter |
```
import scanpy as sp
import scrublet as scr
import pandas as pd
import matplotlib.pyplot as plt
first = sp.read_10x_h5('/home/roman/Documents/Single cell analysis/10x-mouse-early-vs-late-wt-gbm/data/counts/more-late/Mm_CD45_IDH_SMAR_6mice_filtered_feature_bc_matrix.h5')
print(first.shape)
print(type(first))
print(fi... | github_jupyter |
```
import fastai
from fastai import * # Quick access to most common functionality
from fastai.vision import * # Quick access to computer vision functionality
from fastai.callbacks import *
from torchvision.models import vgg16_bn
PATH = Path('/DATA/kaggle/imgnetloc/ILSVRC/Data/CLS-LOC/')
PATH_TRN = PATH/'tra... | github_jupyter |
# Alternating direction algorithms for l1 problems in compressive sensing
We provide a port of [YALL1 basic](http://yall1.blogs.rice.edu/) package. This is built on top of JAX and can be used to solve the following $\ell_1$ minimization problems.
The basis pursuit problem
$$
\tag{BP}
{\min}_{x} \| W x\|_{w,1} \; \tex... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from os.path import join
plt.style.use(["seaborn", "thesis"])
plt.rcParams["figure.figsize"] = (8, 4)
```
# Dataset
```
from SCFInitialGuess.utilities.dataset import extract_triu_batch, AbstractDataset
from s... | github_jupyter |
# Routing optimization in a humanitarian context
> Note: All notebooks need the [environment dependencies](https://github.com/GIScience/openrouteservice-examples#local-installation)
> as well as an [openrouteservice API key](https://openrouteservice.org/dev/#/signup) to run
Routing optimization generally solves the [V... | github_jupyter |
<h1 id="Introduction-to-Python-and-Natural-Language-Technologies">Introduction to Python and Natural Language Technologies</h1>
<h2 id="Laboratory-06,-NLP-Introduction">Laboratory 06, NLP Introduction</h2>
<p><strong>March 18, 2020</strong></p>
<p><strong>Ádám Kovács</strong></p>
<p>During this lab... | github_jupyter |
# Muography
#### Roland Grinis - Researcher at MIPT Nuclear Physics Methods lab - CTO at GrinisRIT (grinisrit.com)
#### Danila Riazanov - Student at MIPT, JetBrains Research trainee
Code available within `NOA` [github.com/grinisrit/noa](https://github.com/grinisrit/noa) - Differentiable Programming Algorithms in ... | github_jupyter |
# CSCA08 Introduction to Computer Science I
## 2018 - Fall
### Anya Tafliovich
```
##ODD BEHAVIOURS
##the end index when slicing strings can be greater than the length of sliced string
i = 'abcde'
i[3:13032]
```
## Defining a Function
```
#def is used to start a function, the function comes after
#everything insid... | github_jupyter |
<table align="left" width="100%"> <tr>
<td style="background-color:#ffffff;"><a href="https://qsoftware.lu.lv/index.php/qworld/" target="_blank"><img src="..\images\qworld.jpg" width="35%" align="left"></a></td>
<td align="right" style="background-color:#ffffff;vertical-align:bottom;horizontal-align:... | github_jupyter |
# K-means clustering
### Part I: Demo of concepts
We're first going to learn what exactly the 'k' and the 'means' part of K-means clustering represent.
#### Step 1: Understand the dataset and the task
I'm starting to plant my flower garden for the spring. I bought seeds for two types of flowers, but upon opening t... | github_jupyter |
##### Copyright 2020 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import models
import os
import random
import cv2
import matplotlib.pyplot as plt
df = pd.read_csv("full_df.csv")
df.sample(5)
img_dir = r'C:\Users\KIIT\Documents\Deep Lea... | 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 |
# Speed Skydiving Analysis and Scoring 2019
Analyze one or more FlySight files with speed skydiving data.
This document implements scoring techniques compatible with the FAI World Air Sports Federation [Speed Skydiving Competition Rules, 2019 Edition](https://www.fai.org/sites/default/files/documents/2019_ipc_cr_spee... | github_jupyter |
# Interleaved Randomized Benchmarking
* **Last Updated:** August 19, 2019
* **Requires:** qiskit-terra 0.8, qiskit-ignis 0.1.2, qiskit-aer 0.2
## Introduction
**Interleaved Randomized Benchmarking** is a variant of the Randomized Benchmarking (RB) method that is used for benchmarking individual Clifford gates via r... | github_jupyter |
# Generalized Multi-Tissue Modeling
The measured PGSE diffusion signal depends on Echo Time (TE), gradient strength (G), orientation $\textbf{n}$, pulse separation $\Delta$ and pulse duration $\delta$. The signal representation can be separated in terms of amplitude and the shape:
\begin{equation}\label{eq:separation}... | github_jupyter |
<a href="https://colab.research.google.com/github/Lawrence-Krukrubo/SQL_for_Data_Science/blob/main/sql_for_data_analysis2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<b><h1>SQL Joins...</h1></b>
We connect to MySQL server and workbench and make... | github_jupyter |
## Task 1: Classifying Documents
#### Using Tokenization (and basic bag-of-words features)
Here is the code we went over at the start, to get started classifying documents by sentiment.
```
import re
import random
import nltk
from nltk.corpus import movie_reviews
# Read in a list of document (wordlist, category) tu... | github_jupyter |
<a href="https://colab.research.google.com/github/olgOk/QCircuit/blob/master/tutorials/How_to_build_Advanced_Circuit.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Advanced Curcuit
by Olga Okrut
Install frameworks, and import libraries
```
!pi... | github_jupyter |
# Particle on a sphere
The Hamiltonial $H$ for a particle on a sphere is given by
\begin{align}
H &= \frac{p^2}{2m} = \frac{L^2}{2 I}
\end{align}
## Exercise 1
$\mathbf{L} = \mathbf{r} \times \mathbf{p}$ is the angular momentum operator
where $\mathbf{r} = (x, y, z)$ is the positional operator and $\mathbf{p} = (p_... | github_jupyter |
# Image prediction accuracy analysis
- Josh Montague (MIT License)
In this notebook, we'll look at the TSV dump from the mysql db that recorded the prediction accuracies (top1, top5, none) from the webapp.
Note: the dialog and some of the choices were specific to my data. The outputs should be sufficiently general t... | github_jupyter |
<span style="font-family:Papyrus; font-size:3em;">Homework 2</span>
<span style="font-family:Papyrus; font-size:2em;">Cross Validation</span>
# Problem
In this homework, you will use cross validation to analyze the effect on model quality
of the number of model parameters and the noise in the observational data.
You... | github_jupyter |
# User Defined Functions
From time to time you hit a wall where you need a simple transformation, but Spark does not offer an appropriate function in the `pyspark.sql.functions` module. Fortunately you can simply define new functions, so called *user defined functions* or short *UDFs*.
```
from pyspark.sql.functions ... | github_jupyter |
## Numpy
<img src= "https://1.bp.blogspot.com/-3P-ULcc-aSc/XwINe8CjKgI/AAAAAAAAFFg/LhApCVa2YqUBlnqDDNW4NudSS398L5gjACLcBGAsYHQ/s640/NumPy%2Barrays.png">
#### A Multidimensional Array Object
```
import numpy as np
l1 = np.arange(1,13)
l1
l1.shape
np.arange(1,13).reshape((2,-1))
np.arange(1,13).reshape((-1,2))
np.aran... | github_jupyter |
# Getting Started with images
```
import cv2
img = cv2.imread('l.png', -1)
print(img)
cv2.imshow('image', img)
k=cv2.waitKey(0)
if k==27:
cv2.destroyAllWindows()
```
# Getting Started with Videos
cv2.VideoWriter is code for writing and saving the video
out.write is use to copy the video
```
import cv2
import n... | github_jupyter |
```
import findspark
findspark.init()
import pyspark
sc = pyspark.SparkContext()
sqlContext = pyspark.sql.SQLContext(sc)
import re
import csv
import random
import ujson as json
from itertools import izip
from operator import add, itemgetter
from collections import Counter, defaultdict
from urlparse import urljoin
from ... | github_jupyter |
```
import pandas as pd
import numpy as np
from tqdm import tqdm
import torch
import os
from sklearn.metrics import silhouette_score
import umap
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
# !pip install pymagnitude
from pymagnitude import Magnitude
# mount google drive
from google.colab ... | github_jupyter |
# Mining the Social Web
## Mining Web Pages
This Jupyter Notebook provides an interactive way to follow along with and explore the examples from the video series. The intent behind this notebook is to reinforce the concepts in a fun, convenient, and effective way.
```
# Downloading nltk packages used in this example... | github_jupyter |
# Operations on word vectors
Welcome to your first assignment of this week!
Because word embeddings are very computionally expensive to train, most ML practitioners will load a pre-trained set of embeddings.
**After this assignment you will be able to:**
- Load pre-trained word vectors, and measure similarity usi... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
```
## MPI PLOTS FOR CASE STUDY 1
```
def MPILOSS(X,Y,Y1,Y2,Y3):
plt.figure(figsize =(10,5))
plt.plot(X,Y, linewidth =3)
plt.plot(X,Y1,linewidth =3)
plt.plot(X,Y2,linewidth =3)
plt.plot(X,Y3,linewidth =3)
plt.grid()
plt.title(' MP... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Filter/filter_neq.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" href="http... | github_jupyter |
```
#for manupulations
import numpy as np
import pandas as pd
#for data visulizations
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.read_csv('data.csv')
print('Shape of the Dataset:', df.shape)
df.head()
#checking if any null values are there or not
df.isnull().sum()
#checking the crops present is the ... | github_jupyter |
```
%matplotlib inline
import sys
import os
import time
import numpy as np
from matplotlib import pyplot as plt
import pandas as pd
import matplotlib as mpl
blues = mpl.cm.get_cmap(plt.get_cmap('Blues'))
greens = mpl.cm.get_cmap(plt.get_cmap('Greens'))
reds = mpl.cm.get_cmap(plt.get_cmap('Reds'))
oranges = mpl.cm.get_... | github_jupyter |
# Assignment 3: Question Answering
Welcome to this week's assignment of course 4. In this you will explore question answering. You will implement the "Text to Text Transfer from Transformers" (better known as T5). Since you implemented transformers from scratch last week you will now be able to use them.
<img sr... | github_jupyter |
<a href="https://colab.research.google.com/github/rlworkgroup/garage/blob/master/examples/jupyter/custom_env.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Demonstrate usage of a custom openai/gym environment with rlworkgroup/garage
Demonstrate us... | github_jupyter |
# Hyperparameter tuning with Hyperopt
In this lab, you will learn to tune hyperparameters in Azure Databricks. This lab will cover the following exercises:
- Exercise 2: Using Hyperopt for hyperparameter tuning.
To upload the necessary data, please follow the instructions in the lab guide.
## Attach notebook to your... | github_jupyter |
```
from calibrimbore import sauron
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
%matplotlib inline
from astropy.coordinates import SkyCoord
import astropy.units as u
from copy import deepcopy
```
## load in the filter and make the composite relation with sauron
The filter file must be a... | github_jupyter |
# Building text classifier with Differential Privacy
In this tutorial we will train a text classifier with Differential Privacy by taking a model pre-trained on public text data and fine-tuning it for a different task.
When training a model with differential privacy, we almost always face a trade-off between model si... | github_jupyter |
```
# Notebooks
import nbimporter
import os
import sys
# Functions from src
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
# Defined Functions
from utils import *
# Pandas, matplotlib, pickle, seaborn
import pickle
import numpy as np
import pand... | github_jupyter |

# Backends
A **backend** represents either a simulator or a real quantum computer and are responsible for running quantum circuits and/or pulse schedules and returning results.
In `qiskit-ibm-runtime`, a backend is represented by an instance of the [IBMBackend](http... | github_jupyter |
This IPython Notebook introduces the use of the `openmc.mgxs` module to calculate multi-energy-group and multi-delayed-group cross sections for an infinite homogeneous medium. In particular, this Notebook introduces the the following features:
* Creation of multi-delayed-group cross sections for an **infinite homogene... | github_jupyter |
# Running NetPyNE in a Jupyter Notebook
## Preliminaries
Hopefully you already completed these preliminaries by following the instructions at https://github.com/Neurosim-lab/netpyne/blob/development/netpyne/tutorials/README.md. We will now walk you through how we installed the NetPyNE tutorials.
We don't want to af... | github_jupyter |
# Building your Recurrent Neural Network - Step by Step
Welcome to Course 5's first assignment! In this assignment, you will implement your first Recurrent Neural Network in numpy.
Recurrent Neural Networks (RNN) are very effective for Natural Language Processing and other sequence tasks because they have "memory". T... | github_jupyter |
```
import numpy as np
import pandas as pd
import seaborn as sns
import math
import matplotlib.pylab as plt
from IPython.display import display, HTML
rs = np.random.RandomState(10)
```
## Links
- https://seaborn.pydata.org/examples/index.html
- https://python-graph-gallery.com/all-charts/
## `DataFrame` Sample Data... | github_jupyter |
```
#The first cell is just to align our markdown tables to the left vs. center
%%html
<style>
table {float:left}
</style>
```
# Manipulating Strings
***
## Learning Objectives
In this lesson you will:
1. Learn the fundamentals of processing text stored in string values
2. Apply various methods to st... | github_jupyter |
# SA-CCR analytical app
This notebook provides a reference implementation of interactive analytical app for SA-CCR analytics in python using Jupyter Notebook and [atoti](https://www.atoti.io).
<img src=./app-preview.gif/ width = 70%>
As a quick reminder, the SA-CCR is a regulatory methodology for computing EAD (Expo... | github_jupyter |
# 目标检测和边界框
:label:`sec_bbox`
在前面的章节(例如 :numref:`sec_alexnet`— :numref:`sec_googlenet`)中,我们介绍了各种图像分类模型。
在图像分类任务中,我们假设图像中只有一个主要物体对象,我们只关注如何识别其类别。
然而,很多时候图像里有多个我们感兴趣的目标,我们不仅想知道它们的类别,还想得到它们在图像中的具体位置。
在计算机视觉里,我们将这类任务称为*目标检测*(object detection)或*目标识别*(object recognition)。
目标检测在多个领域中被广泛使用。
例如,在无人驾驶里,我们需要通过识别拍摄到的视频图像里的车辆、行人、道... | github_jupyter |
[Sascha Spors](https://orcid.org/0000-0001-7225-9992),
Professorship Signal Theory and Digital Signal Processing,
[Institute of Communications Engineering (INT)](https://www.int.uni-rostock.de/),
Faculty of Computer Science and Electrical Engineering (IEF),
[University of Rostock, Germany](https://www.uni-rostock.de/en... | github_jupyter |
```
from bs4 import BeautifulSoup
from selenium import webdriver
from time import sleep
from time import time
from random import randint
from IPython.core.display import clear_output
import pandas as pd
import numpy as np
import psycopg2
import requests
import os
import re
import ast
headers = {'User-Agent': 'Mozilla/5... | github_jupyter |
# The Standard Gate Set
For every possible realization of fault-tolerant quantum computing, there is a set of quantum operations that are most straightforward to realize. Often these consist of multiple so-called Clifford gates, combined with a few single-qubit gates that do not belong to the Clifford group. In this s... | github_jupyter |
# Bite Size Bayes
Copyright 2020 Allen B. Downey
License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
```
## Review
[In the previous notebook](https://colab.... | github_jupyter |
```
import keras
from keras.models import Sequential, Model, load_model
from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda
from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, CuDNNLSTM, CuDNNGRU, BatchNormalization, LocallyConnected2D, ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.