text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# Face Generation
In this project, you'll define and train a DCGAN on a dataset of faces. Your goal is to get a generator network to generate *new* images of faces that look as realistic as possible!
The project will be broken down into a series of tasks from **loading in data to defining and training adversarial net... | github_jupyter |
<div style="width:100%; background-color: #D9EDF7; border: 1px solid #CFCFCF; text-align: left; padding: 10px;">
<b>Renewable power plants: Download and process notebook</b>
<ul>
<li><a href="main.ipynb">Main notebook</a></li>
<li>Download and process notebook</li>
<li><a href="valid... | github_jupyter |
```
# Erasmus+ ICCT project (2018-1-SI01-KA203-047081)
# Toggle cell visibility
from IPython.display import HTML
tag = HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide()
} else {
$('div.input').show()
}
code_show = !code_show
}
$( document... | github_jupyter |
# Mauritian National ID Numbers
## Introduction
The function `clean_mu_nid()` cleans a column containing Mauritian national ID number (NID) strings, and standardizes them in a given format. The function `validate_mu_nid()` validates either a single NID strings, a column of NID strings or a DataFrame of NID strings, r... | github_jupyter |
# Overview of Lux
This tutorial provides an overview of how you can use Lux in your data exploration workflow.
Note: This tutorial assumes that you have already installed Lux and the associate Jupyter widget, if you have not done so already, please check out [this page](https://lux-api.readthedocs.io/en/latest/sour... | github_jupyter |
# Lecture Notes on Scientific Writing in Computer Science
## [The Structure of a Research Paper](http://nbviewer.ipython.org/urls/raw.github.com/mgrani/LeSi--Lecture-Notes-on-Scientific-Working/master/scientific-writing/scientific-writing-paper-structure.ipynb)
__Michael Granitzer__ [(michael.granitzer@uni-passau.de)... | github_jupyter |
```
import os
import sys
import time
import math
```
## Python 数据类型
**不可变数据:** Number(数字)、String(字符串)、Tuple(元组)
**可变数据:** List(列表)、Dictionary(字典)、Set(集合)
#### Number(数字)常用的数学函数
```
x = 10
y = 2
abs(x) # 返回数字的绝对值,如abs(-10) 返回 10
math.fabs(x) # 返回数字的绝对值,如math.fabs(-10) 返回10.0
math.exp(x) # 返回e的x次幂(e^... | github_jupyter |
<a href="https://colab.research.google.com/github/Fuenfgeld/DatamanagementAndArchiving/blob/main/PythonIntro.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
**Use of code Cells**
The code calls a function called print. The print function takes on
... | github_jupyter |
```
import sys
sys.path.append('../src')
import tarski
import tarski.fstrips as fs
import tarski.syntax.temporal.ltl as ltl
from tarski.symbols import *
```
# Planning with Reactions is Checking for $\phi U \varphi$ Specifications
We will start this notebook borrowing the discussion in Chapter 3, Section 3.5 of [Huth... | github_jupyter |
## Train a character-level GPT on some text data
The inputs here are simple text files, which we chop up to individual characters and then train GPT on. So you could say this is a char-transformer instead of a char-rnn. Doesn't quite roll off the tongue as well. In this example we will feed it some Shakespeare, which ... | 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 |
# Legislative Rule Models with AuthoritySpoke
This tutorial will show how to use [AuthoritySpoke](https://authorityspoke.readthedocs.io/en/latest/) to model legal rules found in legislation. This is a departure from most of the AuthoritySpoke documentation, which focuses on judicial holdings.
These examples are based... | github_jupyter |
# Cifar10 Drift Detection
In this example we will deploy an image classification model along with a drift detector trained on the same dataset. For in depth details on creating a drift detection model for your own dataset see the [alibi-detect project](https://github.com/SeldonIO/alibi-detect) and associated [document... | github_jupyter |
# Implementing a Declarative Node using the `ddn.basic.node` Module
In this notebook we demonstrate how to implement a declarative node using the `ddn.basic.node` module. This will allow us to explore the behavior of the node and solve simple bi-level optimization problems. For more sophisticated problems and integrat... | github_jupyter |
```
#Code Preface
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
data2016 = pd.read_csv("2016.csv")
data2016.shape
data2016.columns
data2017 = pd.read_csv("2017.csv")
data2017.drop(columns="#", inplace=True)
data2017.columns = data2017.columns.str.replace('<strong>', '').st... | github_jupyter |
# Detection and Feature Extraction
```
"""
Detection of regions of interest and extraction of characteristics from regions of interest.
@author: Juan Felipe Latorre Gil - jflatorreg@unal.edu.co
"""
import numpy as np
import pandas as pd
from time import process_time
from maad.rois import find_rois_cwt
from maad imp... | github_jupyter |
# oneM2M - Subscriptions and Notifications
This notebook demonstrates how to subscribe to notifications from resources.
<font color="blue">**Please execute the notebook "oneM2M - Subscriptions and Notifications - Notification Server" first from [this notebook](start-notificationServer.ipynb)**</font> .
This starts ... | github_jupyter |
```
# %cd "/content/drive/MyDrive/My Projects/face-verification-with-siamese-network"
# !pip install import-ipynb
# import import_ipynb
# import config
from keras.callbacks import LearningRateScheduler
import tensorflow.keras.backend as K
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
def m... | github_jupyter |
## Composite Bayesian Optimization with the High Order Gaussian Process
In this tutorial, we're going to explore composite Bayesian optimization [Astudillo & Frazier, ICML, '19](https://proceedings.mlr.press/v97/astudillo19a.html) with the High Order Gaussian Process (HOGP) model of [Zhe et al, AISTATS, '19](http://pr... | github_jupyter |
# NLP - Hotel review sentiment analysis in python
```
#warnings :)
import warnings
warnings.filterwarnings('ignore')
import os
dir_Path = 'C:\\'
os.chdir(dir_Path)
```
## Data Facts and Import
```
import pandas as pd
# Local directory
Reviewdata = pd.read_csv(r"C:\Users\yatha\Downloads\train.csv")
#Data Credit - h... | github_jupyter |
```
import tensorflow as tf
import os
import random
import pylab
import numpy as np
import matplotlib.pyplot as plt
import glob
from PIL import Image
DATA_FOLDER = '/home/ankdesh/explore/DeepLearning-UdacityCapston/data/FullImageDataSet/train_sample'
TFRECORDFILENAME = 'train_sample'
IMG_SIZE = 100 # Side for each tran... | github_jupyter |
# Using `ipzCaptureWindow` and `ipzCaptureWindow2` for embedding graphic analysis windows into notebook
<img src="https://raw.githubusercontent.com/indranilsinharoy/PyZDDE/master/Doc/Images/articleBanner_01_ipzcapturewindow.png" height="230">
*Please feel free to [e-mail](mailto:indranil_leo@yahoo.com) any correction... | github_jupyter |
# Warsztat 2 - typy i struktury danych<a id=top></a>
<font size=2>Przed pracą z notatnikiem polecam wykonać kod w ostatniej komórce (zawiera html i css), dzięki czemu całość będzie bardziej estetyczna :)</font>
Cały warsztat będzie poświęcony typom i strukturom danych, które są podstawowymi magazynami informacji d... | github_jupyter |
# yveCRV Reward Claims
> "How do users handle yveCRV reward claims?"
- toc:true
- branch: master
- badges: true
- comments: false
- author: Scott Simpson
- categories: [Curve, Yearn]
- hide: false
```
#hide
#Imports & settings
!pip install plotly --upgrade
import pandas as pd
import plotly.express as px
import plotly... | github_jupyter |
# Dependencies
```
# Memanggil Dependencies
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import random
from numpy import ndarray
from typing import List
from sklearn.metrics import confusion_matrix, roc_curve, auc, roc_auc_score, accuracy_score, classification_report
fr... | github_jupyter |
# Analysing Student Feedback Using Machine Learning
## Importing necessary libraries.
```
import warnings
warnings.filterwarnings('ignore')#avoid warnings for clean output
import numpy as np #Importing the necessary numeric data packages and data analysis packages
import pandas as pd
pd.set_option('display.max_rows... | github_jupyter |
```
import glob
import os
from sklearn.metrics import plot_confusion_matrix
import geopandas as gpd
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import pyplot as plt
sns.set_style('darkgrid')
%matplotlib inline
# data prep and model-tuning
from sklearn.preprocessing import StandardScale... | github_jupyter |
<img src="https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="500 px" align="left">
# Randomized Benchmarking Overview
### Contributors
Shelly Garion$^{1}$, Y... | github_jupyter |
# Gridded Data: Remote access of NASA PO.DAAC satellite data
Demonstrate query tools for finding remote sensing gridded data at the [NASA PO.DAAAC](https://podaac.jpl.nasa.gov). Use `xarray` with the `OPeNDATA` remote access protocol to download the desired subsets of data, and `xarray` to explore the data.
- [Emilio ... | github_jupyter |
```
from pyspark.sql.functions import *
from pyspark.sql.types import *
from datetime import datetime
from pyspark.sql.functions import from_unixtime
from pyspark.sql.functions import to_date
from pyspark.sql import Row
from pyspark.sql.functions import to_json, struct
from pyspark.sql import functions as F
i... | github_jupyter |
```
# Setup constants and globals.
import os
PROJECT = 'predictions-api-to-cloud-ml' # CHANGE THIS
REGION = 'us-west1-a' # CHANGE THIS
STORAGE_BUCKET = 'papi-bucket' # CHANGE THIS
TRAINING_DATA_FILE = 'sample/train.csv' # CHANGE THIS
VALIDATION_DATA_FILE = 'sample/vali... | github_jupyter |
```
%%HTML
<style> code {background-color : pink !important;} </style>
```
Camera Calibration with OpenCV
===
### Run the code in the cell below to extract object points and image points for camera calibration.
```
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
%matplotlib qt
# prepare ob... | github_jupyter |
```
#from IPython.display import Image
#Image(filename='i_could_care_less.png')
#<div style="text-align:center"> <img src="i_could_care_less.png" width="700" height="700"> </div>
from IPython.display import Image
from IPython.display import HTML
html1 = '<div style="text-align:center"> <img src="i_could_care_less.png"... | github_jupyter |
# Q6
In this question, we're just going to go crazy with data structures and looping.
### A
In this question, you'll write some code that takes two lists, and creates a third list that is a collection of sums from the corresponding elements in the first two lists.
As an example, if the two input lists are `[1, 2, 3... | github_jupyter |
##### Copyright 2021 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
import h5py
import tensorflow as tf
import numpy as np
```
### Prepare MNIST data
```
def readImages_hdf5(filename):
'''Reads hdf5 file.
Parameter
---------
filename : the name of the hdf5 file
'''
file = h5py.File( filename + '.h5', "r+") #open the hdf5 file.
hdf5_image... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
from kontrol import *
from kontrol.model import make_weight
from control import *
import dtt2hdf
import sys
sys.path.append('./data')
sys.path.append('/home/terrencetec/Dropbox/Pyground/kontrol/examples/data')
sys.path
items = dtt2hdf.read_diaggui('BS_IP_noise_2020... | github_jupyter |
## EXAMPLE - 3
**Tasks :- Answerability detection**
**Tasks Description**
``answerability`` :- This is modeled as a sentence pair classification task where the first sentence is a query and second sentence is a context passage. The objective of this task is to determine whether the query can be answered from the con... | github_jupyter |
# Estimating the biomass of Cnidarians
To estimate the total biomass of cnidarians, we combine estimates for two main groups which we assume dominate the biomass of cnidarains = planktonic cnidarians (i.e. jellyfish) and corals. We describe the procedure for estimating the biomass of each group
## Planktonic cnidarian... | github_jupyter |
# Test the mesh dependency for the highest Reynolds number
The case *water_05* corresponds to a $d_b=1.8~mm$ air bubble rising in water and yields the highest Reynolds number among the investigated bubbles. The flow field was repeatedly computed in OpenFOAM on four meshes with different refinement levels (refinement_.... | github_jupyter |
```
import ipywidgets as widgets
import traitlets
```
# *OPTIONAL* Separating the logic using classes
As in the previous notebook, the goal here is to separate the logic (generating a string of characters given its length) from the user interface.
This time, we creaate a class to hold the user interface, a class to... | github_jupyter |
# Pseudomonas sample level analysis
Main notebook to run sample-level simulation experiment using *P. aeruginosa* gene expression data.
```
%load_ext autoreload
%autoreload 2
import os
import sys
import ast
import pandas as pd
import numpy as np
import random
from plotnine import (ggplot,
labs,... | github_jupyter |
<a id="title_ID"></a>
# JWST Pipeline Validation Notebook:
# AMI3, AmiAnalyze
<span style="color:red"> **Instruments Affected**</span>: NIRISS
### Table of Contents
Follow this general outline. Additional sections may be added and others can be excluded, as needed. Sections in with a (\*) symbol are required.
<div... | github_jupyter |
One of the main issues in this competition is the size of the dataset. Pandas crashes when attempting to load the entire train and test datasets at once. [One of the kernels has been able to read the entire train dataset using dask](https://www.kaggle.com/ashishpatel26/how-to-handle-this-big-dataset-dask-vs-pandas). In... | github_jupyter |
# Stock-to-Flow Modeling of Bitcoin, Ethereum, and Dogecoin
The pyfinlab crypto module has within it methods for the analysis of cryptocurrencies including the ability to fit power law models to cryptocurrencies and statistically test the closeness of the fitted power law model. The workflow below is as follows:
1. ... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/NAIP/from_name.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" href="https:/... | github_jupyter |
# Updating priors
In this notebook, I will show how it is possible to update the priors as new data becomes available. The example is a slightly modified version of the linear regression in the [Getting started with PyMC3](https://github.com/pymc-devs/pymc3/blob/master/docs/source/notebooks/getting_started.ipynb) note... | github_jupyter |
# INTRODUCTION
1. In this tutorial, we will be tuning hyperparameters for Stable baselines3 models using Optuna.
2. The default model hyperparamters may not be adequate for your custom portfolio or custom state-space. Reinforcement learning algorithms are sensitive to hyperparamters, hence tuning is an important step.
... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D3_ModelFitting/student/W1D3_Tutorial7.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Neuromatch Academy: Week 1, Day 3, Tutorial 7
# Mode... | github_jupyter |
# Imports
```
%load_ext autoreload
%autoreload 2
# Pandas and numpy
import pandas as pd
import numpy as np
#
from IPython.display import display, clear_output
import sys
import time
# Libraries for Visualization
import matplotlib.pyplot as plt
import seaborn as sns
from src.visualization.visualize import plot_corr_... | github_jupyter |
# NumPy
## The Basics of NumPy Arrays
Data manipulation in Python is nearly synonymous with NumPy array manipulation: even newer tools like Pandas are built around the NumPy array. This section will present several examples of using NumPy array manipulation to access data.
We'll cover a few categories of basic array ... | github_jupyter |
```
#!/usr/bin/python3.8
from scipy.integrate import quad
import matplotlib.pylab as plt
import numpy as np
# linear temperature gradient
def TP(z, t_g, z_0):
return t_g * ( 1 - (z / z_0) )
# exponential decay of the water vapor
def CorrCoef(z, c_0, z_0):
return c_0 * np.exp(-(z/z_0))
# Gaussian beam waist
d... | github_jupyter |
# Part I. ETL Pipeline for Pre-Processing the Files
## PLEASE RUN THE FOLLOWING CODE FOR PRE-PROCESSING THE FILES
#### Import Python packages
```
# Import Python packages
import pandas as pd
import cassandra
import re
import os
import glob
import numpy as np
import json
import csv
```
#### Creating list of filepat... | github_jupyter |
# Obtaining and Plotting NEXRAD Radar Data to Create Animations
```
from pylab import *
import pyart, boto3, tempfile, os, shutil, datetime, matplotlib
import numpy as np
import pandas as pd
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
from matplotlib import animation
f... | github_jupyter |
## The network SIR model
In order to introduce mean-field approach of network model, we choose SIR model since this is a simplest model in our implementation.
The dynamical equations are given as
\begin{align}
\dot{S_{in}} &=-\lambda_{in}(t)S_{in}+\sigma_{in},\\
\dot{I}_{in}^{a} &=\alpha\lambda_{in}(t)S_{in}-\gam... | github_jupyter |
## Aggregate traffic data to grid and compare gridded traffic with gridded NOx data
```
!pip install geopandas==0.9.0 -q
import pandas as pd
import geopandas as gpd
import numpy as np
import shapely as shp
import matplotlib.pyplot as plt
import xarray as xr
import shutil
da = xr.DataArray(coords=[np.arange(4,10,0.25),... | github_jupyter |
# Lab 03: Resizing and slicing in PyTorch -- solution
```
# For Google Colaboratory
import sys, os
if 'google.colab' in sys.modules:
# mount google drive
from google.colab import drive
drive.mount('/content/gdrive')
# find automatically the path of the folder containing "file_name" :
file_name = 'p... | github_jupyter |
<a href="/assets/lecture12_code.ipynb" class="link-button">Download</a>
<a href="https://colab.research.google.com/github/technion046195/technion046195/blob/master/content/lecture12/code.ipynb" target="_blank">
<img src="../assets/colab-badge.svg" style="display:inline"/>
</a>
<center><h1>
הרצאה 12 - PCA and K-Means
<... | github_jupyter |
## PRMT-2023 Vision Pending messaging Pathway
### Hypothesis
We believe that for two Vision practices, pending Vision transfers look different to EMIS and TPP pending transfers
We will know this to be true when we can see different patterns in the data for each supplier in terms of the number of messages per conversat... | github_jupyter |
# Computing a sparse solution of a set of linear inequalities
A derivative work by Judson Wilson, 5/11/2014.<br>
Adapted from the CVX example of the same name, by Almir Mutapcic, 2/28/2006.
Topic References:
* Section 6.2, Boyd & Vandenberghe "Convex Optimization" <br>
* "Just relax: Convex programming methods for s... | github_jupyter |
```
import os,shutil
import h5py
from h5glance import H5Glance
import matplotlib.pyplot as plt
# Helpers
from SimEx.Utilities.Units import meter, electronvolt, joule, radian
# PMI
from SimEx.Calculators.XMDYNDemoPhotonMatterInteractor import XMDYNDemoPhotonMatterInteractor
# Simple Beam Parameters
from SimEx.Paramet... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
#export
from nb_007a import *
```
# IMDB
## Fine-tuning the LM
Data has been prepared in csv files at the beginning 007a, we will use it know.
### Loading the data
```
PATH = Path('../data/aclImdb/')
CLAS_PATH = PATH/'clas'
LM_PATH = PATH/'lm'
MODEL_PATH = PATH/'models'
os.ma... | github_jupyter |
### Content:
- Train text classifier on custom labels (market sematic)
#### TODO:
- Grid Testing for Parameters
- Validate features by looking at most important words for each class
- Have a look into Temporal Correlation, ApEN & Cramers V, Hatemining, Related Work Text Classification
- Add pretrained WordEmbedding (e... | github_jupyter |
```
import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision.transforms as transforms
from torch.utils.data import TensorDataset
from matplotlib import pyplot as plt
from sklearn.metrics import accuracy_score
from aijack.attack impo... | github_jupyter |
```
import os
import random
import tensorflow as tf
import shutil
import matplotlib.pyplot as plt
from tensorflow import keras
from tensorflow.keras.optimizers import RMSprop
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint
from tensorflow.keras.preprocessing.image import ImageDataGenerator
config... | github_jupyter |
# Coding Exercise: Model Adaption Meta Learning
In this tutorial, we will implement Model Adaption Meta Learning, to learn a simple curve of sinusoidal data.
If you recall Model Agnostic Meta Learning, consists of 2 loops:
1. To learn parameters for all tasks.
2. To learn task specific parameters
MAML algorithm aims ... | github_jupyter |
# Single Experiment
In this notebook we run a single experiment and display the estimates of the dynamic effects based on our dynamic DML algorithm. We also display some performance of alternative benchmark approaches.
## 1. Data Generation from a Markovian Treatment Model
We consider the following DGP:
\begin{alig... | github_jupyter |
```
import os
import time
```
# Generate Experiment Config
# Generate Job Script
```
job_config_dir = './config/experiments/goodruns_pybullet'
tasks = os.listdir(job_config_dir)
exp_config_list = []
for t in tasks:
exp_runs = os.listdir(os.path.join(job_config_dir, t))
for e in exp_runs:
exp_config_l... | github_jupyter |
This notebook is part of https://github.com/AudioSceneDescriptionFormat/splines, see also https://splines.readthedocs.io/.
[back to overview](hermite.ipynb)
# Properties of Hermite Splines
Hermite splines are interpolating polynomial splines,
where for each polynomial segment,
the desired value at the start and end ... | github_jupyter |
<img src="./pictures/logo-insa.png" style="float:right; max-width: 60px; display: inline" alt="INSA" /></a>
# Propeller selection
*Written by Marc Budinger, INSA Toulouse, France*
## Design graph
The following diagram represents the design graph of the propeller’s selection. The max thrust is assumed to be known he... | github_jupyter |
# Differentiating nuclei according to signal intensity
A common bio-image analysis task is differentiating cells according to their signal expression. In this example we take a two-channel image of nuclei which express Cy3 and eGFP. Visually, we can easily see that some nuclei expressing Cy3 also express eGFP, others d... | github_jupyter |
**This notebook is an exercise in the [Feature Engineering](https://www.kaggle.com/learn/feature-engineering) course. You can reference the tutorial at [this link](https://www.kaggle.com/ryanholbrook/clustering-with-k-means).**
---
# Introduction #
In this exercise you'll explore our first unsupervised learning tec... | github_jupyter |
# Envelope Selection
In this notebook, we will explore how to select the envelope from information layers.
## 0. Initialization
### 0.1. Load required libraries
```
import os
import topogenesis as tg
import pyvista as pv
import numpy as np
import pandas as pd
# extra import function
def lattice_from_csv(file_path):... | github_jupyter |
### LSTM with 256 hidden units
Author: Jeanne Elizabeth Daniel
November 2019
We employ the humble long short-term memory network with 512 hidden units to model the input sequence of words. The LSTM was introduced by Hochreiter and Schmidhuber (1997) to address the shortcomings of the original recurrent neural networ... | github_jupyter |

[](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Healthcare/1.5.Resume_MedicalNer_Model_Training.ipynb)... | github_jupyter |
# Think Bayes
Copyright 2018 Allen B. Downey
MIT License: https://opensource.org/licenses/MIT
```
# Configure Jupyter so figures appear in the notebook
%matplotlib inline
# Configure Jupyter to display the assigned value after an assignment
%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'
impo... | github_jupyter |
```
import cv2
import urllib.request as urllib2
import numpy as np
import sys
import matplotlib.pyplot as plt
sys.path.append("../")
from config import config
from linesearch import *
%matplotlib inline
host = config.raspi_ip + ":8080"
hoststr = 'http://' + host + '/?action=stream'
print ('Streaming ' + hoststr)
l_img... | github_jupyter |
```
import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
!git clone https://github.com/pratyush1019/Medical-Image-Computing
%cd Medical-Image-Computing
from models import R2U_Net
u_net = R2U_Net()
u_net = R2U_Net().cuda()
from DataSetClass import RetinaDataset
tr = torch.utils.dat... | github_jupyter |
# Name
Batch prediction using Cloud Machine Learning Engine
# Label
Cloud Storage, Cloud ML Engine, Kubeflow, Pipeline, Component
# Summary
A Kubeflow Pipeline component to submit a batch prediction job against a deployed model on Cloud ML Engine.
# Details
## Intended use
Use the component to run a batch p... | github_jupyter |
# Clustering Models Analysis
> Learn about different clustering models.
- toc: true
- badges: true
- comments: true
- categories: [clustering]
- image: images/clustering.jpg
```
# import statements
from sklearn.datasets import make_blobs
import numpy as np
import matplotlib.pyplot as plt
from kneed import... | github_jupyter |
<center><img src='../../img/ai4eo_logos.jpg' alt='Logos AI4EO MOOC' width='80%'></img></center>
<br>
<a href="https://www.futurelearn.com/courses/artificial-intelligence-for-earth-monitoring/1/steps/1280524"><< Back to FutureLearn</a><br>
# Physics-based Machine Learning for Copernicus Sentinel-5P Methane Retrieval
... | github_jupyter |
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# Solution Notebook
## Problem: Island Perimeter.
See the [LeetCode](https://leetcode.com/problems/island-perimeter/) problem page.
You ... | github_jupyter |
# Circular Arrays and Hash Tables
26th Febuary 2019
# Queue ADT using a Circular Array
We looked at a circular array as a way of implementing a queue. We saw that we could loop around a fixed size array reusing empty elements from the beginning as they were dequeued.
Here is an example implmentation. Note the way ... | github_jupyter |
```
from CONST import *
import music21
import glob
# Convert files in directory
files = glob.glob("MIDI\**\*.mid", recursive=True)
for i in range(len(files)):
print(i, files[i])
def analyzeFile(i):
f = files[i]
# first, transpose the entire score into C major or A minor
score = music21.converter.parse... | github_jupyter |
<a href="https://colab.research.google.com/github/yuanwxu/corr-net-classify/blob/main/Understanding_MB_interactions_with_Graph_CNN_simulated_data_all_scenarios2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Run multiple iterations of DGCNN
*... | github_jupyter |
## 네이버 뉴스 데이터를 분석하기
이번 데이터는 네이버 뉴스 http://news.naver.com 에 있는 신문기사를 분석하는 작업입니다.
네이버에는 1990년도부터 2018년도까지의 총 100기가가 넘는 뉴스 데이터를 보유하고 있습니다. 오늘의 업무는 이 데이터 중 1990년도의 뉴스 데이터만을 가져와, 뉴스 기사를 정리하거나 특징을 추출하는 작업을 진행하겠습니다.
분석은 저번 시간에 실습했던 내용과 오늘 배운 내용에 더불어, 판다스의 [Working with Text Data](https://pandas.pydata.org/pandas-docs/stabl... | github_jupyter |
```
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
mpl.rcParams['font.size'] = 16
seed = 1
```
### data1. toy-data
```
from kerasy.utils import generateWholeCakes
N = 200
K = 3
r_low, r_high = 2,5
rmin,rmax = -r_high, r_high
epochs = 500
X,Y = np.meshgrid(np.l... | github_jupyter |
<a href="https://colab.research.google.com/github/Shahid-coder/python-colab/blob/main/11_python_json.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## Python JSON
JSON is a syntax for storing and exchanging data.
JSON is text, written with JavaSc... | github_jupyter |
## Q-learning
This notebook will guide you through implementation of vanilla Q-learning algorithm.
You need to implement QLearningAgent (follow instructions for each method) and use it on a number of tests below.
```
import sys, os
if 'google.colab' in sys.modules and not os.path.exists('.setup_complete'):
!wget... | github_jupyter |
# SQL Lab Exercise
## Web Databases: data.world
For the rest of this lesson, we'll be exploring databases in [data.world](https://data.world/), a web database that we can query using SQL in our browser. For reference, you can see the instructions for creating a new project here: [Getting Started Working with Data at ... | github_jupyter |
```
%matplotlib widget
import os
import sys
sys.path.insert(0, os.getenv('HOME')+'/pycode/MscThesis/')
# sys.path.insert(0,r'C:\Users\coren\Documents\PhD\Code\AMFtrack')
import pandas as pd
from amftrack.util import get_dates_datetime, get_dirname, get_data_info, update_plate_info, \
get_current_folders, get_fold... | github_jupyter |
```
# -*- coding: utf-8 -*-
"""
This program makes learning ev-gmm.
"""
# __future__ module make compatible python2 and python3
from __future__ import division, print_function
# basic modules
import os
import os.path
import time
# for warning ignore
import warnings
#warning.filterwarnings('ignore')
# for file syste... | github_jupyter |
# 파이프라인 만들기
Azure ML SDK를 사용해 스크립트 기반 실험을 실행하면 데이터를 수집하고 모델을 학습시킨 다음 개별적으로 등록하는 데 필요한 여러 단계를 수행할 수 있습니다. 그러나 엔터프라이즈 환경에서는 보통 기계 학습 솔루션을 빌드하려면 수행해야 하는 개별 단계 순서를 *파이프라인*에 캡슐화합니다. 이 파이프라인은 사용자의 요청 시 컴퓨팅 대상 하나 이상에서 실행하거나, 자동화된 빌드 프로세스에서 실행하거나, 일정에 따라 실행할 수 있습니다.
이 Notebook에서는 이러한 모든 요소를 취합하여 데이터를 전처리한 다음 모델 학습과 등록을 진... | github_jupyter |
<h1><center>ERM with DNN under penalty of Equalized Odds</center></h1>
We implement here a regular Empirical Risk Minimization (ERM) of a Deep Neural Network (DNN) penalized to enforce an Equalized Odds constraint. More formally, given a dataset of size $n$ consisting of context features $x$, target $y$ and a sensitiv... | github_jupyter |
# Lecture 9: Expectation, Indicator Random Variables, Linearity
## Stat 110, Prof. Joe Blitzstein, Harvard University
----
## More on Cumulative Distribution Functions
A CDF: $F(x) = P(X \le x)$, as a function of real $x$ has to be
* non-negative
* add up to 1
In the following discrete case, it is easy to see ho... | github_jupyter |
<a href="https://colab.research.google.com/github/sampath11/DS-Unit-2-Kaggle-Challenge/blob/master/LECTURE_NOTES_Random_Forests_LS_DS_222_VN_7_23.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Lambda School Data Science
*Unit 2, Sprint 2, Module 2... | github_jupyter |
# SMILES enumeration, vectorization and batch generation
[](https://www.wildcardconsulting.dk/useful-information/smiles-enumeration-as-data-augmentation-for-molecular-neural-networks/)
SMILES en... | github_jupyter |
# Import necessary dependencies
```
import pandas as pd
import numpy as np
import text_normalizer as tn
import warnings
import nltk
warnings.filterwarnings("ignore")
```
# Load and normalize data
```
dataset = pd.read_csv(r'movie_reviews.csv')
# take a peek at the data
print(dataset.head())
reviews = np.array(data... | github_jupyter |
# Finding the Best Classifier
This notebook builds on 04.
Text data tends to be sparse and can result in a high number of features. I belive that the features are related (read: NOT independent), therefore a classification method like Naive Bayes does not seem like a good fit here.
I will try out 3 classifiers:
- XG... | github_jupyter |
```
import os
import cv2
import math
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix, fbeta_score
from keras import optimizers
from keras... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.