code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Interactive single compartment HH example
To run this interactive Jupyter Notebook, please click on the rocket icon ๐ in the top panel. For more information, please see {ref}`how to use this documentation <userdocs:usage:jupyterbooks>`. Please uncomment the line below if you use the Google Colab. (It does not inclu... | github_jupyter |
## Amazon SageMaker Feature Store: Encrypt Data in your Online or Offline Feature Store using KMS key
This notebook demonstrates how to enable encyption for your data in your online or offline Feature Store using KMS key. We start by showing how to programmatically create a KMS key, and how to apply it to the feature ... | github_jupyter |
# Hyperparameter tuning
In the previous section, we did not discuss the parameters of random forest
and gradient-boosting. However, there are a couple of things to keep in mind
when setting these.
This notebook gives crucial information regarding how to set the
hyperparameters of both random forest and gradient boost... | github_jupyter |
```
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequential
from keras.layers import Dropout, Flatten, Dense
from keras.models import model_from_json
import os, sklearn, pandas, numpy as np, random
from sklearn import svm
i... | github_jupyter |
# Module 2: Playing with pytorch: linear regression
```
import matplotlib.pyplot as plt
%matplotlib inline
import torch
import numpy as np
torch.__version__
```
## Warm-up: Linear regression with numpy
Our model is:
$$
y_t = 2x^1_t-3x^2_t+1, \quad t\in\{1,\dots,30\}
$$
Our task is given the 'observations' $(x_t,y_t... | github_jupyter |
GHCN V2 Temperatures ANOM (C) CR 1200KM 1880-present
GLOBAL Temperature Anomalies in .01 C base period: 1951-1980
http://climatecode.org/
```
import os
import git
if not os.path.exists('ccc-gistemp'):
git.Git().clone('https://github.com/ClimateCodeFoundation/ccc-gistemp.git')
if not os.path.exists('madqc... | github_jupyter |
# Inheriting from Unit
### Abstract attributes and methods

**A Unit subclass has class attributes that dictate how an instance is initialized:**
* `_BM` : dict[str, float] Bare module factors for each purchase cost item.
* `_units` : [dict] Units of measure for the `desig... | github_jupyter |
```
# !pip install ray[tune]
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import mean_squared_error
from hyperopt import hp
from ray import tune
from hyperopt import fmin, tpe, hp,Trials, space_eval
import scipy.stats
df = pd.read_csv("../../Data/Raw/flightLogData.csv... | github_jupyter |
<a href="https://colab.research.google.com/github/naufalhisyam/TurbidityPrediction-thesis/blob/main/train_model_DenseNet121_CV.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import os
import datetime
import numpy as np
import pandas as pd
impor... | 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 |
#CHANDAN KUMAR (BATCH 3)- GOOGLE COLAB / logistic regression & Rigid & Lasso Regression
##(Rahul Agnihotri(T.L))
DATASET [HEART ](https://drive.google.com/file/d/10dopwCjH4VE557tSynCcY3fV9OBowq9h/view?usp=sharing)
#Packages to load
```
import numpy as np
import pandas as pd
from sklearn.linear_model import Ridge
... | github_jupyter |
# Selected Economic Characteristics: Employment Status from the American Community Survey
**[Work in progress]**
This notebook downloads [selected economic characteristics (DP03)](https://data.census.gov/cedsci/table?tid=ACSDP5Y2018.DP03) from the American Community Survey 2018 5-Year Data.
Data source: [American Co... | github_jupyter |
# Settings
```
%env TF_KERAS = 1
import os
sep_local = os.path.sep
import sys
# sys.path.append('..' + sep_local + '..' + sep_local +'..' + sep_local + '..' + sep_local + '..'+ sep_local + '..') # For Windows import
# os.chdir('..' + sep_local + '..' + sep_local +'..' + sep_local + '..' + sep_local + '..'+ sep_local +... | github_jupyter |
# DS106 Machine Learning : Lesson Nine Companion Notebook
### Table of Contents <a class="anchor" id="DS106L9_toc"></a>
* [Table of Contents](#DS106L9_toc)
* [Page 1 - Introduction](#DS106L9_page_1)
* [Page 2 - What are Bayesian Statistics?](#DS106L9_page_2)
* [Page 3 - Bayes Theorem](#DS106L9_page_3)
... | github_jupyter |
## Dimensionality Reduction
```
from sklearn.decomposition import PCA
```
### Principal Components Analysis
```
o_dir = os.path.join('outputs','pca')
if os.path.isdir(o_dir) is not True:
print("Creating '{0}' directory.".format(o_dir))
os.mkdir(o_dir)
pca = PCA() # Use all Princ... | github_jupyter |
### The model
$u(c) = log(c)$ utility function
$y = 1$ Deterministic income
$p(r = 0.02) = 0.5$
$p(r = -0.02) = 0.5$
### value iteration
```
# infinite horizon MDP problem
%pylab inline
import numpy as np
from scipy.optimize import minimize
def u(c):
return np.log(c)
# discounting factor
beta = 0.95
... | 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 |
# YAHOO้ปๅฝฑ็ฌ่ฒ็ทด็ฟ
## ็ทด็ฟ็ฌๅ้ปๅฝฑๆพๆ ่ณ่จใๅฟ
้ ้ๆญฅ็ฒๅ้ปๅฝฑ็ไปฃ่ใๆพๆ ๅฐๅใๆพๆ ๆฅๆๅพ๏ผๅ้ๅบๆฅ่ฉข็ตฆไผบๆๅจใ
```
import requests
import re
from bs4 import BeautifulSoup
```
### ๅ
ๆๅฐๅ
จ้จ็้ปๅฝฑไปฃ่(ID)่ณ่จ
```
# ๆฅ็็ฎๅไธๆ ้ฃไบ้ปๅฝฑ๏ผไธฆๆทๅๅบๅ
ถID่ณ่จ
url = 'https://movies.yahoo.com.tw/'
resp = requests.get(url)
resp.encoding = 'utf-8'
# gggggg
soup = BeautifulSoup(resp.text, 'lxml')
html = s... | github_jupyter |
# Flopy MODFLOW 6 (MF6) Support
The Flopy library contains classes for creating, saving, running, loading, and modifying MF6 simulations. The MF6 portion of the flopy library is located in:
*flopy.mf6*
While there are a number of classes in flopy.mf6, to get started you only need to use the main classes summarized ... | github_jupyter |
# Regression
Regression is fundamentally a way to estimate an independent variable based on its relationships to predictor variables. This can be done both linearly and non-linearly with a single to many predictor variables. However, there are certain assumptions that must be satisfied in order for these results to be ... | github_jupyter |
```
from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.grid_search import GridSearchCV
from sklearn import metrics
import numpy as np
import pandas as pd
from matplotlib import pylab as plt
import re
%matplotlib inline
```
## ... | github_jupyter |
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/3_image_processing_deep_learning_roadmap/3_deep_learning_advanced/1_Blocks%20in%20Deep%20Learning%20Networks/8)%20Resnet%20V2%20Bottleneck%20Block%20(Type%20-%202).ipynb" target="_parent"><img src="https://colab.rese... | github_jupyter |
```
import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
import numpy as np
from pyproj import CRS
import pathlib
from pathlib import Path
from shapely import wkt
from tqdm import tqdm
import math
import codecs
from shapely import wkt
import folium
from folium import features
from folium impor... | github_jupyter |
<a href="https://colab.research.google.com/github/malcolmrite-dsi/RockVideoClassifier/blob/main/RocksResnetTrainer.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')
import tensorflow as ... | github_jupyter |
<img src='./img/EU-Copernicus-EUM_3Logos.png' alt='Logo EU Copernicus EUMETSAT' align='right' width='40%'></img>
<br>
<a href="./00_index.ipynb"><< Index</a><span style="float:right;"><a href="./02_AC_SAF_GOME-2_L2_produce_gridded_dataset_L3.ipynb">02 - AC SAF GOME-2 - Produce gridded dataset (L3)>></a>
<br>
# Opti... | github_jupyter |
<center>
<a href="http://www.insa-toulouse.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/Wikistat/Images/logo-insa.jpg" style="float:left; max-width: 120px; display: inline" alt="INSA"/></a>
<a href="http://wikistat.fr/" ><img src="http://www.math.univ-toulouse.fr/~besse/Wikistat/Images/wikistat.jpg" style=... | github_jupyter |
# Experiments comparing the performance of traditional pooling operations and entropy pooling within a shallow neural network and Lenet. The experiments use cifar10 and cifar100.
```
%matplotlib inline
import torch
import torchvision
import torchvision.transforms as transforms
transform = transforms.Compose(
[tran... | github_jupyter |
<a href="https://colab.research.google.com/github/AIWintermuteAI/aXeleRate/blob/dev/resources/aXeleRate_mark_detector.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## M.A.R.K. Detection model Training and Inference
In this notebook we will use ax... | github_jupyter |
```
# Example of how to use the CGMFtk package
```
# Table of Contents
1. [Import Modules](#import)
2. [Read the History File](#read)
3. [Summary Table](#table)
4. [Histogram Fission Fragment Properties](#ffHistograms)
5. [Correlated Observables](#correlations)
6. [Neutron Properties](#neutrons)
7. [Gamma Properties](... | github_jupyter |
# 0. required packages for h5py
```
%run "..\..\Startup_py3.py"
sys.path.append(r"..\..\..\..\Documents")
import ImageAnalysis3 as ia
%matplotlib notebook
from ImageAnalysis3 import *
print(os.getpid())
import h5py
from ImageAnalysis3.classes import _allowed_kwds
import ast
```
# 1. Create field-of-view class
```... | github_jupyter |
CIFAR10 ๆฏๅฆๅคไธๅ dataset๏ผ ๅ mnist ไธๆจฃ๏ผๆๅ็จฎ้กๅฅ๏ผ้ฃๆฉใๆฑฝ่ปใ้ณฅใ่ฒใ้นฟใ็ใ้่ใ้ฆฌใ่นใๅก่ป๏ผ
https://www.cs.toronto.edu/~kriz/cifar.html
```
import keras
from keras.models import Sequential
from PIL import Image
import numpy as np
import tarfile
# ่ฎๅ dataset
# ๅชๆ train ๅ test ๆฒๆ validation
import pickle
train_X=[]
train_y=[]
tar_gz = "../Week06... | github_jupyter |
```
import sys
sys.path.insert(1,"/home1/07064/tg863631/anaconda3/envs/CbrainCustomLayer/lib/python3.6/site-packages") #work around for h5py
from cbrain.imports import *
from cbrain.cam_constants import *
from cbrain.utils import *
from cbrain.layers import *
from cbrain.data_generator import DataGenerator
import tenso... | github_jupyter |
# Docutils
## Presentation
Click [__here__] (youtube link) for the video presentation
## Summary of Support Files
- `demo.ipynb`: the notebook containing this tutorial code
- `test.csv`: a small file data used in the tutorial code
## Installation Instructions
Use `!pip install docutils` to install the `docutils` ... | github_jupyter |
```
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from scipy.spatial.transform import Rotation as R
import copy
# Let's write an expanded-ensemble Sampler() class
class EESampler_RigidThreeParticle(object):
"""An expanded-ensemble Sampler class for a rigid-triangle 3-particle/3-restr... | github_jupyter |
# Creating a Sentiment Analysis Web App
## Using PyTorch and SageMaker
_Deep Learning Nanodegree Program | Deployment_
---
Now that we have a basic understanding of how SageMaker works we will try to use it to construct a complete project from end to end. Our goal will be to have a simple web page which a user can u... | github_jupyter |
## Statistics
### Questions
```{admonition} Problem: JOIN Dataframes
:class: dropdown, tip
Can you tell me the ways in which 2 pandas data frames can be joined?
```
```{admonition} Solution:
:class: dropdown
A very high level difference is that merge() is used to combine two (or more) dataframes on the basis of valu... | github_jupyter |
# Real Estate Price Prediction
```
import pandas as pd
df = pd.read_csv("data.csv")
df.head()
df['CHAS'].value_counts()
df.info()
df.describe()
%matplotlib inline
import matplotlib.pyplot as plt
df.hist(bins=50, figsize=(20,15))
```
## train_test_split
```
import numpy as np
def split_train_test(data, test_ratio):
... | github_jupyter |
# In-Place Waveform Library Updates
This example notebook shows how one can update pulses data in-place without recompiling.
ยฉ Raytheon BBN Technologies 2020
Set the `SAVE_WF_OFFSETS` flag in order that QGL will output a map of the waveform data within the compiled binary waveform library.
```
from QGL import *
impo... | github_jupyter |
```
%load_ext Cython
import numpy as np
np.set_printoptions(precision=2,suppress=True,linewidth=250,threshold=2000)
import numpy as np
import pandas as pd
import pyBigWig
import math
import csv
import multiprocessing
bw = pyBigWig.open("/home/musab/bigwig/wgEncodeSydhTfbsHepg2Arid3anb100279IggrabSig.bigWig")
chromo = '... | github_jupyter |
# Tutorial 09: Inflows
This tutorial walks you through the process of introducing inflows of vehicles into a network. Inflows allow us to simulate open networks where vehicles may enter (and potentially exit) the network. This exercise is organized as follows: in section 1 we prepare our inflows variables to support i... | github_jupyter |
```
%matplotlib inline
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
import numpy as np
np.set_printoptions(precision=3, suppress=True)
import library.helpers as h
import matplotlib.pyplot as plt
import numpy as np
from sklearn.metrics import auc
fr... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pystan
import pybaseball
import arviz as az
player_names = ["Peter Alonso","Keston Hiura","Fernando Tatis Jr.","Harold Ramirez","Jose Trevino","Yordan Alvarez","Vladimir Guerrero Jr.","Steve Wilkerson"]
batter_data = pybaseball.batting_st... | github_jupyter |
[](https://colab.research.google.com/github/ourownstory/neural_prophet/blob/master/example_notebooks/sub_daily_data_yosemite_temps.ipynb)
# Sub-daily data
NeuralProphet can make forecasts for time series with sub-daily observations by passing in... | 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 |
<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>
# Classes and Objects in Python
Estimated time needed: **40** minutes
## Objectives
After completing this la... | github_jupyter |
# Analyzing the Effects of Non-Academic Features on Student Performance
```
# For reading data sets
import pandas
# For lots of awesome things
import numpy as np
# Need this for LabelEncoder
from sklearn import preprocessing
# For building our net
import keras
# For plotting
import matplotlib.pyplot as plt
%matplotlib... | github_jupyter |
```
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "name": "Dunn" },
{ "id": 2, "name": "Sue" },
{ "id": 3, "name": "Chi" },
{ "id": 4, "name": "Thor" },
{ "id": 5, "name": "Clive" },
{ "id": 6, "name": "Hicks" },
{ "id": 7, "name": "Devin" },
{ "id": 8, "name": "Kate" },
{ "id": 9, "name": "Klein" }
]
# โfriendshi... | github_jupyter |
```
import math
from IPython import display
from matplotlib import cm
from matplotlib import gridspec
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from sklearn import metrics
import tensorflow as tf
from tensorflow.python.data import Dataset
tf.logging.set_verbosity(tf.logging.ERROR)
pd... | github_jupyter |
# LOFO Feature Importance
https://github.com/aerdem4/lofo-importance
```
!pip install lofo-importance
import numpy as np
import pandas as pd
df = pd.read_csv("../input/train.csv", index_col='id')
df['wheezy-copper-turtle-magic'] = df['wheezy-copper-turtle-magic'].astype('category')
df.shape
```
### Use the best mode... | github_jupyter |
Submitting various things for end of grant.
```
import os
import sys
import requests
import pandas
import paramiko
import json
from IPython import display
from curation_common import *
from htsworkflow.submission.encoded import DCCValidator
PANDAS_ODF = os.path.expanduser('~/src/odf_pandas')
if PANDAS_ODF not in sys.p... | github_jupyter |
# End-to-end learning for music audio
- http://qiita.com/himono/items/a94969e35fa8d71f876c
```
# ใใผใฟใฎใใฆใณใญใผใ
wget http://mi.soi.city.ac.uk/datasets/magnatagatune/mp3.zip.001
wget http://mi.soi.city.ac.uk/datasets/magnatagatune/mp3.zip.002
wget http://mi.soi.city.ac.uk/datasets/magnatagatune/mp3.zip.003
# ็ตๅ
cat data/... | github_jupyter |
```
import pandas as pd
import numpy as np
import requests
import tensorflow as tf
import autokeras as ak
import kerastuner
import tensorflow_addons as tfa
RS = 69420
# Data Download (may take a few minutes depending on your network)
train_datalink_X = 'https://tournament.datacrunch.com/data/X_train.csv'
train_dat... | github_jupyter |
<table> <tr>
<td style="background-color:#ffffff;">
<a href="http://qworld.lu.lv" target="_blank"><img src="..\images\qworld.jpg" width="25%" align="left"> </a></td>
<td style="background-color:#ffffff;vertical-align:bottom;text-align:right;">
prepared by <a href="http://abu.lu.... | github_jupyter |
```
#@title Paste the values then click run
#@markdown <a href="https://techtanic.github.io/duce" target="_blank">Website</a>
email = "rfrf445fr@gmail.com" #@param {type: "string"}
password = "1234test" #@param {type: "string"}
import os
for index,item in enumerate(["requests","bs4","html5lib","colorama","tqdm","cloud... | github_jupyter |
# Porto Seguro's Safe Driving Prediction
Porto Seguro, one of Brazilโs largest auto and homeowner insurance companies, completely agrees. Inaccuracies in car insurance companyโs claim predictions raise the cost of insurance for good drivers and reduce the price for bad ones.
In the [Porto Seguro Safe Driver Predictio... | github_jupyter |
```
%matplotlib inline
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
plt.style.use('ggplot')
import pickle
from sklearn.preprocessing import LabelEncoder
import seaborn as sns
color = sns.color_palette()
sns.set(rc={'figure.figsize':(12,8)})
import sklearn
from sklearn.preprocessing impo... | github_jupyter |
```
import os
import pickle
from neutrinomass.completions import EffectiveOperator, Completion
from neutrinomass.database import ExoticField
from neutrinomass.database import ModelDataFrame, EXOTICS, TERMS, MVDF
from neutrinomass.completions import EFF_OPERATORS
from neutrinomass.completions import DERIV_EFF_OPERATORS... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_csv('data_1000.csv')
data=df[['correct_answ','bleu_score','levenstein_sim','cosine_sim','jaccard_sim']]
data.head(10)
data.describe()
data.boxplot(by='correct_answ', column=['bleu_score', 'levenstein_sim', 'cosine_sim', 'jaccard_sim'... | github_jupyter |
## CIFAR10 using a simple deep networks
Credits: \
https://medium.com/@sergioalves94/deep-learning-in-pytorch-with-cifar-10-dataset-858b504a6b54 \
https://jovian.ai/aakashns/05-cifar10-cnn
```
import torch
import torchvision
import numpy as np
import matplotlib.pyplot as plt
import torch.nn as nn
import torch.nn.func... | github_jupyter |
# Kinetics ๋ฐ์ดํฐ ์ธํธ๋ก ECO์ฉ DataLoader ์์ฑ
Kineteics ๋์์ ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํด, ECO์ฉ DataLoader๋ฅผ ๋ง๋ญ๋๋ค
# 9.4 ํ์ต ๋ชฉํ
1. Kinetics ๋์์ ๋ฐ์ดํฐ ์ธํธ๋ฅผ ๋ค์ด๋ก๋ํ ์ ์๋ค
2. ๋์์ ๋ฐ์ดํฐ๋ฅผ ํ๋ ์๋ณ ํ์ ๋ฐ์ดํฐ๋ก ๋ณํํ ์ ์๋ค
3. ECO์์ ์ฌ์ฉํ๊ธฐ ์ํ DataLoader๋ฅผ ๊ตฌํํ ์ ์๋ค
# ์ฌ์ ์ค๋น
- ์ด ์ฑ
์ ์ง์์ ๋ฐ๋ผ Kinetics ๋์์ ๋ฐ์ดํฐ์, ํ์ ๋ฐ์ดํฐ๋ฅผ frame๋ณ๋ก ํ์ ๋ฐ์ดํฐ๋ก ๋ณํํ๋ ์กฐ์์ ์ํํด์ฃผ์ธ์
- ๊ฐ์ ํ๊ฒฝ pytorch_p36์์ ์คํํฉ๋๋ค
`... | github_jupyter |
```
from IPython.display import HTML
# Cell visibility - COMPLETE:
#tag = HTML('''<style>
#div.input {
# display:none;
#}
#</style>''')
#display(tag)
#Cell visibility - TOGGLE:
tag = HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide()
} else {
$(... | github_jupyter |
# Tutorial 09: Standard problem 5
> Interactive online tutorial:
> [](https://mybinder.org/v2/gh/ubermag/oommfc/master?filepath=docs%2Fipynb%2Findex.ipynb)
## Problem specification
The sample is a thin film cuboid with dimensions:
- length $l_{x} = 100 \,\text{nm}$,
- w... | github_jupyter |
Mount my google drive, where I stored the dataset.
```
from google.colab import drive
drive.mount('/content/drive')
```
**Download dependencies**
```
!pip3 install sklearn matplotlib GPUtil
!pip3 install torch torchvision
```
**Download Data**
In order to acquire the dataset please navigate to:
https://ieee-datap... | github_jupyter |
# graphblas.matrix_multiply
This example will go over how to use the `--graphblas-lower` pass from `graphblas-opt` to lower the `graphblas.matrix_multiply` op.
Letโs first import some necessary modules and generate an instance of our JIT engine.
```
import mlir_graphblas
import mlir_graphblas.sparse_utils
import num... | github_jupyter |
<a href="https://colab.research.google.com/github/ProfessorDong/Deep-Learning-Course-Examples/blob/master/CNN_Examples/ComputerVision0.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
#Classify 10 different object with Convolutional Neural Network
... | github_jupyter |
## Library Imports
```
from time import time
notebook_start_time = time()
import os
import re
import gc
import pickle
import random as r
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
from torch import nn, optim
from torch.utils.data import Dataset
from torch.utils.data import Dat... | github_jupyter |
```
from tqdm.auto import tqdm
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split , StratifiedKFold
import tensorflow as tf
import tensorflow.keras.backend as K
from... | github_jupyter |
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split, cross_val_score, GridSearchCV, RepeatedStratifiedKFold
from sklearn.preprocessing import StandardScaler, LabelEncoder
from category_encoders import OneHotEncoder
from sk... | github_jupyter |
# LDA Training
<figure>
<div>
<img src=https://s2.loli.net/2022/02/28/X7vzOlDHJtP6UnM.png width="600">
</div>
<figcaption>The LDA training algorithm from <a href=http://www.arbylon.net/publications/text-est.pdf>Parameter estimation for text analysis</a></figcaption>
</figure>
```
import random
import numpy as np
from ... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
import json
import scipy.stats as st
```
Set plot font size
```
FS = 18
```
Get dictionary with information about errors and p-values during convergent time steps
```
fname = './data/p3_p7_evolve_results/190211_errs_per_conv_ts_pr_0.005_g_1.1_niter_100.json'
wi... | github_jupyter |
[View in Colaboratory](https://colab.research.google.com/github/schwaaweb/aimlds1_11-NLP/blob/master/M11_A_DJ_NLP_Assignment.ipynb)
### Assignment: Natural Language Processing
In this assignment, you will work with a data set that contains restaurant reviews. You will use a Naive Bayes model to classify the reviews (... | github_jupyter |
# Machine Learning Engineer Nanodegree
## Unsupervised Learning
## Project 3: Creating Customer Segments
Welcome to the third project of the Machine Learning Engineer Nanodegree! In this notebook, some template code has already been provided for you, and it will be your job to implement the additional functionality ne... | github_jupyter |
```
from __future__ import division
import theano
import theano.tensor as T
import theano.tensor.signal.conv
import numpy as np
import cv2, scipy, time, os
from tqdm import tqdm
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
from my_utils import Progbar
from skimage import measure
import matlab_wr... | github_jupyter |
```
%matplotlib inline
```
# Simple Oscillator Example
This example shows the most simple way of using a solver.
We solve free vibration of a simple oscillator:
$$m \ddot{u} + k u = 0,\quad u(0) = u_0,\quad \dot{u}(0) = \dot{u}_0$$
using the CVODE solver. An analytical solution exists, given by
$$u(t) = u_0 \cos\left... | github_jupyter |
```
import classifierMLP as cmlp
import os
import struct
import numpy as np
def load_mnist(path, kind='train'):
"""Load MNIST data from `path`"""
labels_path = os.path.join(path,
'%s-labels-idx1-ubyte' % kind)
images_path = os.path.join(path,
... | github_jupyter |
# Siamese networks with TensorFlow 2.0/Keras
In this example, we'll implement a simple siamese network system, which verifyies whether a pair of MNIST images is of the same class (true) or not (false).
_This example is partially based on_ [https://github.com/keras-team/keras/blob/master/examples/mnist_siamese.py](ht... | github_jupyter |
# BBoxerwGradCAM
### This class forms boundary boxes (rectangle and polygon) using GradCAM outputs for a given image.
The purpose of this class is to develop Rectangle and Polygon coordinates that define an object based on an image classification model. The 'automatic' creation of these coordinates, which are often i... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/drive')
cd /content/drive/MyDrive/ML-LaDECO/MLaDECO
```
### Importing libraries and methods from thermograms, ml_training and ultilites modules
```
import numpy as np
print('Project MLaDECO')
print('Author: Viswambhar Yasa')
print('Software version: 0.1')
from... | github_jupyter |
# Hierarchical Clustering
**Hierarchical clustering** refers to a class of clustering methods that seek to build a **hierarchy** of clusters, in which some clusters contain others. In this assignment, we will explore a top-down approach, recursively bipartitioning the data using k-means.
**Note to Amazon EC2 users**:... | github_jupyter |
### ์ฝ๋ชจ๊ณ ๋กํ์ ๊ณต๋ฆฌ
1) ๋ชจ๋ ์ฌ๊ฑด์ ๋ํด ํ๋ฅ ์ ์ค์์ด๊ณ 0 ๋๋ ์์์ด๋ค.
- $P(A) \geq 0$
2) ํ๋ณธ๊ณต๊ฐ(์ ์ฒด์งํฉ) ์ด๋ผ๋ ์ฌ๊ฑด(๋ถ๋ถ์งํฉ)์๋ ๋ํ ํ๋ฅ ์ 1์ด๋ค.
- $P(\Omega) = 1$
3) ๊ณตํต์์๊ฐ ์๋ ๋ ์ฌ๊ฑด์ ํฉ์งํฉ์ ํ๋ฅ ์ ์ฌ๊ฑด๋ณ ํ๋ฅ ์ ํฉ์ด๋ค
- $A\cap B = \emptyset \rightarrow P(A\cup B) = P(A) + P(B)$
-----
### ํ๋ฅ ์ฑ์ง ์์ฝ
1) ๊ณต์งํฉ์ ํ๋ฅ
- $P(0) = \emptyset$
... | github_jupyter |
# Object Detection with SSD
### Here we demostrate detection on example images using SSD with PyTorch
```
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from... | github_jupyter |
# Data Attribute Recommendation - TechED 2020 INT260
Getting started with the Python SDK for the Data Attribute Recommendation service.
## Business Scenario
We will consider a business scenario involving product master data. The creation and maintenance of this product master data requires the careful manual selecti... | github_jupyter |
# Resumen
Este cuaderno digital interactivo tiene como objetivo demostrar las relaciones entre las propiedades fisico-quรญmicas de la vegetaciรณn y el espectro solar.
Para ello haremos uso de modelos de simulaciรณn, en particular de modelos de transferencia radiativa tanto a nivel de hoja individual como a nivel de dosel... | github_jupyter |
# Detecting sound sources in YouTube videos
## First load all dependencies and set work and data paths
```
# set plotting parameters
%matplotlib inline
import matplotlib.pyplot as plt
# change notebook settings for wider screen
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100... | github_jupyter |
```
# Filter tensorflow version warnings
import os
# https://stackoverflow.com/questions/40426502/is-there-a-way-to-suppress-the-messages-tensorflow-prints/40426709
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # or any {'0', '1', '2'}
import warnings
# https://stackoverflow.com/questions/15777951/how-to-suppress-pandas-fu... | github_jupyter |
## Connect to Chicago Data Portal API - Business Licenses Data
```
#Import dependencies
import pandas as pd
import requests
import json
# Google developer API key
from config2 import API_chi_key
# Build API URL
# API calls = 8000 (based on zipcode and issued search results)
# Filters: 'application type' Issued
target... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D1_BayesianDecisions/W3D1_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Tutorial 1: Bayes with a binary hidden state
**Week 3, D... | github_jupyter |
```
ls -l| tail -10
#G4
from google.colab import drive
drive.mount('/content/gdrive')
cp gdrive/My\ Drive/fingerspelling5.tar.bz2 fingerspelling5.tar.bz2
# rm -r surrey/
%rm -r dataset5/
# rm fingerspelling5.tar.bz2
# cd /media/datastorage/Phong/
!tar xjf fingerspelling5.tar.bz2
cd dataset5
mkdir surrey
mkdir surrey/D
... | github_jupyter |
## Dependencies
```
# !pip install --quiet efficientnet
!pip install --quiet image-classifiers
import warnings, json, re, glob, math
from scripts_step_lr_schedulers import *
from melanoma_utility_scripts import *
from kaggle_datasets import KaggleDatasets
from sklearn.model_selection import KFold
import tensorflow.ker... | github_jupyter |
# CTA data analysis with Gammapy
## Introduction
**This notebook shows an example how to make a sky image and spectrum for simulated CTA data with Gammapy.**
The dataset we will use is three observation runs on the Galactic center. This is a tiny (and thus quick to process and play with and learn) subset of the simu... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import folium
from folium.plugins import MarkerCluster
%matplotlib inline
australia=pd.read_csv("https://frenzy86.s3.eu-west-2.amazonaws.com/fav/australia_cleaned.csv")
australia.head()
plt.figure(figsize=(18,12))
plt.hist(australia["confidence"],label="Sicurezz... | github_jupyter |
<a href="https://colab.research.google.com/github/combineinator/combine-inator-acikhack2021/blob/main/Combineinator_Library.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')
```
## Comb... | github_jupyter |
```
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import tensorflow_probability as tfp
# -- plotting
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['axes.linewidth'] = 1.5
mpl.rcParams['ax... | github_jupyter |
```
%matplotlib inline
from matplotlib import style
style.use('fivethirtyeight')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import datetime as dt
```
# Reflect Tables into SQLAlchemy ORM
```
# Python SQL toolkit and Object Relational Mapper
import sqlalchemy
from sqlalchemy.ext.automap imp... | github_jupyter |
```
#import libraries
import cv2
import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.models import model_from_json
import pickle
import tkinter as tk
from tkinter import filedialog
from tkinter import PhotoImage
from pygame import mixer
import matplotlib.pyplot as plt
import random
import os
#Taki... | github_jupyter |
<a href="https://colab.research.google.com/github/humbertoguell/daa2020_1/blob/master/21octubre.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
2+3+
for r in range(n):
sumaRenglon=0
sumaRenglon=0
sumaRenglon=0
for c in range(n):
suma... | github_jupyter |
# Framing models
```
import lettertask
import patches
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
from tqdm import tqdm
import lazytools_sflippl as lazytools
import plotnine as gg
import pandas as pd
cbm = lettertask.data.CompositionalBinaryModel(
width=[5, 5],
change_prob... | github_jupyter |
<center>
<img src="https://gitlab.com/ibm/skills-network/courses/placeholder101/-/raw/master/labs/module%201/images/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" />
</center>
# **Data Visualization**
Estimated time needed: **30** minutes
In this lab, you will learn how to visualize and interpret data
... | github_jupyter |
<!--  -->
## Introduction
Understanding heat transport in semiconductors and insulators is of fundamental importance because of its technological impact in electronics and renewable energy harvesting and conversion.
Anharmoni... | github_jupyter |
```
import keras
from keras.models import Sequential, Model, load_model
from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda
from keras.layers import Conv2D, MaxPooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, BatchNormalization, LocallyConnected2D, Permute
from keras.layers import Concat... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.