text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
# Import required libraries
import pandas as pd
import matplotlib.pyplot as plt
import re
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import string
import nltk
import warnings
%matplotlib inline
warnings.filterwarnings("ignore", category=DeprecationWarning)
from nltk.corpus import st... | github_jupyter |
```
# header files needed
import numpy as np
import torch
import torch.nn as nn
import torchvision
from google.colab import drive
drive.mount('/content/drive')
np.random.seed(1234)
torch.manual_seed(1234)
torch.cuda.manual_seed(1234)
# define transforms
train_transforms = torchvision.transforms.Compose([torchvision.tra... | github_jupyter |
WARNING: This notebook may take a while to run all the cells.
```
import requests
url = 'http://kdd.ics.uci.edu/databases/kddcup99/kddcup.data_10_percent.gz'
r = requests.get(url, allow_redirects=True)
open('kddcup.data_10_percent.gz', 'wb').write(r.content)
```
Downloading the dataset. It will download the dataset i... | github_jupyter |
# Birthquake
We'd like to know what earthquakes occurred on our birthday.
**Proxy trouble? See below.**
Let's make some strings!
```
birthday = '1971-05-26'
birthdayafter = '1971-05-27'
```
Now we can build a URL by concatenating the strings:
```
url = 'https://earthquake.usgs.gov/fdsnws/event/1/query'
query_url... | github_jupyter |
SOP054 - Install azdata CLI (using pip)
=======================================
Steps
-----
### Common functions
Define helper functions used in this notebook.
```
# Define `run` function for transient fault handling, hyperlinked suggestions, and scrolling updates on Windows
import sys
import os
import re
import js... | github_jupyter |
# 03. DQN example with CartPole
## Colab 용 package 설치 코드
```
!pip install gym
!pip install JSAnimation
```
### package import
```
# The typical imports
from IPython.display import clear_output
import gym
import numpy as np
import matplotlib.pyplot as plt
import random
%matplotlib inline
import tensorflow as tf
n... | github_jupyter |
```
from influxdb import InfluxDBClient
import pandas as pd
import matplotlib.pylab as plt
%matplotlib inline
from matplotlib.pylab import rcParams
rcParams['figure.figsize'] = 15, 6
plt.style.use('ggplot')
from pandas import read_csv
folderName = 's1t1rc1nc1t2mediumcomputeprimeappt2micro1r3'
host = '10.155.208.132'
po... | github_jupyter |
# 1. Data Aquisition
We will reference the publically available [Reddit dump](https://www.reddit.com/r/datasets/comments/3bxlg7/i_have_every_publicly_available_reddit_comment/). The dataset is publically available on Google BigQuery and is divided across months from December 2015 - October 2018. BigQuery allows us to ... | github_jupyter |
```
import os, platform, pprint, sys
import fastai
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn
import yellowbrick as yb
from fastai.tabular.data import TabularDataLoaders, TabularPandas
from fastai.tabular.all import FillMissing, Categorify, Normalize,... | github_jupyter |
# Assignment 3: Hello Vectors
Welcome to this week's programming assignment of the specialization. In this assignment we will explore word vectors. In natural language processing, we represent each word as a vector consisting of numbers. The vector encodes the meaning of the word. These numbers (or weights) for each ... | github_jupyter |
# Detecting and Classifying Toxic Comments
# Part 3-1: TF*IDF & Random Forest Classifiers
It may be possible to employ sequential binary models in order to get better results with rarer cases.
If we first classify Toxic and Not Toxic, we could further process only the Toxic results against models that had been traine... | github_jupyter |
```
import argparse
import json
import mxnet as mx
import tensorflow as tf
from tensorflow.python.framework import graph_util
import numpy as np
from converter import Converter
import os
import time
%reload_ext autoreload
%autoreload 2
def main(model_prefix, output_prefix, input_h=128, input_w = 128):
# Parsing... | github_jupyter |
<h1 align="center">TensorFlow Neural Network Lab</h1>
<img src="image/notmnist.png">
In this lab, you'll use all the tools you learned from *Introduction to TensorFlow* to label images of English letters! The data you are using, <a href="http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html">notMNIST</a>, consi... | github_jupyter |
```
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by imp... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
x = np.array([[0, 1, 2], [0, 1, 2]])
y = np.array([[0, 0, 0], [1, 1, 1]])
plt.plot(x, y, color='red', marker='.', linestyle='')
plt.grid(True)
plt.show()
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 100, 100)
y = np.linspace(0, 100, 100)
... | github_jupyter |
# Using SageMaker Neo to Compile a Tensorflow U-Net Model
[SageMaker Neo](https://aws.amazon.com/sagemaker/neo/) makes it easy to compile pre-trained TensorFlow models and build an inference optimized container without the need for any custom model serving or inference code.
<img src="https://paperswithcode.com/media... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/JavaScripts/Image/Polynomial.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" ... | github_jupyter |
```
%matplotlib inline
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
import pylab
pylab.rcParams['figure.figsize'] = (10.0, 8.0)
from torch.utils.data import DataLoader
import torch
import os
import torchvision.transforms as transforms
from faster_rcnn.utils.datasets.voc.voc impo... | github_jupyter |
# Instructions
Implement a PyTorch dataset for keypoint detection.
Read about custom datasets here:
* https://jdhao.github.io/2017/10/23/pytorch-load-data-and-make-batch/
Image augmentation is an important part of deep learning pipelines. It artificially increases your training sample by generating transformed versi... | github_jupyter |
```
import pandas as pd
import numpy as np
import yfinance as yf
from fbprophet import Prophet
from fbprophet.plot import add_changepoints_to_plot
import multiprocessing as mp
from datetime import date,timedelta
import time as t
import matplotlib.pyplot as plt
import defs
from sklearn.metrics import mean_squared_error... | 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 |
<table 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 style="background-color:#ffffff;vertical-align:bottom;text-align:right;">
... | github_jupyter |
# Introduction to Deep Learning with PyTorch
In this notebook, you'll get introduced to [PyTorch](http://pytorch.org/), a framework for building and training neural networks. PyTorch in a lot of ways behaves like the arrays you love from Numpy. These Numpy arrays, after all, are just tensors. PyTorch takes these tenso... | github_jupyter |
```
from datetime import datetime, timezone
import pandas as pd
import langdetect
import json
lang_code = pd.read_json('ISO-639-1-language.json')
def get_language(text=None):
langs = []
if text:
langs = [{
"name": lang_code.set_index('code').loc[lang.lang, 'name'],
"code": lang... | github_jupyter |
# CDR3 entropy in shared and unshared clonotypes
Starting with unique cross-subject clonotype datasets, computes per-position entropy for CDR3s in unshared or shared (found in at least 6 of 10 samples) clonotypes.
The following Python packages are required:
* numpy
* pandas
and can be installed by running `pip i... | github_jupyter |
```
#from preprocess import *
#standard module
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
# import sklearn
from sklearn import linear_model
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.preproces... | github_jupyter |
## Calculate null distribution from median Cell Painting scores with same sample size as L1000
Code modified from @adeboyeML
```
import os
import pathlib
import pandas as pd
import numpy as np
from collections import defaultdict
from pycytominer import feature_select
from statistics import median
import random
from s... | github_jupyter |
<table width="100%">
<tr style="border-bottom:solid 2pt #009EE3">
<td class="header_buttons">
<a href="generation_of_time_axis.zip" download><img src="../../images/icons/download.png" alt="biosignalsnotebooks | download button"></a>
</td>
<td class="header_buttons">
<... | github_jupyter |
```
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
```
# Unsupervised Learning Part 2 -- Clustering
Clustering is the task of gathering samples into groups of similar
samples according to some predefined similarity or distance (dissimilarity)
measure, such as the Euclidean distance.
<img width... | github_jupyter |
# Clustering Sprint Challenge
Objectives:
* Describe two clustering algorithms
* Create k clusters with the k-Means algorithm
* Compare/contrast the performance of the two algorithms on two datasets
### 1. Describe two different clustering algorithms
There are many clustering algorithms with profoundly different imp... | github_jupyter |
## Installing dependencies
```
!pip install simpletransformers datasets tqdm pandas
```
##Loading data from huggingface(optional)
```
import pandas as pd
from datasets import load_dataset
from tqdm import tqdm
dataset = load_dataset('tapaco', 'en')
def process_tapaco_dataset(dataset, out_file):
tapaco = []
#... | github_jupyter |
```
import numpy as np
import h5py
import matplotlib.pyplot as plt
# Helper function to help read the h5 files.
def simple_read_data(fileName):
print(fileName)
hf = h5py.File('{}.h5'.format(fileName), 'r')
# We'll return a dictionary object.
results = {}
results['rs_glob_acc'] = np.array(... | github_jupyter |
```
import os
import sys
data_dir = "/home/ec2-user/pwp-summer-2019/master_thesis_nhh_2019/processed_data/"
raw_dir = "/home/ec2-user/pwp-summer-2019/master_thesis_nhh_2019/raw_data/"
import pandas as pd
import numpy as np
import random
import math
pd.set_option('display.max_columns', 999)
```
### Function for spl... | github_jupyter |
```
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import numpy as np
import time
from prune import *
#TODO
n_epochs = 3
batch_size_train = 64
batch_size_test = 1000
learning_rate = 0.01
momentum = 0.5
log_interval = 10
random_seed = 1
torch.backends.cudnn.ena... | github_jupyter |
# Monte Carlo Localization
千葉工業大学 上田 隆一
(c) 2017 Ryuichi Ueda
This software is released under the MIT License, see LICENSE.
## はじめに
このコードは、移動ロボットの自己位置推定に使われるMonte Carlo Localization(MCL)のサンプルです。
## コードの流れ
確率的な考え方で自分の位置を推定するロボットは、自身の姿勢(位置と向き)について確証は持たず、常に自身の姿勢について曖昧な表現をします。 MCLでは、ロボットが自身の姿勢を複数の候補点で表現します。ロボットは複数の候... | github_jupyter |
# DSA simulations
```
% matplotlib inline
%config InlineBackend.figure_format = 'retina'
%load_ext line_profiler
%load_ext autoreload
%autoreload 2
from __future__ import division
import numpy as np
import glob, os
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['figure.dpi'] = 2.5 * matplotlib... | github_jupyter |
# Visualizing time-resolved LFP-Spiking Analysis of CRCNS PFC2 Dataset
```
%load_ext autoreload
%autoreload 2
import sys
sys.path.append('/Users/rdgao/Documents/code/research/spectralCV/')
sys.path.append('/Users/rdgao/Documents/code/research/neurodsp/')
%matplotlib inline
# imports
import numpy as np
import scipy a... | github_jupyter |
# Look-Aside Cache for MongoDB
### This is a sample notebook for using Aerospike as a read/look-aside cache
- This notebook demonstrates the use of Aerospike as a cache using Mongo as another primary datastore
- It is required to run Mongo as a separte container using `docker run --name some-mongo -d mongo:latest`
To... | github_jupyter |
# Fighting Game AI
## Introduction
Do you know about Pokemon? Well this turn-based fighting game is similar to Pokemon, but we do not send out monsters to duke it out. Instead, the battle is between humans. Since the actions that can be taken by both players are the same, there is some form of game theory involved and... | github_jupyter |
# 判断爬取下来的url是哪种类型的url
```
CSDN_SEEDS_URL = "https://blog.csdn.net/"
REGEX_CSDN_USER_MY_URL = "http[s]*://my\\.csdn\\.net/\\w+"
REGEX_CSDN_USER_BLOG_URL = "http[s]*://blog\\.csdn\\.net/\\w+"
REGEX_CSDN_BLOG_LIST_URL = "http[s]*://blog\\.csdn\\.net/\\w+/article/list/\\d+\\?"
REGEX_CSDN_BLOG_URL = "http[s]*://blog\\.csd... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Terrain/alos_global_dsm.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_bla... | github_jupyter |
```
from __future__ import division
import random
import pprint
import sys
import time
import numpy as np
from optparse import OptionParser
import pickle
from keras import backend as K
from keras.optimizers import Adam, SGD, RMSprop
from keras.layers import Input
from keras.models import Model
from rcnn import config,... | github_jupyter |
# Runtime ≈ 1 minute
# This notebook completes the process of wrangling the text for EDA and other future analyses.
# The processing is the following order:
* Scispacy - Acronyms
* General Cleaning
* Spacy - Lemmatization
```
try:
from google.colab import drive
drive.mount('./drive/')
%cd drive/My ... | github_jupyter |
# SageMaker Inference Pipeline with Scikit Learn and Linear Learner
ISO20022 pacs.008 inference pipeline notebook. This notebook uses training dataset to perform model training. It uses SageMaker Linear Learner to train a model. The problem is defined to be a `binary classification` problem of accepting or rejecting a ... | github_jupyter |
```
# Copyright 2020 Google LLC
#
# 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 writi... | github_jupyter |
### Dependences
```
import sys
sys.path.append("../")
import math
from tqdm import tqdm
import numpy as np
import tensorflow as tf
from PIL import Image
import matplotlib.pyplot as plt
from IPython.display import clear_output
from lib.models.LinkNet import LinkNet
import lib.utils as utils
import IPython.display ... | github_jupyter |
#JRW, HW4 Solution, DATSCI W261, October 2015
```
!mkdir Data
!curl -L https://www.dropbox.com/s/vbalm3yva2rr86m/Consumer_Complaints.csv?dl=0 -o Data/Consumer_Complaints.csv
!curl -L https://www.dropbox.com/s/zlfyiwa70poqg74/ProductPurchaseData.txt?dl=0 -o Data/ProductPurchaseData.txt
!curl -L https://www.dropbox.com/... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.pipeline import make_pipeline, Pipeline
from sklearn.model_selection import train_test_split
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.data... | github_jupyter |
# COVID-19 Scientific Analysis
### What is Covid-19 ?
Coronavirus disease 2019 (COVID-19) is an infectious disease caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2).
The disease was first identified in December 2019 in Wuhan, the capital of China's Hubei province, and has since spread globally, r... | github_jupyter |
#EOSC 582 Assignment V (SSMI)
```
__author__ = 'Yingkai (Kyle) Sha'
__email__ = 'yingkai@eos.ubc.ca'
import h5py
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
% matplotlib inline
import warnings
warnings.filterwarnings('ignore')
```
Function for histogram.
```
def hist_... | github_jupyter |
Author: Michael Gygli ([Github](https://github.com/gyglim), [Twitter](https://twitter.com/GygliMichael)), 2016-01-13
# Introduction #
This example demonstrates how to compute *C3D convolutional features* using Lasagne and Theano. C3D can be used as a general video feature and has shown strong performance. You can fi... | github_jupyter |
```
import numpy as np
import pandas as pd
import seaborn as sns
import glob
import os
import matplotlib.pyplot as plt
import shutil
from prediction_utils.util import df_dict_concat, yaml_read, yaml_write
project_dir = "/share/pi/nigam/projects/spfohl/cohorts/admissions/starr_20200523"
os.listdir(os.path.join(project_d... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
def r2(x, y):
return stats.pearsonr(x, y)[0] ** 2
%matplotlib inline
```
# Preparing Data
```
test_counts = {'yes': 256, 'no': 252, 'up': 272, 'down': 253, 'left': 267, 'right': 259, 'on': 246... | github_jupyter |
<a href="https://colab.research.google.com/github/daemon-Lee/simplex_method_for_linear_program/blob/master/project/simplex_method/Simplex_method.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#@title Copyright 2020 Duy L.Dinh. { display-mode: "... | github_jupyter |
# How to automate IP ranges calculations in Azure using PowerShell
> The notebook does work on Linux and [](https://mybinder.org/v2/gh/eosfor/scripting-notes/HEAD)
## Scenario
Assume we got the IP rage of `10.172.0.0/16` from the network team for planned Azure Landing Zo... | github_jupyter |
TSG001 - Run azdata copy-logs
=============================
Steps
-----
### Common functions
Define helper functions used in this notebook.
```
# Define `run` function for transient fault handling, suggestions on error, and scrolling updates on Windows
import sys
import os
import re
import json
import platform
impo... | github_jupyter |
# CrowdTruth for Multiple Choice Tasks: Relation Extraction
In this tutorial, we will apply CrowdTruth metrics to a **multiple choice** crowdsourcing task for **Relation Extraction** from sentences. The workers were asked to read a sentence with 2 highlighted terms, then pick from a multiple choice list what are the r... | github_jupyter |
```
import scipy.io as sio
def readQTMFile(qtmFile):
content = sio.loadmat(qtmFile)
index = 0
mat_var_index = 0
for key in content.keys():
index = key.find('__') #the variable in the matlab file is the first key that don't have this chars
if index == -1:
break
... | github_jupyter |
# Neo4j
Neo4j is a graph database, and is useful when the *relationships* between items in our database is of interest.
- [Developer's manual](https://neo4j.com/docs/developer-manual/3.4/)
- [The Cypher query language](https://neo4j.com/docs/developer-manual/3.4/cypher/)
- [Cypher magic](https://ipython-cypher.readth... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"><li><span><a href="#Chapter-1---Exploring-Tick,-Volume,-DV-Bars" data-toc-modified-id="Chapter-1---Exploring-Tick,-Volume,-DV-Bars-1" data-vivaldi-spatnav-clickable="1"><span class="toc-item-num">1 </span>Chapter 1 ... | github_jupyter |
# Feature Engineering
Author : [Alexandre Gramfort](http://alexandre.gramfort.net)
with some code snippets from [Olivier Grisel](http://ogrisel.com/) (leaf encoder)
It is the most creative aspect of Data Science!
We will use here the Titanic dataset.
```
import numpy as np
import pandas as pd
im... | github_jupyter |
```
%matplotlib inline
```
# Feature transformations with ensembles of trees
Transform your features into a higher dimensional, sparse space. Then
train a linear model on these features.
First fit an ensemble of trees (totally random trees, a random
forest, or gradient boosted trees) on the training set. Then each... | github_jupyter |
# Using AWS Lambda and PyWren for Landsat 8 Time Series
This notebook is a simple demonstration of drilling a timeseries of [NDVI](https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index) values from the [Landsat 8 satellite images held on AWS](https://landsatonaws.com/). You can view these [time series o... | github_jupyter |
```
import ROOT
import ostap.fixes.fixes
from ostap.core.core import cpp, Ostap
from ostap.core.core import pwd, cwd, ROOTCWD
from ostap.core.core import rootID, funcID, funID, fID, histoID, hID, dsID
from ostap.core.core import VE
from ostap.histos.histos import h1_axis, h2_axes, h3_axes
from ostap.histos.graphs impor... | github_jupyter |
```
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
from albert import modeling
from albert import optimization
from albert import tokenization
import tensorflow as tf
import numpy as np
tokenizer = tokenization.FullTokenizer(
vocab_file='albert-base-2020-04-10/sp10m.cased.v10.vocab', do_lower_case=False,
... | github_jupyter |
# Astronomy 8824 - Problem Set 5
The goal of this problem set is to gain familiarity with Fisher Matrix Forecasts.
This problem set was developed by David Weinberg, with some modifications by Paul Martini.
```
import numpy as np
from numpy import matrix
from numpy import linalg
import matplotlib.pyplot as plt
from m... | github_jupyter |
```
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from glob import glob
from riverreliability.plots import posterior_reliability_diagram
from riverreliability import metrics
LEARNING_RATE = .1
LR_DROP = 10000
MOMENTUM = .9
LR_DECAY = .96
EPOCHS = 250
model = tf.keras.applications.ResNet152... | github_jupyter |
```
# Load packages
import tensorflow as tf
from tensorflow import keras
import numpy as np
import pandas as pd
import os
import scipy as scp
import scipy.stats as scps
from datetime import datetime
# Load my own functions
import dnnregressor_train_eval_keras as dnnk
import make_data_wfpt as mdw
# Load data
data = pd.... | github_jupyter |
# PyTorch
```
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
seed = 1
lr = 0.001
momentum = 0.5
batch_size = 64
test_batch_size = 64
epochs = 5
no_cuda = False
log_interval = 100
```
## Model
```
class Net(nn.Module):
... | github_jupyter |
<a href="https://colab.research.google.com/github/jeffheaton/t81_558_deep_learning/blob/master/t81_558_class_08_1_kaggle_intro.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 8: Kaggle Data Se... | github_jupyter |
# Multiple Time Series, Pre-trained Models and Covariates
This notebook serves as a tutorial for:
* Training a single model on multiple time series
* Using a pre-trained model to obtain forecasts for any time series unseen during training
* Training and using a model using covariates
First, some necessary imports:
... | github_jupyter |
```
import pandas as pd
import geoplot
import geopandas
import matplotlib.pyplot as plt
%matplotlib inline
from shapely.geometry import Polygon
import warnings
warnings.filterwarnings(action="ignore")
#Check geopandas version
geopandas.__version__
#Set figure size and font size
plt.rcParams["figure.figsize"]=(12,10)
p... | github_jupyter |
# Xarray-spatial
### User Guide: Zonal
-----
Xarray-spatial's zonal functions provide an easy way to generate statistics for zones within a raster aggregate. It's set up with a default set of calculations, or you can input any set of custom calculations you'd like to perform.
[Generate terrain](#Generate-Terrain-Data... | github_jupyter |
### SVM (Support Vector Machine)
In this notebook we are going to implement the Support Vector Machine algorithim from scratch using python and numpy.
### Definition
Support Vector Machine (SVM) is a relatively simple Supervised Machine Learning Algorithm used for classification and/or regression. It is more preferr... | github_jupyter |
# Exploration of the UC Berkeley Milling Data Set
> In this notebook we introduce a metal machining data set. We’ll explore the data set and see how it is structured. Data exploration is an important first step in any new data science problem. (notebook originally featured at [tvhahn.com](https://www.tvhahn.com/), offi... | github_jupyter |
# Tutorial 4: Turbine Assembly
Here's what we've done so far in these tutotirals:
+ Ran two simple cost models of turbines. In these, we estiamted masses of components and cost per kilogram of those components.
+ We learned how OpenMDAO makes *components* when we calculated the Betz limit by modelling an idealized `... | github_jupyter |
# Azure Kubernetes Service (AKS) Deep MNIST
In this example we will deploy a tensorflow MNIST model in the Azure Kubernetes Service (AKS).
This tutorial will break down in the following sections:
1) Train a tensorflow model to predict mnist locally
2) Containerise the tensorflow model with our docker utility
3) Sen... | github_jupyter |
<img src="../static/aeropython_name_mini.png" alt="AeroPython" style="width: 300px;"/>
# Clase 5: SymPy

__SymPy es una biblioteca de Python para matemática simbólica__. Apunta a convertirse en un sistema de algebra computacional (__CAS__) con todas sus prestaciones mante... | github_jupyter |
# 1. Introduction to Python syntax
This notebook demonstrates some basic syntax rules of Python programming language. It's a scratchpad to experiment in, so go nuts! You _cannot_ break things.
- [Using Jupyter notebooks](#Using-Jupyter-notebooks)
- [Basic data types](#Basic-data-types)
- [Strings](#Strings)
-... | github_jupyter |
# Alternative methods for chemical equilibrium
The methods previously examined for determining the equilibrium composition rely on knowing the chemical reaction(s) occurring, and can involve highly nonlinear equations.
Fortunately, we have methods that do not require knowing what reaction(s) are occurring.
We will co... | github_jupyter |
```
#export
from fastai2.test import *
from fastai2.basics import *
from fastai2.callback.progress import *
from fastai2.text.data import TensorText
from nbdev.showdoc import *
#default_exp callback.wandb
```
# Wandb
> Integration with [wandb](https://www.wandb.com/)
First thing first, you need to install wandb with... | github_jupyter |
```
from Naive import NaiveBayes
```
# Naive Bayes -- Class to Calculate Single Phrase Posterior Probability
This class is designed for calculating single phrase probability to classify a given property. We could either write our own definition of likelihoods of each feature, or simply load in my pre-defined `json` ... | github_jupyter |
```
import casadi as cs
from urdf2casadi import urdfparser as u2c
import urdf2casadi.geometry.dual_quaternion as dual_quaternion_geometry
import os # For current directory
dual_quaternion_to_transformation_matrix = dual_quaternion_geometry.to_numpy_transformation_matrix
# urdf2casadi uses cs.SX, which can be hard to re... | github_jupyter |
# Time series forecasting using recurrent neural networks
### Import necessary libraries
```
%matplotlib notebook
import numpy
import pandas
import math
import time
import sys
import datetime
import matplotlib.pyplot as ma
import keras.models as km
import keras.layers as kl
import sklearn.preprocessing as sp
```
###... | github_jupyter |
```
import matplotlib.pyplot as plt
import scipy as sp
import numpy as np
import time
import networkx as nx
try:
from localgraphclustering import *
except:
# when the package is not installed, import the local version instead.
# the notebook must be placed in the original "notebooks/" folder
sys.path.... | github_jupyter |
# Rational Expectations Agricultural Market Model
**Randall Romero Aguilar, PhD**
This demo is based on the original Matlab demo accompanying the <a href="https://mitpress.mit.edu/books/applied-computational-economics-and-finance">Computational Economics and Finance</a> 2001 textbook by Mario Miranda and Paul Fackle... | github_jupyter |
```
import torch
from torch import nn, optim
import numpy as np
import mlflow
import pathlib
from pytorch_lightning.core.lightning import LightningModule
import pytorch_lightning
pytorch_lightning.__version__
mlflow.pytorch.autolog()
class Generator(LightningModule):
def __init__(self, voc, embed_size=128, hidden_... | github_jupyter |
```
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import lightgbm as lgb
import matplotlib.pyplot as plt
... | github_jupyter |
```
import pandas as pd
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow.keras import layers
from keras.preprocessing import image
from PIL import Image
import os
import warnings
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import random
import cv2
from time im... | github_jupyter |
# Introduction to Matplotlib (tutorial)
This notebook gives a short introduction to *Matplotlib*, Python's most popular package for plotting. Although many different plotting packages exist in the Python ecosystem (see [this talk](https://www.youtube.com/watch?v=FytuB8nFHPQ) for an overview), Matplotlib is arguably the... | github_jupyter |
# Anatomy of an MD simulation script File
Different simulation packages often use different languages and have different syntax. For example, HOOMD-Blue uses a Python based interface, LAMMPS uses its own custom scripting language, and GROMACS relies upon an input file to define parameters and methods. However, despi... | github_jupyter |
# Clique Method Robustness Verification for Tree Ensembles and Gradient Boosted Decision Tree Classifiers
```
from xgboost import XGBClassifier
import lightgbm
import numpy as np
from sklearn.ensemble import ExtraTreesClassifier, RandomForestClassifier, GradientBoostingClassifier
from art.classifiers import XGBoostCl... | github_jupyter |
### Custom data generator for loading video data for action recognition
```
import pandas as pd
import cv2
import numpy as np
from sklearn.utils import shuffle
import os
from collections import deque
import copy
import matplotlib
import matplotlib.pyplot as plt
from keras.utils import np_utils
from config import Confi... | github_jupyter |
<a href ="https://colab.research.google.com/github/GEM-benchmark/NL-Augmenter/blob/main/notebooks/Write_a_sample_transformation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Licensed under the Apache License, Version 2.0 (the "License");
you may n... | github_jupyter |
# Machine Learning Engineer Nanodegree
## Introduction and Foundations
## Project 0: Titanic Survival Exploration
In 1912, the ship RMS Titanic struck an iceberg on its maiden voyage and sank, resulting in the deaths of most of its passengers and crew. In this introductory project, we will explore a subset of the RMS ... | github_jupyter |
# iOS人脸识别库(静态库)
## 创建静态库

## dlib库源代码添加到工程
* 把dlib拷贝到新建工程目录下
## 编译dlib库
* 使用Xcode构建dlib工程
```bash
cd dlib/dlib
mkdir build
cd build
cmake -G Xcode ..
```
* 打开工程文件dlib.xcodeproj进行配置
```
TARGETS -> dlib -> Build Settings -> Architectures -> Architectures = arm64 arm64e armv7 armv7s... | github_jupyter |
##### Copyright 2018 The TensorFlow Authors.
Licensed under the Apache License, Version 2.0 (the "License");
```
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... | github_jupyter |
# Load Image
### This code loads train & valid/test images and converts it to data frame
```
import cv2
import numpy as np
import pandas as pd
from keras.preprocessing.image import img_to_array
from sklearn.model_selection import train_test_split
from keras.utils import to_categorical
from keras.preprocessing.image i... | github_jupyter |
# Python 容器使用的 5 个技巧和 2 个误区
https://yq.aliyun.com/articles/719141?spm=a2c4e.11155472.0.0.5c217f8fqXNF7H
## 避免频繁扩充列表/创建新列表
- 更多的使用 yield 关键字,返回生成器对象
- 尽量使用生成器表达式替代列表推导表达式
生成器表达式: (i for in range(100))
列表推导表达式: [i for in range(100)]
- 尽量使用模块提供的懒惰对象:
使用 re.finditer 替代 re.findall
直接使用可迭... | github_jupyter |
## Visualizing Earnings Based On College Majors
In this project we are going to visualize the salary eaarned by professionals from popular major. We will be working with dataset on job outcome of students who graduated from college between 2010 and 2012. The dataset was realesed by [American Community Survey](https://... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.