code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
##### Copyright 2019 Google LLC
```
#@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 ... | github_jupyter |
# Road Following - Live demo
In this notebook, we will use model we trained to move jetBot smoothly on track.
### Load Trained Model
We will assume that you have already downloaded ``best_steering_model_xy.pth`` to work station as instructed in "train_model.ipynb" notebook. Now, you should upload model file to JetBo... | github_jupyter |
# Deep Deterministic Policy Gradients (DDPG)
---
In this notebook, we train DDPG with OpenAI Gym's Pendulum-v0 environment.
### 1. Import the Necessary Packages
```
import gym
import random
import torch
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
%matplotlib inline
from ddpg_agen... | github_jupyter |
```
%matplotlib inline
import numpy as np
import sys
import os
import matplotlib.pyplot as plt
import math
import pickle
import pandas as pd
import scipy.io
import time
import h5py
import bz2
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
from mpl_toolkit... | github_jupyter |
<h1 align='center' style="margin-bottom: 0px"> An end to end implementation of a Machine Learning pipeline </h1>
<h4 align='center' style="margin-top: 0px"> SPANDAN MADAN</h4>
<h4 align='center' style="margin-top: 0px"> Visual Computing Group, Harvard University</h4>
<h4 align='center' style="margin-top: 0px"> Computer... | github_jupyter |
## <span style="color:purple">ArcGIS API for Python: Traffic and Pedestrian Activity Detection</span>

## Integrating ArcGIS with TensorFlow Deep Learning using the ArcGIS API for Python
## Jackson Hole, Wyoming Traffic Intersection Detection
This notebook p... | github_jupyter |
<a href="https://colab.research.google.com/github/mbohling/spiking-neuron-model/blob/main/Hodgkin-Huxley/SpikingNeuronModel_HH.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#The Spiking Neuron Model - Coding Challenge Problems (Part 3)
# Hodgkin-... | github_jupyter |
# 광학 인식

흔히 볼 수 있는 Computer Vision 과제는 이미지에서 텍스트를 감지하고 해석하는 것입니다. 이러한 종류의 처리를 종종 *OCR(광학 인식)*이라고 합니다.
## Computer Vision 서비스를 사용하여 이미지에서 텍스트 읽기
**Computer Vision** Cognitive Service는 다음을 비롯한 OCR 작업을 지원합니다.
- 여러 언어로 된 텍스트를 읽는 데 사용할 수 있는 **OCR** API. 이 API는 동기식으로 사용할 수 있으며,... | github_jupyter |
```
#!/usr/bin/python3
#
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
"""
This jupyter notebook is used to display the intersections
between... | github_jupyter |
### Ricapitolazione Lez 3 (teoria)
- definizione di funzione
- espressioni booleane
- if elif else
#### Confronto fra reali
il numero di bit dedicato ai reali è finito, c'è un approssizmazione
e spesso == non va bene
```
from math import *
sqrt(2)**2==2
sqrt(2)
sqrt(2)**2
epsilon = 1e-15
abs(sqrt(2)**2-2) < epsilon
i... | github_jupyter |
# The Atoms of Computation
Programming a quantum computer is now something that anyone can do in the comfort of their own home.
But what to create? What is a quantum program anyway? In fact, what is a quantum computer?
These questions can be answered by making comparisons to standard digital computers. Unfortuna... | github_jupyter |
# Units in Python
```
import numpy as np
```
### Find the position (x) of a rocket moving at a constant velocity (v) after a time (t)
<img src="./images/rocket.png" width="400"/>
```
def find_position(velocity, time):
result = velocity * time
return result
```
### If v = 10 m/s and t = 10 s
```
my_velocit... | github_jupyter |
# **Discriminative Feature Selection**
# FEATURE SELECTION
Feature Selection is the process where you automatically or manually select those features which contribute most to your prediction variable or output in which you are interested in. Having irrelevant features in your data can decrease the accuracy of the mod... | github_jupyter |
!wget https://www.dropbox.com/s/ic9ym6ckxq2lo6v/Dataset_Signature_Final.zip
#!wget https://www.dropbox.com/s/0n2gxitm2tzxr1n/lightCNN_51_checkpoint.pth
#!wget https://www.dropbox.com/s/9yd1yik7u7u3mse/light_cnn.py
import zipfile
sigtrain = zipfile.ZipFile('Dataset_Signature_Final.zip', mode='r')
sigtrain.extractall()
... | github_jupyter |
# Miscellaneous
This section describes the organization of classes, methods, and functions in the ``finite_algebra`` module, by way of describing the algebraic entities they represent. So, if we let $A \rightarrow B$ denote "A is a superclass of B", then the class hierarchy of algebraic structures in ``finite_algebra... | 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 |
```
import itertools
import collections
import copy
from functools import cache
# from https://bradfieldcs.com/algos/graphs/dijkstras-algorithm/
import heapq
def calculate_distances(graph, starting_vertex):
distances = {vertex: float('infinity') for vertex in graph}
distances[starting_vertex] = 0
pq = [(... | github_jupyter |
```
import pandas as pd
import matplotlib as mpl
import seaborn as sns
import numpy as np
import os
import re
import time
```
# Importing the Data
This data was taken from the webrobots.io scrape of the kickstarter.com page. I've pulled together data from four different scrape dates (2/16, 2/17, 2/18, and 2/19) and do... | github_jupyter |
```
#|hide
#|skip
! [ -e /content ] && pip install -Uqq fastai # upgrade fastai on colab
```
# Tabular training
> How to use the tabular application in fastai
To illustrate the tabular application, we will use the example of the [Adult dataset](https://archive.ics.uci.edu/ml/datasets/Adult) where we have to predict... | github_jupyter |
```
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import skimage as sk
from skimage import measure
import os
import tifffile
from tqdm import tqdm
dots_data = pd.read_csv("field_001.gated_dots.tsv", sep="\t")
dots_data2 = dots_data.loc["60x" == dots_data["magnification"], :]
dots_data2
ref... | github_jupyter |
```
from pyalink.alink import *
useLocalEnv(4)
from utils import *
import os
import pandas as pd
DATA_DIR = ROOT_DIR + "mnist" + os.sep
DENSE_TRAIN_FILE = "dense_train.ak";
SPARSE_TRAIN_FILE = "sparse_train.ak";
INIT_MODEL_FILE = "init_model.ak";
TEMP_STREAM_FILE = "temp_stream.ak";
VECTOR_COL_NAME = "vec";
LABEL_... | github_jupyter |
# Introduction to `pandas`
```
# pandas is the data frame equivalent in Python
import numpy as np
import pandas as pd
```
## Series and Data Frames
### Series objects
A `Series` is like a vector. All elements must have the same type or are nulls.
```
s = pd.Series([1,1,2,3] + [None])
s
```
### Size
```
s.size # ... | github_jupyter |
# py2neo
By Zhanghan Wang
Refer to [The Py2neo v4 Handbook](https://py2neo.org/v4/index.html#)
This is a .ipynb file to illustrate how to use py2neo
## Import
```
import pprint
import numpy as np
import pandas as pd
import py2neo
print(py2neo.__version__)
from py2neo import *
from py2neo.ogm import *
```
## Att... | github_jupyter |
# Enron email data set exploration
```
# Get better looking pictures
%config InlineBackend.figure_format = 'retina'
df = pd.read_feather('enron.feather')
df = df.sort_values(['Date'])
df.tail(5)
```
## Email traffic over time
Group the data set by `Date` and `MailID`, which will get you an index that collects all of... | github_jupyter |
# ONNX Runtime: Tutorial for STVM execution provider
This notebook shows a simple example for model inference with STVM EP.
#### Tutorial Roadmap:
1. Prerequistes
2. Accuracy check for STVM EP
3. Configuration options
## 1. Prerequistes
Make sure that you have installed all the necessary dependencies described in ... | github_jupyter |
# Wave (.wav) to Zero Crossing.
This is an attempt to produce synthetic ZC (Zero Crossing) from FS (Full Scan) files. All parts are calculated in the time domain to mimic true ZC. FFT is not used (maybe with the exception of the internal implementation of the Butterworth filter).
Current status: Seems to work well fo... | github_jupyter |
# Binned Likelihood Tutorial
The detection, flux determination, and spectral modeling of Fermi LAT sources is accomplished by a maximum likelihood optimization technique as described in the [Cicerone](https://fermi.gsfc.nasa.gov/ssc/data/analysis/documentation/Cicerone/Cicerone_Likelihood/) (see also, e.g., [Abdo, A. ... | github_jupyter |
```
from collections import Counter
import numpy as np
from csv import DictReader
from keras.preprocessing.sequence import pad_sequences
from keras.utils import np_utils
from keras.models import Sequential, Model, load_model
from keras.layers import concatenate, Embedding, Dense, Dropout, Activation, LSTM, CuDNNLSTM, C... | github_jupyter |
```
##### Copyright 2021 The Cirq Developers
#@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 agree... | github_jupyter |
```
##The premise of this project is for the implementation a CNN with VGG-16 as a feature selector
import matplotlib.pyplot as plt
%matplotlib inline
#Create an ImageGenerator object that is used to randomize and make certain small transformations to the image
#to build better and robust networks
from keras.preproce... | github_jupyter |
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i>
<i>Licensed under the MIT License.</i>
# Hard Negative Sampling for Object Detection
You built an object detection model, evaluated it on a test set, and are happy with its accuracy. Now you deploy the model in a real-world application and you may find... | github_jupyter |
```
import os
os.environ['CUDA_VISIBLE_DEVICES'] = ''
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'prepare/mesolitica-tpu.json'
b2_application_key_id = os.environ['b2_application_key_id']
b2_application_key = os.environ['b2_application_key']
from google.cloud import storage
client = storage.Client()
bucket = client... | github_jupyter |
# Venture Funding with Deep Learning
## Steps:
* Prepare the data for use on a neural network model.
* Compile and evaluate a binary classification model using a neural network.
* Optimize the neural network model.
```
# Imports
import pandas as pd
from pathlib import Path
import tensorflow as tf
from tensorflow.ke... | github_jupyter |
```
import os
import os.path as path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from tensorflow.keras import layers, models, optimizers, regularizers
from tensorflow.keras.models import load_model
current_dir = os.path.join(os.getcwd())
file = os.path.join(path.dirname(path.dirname(... | github_jupyter |
<a href="https://colab.research.google.com/github/cxbxmxcx/EatNoEat/blob/master/Chapter_9_Build_Nutritionist.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Imports
```
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
imp... | github_jupyter |
#Build a regression model: Get started with R and Tidymodels for regression models
## Introduction to Regression - Lesson 1
#### Putting it into perspective
✅ There are many types of regression methods, and which one you pick depends on the answer you're looking for. If you want to predict the probable height for a ... | github_jupyter |
```
# Code based on souce from https://machinelearningmastery.com/how-to-develop-a-pix2pix-gan-for-image-to-image-translation/
# Required imports for dataset import, preprocessing and compression
"""
GAN analysis file. Takes in trained .h5 files created while training the network.
Generates test files from testing sy... | github_jupyter |
# Load and preprocess 2012 data
We will, over time, look over other years. Our current goal is to explore the features of a single year.
---
```
%pylab --no-import-all inline
import pandas as pd
```
## Load the data.
---
If this fails, be sure that you've saved your own data in the prescribed location, then retry... | github_jupyter |
# Operations on word vectors
Welcome to your first assignment of this week!
Because word embeddings are very computationally 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 u... | github_jupyter |
## Versions of used packages
We will check PyTorch version to make sure everything work properly.
We use `python 3.6.9`, `torch==1.6.0`
```
!python --version
!pip freeze | grep torch
!pip install transformers
```
## Error handling
**RuntimeError: CUDA out of memory...**
> 發生原因可能為讀取的 batch 過大或是記憶體未釋放乾淨。若縮小 batch s... | github_jupyter |
# Molecular Hydrogen H<sub>2</sub> Ground State
Figure 7.1 from Chapter 7 of *Interstellar and Intergalactic Medium* by Ryden & Pogge, 2021,
Cambridge University Press.
Plot the ground state potential of the H<sub>2</sub> molecule (E vs R) and the bound vibration levels.
Uses files with the H<sub>2</sub> potential ... | github_jupyter |
```
%matplotlib inline
import numpy as np
import sygma
import matplotlib.pyplot as plt
from galaxy_analysis.plot.plot_styles import *
import galaxy_analysis.utilities.convert_abundances as ca
def plot_settings():
fsize = 21
rc('text',usetex=False)
rc('font',size=fsize)
return
sygma.sygma?
s = {}
meta... | github_jupyter |
```
import tensorflow as tf
import numpy as np
import keras
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
import os
import cv2
import random
import keras.backend as K
import sklearn
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.preprocessing.image im... | github_jupyter |
# Kaggle Home price prediction
### by Mohtadi Ben Fraj
#### In this version, we find the most correlated variables with 'SalePrice' and them in our Sklearn models
```
# Handle table-like data and matrices
import numpy as np
import pandas as pd
# Modelling Algorithms
from sklearn.tree import DecisionTreeClassifier
f... | github_jupyter |
# Reinterpreting Tensors
Sometimes the data in tensors needs to be interpreted as if it had different type or shape. For example, reading a binary file into memory produces a flat tensor of byte-valued data, which the application code may want to interpret as an array of data of specific shape and possibly different t... | github_jupyter |
```
# RJMC for GMMs:
import matplotlib.pyplot as plt
%matplotlib inline
from autograd import numpy as np
np.random.seed(0)
from scipy.stats import norm
from scipy.stats import dirichlet
from scipy.special import logsumexp
def gaussian_mixture_log_likelihood(X, means, stdevs, weights):
component_log_pdfs = np.arra... | github_jupyter |
<img src='./img/LogoWekeo_Copernicus_RGB_0.png' align='right' width='20%'></img>
# Tutorial on basic land applications (data processing) Version 2
In this tutorial we will use the WEkEO Jupyterhub to access and analyse data from the Copernicus Sentinel-2 and products from the [Copernicus Land Monitoring Service (CLMS... | github_jupyter |
```
from HARK.ConsumptionSaving.ConsLaborModel import (
LaborIntMargConsumerType,
init_labor_lifecycle,
)
import numpy as np
import matplotlib.pyplot as plt
from time import process_time
mystr = lambda number: "{:.4f}".format(number) # Format numbers as strings
do_simulation = True
# Make and solve a labor int... | github_jupyter |
```
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from statsmodels.distributions.empirical_distribution import ECDF
from datetime import date, datetime, timedelta, timezone
%matplotlib inline
#set default plotting styles
sns.set(rc={'figure.figsize':(15, 6)})
sn... | github_jupyter |
# Factors
This notebook calculates the factors used to add seasonality patterns to reconstructed data.
Factors are multiplicative scalars applied for a numerical feature for each groupby value (e.g. average monthly windspeed ratio as percentage of annual average)
## 0 - Setup
### 0.1 - Imports
Load the necessary dep... | github_jupyter |
```
import numpy as np
import pandas as pd
from pathlib import Path
# visualization
import matplotlib.pyplot as plt
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
```
## Read and clean datasets
```
def clean_Cohen_datasets(path):
"""Read local raw datasets and clean them"""
# read datas... | github_jupyter |
<a href="https://colab.research.google.com/github/jpabloglez/Master_IA_Sanidad/blob/main/2_3_3_Exploracion_visual_de_datos.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Exploración de datos
## Conjunto de datos de Diabetes
```
"""
En este cuad... | github_jupyter |
# To solve 'Tower of Hanoi' using recursion
______

Source pillar Helper pillar Destination pillar
Let the number of disk $(n)$ be 3, and the first piller is source, middle piller is hel... | github_jupyter |
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from astropy.time import Time
import astropy.units as u
from rms import Planet
times, spotted_lc, spotless_lc = np.loadtxt('ring.txt', unpack=True)
d = Planet(per=4.049959, inc=90, a=39.68, t0=0,
rp=(0.3566/100)**0.5, lam=0, ecc=0, w... | github_jupyter |
[Bag of Words Meets Bags of Popcorn](https://www.kaggle.com/c/word2vec-nlp-tutorial/data)
======
## Data Set
The labeled data set consists of 50,000 IMDB movie reviews, specially selected for sentiment analysis. The sentiment of reviews is binary, meaning the IMDB rating < 5 results in a sentiment score of 0, and rat... | github_jupyter |
```
# Import data from Excel sheet
import pandas as pd
df = pd.read_excel('aibl_ptdemog_final.xlsx', sheet_name='aibl_ptdemog_final')
#print(df)
sid = df['RID']
grp = df['DXCURREN']
age = df['age']
sex = df['PTGENDER(1=Female)']
tiv = df['Total'] # TIV
field = df['field_strength']
grpbin = (grp > 1) # 1=CN, ...
# Scan ... | github_jupyter |
# PyTorch Basics
```
import torch
import numpy as np
torch.manual_seed(1234)
```
## Tensors
* Scalar is a single number.
* Vector is an array of numbers.
* Matrix is a 2-D array of numbers.
* Tensors are N-D arrays of numbers.
#### Creating Tensors
You can create tensors by specifying the shape as arguments. Here... | 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 |
## DEMs coregistration demo
### Note: The data for co-registration should be utm projected.
```
import os
root_proj = '/Users/luo/OneDrive/GitHub/Glacier-in-RGI1305'
os.chdir(root_proj)
import numpy as np
import matplotlib.pyplot as plt
from utils.geotif_io import readTiff, writeTiff
from utils.imgShow import imgShow
... | github_jupyter |
```
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from sklearn.metrics import confusion_matrix,balanced_accuracy_score,roc_auc_score,roc_curve
from p4tools import io
ResultsPath = '../../Data/SummaryResults/'
FiguresPath = '../../Data/Figures/'
if not os.path.isdir(F... | github_jupyter |
<a href="https://colab.research.google.com/github/JSJeong-me/CNN-Cats-Dogs/blob/main/5_aug_pretrained.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
from google.colab import drive
drive.mount('/content/drive')
%matplotlib inline
!ls -l
!cp ./dr... | github_jupyter |
<img src="./img/Circuit.png" style="width: 50%; height: 50%"> </img>
<img src="./img/treqs.png" style="width: 50%; height: 50%"> </img>
$$ CPE_{x} = \frac{1}{Q_x(\imath\omega)^{p_x}}, \ x=H, M, L, E $$
$$ R(\omega) = R_{\infty}+\sum_{x=H, M, L, E}\frac{1}{\frac{1}{R_x}+\frac{1}{CPE_x(\omega)}}$$
$$ R(\omega) = R_{\... | github_jupyter |
# Nonlinear Equations
We want to find a root of the nonlinear function $f$ using different methods.
1. Bisection method
2. Newton method
3. Chord method
4. Secant method
5. Fixed point iterations
```
%matplotlib inline
from numpy import *
from matplotlib.pyplot import *
import sympy as sym
t = sym.symbols('t')
f_sy... | github_jupyter |
<center>
<img src="https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0101EN-SkillsNetwork/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# **Exception Handling**
Estimated time needed: **15** minutes
## Objectives
After completing this lab you w... | github_jupyter |
```
# python the hardway https://learnpythonthehardway.org/book/index.html
# Exercise 1 - Hello world
import sys
print ("Hello Snake")
# Exercise 2 - simple math operations
print ("5 + 2 = ", 5 + 2)
print ("5 > 2 ? ", 5 > 2)
print ("7 / 4 = ", 7/4)
# print ("7 % 4 = ", 7%4)
# Exercise 3 - variables and names
my_nam... | github_jupyter |
<a href="https://colab.research.google.com/github/codeforhk/python_course/blob/master/py_class_1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
<img src="https://www.codefor.hk/wp-content/themes/DC_CUSTOM_THEME/img/logo-code-for-hk-logo.svg" ... | github_jupyter |
## Lists
A **List** is a common way to store a collection of objects in Python. Lists are defined with square brackets `[]` in Python.
```
# An empty list can be assigned to a variable and aded to later
empty_list = []
# Or a list can be initialized with a few elements
fruits_list = ['apple', 'banana', 'orange', 'wat... | github_jupyter |
```
import matplotlib as mpl
import matplotlib.pyplot as plt
from agglio_lib import *
#-------------------------------Data Generation section---------------------------#
n = 1000
d = 50
sigma=0.5
w_radius = 10
wAst = np.random.randn(d,1)
X = getData(0, 1, n, d)/np.sqrt(d)
w0 =w_radius*np.random.randn(d,1)/np.sqrt(d)
ip... | github_jupyter |
Lambda School Data Science
*Unit 2, Sprint 3, Module 2*
---
# Permutation & Boosting
You will use your portfolio project dataset for all assignments this sprint.
## Assignment
Complete these tasks for your project, and document your work.
- [ ] If you haven't completed assignment #1, please do so first.
- [ ] C... | github_jupyter |
```
import numpy as np
from scipy.optimize import fsolve
% matplotlib inline
import time
import pylab as pl
from IPython import display
# PSl – Power of solar radiation arriving to the Earth (short wave radiation)
# Pz – Power of radiation emitted from Earth (long wave radiation)
# A – mean albedo of the Earth surfac... | github_jupyter |
```
from selenium import webdriver
import time
import numpy as np
DRIVER = webdriver.Chrome()
def get_stats_from_window(driver, handle_number):
driver.switch_to.window(handle_number)
new_link = driver.current_url
statistics1=new_link[:-7]+"statistics;1"
time.sleep(2)
try:
driver.get(stati... | github_jupyter |
```
from tsfresh.feature_extraction import extract_features
from tsfresh.feature_extraction.settings import ComprehensiveFCParameters, MinimalFCParameters, EfficientFCParameters
from tsfresh.feature_extraction.settings import from_columns
import numpy as np
import pandas as pd
```
This notebooks illustrates the `"fc_... | github_jupyter |
## External Compton

### Broad Line Region
```
import jetset
print('tested on jetset',jetset.__version__)
from jetset.jet_model import Jet
my_jet=Jet(name='EC_example',electron_distribution='bkn',beaming_expr='bulk_theta')
my_jet.add_EC_component(['EC_BLR','EC_Disk'],disk_type='BB')... | github_jupyter |
```
from sklearn.linear_model import LogisticRegression
import csv
import pandas as pd
import numpy as np
from sklearn import preprocessing
from sklearn import utils
%matplotlib inline
import matplotlib.pyplot as plt
from pandas.plotting import scatter_matrix
df = pd.read_csv('data_1000.csv')
# for i, row in df.iterro... | github_jupyter |
<a href="https://colab.research.google.com/github/dafrie/fin-disclosures-nlp/blob/master/Multi_class_classification_with_Transformers.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Multi-Class classification with Transformers
# Setup
```
# Load... | github_jupyter |
```
import numpy as np
import pandas as pd
import warnings
import os
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.layers import LSTM, Dense
from tensorflow.keras.layers import Bidirectional
from tensorflow.keras.optimizers import Adam
from tensor... | github_jupyter |
[View in Colaboratory](https://colab.research.google.com/github/coleman-word/DevOps-Notebooks/blob/master/Markdown_Guide.ipynb)
Formatting text in Colaboratory: A guide to Colaboratory markdown
===
## What is markdown?
Colaboratory has two types of cells: text and code. The text cells are formatted using a simple ma... | github_jupyter |
```
# default_exp models.XResNet1dPlus
```
# XResNet1dPlus
> This is a modified version of fastai's XResNet model in github. Changes include:
* API is modified to match the default timeseriesAI's API.
* (Optional) Uber's CoordConv 1d
```
#export
from tsai.imports import *
from tsai.models.layers import *
from tsai.m... | github_jupyter |
```
# cleanup data and put them in the new csv files
import numpy as np
import scipy
import pandas as pd
from sklearn import tree, ensemble, linear_model, svm, cross_validation, grid_search
import math
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
%matplotlib inline
## load test data (this one does ... | github_jupyter |
```
#export
from pathlib import Path
import urllib.request as u_request
from zipfile import ZipFile
import csv
import pandas as pd
from andi import andi_datasets, normalize
import numpy as np
from fastai.text.all import *
#hide
from nbdev.showdoc import *
# default_exp data
```
# Data
> Here we deal with the data a... | github_jupyter |
Simulation Demonstration
=====================
```
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import soepy
```
In this notebook we present descriptive statistics of a series of simulated samples with the soepy toy model.
soepy is closely aligned to the model in Blundell et. al. (2016). Y... | github_jupyter |
# Quickstart
In this tutorial, we will show how to solve a famous optimization problem, minimizing the Rosenbrock function, in simplenlopt. First, let's define the Rosenbrock function and plot it:
$$
f(x, y) = (1-x)^2+100(y-x^2)^2
$$
```
import numpy as np
def rosenbrock(pos):
x, y = pos
return (1-x)**... | github_jupyter |
# Categorical Data Plots
Now let's discuss using seaborn to plot categorical data! There are a few main plot types for this:
* factorplot
* boxplot
* violinplot
* stripplot
* swarmplot
* barplot
* countplot
Let's go through examples of each!
```
import seaborn as sns
%matplotlib inline
tips = sns.load_dataset('tips... | github_jupyter |
# <img style="float: left; padding-right: 10px; width: 45px" src="https://raw.githubusercontent.com/Harvard-IACS/2018-CS109A/master/content/styles/iacs.png"> CS109B Data Science 2: Advanced Topics in Data Science
## Lecture 5.5 - Smoothers and Generalized Additive Models - Model Fitting
<div class="discussion"><b>JUS... | github_jupyter |
## Applicazione del transfer learning con MobileNet_V2
A high-quality, dataset of images containing fruits. The following fruits are included: Apples - (different varieties: Golden, Golden-Red, Granny Smith, Red, Red Delicious), Apricot, Avocado, Avocado ripe, Banana (Yellow, Red), Cactus fruit, Carambula, Cherry, Clem... | github_jupyter |
```
import pandas as pd
import seaborn as sns
from sklearn.neighbors import NearestNeighbors
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
from sklearn.decomposit... | github_jupyter |
```
from gridworld import *
% matplotlib inline
# create the gridworld as a specific MDP
gridworld=GridMDP([[-0.04,-0.04,-0.04,1],[-0.04,None, -0.04, -1], [-0.04, -0.04, -0.04, -0.04]], terminals=[(3,2), (3,1)], gamma=1.)
example_pi = {(0,0): (0,1), (0,1): (0,1), (0,2): (1,0), (1,0): (1,0), (1,2): (1,0), (2,0): (0,1)... | github_jupyter |
<h2>Quadratic Regression Dataset - Linear Regression vs XGBoost</h2>
Model is trained with XGBoost installed in notebook instance
In the later examples, we will train using SageMaker's XGBoost algorithm.
Training on SageMaker takes several minutes (even for simple dataset).
If algorithm is supported on Python, we... | github_jupyter |
# Table of Contents
<div class="toc" style="margin-top: 1em;"><ul class="toc-item" id="toc-level0"><li><span><a href="http://localhost:8888/notebooks/work/bisdev/phenology-baps/spring-indices/annual-indices-of-spring.ipynb#Purpose" data-toc-modified-id="Purpose-1"><span class="toc-item-num">1 </span>Purpose... | 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 |
# Analyse data with Python Pandas
Welcome to this Jupyter Notebook!
Today you'll learn how to import a CSV file into a Jupyter Notebook, and how to analyse already cleaned data. This notebook is part of the course Python for Journalists at [datajournalism.com](https://datajournalism.com/watch/python-for-journalist... | github_jupyter |
# Example File:
In this package, we show three examples:
<ol>
<li>4 site XY model</li>
<li>4 site Transverse Field XY model with random coefficients</li>
<li><b> Custom Hamiltonian from OpenFermion </b> </li>
</ol>
## Clone and Install The Repo via command line:
```
git clone https://github.com/ke... | github_jupyter |
```
import requests
import simplejson as json
import pandas as pd
import numpy as np
import os
import json
import math
from openpyxl import load_workbook
df={"mapping":{
"Afferent / Efferent Arteriole Endothelial": "Afferent Arteriole Endothelial Cell",
"Ascending Thin Limb": "Ascending Thin Limb Cell",
"Ascending V... | github_jupyter |
Single-channel CSC (Constrained Data Fidelity)
==============================================
This example demonstrates solving a constrained convolutional sparse coding problem with a greyscale signal
$$\mathrm{argmin}_\mathbf{x} \sum_m \| \mathbf{x}_m \|_1 \; \text{such that} \; \left\| \sum_m \mathbf{d}_m * \ma... | github_jupyter |
# 六軸史都華平台模擬
```
import numpy as np
import pandas as pd
from sympy import *
init_printing(use_unicode=True)
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
import seaborn as sns
sns.set()
%matplotlib inline
```
### Stewart Func
```
α, β, γ = symbols('α β γ')
x, y, z = symbols... | github_jupyter |
```
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import os, sys
sys.path.append('/home/sandm/Notebooks/stay_classification/src/')
```
# TODOs (from 09.06.2020)
1. Strip away t... | github_jupyter |
## 目录
- [10. 文本聚类](#10-文本聚类)
- [10.1 概述](#101-概述)
- [10.2 文档的特征提取](#102-文档的特征提取)
- [10.3 k均值算法](#103-k均值算法)
- [10.4 重复二分聚类算法](#104-重复二分聚类算法)
- [10.5 标准化评测](#105-标准化评测)
## 10. 文本聚类
正所谓物以类聚,人以群分。人们在获取数据时需要整理,将相似的数据归档到一起,自动发现大量样本之间的相似性,这种根据相似性归档的任务称为聚类。
### 10.1 概述
1. **聚类**
**聚类**(cluster analysis )指的是将给定对象的集合划... | github_jupyter |
<a href="https://colab.research.google.com/github/davidnoone/PHYS332_FluidExamples/blob/main/04_ColloidViscosity_SOLUTION.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Colloids and no-constant viscosity (1d case)
Colloids are a group of materia... | 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 |
# 1. Load Data
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.model_selection import train_test_split
from sklearn.preproces... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.