code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Create TensorFlow Deep Neural Network Model
**Learning Objective**
- Create a DNN model using the high-level Estimator API
## Introduction
We'll begin by modeling our data using a Deep Neural Network. To achieve this we will use the high-level Estimator API in Tensorflow. Have a look at the various models availab... | github_jupyter |
# Compare different DEMs for individual glaciers
For most glaciers in the world there are several digital elevation models (DEM) which cover the respective glacier. In OGGM we have currently implemented 10 different open access DEMs to choose from. Some are regional and only available in certain areas (e.g. Greenland ... | github_jupyter |
Created from https://github.com/awslabs/amazon-sagemaker-examples/blob/master/introduction_to_amazon_algorithms/random_cut_forest/random_cut_forest.ipynb
```
import boto3
import botocore
import sagemaker
import sys
bucket = 'tdk-awsml-sagemaker-data.io-dev' # <--- specify a bucket you have access to
prefix = ''
ex... | github_jupyter |
<br>
# Analysis of Big Earth Data with Jupyter Notebooks
<img src='./img/opengeohub_logo.png' alt='OpenGeoHub Logo' align='right' width='25%'></img>
Lecture given for OpenGeoHub summer school 2020<br>
Tuesday, 18. August 2020 | 11:00-13:00 CEST
#### Lecturer
* [Julia Wagemann](https://jwagemann.com) | Independent c... | github_jupyter |
<a href="https://colab.research.google.com/github/sima97/unihobby/blob/master/test.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')
pip install nilearn
pip install tables
pip install gi... | github_jupyter |
```
import pandas as pd
import numpy as np
from tools import acc_score
df_train = pd.read_csv("../data/train.csv", index_col=0)
df_test = pd.read_csv("../data/test.csv", index_col=0)
train_bins = seq_to_num(df_train.Sequence, target_split=True, pad=True, pad_adaptive=True,
pad_maxlen=100, dtype=... | github_jupyter |
# 📃 Solution of Exercise M6.01
The aim of this notebook is to investigate if we can tune the hyperparameters
of a bagging regressor and evaluate the gain obtained.
We will load the California housing dataset and split it into a training and
a testing set.
```
from sklearn.datasets import fetch_california_housing
fr... | github_jupyter |
## Recommendations with MovieTweetings: Collaborative Filtering
One of the most popular methods for making recommendations is **collaborative filtering**. In collaborative filtering, you are using the collaboration of user-item recommendations to assist in making new recommendations.
There are two main methods of ... | github_jupyter |
### Feature Engineering notebook
This is a demo notebook to play with feature engineering toolkit. In this notebook we will see some capabilities of the toolkit like filling missing values, PCA, Random Projections, Normalizing values, and etc.
```
%load_ext autoreload
%autoreload 1
%matplotlib inline
from Pipeline i... | github_jupyter |
# Figure 4: NIRCam Grism + Filter Sensitivities ($1^{st}$ order)
***
### Table of Contents
1. [Information](#Information)
2. [Imports](#Imports)
3. [Data](#Data)
4. [Generate the First Order Grism + Filter Sensitivity Plot](#Generate-the-First-Order-Grism-+-Filter-Sensitivity-Plot)
5. [Issues](#Issues)
6. [About this... | github_jupyter |
**Version 2**: disable unfreezing for speed
## setup for pytorch/xla on TPU
```
import os
import collections
from datetime import datetime, timedelta
os.environ["XRT_TPU_CONFIG"] = "tpu_worker;0;10.0.0.2:8470"
_VersionConfig = collections.namedtuple('_VersionConfig', 'wheels,server')
VERSION = "torch_xla==nightly"
... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sb
import gc
prop_data = pd.read_csv("properties_2017.csv")
# prop_data
train_data = pd.read_csv("train_2017.csv")
train_data
# missing_val = prop_data.isnull().sum().reset_index()
# missing_val.columns = ['column_name', 'missi... | github_jupyter |
```
from IPython.core.display import HTML
with open('../style.css', 'r') as file:
css = file.read()
HTML(css)
```
# A Crypto-Arithmetic Puzzle
In this exercise we will solve the crypto-arithmetic puzzle shown in the picture below:
<img src="send-more-money.png">
The idea is that the letters
"$\texttt{S}$", "$\t... | github_jupyter |
# Solution based on Multiple Models
```
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
```
# Tokenize and Numerize - Make it ready
```
training_size = 20000
training_sentences = sent... | github_jupyter |
#1. Install Dependencies
First install the libraries needed to execute recipes, this only needs to be done once, then click play.
```
!pip install git+https://github.com/google/starthinker
```
#2. Get Cloud Project ID
To run this recipe [requires a Google Cloud Project](https://github.com/google/starthinker/blob/mast... | github_jupyter |
# Tutorial on Python for scientific computing
Marcos Duarte
This tutorial is a short introduction to programming and a demonstration of the basic features of Python for scientific computing. To use Python for scientific computing we need the Python program itself with its main modules and specific packages for scient... | github_jupyter |
```
import numpy as np
import pandas as pd
import json as json
from scipy import stats
from statsmodels.formula.api import ols
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from o_plot import opl # a small local package dedicated to this project
# Prepare the data
# loading the data
file_name =... | github_jupyter |
# Continuous Control
---
## 1. Import the Necessary Packages
```
from unityagents import UnityEnvironment
import random
import torch
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
%matplotlib inline
from ddpg_agent import Agent
```
## 2. Instantiate the Environment and 20 Agents
`... | github_jupyter |
# **OPTICS Algorithm**
Ordering Points to Identify the Clustering Structure (OPTICS) is a Clustering Algorithm which locates region of high density that are seperated from one another by regions of low density.
For using this library in Python this comes under Scikit Learn Library.
## Parameters:
**Reachability Dis... | github_jupyter |
```
from datascience import *
path_data = '../data/'
import numpy as np
import matplotlib.pyplot as plots
plots.style.use('fivethirtyeight')
%matplotlib inline
```
# Finding Probabilities
Over the centuries, there has been considerable philosophical debate about what probabilities are. Some people think that probabili... | github_jupyter |
#
# <p style="color:red">Chapter 7</p>
### 1. What makes dictionaries different from sequence type containers like lists and tuples is the way the data are stored and accessed.
### 2.Sequence types use numeric keys only (numbered sequentially as indexed offsets from the beginning of the sequence). Mapping types may ... | github_jupyter |
# Chapter 7. 텍스트 문서의 범주화 - (4) IMDB 전체 데이터로 전이학습
- 앞선 전이학습 실습과는 달리, IMDB 영화리뷰 데이터셋 전체를 사용하며 문장 수는 10개 -> 20개로 조정한다
- IMDB 영화 리뷰 데이터를 다운로드 받아 data 디렉토리에 압축 해제한다
- 다운로드 : http://ai.stanford.edu/~amaas/data/sentiment/
- 저장경로 : data/aclImdb
```
import os
import config
from dataloader.loader import Loader
from pre... | github_jupyter |
```
import pandas as pd
from bs4 import BeautifulSoup as soup
from splinter import Browser
import requests
import time
from webdriver_manager.chrome import ChromeDriverManager
from selenium import webdriver
!pip install chromedriver
driver = webdriver.Chrome(ChromeDriverManager().install())
#driver = webdriver.chrome(e... | github_jupyter |
### Lgbm and Optuna
* changed with cross validation
```
import pandas as pd
import numpy as np
# the GBM used
mport xgboost as xgb
import catboost as cat
import lightgbm as lgb
from sklearn.model_selection import cross_validate
from sklearn.metrics import make_scorer
# to encode categoricals
from sklearn.preprocess... | github_jupyter |
# "Tuesday Wonderland and PLOT Fidel Huancas"
> "In this blog post we head back to the fine folks at PLOT coffee roasting this time looking at a Peruvian competition lot. We pair this with the Esbjörn Svennson Trio classic 'Tuesday Wonderland' from 2006"
- toc: false
- author: Lewis Cole (2020)
- branch: master
- badge... | github_jupyter |
```
import pandas as pd
import numpy as np
data = np.array([1,2,3,4,5,6])
name = np.array(['' for x in range(6)])
besio = np.array(['' for x in range(6)])
entity = besio
columns = ['name/doi', 'data', 'BESIO', 'entity']
df = pd.DataFrame(np.array([name, data, besio, entity]).transpose(), columns=columns)
df.iloc[1,0] =... | github_jupyter |
# TensorFlow Tutorial #01
# Simple Linear Model
by [Magnus Erik Hvass Pedersen](http://www.hvass-labs.org/)
/ [GitHub](https://github.com/Hvass-Labs/TensorFlow-Tutorials) / [Videos on YouTube](https://www.youtube.com/playlist?list=PL9Hr9sNUjfsmEu1ZniY0XpHSzl5uihcXZ)
## Introduction
This tutorial demonstrates the bas... | github_jupyter |
# Modelling trend life cycles in scientific research
**Authors:** E. Tattershall, G. Nenadic, and R.D. Stevens
**Abstract:** Scientific topics vary in popularity over time. In this paper, we model the life-cycles of 200 topics by fitting the Logistic and Gompertz models to their frequency over time in published abstr... | github_jupyter |
# CTR预估(1)
资料&&代码整理by[@寒小阳](https://blog.csdn.net/han_xiaoyang)(hanxiaoyang.ml@gmail.com)
reference:
* [《广告点击率预估是怎么回事?》](https://zhuanlan.zhihu.com/p/23499698)
* [从ctr预估问题看看f(x)设计—DNN篇](https://zhuanlan.zhihu.com/p/28202287)
* [Atomu2014 product_nets](https://github.com/Atomu2014/product-nets)
关于CTR预估的背景推荐大家看欧阳辰老师在知... | github_jupyter |
```
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
from os import listdir
import seaborn as sns
sns.set_style("white")
from keras.preprocessing import sequence
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import L... | github_jupyter |
```
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from keras import initializers
import keras.backend as K
import numpy as np
import pandas as pd
from tensorflow.keras.layers import *
from keras.regularizers import l2#正则化
# 12-0.2
# 13-2.4
# 18-12.14
import pandas as pd
import... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import os
destdir = '/Users/argha/Dropbox/CS/DatSci/nyc-data'
files = [ f for f in os.listdir(destdir) if os.path.isfile(os.path.jo... | github_jupyter |
```
import os
from tensorflow.keras import layers
from tensorflow.keras import Model
from tensorflow.keras.applications.inception_v3 import InceptionV3
#!wget --no-check-certificate \
# https://storage.googleapis.com/mledu-datasets/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5 \
# -O /tmp/inception_v... | github_jupyter |
CER041 - Install signed Knox certificate
========================================
This notebook installs into the Big Data Cluster the certificate signed
using:
- [CER031 - Sign Knox certificate with generated
CA](../cert-management/cer031-sign-knox-generated-cert.ipynb)
Steps
-----
### Parameters
```
app_na... | github_jupyter |
```
import requests
!pip3 install requests
response = requests.get("https://api.spotify.com/v1/search?q=Lil&type=artist&market=US&limit=50")
print(response.text)
data = response.json()
type(data)
data.keys()
data['artists'].keys()
artists=data['artists']
type(artists['items'])
artist_info = artists['items']
for artist... | github_jupyter |
<img src="http://developer.download.nvidia.com/compute/machine-learning/frameworks/nvidia_logo.png" style="width: 90px; float: right;">
# HugeCTR Continuous Training and Inference Demo (Part I)
## Overview
In HugeCTR version 3.3, we finished the whole pipeline of parameter server, including
1. The parameter dumping... | github_jupyter |
## Observations and Insights
```
# Dependencies and Setup
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as st
# Study data files
mouse_metadata_path = "data/Mouse_metadata.csv"
study_results_path = "data/Study_results.csv"
# Read the mouse data and the study results
mouse_metadata = pd.read_... | github_jupyter |
```
!pip install -q condacolab
import condacolab
condacolab.install()
!conda install -c chembl chembl_structure_pipeline
import chembl_structure_pipeline
from chembl_structure_pipeline import standardizer
from IPython.display import clear_output
# https://www.dgl.ai/pages/start.html
# !pip install dgl
!pip install dg... | github_jupyter |
# Normalize text
```
herod_fp = '/Users/kyle/cltk_data/greek/text/tlg/plaintext/TLG0016.txt'
with open(herod_fp) as fo:
herod_raw = fo.read()
print(herod_raw[2000:2500]) # What do we notice needs help?
from cltk.corpus.utils.formatter import tlg_plaintext_cleanup
herod_clean = tlg_plaintext_cleanup(herod_raw, rm... | github_jupyter |
```
import pandas as pd
import numpy as np
# set the column names
colnames=['price', 'year_model', 'mileage', 'fuel_type', 'mark', 'model', 'fiscal_power', 'sector', 'type', 'city']
# read the csv file as a dataframe
df = pd.read_csv("./data/output.csv", sep=",", names=colnames, header=None)
# let's get some simple vi... | github_jupyter |
# Credit Risk Classification
Credit risk poses a classification problem that’s inherently imbalanced. This is because healthy loans easily outnumber risky loans. In this Challenge, you’ll use various techniques to train and evaluate models with imbalanced classes. You’ll use a dataset of historical lending activity fr... | github_jupyter |
```
import glob
import os
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cv2
import math
from tqdm.auto import tqdm
from sklearn import linear_model
import optuna
import seaborn as sns
FEAT_OOFS = [
{
'model' : 'feat_lasso',
'fn' : '../output/2021011_se... | github_jupyter |
## Introduction to \LaTeX Math Mode
Jupyter notebooks integrate the MathJax Javascript library in order to render mathematical formulas and symbols in the same way as one would in \LaTeX (often used to typeset textbooks, research papers, or other technical documents).
First, we will take a look at a couple of rendere... | github_jupyter |
```
#import necessary modules, set up the plotting
import numpy as np
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
import matplotlib;matplotlib.rcParams['figure.figsize'] = (8,6)
from matplotlib import pyplot as plt
import GPy
```
# Interacting with models
### November 2014, by Max Zwiessele
#### wi... | github_jupyter |
```
%matplotlib inline
```
# Partial Dependence Plots
Sigurd Carlsen Feb 2019
Holger Nahrstaedt 2020
.. currentmodule:: skopt
Plot objective now supports optional use of partial dependence as well as
different methods of defining parameter values for dependency plots.
```
print(__doc__)
import sys
from skopt.plot... | github_jupyter |
# Training Models
The central goal of machine learning is to train predictive models that can be used by applications. In Azure Machine Learning, you can use scripts to train models leveraging common machine learning frameworks like Scikit-Learn, Tensorflow, PyTorch, SparkML, and others. You can run these training sc... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import tensorflow as tf
import numpy as np
import pandas as pd
import altair as alt
import shap
from interaction_effects.marginal import MarginalExplainer
from interaction_effects import utils
n = 3000
d = 3
batch_size = 50
learning_rate = 0.02
X = np.random.randn(n, d)
y = (np.s... | github_jupyter |
#CHALLENGE TASK
#Stats Challege notebook
#Fit multiple linear regression for the following data and check for the assumptions using python
#X1 22 22 25 26 24 28 29 27 24 33 39 42
#X2 15 14 18 13 12 11 11 10 5 9 7 3
#Y 55 56 55 59 66 65 69 70 75 75 78 79
```
import numpy as np
import pandas as pd
import statsmodels... | github_jupyter |
### Prepare stimuli in stereo with sync tone in the L channel
To syncrhonize the recording systems, each stimulus file goes in stereo, the L channel has the stimulus, and the R channel has a pure tone (500-5Khz).
This is done here, with the help of the rigmq.util.stimprep module
It uses (or creates) a dictionary of {st... | github_jupyter |
# Scaling and Normalization
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler
from scipy.cluster.vq import whiten
```
Terminology (from [this post](https://towardsdatascience.com/scale-standardi... | github_jupyter |
# Tutorial 6.3. Advanced Topics on Extreme Value Analysis
### Description: Some advanced topics on Extreme Value Analysis are presented.
#### Students are advised to complete the exercises.
Project: Structural Wind Engineering WS19-20
Chair of Structural Analysis @ TUM - R. Wüchner, M. Péntek
Autho... | github_jupyter |
# What's this TensorFlow business?
You've written a lot of code in this assignment to provide a whole host of neural network functionality. Dropout, Batch Norm, and 2D convolutions are some of the workhorses of deep learning in computer vision. You've also worked hard to make your code efficient and vectorized.
For t... | github_jupyter |
<h1>Lists</h1>
<li>Sequential, Ordered Collection
<h2>Creating lists</h2>
```
x = [4,2,6,3] #Create a list with values
y = list() # Create an empty list
y = [] #Create an empty list
print(x)
print(y)
```
<h3>Adding items to a list</h3>
```
x=list()
print(x)
x.append('One') #Adds 'One' to the back of the empty list
... | github_jupyter |
```
import shapefile
import numpy as np
import xarray as xr
from shapely.geometry import mapping as mappy
from shapely.geometry import Polygon
import cartopy.crs as ccrs
import cartopy
import os, sys
import pandas as pd
import richdem as rd
import skimage
from matplotlib import pyplot as plt
%matplotlib inline
from ski... | github_jupyter |
# Authoring repeatable processes aka AzureML pipelines
```
from azureml.core import Workspace
ws = Workspace.from_config()
dataset = ws.datasets["diabetes-tabular"]
compute_target = ws.compute_targets["cpu-cluster"]
from azureml.core import RunConfiguration
# To simplify we are going to use a big demo environment in... | github_jupyter |
# Local Feature Matching
By the end of this exercise, you will be able to transform images of a flat (planar) object, or images taken from the same point into a common reference frame. This is at the core of applications such as panorama stitching.
A quick overview:
1. We will start with histogram representations fo... | github_jupyter |
```
# Load necessary modules and libraries
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import Perceptron
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.model_selection import learning_curve
from sklearn.neural_network import M... | github_jupyter |
# SiteAlign features
We read the SiteAlign features from the respective [paper](https://onlinelibrary.wiley.com/doi/full/10.1002/prot.21858) and [SI table](https://onlinelibrary.wiley.com/action/downloadSupplement?doi=10.1002%2Fprot.21858&file=prot21858-SupplementaryTable.pdf) to verify `kissim`'s implementation of th... | github_jupyter |
# "Building Excel dashboard using NYSE data"
> "A project for my Udacity certificate in business analysis"
- toc: false
- branch: master
- badges: false
- hide_github_badge: true
- comments: true
- categories: [Excel, Dashboards]
- image: images/dashboard_icon.webp
- hide: false
- search_exclude: false
- metadata_key1... | github_jupyter |
# Fashion MNIST Generative Adversarial Network (GAN)
[Мой блог](https://tiendil.org)
[Пост об этом notebook](https://tiendil.org/generative-adversarial-network-implementation)
[Все публичные notebooks](https://github.com/Tiendil/public-jupyter-notebooks)
Учебная реализация [GAN](https://en.wikipedia.org/wiki/Genera... | github_jupyter |
```
#@markdown ■■■■■■■■■■■■■■■■■■
#@markdown 初始化openpose
#@markdown ■■■■■■■■■■■■■■■■■■
#设置版本为1.x
%tensorflow_version 1.x
import tensorflow as tf
tf.__version__
! nvcc --version
! nvidia-smi
! pip install PyQt5
import time
init_start_time = time.time()
#安装 cmake
#https://drive.google.com/file/d/1lAXs5X7qMnKQE4... | github_jupyter |
**Important note:** You should always work on a duplicate of the course notebook. On the page you used to open this, tick the box next to the name of the notebook and click duplicate to easily create a new version of this notebook.
You will get errors each time you try to update your course repository if you don't do ... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Project: **Finding Lane Lines on the Road**
***
In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j... | github_jupyter |
```
## Advanced Course in Machine Learning
## Week 4
## Exercise 2 / Probabilistic PCA
import numpy as np
import scipy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from numpy import linalg as LA
sns.set_style("darkgrid")
def build_dataset(N, D, K, ... | github_jupyter |
# Bayes Classifier
```
import util
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal as mvn
%matplotlib inline
def clamp_sample(x):
x = np.minimum(x, 1)
x = np.maximum(x, 0)
return x
class BayesClassifier:
def fit(self, X, Y):
# assume classes are numbered 0...... | github_jupyter |
```
%matplotlib inline
import pandas as pd
import cv2
import numpy as np
from matplotlib import pyplot as plt
df = pd.read_csv("data/22800_SELECT_t___FROM_data_data_t.csv",header=None,index_col=0)
df = df.rename(columns={0:"no", 1: "CAPTDATA", 2: "CAPTIMAGE",3: "timestamp"})
df.info()
df.sample(5)
def alpha_to_gray(im... | github_jupyter |
```
# Import and create a new SQLContext
from pyspark.sql import SQLContext
sqlContext = SQLContext(sc)
# Read the country CSV file into an RDD.
country_lines = sc.textFile('file:///home/ubuntu/work/notebooks/UCSD/big-data-3/final-project/country-list.csv')
country_lines.collect()
# Convert each line into a pair of wo... | github_jupyter |
# Our data exists as vectors in matrixes
Linear algeabra helps us manipulate data to eventually find the smallest sum squared errors of our data which will give us our beta value for our regression model
```
import numpy as np
# create array to be transformed into vectors
x1 = np.array([1,2,1])
x2 = np.array([4,1,5])... | github_jupyter |
# Datafaucet
Datafaucet is a productivity framework for ETL, ML application. Simplifying some of the common activities which are typical in Data pipeline such as project scaffolding, data ingesting, start schema generation, forecasting etc.
```
import datafaucet as dfc
```
## Loading and Saving Data
```
dfc.project... | github_jupyter |
## Deciding on a Model Using Manual Analysis with Gradio
This notebook documents some of the steps taken to choose the final model for deployment.
For this project, we played around with four different models to see which performed best for our dataset. Our initial literature search showcased four different models th... | github_jupyter |
<a href="https://colab.research.google.com/github/taniokah/where-is-santa/blob/master/Indexer_for_Santa.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Indexer for Santa
Script score queryedit
https://www.elastic.co/guide/en/elasticsearch/refer... | github_jupyter |
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from astropy.visualization import astropy_mpl_style
plt.style.use(astropy_mpl_style)
import astropy.units as u
from astropy.time import Time
from astropy.coordinates import SkyCoord, EarthLocation, AltAz, ICRS
```
The observing period is the wh... | github_jupyter |
```
import sys
import os
import time
import torch
import torch.backends.cudnn as cudnn
import argparse
import socket
import pandas as pd
import csv
import numpy as np
import pickle
import re
from model_util import MyAlexNetCMC
from contrast_util import NCEAverage,AverageMeter,NCESoftmaxLoss
from torch.utils.data.sample... | github_jupyter |
# Build a Pipeline
> A tutorial on building pipelines to orchestrate your ML workflow
A Kubeflow pipeline is a portable and scalable definition of a machine learning
(ML) workflow. Each step in your ML workflow, such as preparing data or
training a model, is an instance of a pipeline component. This document
provides... | github_jupyter |

https://www.kaggle.com/danofer/sarcasm
<div class="markdown-converter__text--rendered"><h3>Context</h3>
<p>This dataset contains 1.3 million Sarcastic comments from the Internet commentary website Reddit. The dataset was generated by scrap... | github_jupyter |
<a href="https://colab.research.google.com/github/RamSaw/NLP/blob/master/HW_03_LSTM.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import re
from collections import defaultdict
from tqdm import tnrange, tqdm_notebook
import random
from tqdm.aut... | github_jupyter |
```
# Import Splinter, BeautifulSoup, and Pandas
from splinter import Browser
from bs4 import BeautifulSoup as soup
import pandas as pd
from webdriver_manager.chrome import ChromeDriverManager
# Set up Splinter
executable_path = {'executable_path': ChromeDriverManager().install()}
browser = Browser('chrome', **executab... | github_jupyter |
```
# Copyright 2020 NVIDIA Corporation. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | github_jupyter |
# 3. Markov Models Example Problems
We will now look at a model that examines our state of healthiness vs. being sick. Keep in mind that this is very much like something you could do in real life. If you wanted to model a certain situation or environment, we could take some data that we have gathered, build a maximum l... | github_jupyter |
# Quantization of Signals
*This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).*
## Spectral Shaping of the Quantization Noise
The quan... | github_jupyter |
# Neural networks with PyTorch
Deep learning networks tend to be massive with dozens or hundreds of layers, that's where the term "deep" comes from. You can build one of these deep networks using only weight matrices as we did in the previous notebook, but in general it's very cumbersome and difficult to implement. Py... | github_jupyter |
# ------------ First A.I. activity ------------
## 1. IBOVESPA volume prediction
-> Importing libraries that are going to be used in the code
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
```
-> Importing the datasets
```
dataset = pd.read_csv("datasets/ibovespa.csv",delimiter = ";")
`... | github_jupyter |
# Exercise 02 - Functions and Getting Help !
## 1. Complete Your Very First Function
Complete the body of the following function according to its docstring.
*HINT*: Python has a builtin function `round`
```
def round_to_two_places(num):
"""Return the given number rounded to two decimal places.
>>> ro... | github_jupyter |
```
import matplotlib.pyplot as plt
import netCDF4 as nc
import numpy as np
from salishsea_tools import geo_tools
%matplotlib inline
bathyfile = '/home/sallen/MEOPAR/grid/bathymetry_201702.nc'
meshfile = '/home/sallen/MEOPAR/grid/mesh_mask201702.nc'
mesh = nc.Dataset(meshfile)
model_lats = nc.Dataset(bathyfile).variab... | github_jupyter |
# Plotting massive data sets
This notebook plots about half a million LIDAR points around Toronto from the KITTI data set. ([Source](http://www.cvlibs.net/datasets/kitti/raw_data.php)) The data is meant to be played over time. With pydeck, we can render these points and interact with them.
### Cleaning the data
Firs... | github_jupyter |
# Seq2Seq with Attention for Korean-English Neural Machine Translation
- Network architecture based on this [paper](https://arxiv.org/abs/1409.0473)
- Fit to run on Google Colaboratory
```
import os
import io
import tarfile
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F... | github_jupyter |
# Imports and Paths
```
import urllib3
http = urllib3.PoolManager()
from urllib import request
from bs4 import BeautifulSoup, Comment
import pandas as pd
from datetime import datetime
# from shutil import copyfile
# import time
import json
```
# Load in previous list of games
```
df_gms_lst = pd.read_csv('../data/bg... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
import matplotlib as mpl
import matplotlib.dates as mdates
import datetime
# Set the matplotlib settings (eventually this will go at the top of the graph_util)
mpl.rcParams['axes.labelsize'] = 16
mpl.... | github_jupyter |
# Artificial Intelligence Nanodegree
## Voice User Interfaces
## Project: Speech Recognition with Neural Networks
---
In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete this project. You will not need to modify the... | github_jupyter |
<h1> Logistic Regression <h1>
<h2> ROMÂNĂ <h2>
<blockquote><p>În final, o să observăm dacă Google PlayStore a avut destule date pentru a putea prezice popularitatea unei aplicații de trading sau pentru topul jocurilor plătite.
Lucrul acesta se va face prin împărțirea descărcărilor în 2 variabile dummy. Cu mai mult d... | github_jupyter |
# Import libraries and data
Dataset was obtained in the capstone project description (direct link [here](https://d3c33hcgiwev3.cloudfront.net/_429455574e396743d399f3093a3cc23b_capstone.zip?Expires=1530403200&Signature=FECzbTVo6TH7aRh7dXXmrASucl~Cy5mlO94P7o0UXygd13S~Afi38FqCD7g9BOLsNExNB0go0aGkYPtodekxCGblpc3I~R8TCtWRr... | github_jupyter |
```
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
STATS_DIR = "/hg191/corpora/legaldata/data/stats/"
SEM_FEATS_FILE = os.path.join (STATS_DIR, "ops.temp.semfeat")
INDEG_FILE = os.path.join (STATS_DIR, "ops.ind")
ind = pd.read_csv (INDEG_FILE, ... | github_jupyter |
# Geometric operations
## Overlay analysis
In this tutorial, the aim is to make an overlay analysis where we create a new layer based on geometries from a dataset that `intersect` with geometries of another layer. As our test case, we will select Polygon grid cells from `TravelTimes_to_5975375_RailwayStation_Helsinki... | github_jupyter |
# GNN Implementation
- Name: Abhishek Aditya BS
- SRN: PES1UG19CS019
- VI Semester 'A' Section
- Date: 27-04-2022
```
import sys
if 'google.colab' in sys.modules:
%pip install -q stellargraph[demos]==1.2.1
import pandas as pd
import os
import stellargraph as sg
from stellargraph.mapper import FullBatchNodeGenerator... | github_jupyter |
# Solution to puzzle number 5
```
import pandas as pd
import numpy as np
data = pd.read_csv('../inputs/puzzle5_input.csv')
data = [val for val in data.columns]
data[:10]
```
## Part 5.1
### After providing 1 to the only input instruction and passing all the tests, what diagnostic code does the program produce?
More... | github_jupyter |
```
import nltk
from nltk.corpus import state_union
import pandas as pd
import os
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import TruncatedSVD
from sklearn.decomposition import NMF
#from sklearn.metrics.pairwise import cosine_similarity
import matplotlib.pyplot as pl... | github_jupyter |
# Average Monthly Temperatures, 1970-2004
**Date:** 2021-12-02
**Reference:**
```
library(TTR)
options(
jupyter.plot_mimetypes = "image/svg+xml",
repr.plot.width = 7,
repr.plot.height = 5
)
```
## Summary
The aim of this notebook was to show how to decompose seasonal time series data using **R** so the... | github_jupyter |
```
import pandas as pd
import numpy as np
import math
from pprint import pprint
import pandas as pd
import numpy as np
import nltk
import matplotlib.pyplot as plt
import seaborn as sns
nltk.download('vader_lexicon')
nltk.download('stopwords')
from nltk.corpus import stopwords
stop_words = stopwords.words('english')
fr... | github_jupyter |
# PySchools without Thomas High School 9th graders
### Dependencies and data
```
# Dependencies
import os
import numpy as np
import pandas as pd
# School data
school_path = os.path.join('data', 'schools.csv') # school data path
school_df = pd.read_csv(school_path)
# Student data
student_path = os.path.join('data', '... | github_jupyter |
# **ANALYSIS OF FINANCIAL INCLUSION IN EAST AFRICA BETWEEN 2016 TO 2018**
##DEFINING QUESTION
The research problem is to figure out how we can predict which individuals are most likely to have or use a bank account.
### METRIC FOR SUCCESS
My solution procedure will be to help provide an indication of the state of ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.