code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
```
import re
from typing import List
import pandas as pd
import numpy as np
from tqdm.notebook import tqdm
import optuna
from sklearn.metrics import roc_auc_score
from sklearn.preprocessing import OneHotEncoder, StandardScaler, MinMaxScaler, PolynomialFeatures
from sklearn.linear_model import LogisticRegression, SGD... | github_jupyter |
<a href="https://colab.research.google.com/github/yukinaga/minnano_ai/blob/master/section_7/ml_libraries.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# 機械学習ライブラリ
機械学習ライブラリ、KerasとPyTorchのコードを紹介します。
今回はコードの詳しい解説は行いませんが、実装の大まかな流れを把握しましょう。
## ● Ke... | github_jupyter |
# Transfer Learning Template
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import os, json, sys, time, random
import numpy as np
import torch
from torch.optim import Adam
from easydict import EasyDict
import matplotlib.pyplot as plt
from steves_models.steves_ptn import Steves_Prototypical_Network
... | github_jupyter |
```
import tqdm
from tqdm import tqdm_notebook
import time
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as axes3d
import matplotlib.ticker as ticker
# import warnings
# warnings.filterwarnings('ignore')
import pandas as pd
import matplotlib.pyplot as plt
imp... | github_jupyter |
# Fig.3 - Comparisons of MDR's AUC across 12 different sets
Change plot's default size and font
```
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = [20, 12]
rc = {"font.family" : "sans-serif",
"font.style" : "normal",
"mathtext.fontset" : "dejavusans"}
plt.rcParams.update(rc)
plt.rcParam... | github_jupyter |
```
# Define a function calls addNumber(x, y) that takes in two number and returns the sum of the two numbers.
def addNumber(x, y):
return(sum((x, y)))
addNumber(10,20)
# Define a function calls subtractNumber(x, y) that takes in two numbers and returns the difference of the two numbers.
def subtractNumber(x,y)... | github_jupyter |
# Image Classification
In this project, you'll classify images from the [CIFAR-10 dataset](https://www.cs.toronto.edu/~kriz/cifar.html). The dataset consists of airplanes, dogs, cats, and other objects. You'll preprocess the images, then train a convolutional neural network on all the samples. The images need to be no... | github_jupyter |
# Least-squares technique
## References
- Statistics in geography: https://archive.org/details/statisticsingeog0000ebdo/
## Imports
```
from functools import partial
import numpy as np
from scipy.stats import multivariate_normal, t
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from ipywi... | github_jupyter |
# 1. 정규 표현식
* 출처 : 서적 "잡아라! 텍스트 마이닝 with 파이썬"
* 문자열이 주어진 규칙에 일치하는 지, 일치하지 않는지 판단할 수 있다.
정규 표현식을 이용하여 특정 패턴을 지니니 문자열을 찾을 수 있어 텍스트 데이터 사전 처리 및
크롤링에서 주로 쓰임
```
string = '기상청은 슈퍼컴퓨터도 서울지역의 집중호우를 제대로 예측하지 못했다고 설명했습니다. 왜 오류가 발생했\
습니다. 왜 오류가 발생했는지 자세히 분석해 예측 프로그램을 보완해야 할 대목입니다. 관측 분야는 개선될 여지가\
있습니다. 지금 보시는 왼쪽 사진이... | github_jupyter |
```
# For cross-validation
FRACTION_TRAINING = 0.5
# For keeping output
detailed_output = {}
# dictionary for keeping model
model_dict = {}
import pandas as pd
import pickle
import numpy as np
import matplotlib.pyplot as plt
import sklearn
from matplotlib.colors import ListedColormap
from sklearn import linear_model
... | github_jupyter |
# Callin Switzer
## Modifications to TLD code for ODE system
___
```
from matplotlib import pyplot as plt
%matplotlib inline
from matplotlib import cm
import numpy as np
import os
import scipy.io
import seaborn as sb
import matplotlib.pylab as pylab
# forces plots to appear in the ipython notebook
%matplotlib inline
f... | github_jupyter |
```
from IPython.display import display, HTML
from pyspark.sql import SparkSession
from pyspark import StorageLevel
import pandas as pd
from pyspark.sql.types import StructType, StructField,StringType, LongType, IntegerType, DoubleType, ArrayType
from pyspark.sql.functions import regexp_replace
from sedona.register imp... | github_jupyter |
# Stepper Motors
* [How to use a stepper motor with the Raspberry Pi Pico](https://www.youngwonks.com/blog/How-to-use-a-stepper-motor-with-the-Raspberry-Pi-Pico)
* [Control 28BYJ-48 Stepper Motor with ULN2003 Driver & Arduino](https://lastminuteengineers.com/28byj48-stepper-motor-arduino-tutorial/) Description of the ... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/image_smoothing.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="... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Deep Learning
## Project: Build a Traffic Sign Recognition Classifier
In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is required that cannot be included i... | github_jupyter |
```
import numpy as np
arr = np.arange(0,11)
arr
# Simplest way to pick an element or some of the elements from an array is similar to indexing in a python list.
arr[8] # Gives value at the index 8
# Slice Notations [start:stop]
arr[1:5] # 1 inclusive and 5 exclusive
# Another Example of Slicing
arr[0:5]
# To have e... | github_jupyter |
# NumPy, Pandas and Matplotlib with ICESat
UW Geospatial Data Analysis
CEE498/CEWA599
David Shean
## Objectives
1. Solidify basic skills with NumPy, Pandas, and Matplotlib
2. Learn basic data manipulation, exploration, and visualizatioin with a relatively small, clean point dataset (65K points)
3. Learn a bit m... | github_jupyter |
```
import numpy as np
import pandas as pd
training_data = pd.read_csv("hackerrank-predict-email-opens-dataset/training_dataset.csv")
testing_data = pd.read_csv("hackerrank-predict-email-opens-dataset/test_dataset.csv")
training_data.head()
training_data.shape
testing_data.head()
testing_data.shape
training_data.info()... | github_jupyter |
## Implement Sliding Windows and Fit a Polynomial
This notebook displays how to create a sliding windows on a image using Histogram we did in an earlier notebook.
we can use the two highest peaks from our histogram as a starting point for determining where the lane lines are, and then use sliding windows moving upward... | github_jupyter |
```
"""
基于扩展窗的欧拉反卷积算法
欧拉反卷积的常用方法是基于滑动窗口:但由于每个窗口是在整个区域仅运行一次解卷积会产生很多虚假的解决方案。
并且基于滑动窗口的反卷积方法不能出给指定的源的个数。所以发展了基于扩展窗的欧拉反卷积算法。
其基本思想是:从一个选点的中心点扩展许多窗口进行反卷积。然后只选择其中一个解决方案(最小误差方案)作为最终估计。
这种方法不仅可以提供单一解决方案,还可以通过可以针对每个异常选择不同的扩展中心实现对多个异常的解释。
扩展窗口方案实现于:geoist.euler_expanding_window.ipynb。
"""
from geoist.pfm import sphere, pftrans... | github_jupyter |
```
import os
import couchdb
from lib.genderComputer.genderComputer import GenderComputer
server = couchdb.Server(url='http://127.0.0.1:15984/')
db = server['tweets']
gc = GenderComputer(os.path.abspath('./data/nameLists'))
date_list = []
for row in db.view('_design/analytics/_view/conversation-date-breakdown', reduce=... | github_jupyter |
```
import pandas as pd
import numpy as np
pd.set_option('display.max_columns', None)
df = pd.read_csv('/Users/mattmastin/Desktop/Valley-Behavioral/vbhsample.csv')
df.describe()
columns_drop = ['Unnamed: 15', 'EmploymentInformation', 'HeadOfHousehold']
df.drop(columns=columns_drop, axis=1)
df['ClientStatus'] = df['C... | github_jupyter |
### Natural Language Processing, a look at distinguishing subreddit categories by analyzing the text of the comments and posts
**Matt Paterson, hello@hiremattpaterson.com**
General Assembly Data Science Immersive, July 2020
### Abstract
**HireMattPaterson.com has been (fictionally) contracted by Virgin Galactic’s ma... | github_jupyter |
<a href="https://colab.research.google.com/github/vitutorial/exercises/blob/master/LatentFactorModel/LatentFactorModel.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
%matplotlib inline
import os
import re
import urllib.request
import numpy as ... | github_jupyter |
# Lambda School Data Science - Recurrent Neural Networks and LSTM
> "Yesterday's just a memory - tomorrow is never what it's supposed to be." -- Bob Dylan
# Lecture
Wish you could save [Time In A Bottle](https://www.youtube.com/watch?v=AnWWj6xOleY)? With statistics you can do the next best thing - understand how dat... | github_jupyter |
# Assignment 1.
## Formalia:
Please read the [assignment overview page](https://github.com/suneman/socialdata2021/wiki/Assignment-1-and-2) carefully before proceeding. This page contains information about formatting (including formats etc), group sizes, and many other aspects of handing in the assignment.
_If you f... | github_jupyter |
# AU Fundamentals of Python Programming-W10X
## Topic 1(主題1)-字串和print()的參數
### Step 1: Hello World with 其他參數
sep = "..." 列印分隔 end="" 列印結尾
* sep: string inserted between values, default a space.
* end: string appended after the last value, default a newline.
```
print('Hello World!') #'Hello World!' is the same a... | github_jupyter |
```
import csv
from sklearn import preprocessing
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
%matplotlib inline
datContent = [i.strip().split() for i in open("./doughs.dat").readlines()]
y=np.array(datContent[1:])
labels = y[:,7].astype(np.float32)
y = y[:,1:7].astype(np.float32)
labels
c... | github_jupyter |
## Topic Modelling (joint plots by quality band)
Shorter notebook just for Figures 9 and 10 in the paper.
```
%matplotlib inline
import matplotlib.pyplot as plt
# magics and warnings
%load_ext autoreload
%autoreload 2
import warnings; warnings.simplefilter('ignore')
import os, random
from tqdm import tqdm
import pa... | github_jupyter |
# Inspect Nucleus Training Data
Inspect and visualize data loading and pre-processing code.
https://www.kaggle.com/c/data-science-bowl-2018
```
import os
import sys
import itertools
import math
import logging
import json
import re
import random
import time
import concurrent.futures
import numpy as np
import matplotl... | github_jupyter |
```
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.patches as patches
from moviepy.editor import VideoFileClip
from IPython.display import HTML
import glob
%matplotlib inline
objp = np.zeros((6*9,3), np.float32)
objp[:,:2] = np.mgrid[0:9,0:6].T.reshape(-... | github_jupyter |
+ This notebook is part of lecture 7 *Solving Ax=0, pivot variables, and special solutions* in the OCW MIT course 18.06 by Prof Gilbert Strang [1]
+ Created by me, Dr Juan H Klopper
+ Head of Acute Care Surgery
+ Groote Schuur Hospital
+ University Cape Town
+ <a href="mailto:juan.klopper@uct.ac.za">Ema... | github_jupyter |
```
# !pip install simplejson
from pymongo import MongoClient
from pathlib import Path
from tqdm.notebook import tqdm
import numpy as np
import simplejson as json
import itertools
from functools import cmp_to_key
import networkx as nx
from IPython.display import display, Image, JSON
from ipywidgets import widgets, Ima... | github_jupyter |
# Using enterprise_extensions to analyze PTA data
In this notebook you will learn:
* How to use `enterprise_extensions` to create `enterprise` models,
* How to search in PTA data for a isotropic stochastic gravitational wave background using multiple pulsars,
* How to implement a HyperModel object to sample a `model_2... | github_jupyter |
### This Notebook is done for Pixelated Data for 1 Compton, 2 PhotoElectric with 2 more Ambiguity!
#### I got 89% Accuracy on Test set!
##### I am getting X from Blurred Dataset, y as labels from Ground Truth
```
import pandas as pd
import numpy as np
from keras.utils import to_categorical
import math
df = {'Label':[... | github_jupyter |
# LassoLars Regression with Scale
This Code template is for the regression analysis using a simple LassoLars Regression. It is a lasso model implemented using the LARS algorithm and feature scaling.
### Required Packages
```
import warnings
import numpy as np
import pandas as pd
import seaborn as se
import ma... | github_jupyter |
[Table of Contents](./table_of_contents.ipynb)
# Discrete Bayes Filter
# 离散贝叶斯滤波
```
%matplotlib inline
#format the book
import book_format
book_format.set_style()
```
The Kalman filter belongs to a family of filters called *Bayesian filters*. Most textbook treatments of the Kalman filter present the Bayesian formu... | github_jupyter |
# House Prices: Advanced Regression Techniques
This goal of this project was to predict sales prices and practice feature engineering, RFs, and gradient boosting. The dataset was part of the [House Prices Kaggle Competition](https://www.kaggle.com/c/house-prices-advanced-regression-techniques).
<br>
### Table of Co... | github_jupyter |
<a href="https://colab.research.google.com/github/mees/calvin/blob/main/RL_with_CALVIN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<h1>Reinforcement Learning with CALVIN</h1>
The **CALVIN** simulated benchmark is perfectly suited for training a... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import seaborn as sbn
import scipy.stats as stats
from pandas.plotting import scatter_matrix
import statsmodels.api as sm
import datetime as dt
import pandasql as ps
data = pd.read_csv('~/Downloads/EIA930_BALANCE_2020_Jan... | github_jupyter |
# Polish phonetic comparison
> "Transcript matching for E2E ASR with phonetic post-processing"
- toc: false
- branch: master
- hidden: true
- categories: [asr, polish, phonetic, todo]
```
from difflib import SequenceMatcher
import icu
plipa = icu.Transliterator.createInstance('pl-pl_FONIPA')
```
The errors in E2E m... | github_jupyter |
# HW9: Forecasting Solar Cycles
Below is the notebook associated with HW\#9. You can run the notebook in two modes. If you have the `emcee` and `corner` packages installed on your machine, along with the data files, just keep the following variable set to `False`. If you are running it in a Google colab notebook, set ... | github_jupyter |
# Load Cats and Dogs Images
## Install Packages
```
!pip install --upgrade keras==2.2.4
!pip install --upgrade tensorflow==1.13.1
!pip install --upgrade 'numpy<1.15.0'
```
> **Note:** After running the pip command you should restart the Jupyter kernel.<br>
> To restart the kernel, click on the kernel-restart button... | github_jupyter |
# INSTALLATION
```
!pip install aif360
!pip install fairlearn
!apt-get install -jre
!java -version
!pip install h2o
!pip install xlsxwriter
```
#IMPORTS
```
import numpy as np
from mlxtend.feature_selection import ExhaustiveFeatureSelector
from xgboost import XGBClassifier
# import pandas as pd
import matplotlib.... | github_jupyter |
This notebook compares the email activities and draft activites of an IETF working group.
Import the BigBang modules as needed. These should be in your Python environment if you've installed BigBang correctly.
```
import bigbang.mailman as mailman
from bigbang.parse import get_date
#from bigbang.functions import *
fr... | github_jupyter |
# Visualize 3D Points (Parabolic data)
This notebook uses 3D plots to visualize 3D points. Reads measurement data from a csv file.
```
%matplotlib notebook
##%matplotlib inline
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
import numpy as np
from filter.kalman import Kalman3D
fmt = lambda x: "%9.3f... | github_jupyter |
# Fastpages Notebook Blog Post
> A tutorial of fastpages for Jupyter notebooks.
- toc: true
- badges: true
- comments: true
- categories: [jupyter]
- image: images/chart-preview.png
# About
This notebook is a demonstration of some of capabilities of [fastpages](https://github.com/fastai/fastpages) with notebooks.
... | github_jupyter |
# Coupling to Ideal Loads
In this notebook, we investigate the WEST ICRH antenna behaviour when the front-face is considered as the combination of ideal (and independant) loads made of impedances all equal to $Z_s=R_c+j X_s$, where $R_c$ corresponds to the coupling resistance and $X_s$ is the strap reactance.
<img s... | github_jupyter |
# 数组基础
## 创建一个数组
```
import numpy as np
import pdir
pdir(np)
import numpy as np
a1 = np.array([0, 1, 2, 3, 4])#将列表转换为数组,可以传递任何序列(类数组),而不仅仅是常见的列表(list)数据类型。
a2 = np.array((0, 1, 2, 3, 4))#将元组转换为数组
print 'a1:',a1,type(a1)
print 'a2:',a2,type(a2)
b = np.arange(5) #python内置函数range()的数组版,返回的是numpy ndarrays数组对象,而不是列表
print... | github_jupyter |
# A Scientific Deep Dive Into SageMaker LDA
1. [Introduction](#Introduction)
1. [Setup](#Setup)
1. [Data Exploration](#DataExploration)
1. [Training](#Training)
1. [Inference](#Inference)
1. [Epilogue](#Epilogue)
# Introduction
***
Amazon SageMaker LDA is an unsupervised learning algorithm that attempts to describe ... | github_jupyter |
```
#default_exp synchro.extracting
from nbdev.showdoc import *
%load_ext autoreload
%autoreload 2
```
# synchro.extracting
> Function to extract data of an experiment from 3rd party programs
To align timeseries of an experiment, we need to read logs and import data produced by 3rd party softwares used during the exp... | github_jupyter |
<a href="https://colab.research.google.com/github/totti0223/deep_learning_for_biologists_with_keras/blob/master/notebooks/PlantDisease_tutorial.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Training a Plant Disease Diagnosis Model with PlantVill... | github_jupyter |
# LeNet Lab Solution

Source: Yan LeCun
## Load Data
Load the MNIST data, which comes pre-loaded with TensorFlow.
You do not need to modify this section.
```
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", reshape=False)
X_... | github_jupyter |
# Single-stepping the `logictools` Pattern Generator
* This notebook will show how to use single-stepping mode with the pattern generator
* Note that all generators in the _logictools_ library may be **single-stepped**
### Visually ...
#### The _logictools_ library on the Zynq device on the PYNQ board

In this notebook you will teach a __pytorch__ neural network to do Q-learning.
```
# # in google colab uncomment this
# import os
# os.system('apt-get insta... | github_jupyter |
# Frame of reference
> Marcos Duarte, Renato Naville Watanabe
> [Laboratory of Biomechanics and Motor Control](http://pesquisa.ufabc.edu.br/bmclab)
> Federal University of ABC, Brazil
<h1>Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Frame-of-reference-for-h... | github_jupyter |
# Volume Sampling vs projection DPP for low rank approximation
## Introduction
#### In this notebook we compare the volume sampling and projection DPP for low rank approximation.
We recall the result proved in the article [DRVW]:\\
Let S be a random subset of k columns of X chosen with probability: $$P(S) = \frac{1}{Z_... | github_jupyter |
# Convolutional Neural Network Example
Build a convolutional neural network with TensorFlow.
- Author: Aymeric Damien
- Project: https://github.com/aymericdamien/TensorFlow-Examples/
These lessons are adapted from [aymericdamien TensorFlow tutorials](https://github.com/aymericdamien/TensorFlow-Examples)
/ [GitHub]... | github_jupyter |
```
import os, os.path
import pickle
import time
import numpy
from scipy import interpolate
from galpy.util import bovy_conversion, bovy_plot, save_pickles
import gd1_util
from gd1_util import R0, V0
import seaborn as sns
from matplotlib import cm, pyplot
import simulate_streampepper
import statsmodels.api as sm
lowess... | github_jupyter |
```
import numpy as np
import nibabel.cifti2 as ci
from itertools import product
from joblib import Parallel, delayed
import pickle
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from graspy.plot import heatmap
%matplotlib inline
from hyppo.time_series import MGCX
```
## Look At It
`... | github_jupyter |
```
!nvidia-smi
# -*- coding: utf-8 -*-
from __future__ import print_function
import keras
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten, Lambda
from keras.layers import Conv2D, MaxPooling2D
from keras.layers.normalization import Batc... | github_jupyter |
# Buffered Text-to-Speech
In this tutorial, we are going to build a state machine that controls a text-to-speech synthesis. The problem we solve is the following:
- Speaking the text takes time, depending on how long the text is that the computer should speak.
- Commands for speaking can arrive at any time, and we wo... | github_jupyter |
# 概要
- 101クラス分類
- 対象:料理画像
- VGG16による転移学習
1. 全結合層
1. 全層
- RXなし
```
RUN = 100
```
# 使用するGPUメモリの制限
```
import tensorflow as tf
tf_ver = tf.__version__
if tf_ver.startswith('1.'):
from tensorflow.keras.backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
c... | github_jupyter |
# Query Classifier Tutorial
[](https://colab.research.google.com/github/deepset-ai/haystack/blob/master/tutorials/Tutorial14_Query_Classifier.ipynb)
In this tutorial we introduce the query classifier the goal of introducing this feature was to o... | github_jupyter |
# Chapter 3: Inferential statistics
[Link to outline](https://docs.google.com/document/d/1fwep23-95U-w1QMPU31nOvUnUXE2X3s_Dbk5JuLlKAY/edit#heading=h.uutryzqeo2av)
Concept map:

#### Notebook setup
```
# loading Python modules
import math
impo... | github_jupyter |
## Compare built-in Sagemaker classification algorithms for a binary classification problem using Iris dataset
In the notebook tutorial, we build 3 classification models using HPO and then compare the AUC on test dataset on 3 deployed models
IRIS is perhaps the best known database to be found in the pattern recogniti... | github_jupyter |
## This Notebook - Goals - FOR EDINA
**What?:**
- Standard classification method example/tutorial
**Who?:**
- Researchers in ML
- Students in computer science
- Teachers in ML/STEM
**Why?:**
- Demonstrate capability/simplicity of core scipy stack.
- Demonstrate common ML concept known to learners and used by resear... | github_jupyter |
## Dependencies
```
!nvidia-smi
!jupyter notebook list
%env CUDA_VISIBLE_DEVICES=3
%matplotlib inline
%load_ext autoreload
%autoreload 2
import time
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
import tor... | github_jupyter |
```
from os import listdir
from numpy import array
from keras.preprocessing.text import Tokenizer, one_hot
from keras.preprocessing.sequence import pad_sequences
from keras.models import Model, Sequential, model_from_json
from keras.utils import to_categorical
from keras.layers.core import Dense, Dropout, Flatten
from ... | github_jupyter |
# Inference and Validation
Now that you have a trained network, you can use it for making predictions. This is typically called **inference**, a term borrowed from statistics. However, neural networks have a tendency to perform *too well* on the training data and aren't able to generalize to data that hasn't been seen... | github_jupyter |
# Regular Expressions
Regular expressions are text-matching patterns described with a formal syntax. You'll often hear regular expressions referred to as 'regex' or 'regexp' in conversation. Regular expressions can include a variety of rules, from finding repetition, to text-matching, and much more. As you advance in ... | github_jupyter |
### What is an Autoencoder?
An Autoencoder is a model that can make use of a CNN's ability to compress the data into a flat vector / feature vector. We can think of it as a smart encoder that learns compression and decompression algorithms from the data. As an example, if you had a file format that was highly dimensio... | github_jupyter |
Lambda School Data Science
*Unit 4, Sprint 3, Module 2*
---
# Convolutional Neural Networks (Prepare)
> Convolutional networks are simply neural networks that use convolution in place of general matrix multiplication in at least one of their layers. *Goodfellow, et al.*
## Learning Objectives
- <a href="#p1">Part ... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import urllib.request as urllib
from datetime import datetime
import time
import ergo # Download from https://github.com/rethinkpriorities/ergo
def fetch(url):
max_attempts = 80
attempts = 0
sleeptime = 10 #in seconds, no reason t... | github_jupyter |
```
%matplotlib inline
```
# Training a ConvNet PyTorch
In this notebook, you'll learn how to use the powerful PyTorch framework to specify a conv net architecture and train it on the CIFAR-10 dataset.
```
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.u... | github_jupyter |
# Programación lineal
<img style="float: right; margin: 0px 0px 15px 15px;" src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Linear_Programming_Feasible_Region.svg/2000px-Linear_Programming_Feasible_Region.svg.png" width="400px" height="125px" />
> La programación lineal es el campo de la optimización m... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy as sp
import os
os.chdir('/Users/steve/GetOldTweets3-0.0.10')
import re
import nltk
import contractions
os.environ['KMP_DUPLICATE_LIB_OK']='True'
from sklearn.feature_extraction.text import TfidfVectorizer, C... | github_jupyter |
# NYSE & Blurr
In this guide we will train a machine learning model that predicts closing price of a stock based on historical data. We will transform time-series stock data into features to train this model.
## Prerequisites
It's recommended to have a basic understanding of how Blurr works. Following [tutorials 1]... | github_jupyter |
# Xarray-spatial
### User Guide: Surface tools
-----
With the Surface tools, you can quantify and visualize a terrain landform represented by a digital elevation model.
Starting with a raster elevation surface, represented as an Xarray DataArray, these tools can help you identify some specific patterns that may not be... | github_jupyter |
<a href="https://www.bigdatauniversity.com"><img src="https://ibm.box.com/shared/static/cw2c7r3o20w9zn8gkecaeyjhgw3xdgbj.png" width=400 align="center"></a>
<h1 align="center"><font size="5"> Logistic Regression with Python</font></h1>
In this notebook, you will learn Logistic Regression, and then, you'll create a mod... | github_jupyter |
```
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(419, 383)
self.radioButton = QtWidgets.QRadioButton(Dialog)
self.radioButton.setGeometry(QtCore.QRect(200, 110, 100, 20))
self.radio... | github_jupyter |
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_13_02_checkpoint.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# T81-558: Applications of Deep Neural Networks
**Module 13: Advanced/Other... | github_jupyter |
```
%matplotlib inline
import matplotlib.pylab as plt
import numpy as np
from keras import objectives
from keras import backend as K
from keras import losses
import tensorflow as tf
import interactions_results
import train_interactions
OBJ_IDS = ['1', '2']
COLUMNS_MAP = [('x', 'ant%s_x'),
('y', 'ant%s_y'),
... | github_jupyter |
> Developed by [Yeison Nolberto Cardona Álvarez](https://github.com/yeisonCardona)
> [Andrés Marino Álvarez Meza, PhD.](https://github.com/amalvarezme)
> César Germán Castellanos Dominguez, PhD.
> _Digital Signal Processing and Control Group_ | _Grupo de Control y Procesamiento Digital de Señales ([GCPDS](https:... | 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 |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
from sklearn.model_selection import train_test_split
from tensorflow.keras.preprocessing.image import ImageDataGenerator
df = pd.DataFrame(c... | github_jupyter |
```
from __future__ import division
import numpy as np
import pylab as plt
import swordfish as sf
from scipy.interpolate import interp1d
from scipy.constants import c
from numpy.random import multivariate_normal
from matplotlib import rc
from scipy.interpolate import UnivariateSpline
rc('text', usetex=True)
rc('font',*... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = "retina"
# print(plt.style.available)
plt.style.use("ggplot")
# plt.style.use("fivethirtyeight")
plt.style.use("seaborn-talk")
from tqdm import tnrange, tqdm_notebook
def uniform_linear_array(n_mics, spacing... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
, feel free to skim through this lesson.
- #### Create a NumPy array:
- from a pandas dataframe: [pandas.DataFrame.values](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.values.html)
- from a Python sequence: [... | github_jupyter |
# Setup
```
%load_ext rpy2.ipython
import os
from json import loads as jloads
from glob import glob
import pandas as pd
import datetime
%%R
library(gplots)
library(ggplot2)
library(ggthemes)
library(reshape2)
library(gridExtra)
library(heatmap.plus)
ascols = function(facs, pallette){
facs = facs[,1]
ffacs =... | github_jupyter |
```
import cv2 as cv
import numpy as np
import random
img = cv.imread("task13.jpg")
temp = cv.imread("task13temp.jpg")
noise = 100
prev_noise = 0
result_of_ch = np.copy(img)
result_of_matching = np.copy(img)
rotated_img = np.copy(img)
bright_size = 10
contrast_size = 10
angle_size = 0.0
scale_size = 1.0
point_list=list... | github_jupyter |
<a href="https://colab.research.google.com/github/brit228/AB-Demo/blob/master/module2-Bag-of-Words/LS_DS_422_BOW_Assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import re
import string
!pip install -U nltk
import nltk
nltk.download(... | github_jupyter |
# Code stuff - not slides!
```
%run ../ML_plots.ipynb
```
# Session 12:
## Supervised learning, part 1
*Andreas Bjerre-Nielsen*
## Agenda
1. [Modelling data](#Modelling-data)
1. [A familiar regression model](#A-familiar-regression-model)
1. [The curse of overfitting](#The-curse-of-overfitting)
1. [Important details... | github_jupyter |
# Colab FAQ
For some basic overview and features offered in Colab notebooks, check out: [Overview of Colaboratory Features](https://colab.research.google.com/notebooks/basic_features_overview.ipynb)
You need to use the colab GPU for this assignmentby selecting:
> **Runtime** → **Change runtime type** → **Har... | github_jupyter |
```
import cv2
import os
import numpy
from PIL import Image
import matplotlib.pyplot as plt
# !tar -xf EnglishHnd.tgz
# !mv English/Hnd ./
# !rm -rf Hnd/Trj/
# !mv Hnd/Img/* Hnd/
# !rm -rf Hnd/Img
# !rm -rf English
# !rm -rf Hnd
label_list = ['0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H', 'I'... | github_jupyter |
```
!pip install datasets -q
!pip install sagemaker -U -q
!pip install s3fs==0.4.2 -U -q
```
### Load dataset and have a peak:
This cell is required in SageMaker Studio, otherwise the download of the dataset will throw an error.
After running this cell, the kernel needs to be restarted. After restarting tthe kernel, ... | github_jupyter |
# IllusTrip: Text to Video 3D
Part of [Aphantasia](https://github.com/eps696/aphantasia) suite, made by Vadim Epstein [[eps696](https://github.com/eps696)]
Based on [CLIP](https://github.com/openai/CLIP) + FFT/pixel ops from [Lucent](https://github.com/greentfrapp/lucent).
3D part by [deKxi](https://twitter.com/deK... | github_jupyter |
```
import time
from IPython import display
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
plt.rcParams['figure.figsize'] = [16, 10]
```
# 1) Get data in a pandas.DataFrame and plot it using matplotlib.pyplot
```
# Get data
# 1) dire... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.