code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
<style>div.container { width: 100% }</style>
<img style="float:left; vertical-align:text-bottom;" height="65" width="172" src="assets/PyViz_logo_wm_line.png" />
<div style="float:right; vertical-align:text-bottom;"><h2>Tutorial 04. Working with tabular data</h2></div>
As we have already discovered, HoloViews elements... | github_jupyter |
```
import os
import math
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import AxesZero
import matplotlib.gridspec as gridspec
from matplotlib import cm, transforms
import matplotlib.ticker as mtick
from mpl_axes_aligner import align
import numpy as np
np.seterr(divide='ignore')
from scipy.sta... | github_jupyter |
```
# default_exp utils
```
# Utils
> General purpose utils functions
```
#hide
from nbdev.showdoc import *
#export
import os
from typing import Dict, Any
#export
def dest(destination_dataset_table, prefix_dataset='tmp', return_dataset_only=False, return_table_only=False) -> Dict[str, Any]:
"""If `AIRFLOW_ENV... | github_jupyter |
# Machine Learning Engineer Nanodegree
## Unsupervised Learning
## Project: 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 nece... | github_jupyter |
## Movie Review Sentiment Analysis - The Lion King (2019) EDA and Visualization
## Agenda
- Data Extraction (Web-scrapping)
- Visualization
- Regular Expression for special character removal
- Removal of accented characters and expanding contractions
- Tokenisation
- Stop Word Removal
- Ste... | github_jupyter |
## Distortion Correction
This notebook will explain about correcting Distortion and generate an undistorted image.
There are two main steps to this process: use chessboard images to obtain image points and object points, and then use the OpenCV functions `cv2.calibrateCamera()` and `cv2.undistort()` to compute the ca... | github_jupyter |
```
# default_exp utils
```
# Utils
> Collection of useful functions.
```
#hide
from nbdev.showdoc import *
#export
import os
import numpy as np
from typing import Iterable, TypeVar, Generator
from plum import dispatch
from pathlib import Path
from functools import reduce
function = type(lambda: ())
T = TypeVar('T... | github_jupyter |
# Module 7.2 | Apply Data Storytelling to Lending Club loan data
Guiding Principles for EDA/ Visualizations
1. Graphical Integrity
2. Keep it simple
3. Use the right display
4. Use color strategically
5. Tell a story with Data
Guiding Principles for Effective Storytelling
1. Audience (Know Your Audience)
2. Engaging ... | github_jupyter |
### CoreBx_island_v6 - Try to process entire N. Core Banks
Interpolate the North Core Banks DEMs onto rotated 1-m grid and save each as a .nc file.
Versioning jumped from v2 to v5, trying to be consistent with versions in processing notebooks.
New invV5
* Files are switched to the "merged DEMs" that Jin-Si made, so ... | github_jupyter |
# Notebook setup
```
import nltk
from nltk import sent_tokenize, word_tokenize
import os
import string
import re
from nltk.sentiment.vader import SentimentIntensityAnalyzer
nltk.download('punkt')
nltk.download('vader_lexicon');
# Disable output to reduce execution time.
output = False
outPath = "../training_set/ocr_o... | github_jupyter |
# Generate Region of Interests (ROI) labeled arrays for simple shapes
This example notebook explain the use of analysis module "skbeam/core/roi" https://github.com/scikit-beam/scikit-beam/blob/master/skbeam/core/roi.py
```
import skbeam.core.roi as roi
import skbeam.core.correlation as corr
import numpy as np
import... | github_jupyter |
# Neural Networks with Keras
513/513 - 0s - loss: 1.7734 - acc: 0.2710
Loss: 1.7734287705337792, Accuracy: 0.2709551751613617
uses minmaxscaler
ref: 21-Machine-Learning/3/Activities/02-Evr_First_Neural_Network/Solved/First_Neural_Network.ipynb#Model-Summary
```
# Dependencies
import pandas as pd
from sklearn.prepr... | github_jupyter |
<p align="center">
<img src="http://www.di.uoa.gr/themes/corporate_lite/logo_el.png" title="Department of Informatics and Telecommunications - University of Athens"/> </p>
---
<h1 align="center">
Artificial Intelligence
</h1>
<h1 align="center" >
Deep Learning for Natural Language Processing
</h1>
---
<h2 alig... | github_jupyter |
# Setup
Before attending the workshp you should set up a scientific Python computing environment using the [Anaconda python distribution by Continuum Analytics](https://www.continuum.io/downloads). This page describes how. If this doesn't work, let [me](mailto:neal.caren@gmail.com) know and I will set you up with a vi... | github_jupyter |
### Distributed MCMC Retrieval
This notebook runs the MCMC retrievals on a local cluster using `ipyparallel`.
```
import ipyparallel as ipp
c = ipp.Client(profile='gold')
lview = c.load_balanced_view()
```
## Retrieval Setup
```
%%px
%env ARTS_BUILD_PATH=/home/simonpf/build/arts
%env ARTS_INCLUDE_PATH=/home/simonpf... | github_jupyter |
## Validated boundaries to government unit incident density comparison
The backing theory for this notebook is proving that we will be able to use the highest-density (fire count vs government unit area) government unit to determine a department's boundary for departments that do not have boundaries.
```
import psyco... | github_jupyter |
# Search for best parameters for Random Forest classifier
## Read data
```
# Pandas is used for data manipulation
import pandas as pd
time='80_100'
# Read in data as a dataframe
features = pd.read_csv('../features/features_training1/features_{}.csv'.format(time))
import numpy as np
import seaborn as sns
import matp... | github_jupyter |
# ランダムフォレストのデモプログラム
ランダムフォレストのデモプログラムです。
ランダムフォレストの中身に関してはこちら↓で解説しています。
https://yuyumoyuyu.com/2021/02/21/ensembledecisiontree/
```
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import matplotlib.figure as figure
import numpy as np
from sklearn.model_selection import GridSearchCV
f... | github_jupyter |
# Face Transformation from Human to Anime
This notebook demonstrates how to transform a human face to an anime face using StyleGAN2.
Contact: alienncheng@gmail.com
## Data Preparation
First of all, we need a dataset to train the model.
I downloaded the [danbooru2019-portrait](https://www.gwern.net/Crops#danbooru2019-... | github_jupyter |
# Introduction

This notebook provides a demo to use the methods used in the paper with new data. If new to collaboratory ,please check the following [link](https://medium.com/lean-in-women-in-tech-india/google-colab-the-beginners-guide-5ad... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import numpy as np
import cvxpy as cp
from scipy import stats
import torch
from torch import nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import DataLoader
import torch.optim as optim
import os
import random
import sys
sys.path.ins... | github_jupyter |
```
from IPython.display import HTML
css_file = './custom.css'
HTML(open(css_file, "r").read())
```
# Homogeneity Metrics
© 2018 Daniel Voigt Godoy
## 1. Definitions
### Entropy
***Entropy*** is a measure of ***uncertainty*** associated with a given ***distribution q(y)***.
From Wikipedia:
...is the average ... | github_jupyter |
```
import logging
from gensim.models import ldaseqmodel
from gensim.corpora import Dictionary, bleicorpus, textcorpus
import numpy as np
from gensim.matutils import hellinger
import time
import pickle
import pyLDAvis
import matplotlib.pyplot as plt
from scipy.stats import entropy
import pandas as pd
from numpy.linalg ... | github_jupyter |
"""
This file was created with the purpose of developing
a random forest classifier to identify market squeeze
This squeeze classification depends of the comparison of 2 indicators:
2 std of a 20 period bollinger bands and 2 atr of a 20 period keltner channel
our definition of squeeze:
when the upper bollinger band ... | github_jupyter |
<center>
<img src="https://habrastorage.org/web/677/8e1/337/6778e1337c3d4b159d7e99df94227cb2.jpg"/>
## Специализация "Машинное обучение и анализ данных"
<center>Автор материала: программист-исследователь Mail.Ru Group, старший преподаватель Факультета Компьютерных Наук ВШЭ [Юрий Кашницкий](https://yorko.github.io/)
# ... | github_jupyter |
# 531 - Lab 1 - Visualizing world health data
There are two versions of this lab, one in Python and one in R.
The R lab will use `ggplot` and the Python lab will use `Altair`.
This is the Python version.
Please choose a version to complete, though keep in mind that you are required to alternate between completing th... | github_jupyter |
# Modeling resting-state MEG-Data
In this example we will learn how to use `neurolib` to simulate resting state functional connectivity of MEG recordings.
In the first part of the notebook, we will compute the frequency specific functional connectivity matrix of an examplary resting state MEG recording from the [You... | github_jupyter |
## Outline
* Recap of data
* Feedforward network with Pytorch tensors and autograd
* Using Pytorch's NN -> Functional, Linear, Sequential & Pytorch's Optim
* Moving things to CUDA
```
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib.colors
import pandas as pd
from sklearn.model_selecti... | github_jupyter |
# Import modules
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import gridspec
from matplotlib import cm
from pysheds.grid import Grid
from matplotlib import colors
import seaborn as sns
import warnings
from partition import differentiated_linear_weights, controller_placeme... | github_jupyter |
# NSF COA author/affiliation tool
Inspired by [this awesome tool](https://github.com/ejfertig/NSFBiosketch) from Dr. Elana Fertig, but unable to get it to run in time due to a java install problem with the xlsx package in my perpetually infuriating R environment, I whipped up something similar for the Pythonistas.
T... | github_jupyter |
```
# default_exp optimizer
#export
from local.torch_basics import *
from local.test import *
from local.notebook.showdoc import *
```
# Optimizer
> Define the general fastai optimizer and the variants
## Optimizer -
```
#export
class _BaseOptimizer():
"Common functionality between `Optimizer` and `OptimWrapper... | github_jupyter |
# Grid algorithm for the beta-binomial hierarchical model
[Bayesian Inference with PyMC](https://allendowney.github.io/BayesianInferencePyMC)
Copyright 2021 Allen B. Downey
License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
```
# I... | github_jupyter |
```
from datascience import *
import numpy as np
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn')
from scipy import stats
from scipy.stats import norm
import matplotlib
matplotlib.__version__
import seaborn as sns
sns.set(color_codes = True)
#Data or Fe-based, Cuprates,... | github_jupyter |
# Generate reference data
Make reference data for `carsus/io/output/base.py` module.
```
import pandas as pd
from pandas.testing import assert_frame_equal, assert_series_equal
from carsus.io.nist import NISTWeightsComp, NISTIonizationEnergies
from carsus.io.kurucz import GFALLReader
from carsus.io.zeta import KnoxLon... | github_jupyter |
```
import pandas as pd
import numpy as np
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import sys
import re
import webbrowser
from time import sleep
# https://stackoverflow.com/questions/4028904/how-to-get-the-home-directory-in-python
from os.path import expanduser
from os import listdi... | github_jupyter |
# Starting a local neuroglancer session with FAFB dataset
### This example shows how to start a local neuroglancer session and further add neurons, synapses, neuropil meshes from a public catmaid instance
### Import neccesary library modules now
```
import navis
import fafbseg
import pymaid
import pandas as pd
impor... | github_jupyter |
# BB84 Quantum Key Distribution (QKD) Protocol using Qiskit
This notebook is a _demonstration_ of the BB84 Protocol for QKD using Qiskit.
BB84 is a quantum key distribution scheme developed by Charles Bennett and Gilles Brassard in 1984 ([paper]).
The first three sections of the paper are readable and should give you... | github_jupyter |
**[Back to Fan's Intro Stat Table of Content](https://fanwangecon.github.io/Stat4Econ/)**
# Rescaling Standard Deviation and Covariance
We have various tools at our disposal to summarize variables and the relationship between variables. Imagine that we have multiple toolboxes. This is the first one. There are two lev... | github_jupyter |
Iterations, in programming, let coders repeat a set of instructions until a condition is met. Think about this as being stuck in a loop that will continue until something tells you to break out.
## While loop
The `while` loop is one of two iteration types you'll learn about. In this loop, you must specify a condition... | github_jupyter |
```
'''
-*- coding: utf-8 -*-
2019 - 2학기 - 정보융합학부 데이터사이언스
빅데이터 처리 및 응용 과목 지정 프로젝트
주제 : " 네이버 - 다음 - 구글 실시간 검색어 순위 크롤링 및 분석 "
Blog : https://blog.naver.com/sooftware
GitHub : https://github.com/sh951011
Kwangwoon University Electronic-Communication Dept. 2014707073 김수환
'''
from PyQt5 import QtCore, Qt... | github_jupyter |
My family know I like puzzles so they gave me this one recently:

When you take it out the box it looks like this:

And very soon after it looked like this (which explains why I've ... | github_jupyter |
```
import cv2
import numpy as np
# Define a function to track the object
def start_tracking():
# Initialize the video capture object
cap = cv2.VideoCapture(0)
# Define the scaling factor for the frames
scaling_factor = 0.5
# Number of frames to track
num_frames_to_track = 5
# Skipping f... | github_jupyter |
# Random Forest Regression Example
## Boston housing prices
The objective is to predict the median price of a home in Boston. The variables are crime rate, zoning information,
proportion of non-retail business, etc. This dataset has median prices in Boston for 1972. Even though the data is pretty old, the methodolo... | github_jupyter |
```
%reload_ext autoreload
%autoreload 2
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
import os
import re
import pickle
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib... | 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 |
# Dask Tutorial
<div class="alert-info">
### Overview
* **teaching:** 20 minutes
* **exercises:** 0
* **questions:**
* How does Dask parallelize computations in Python?
</div>
### Table of contents
1. [**Dask primer**](#Dask-primer)
1. [**Dask clusters**](#Dask-Clusters)
1. [**Dask dataframe**](#Dask-Dataf... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from aflow.entries import Entry
a = {
"compound": "Be2O2",
"auid":"aflow:ed51b7b3938f117f",
"aurl":"aflowlib.duke.edu:AFLOWDATA/ICSD_WEB/HEX/Be1O1_ICSD_15620",
"agl_thermal_conductivity_300K":"53.361",
"Egap":"7.4494"
}
A = Entry(**a)
A.kpoints
from aflow.caste... | github_jupyter |
## 1. Train your own word2vec representations as we did in our first example in the checkpoint. But, you need to experiment with the hyperparameters of the vectorization step. Modify the hyperparameters and run the classification models again. Can you wrangle any improvements?
```
import numpy as np
import pandas as p... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
from keras.datasets import mnist
# Digit recognition when data is in 'pixel form'
(X_train, y_train), (X_test, y_test) = mnist.load_data()
# Shape of the pictures
X_test[4,:,:].shape
df = pd.DataFrame(X_train[0,:,:])
df
img = X_test[... | github_jupyter |
# SageMaker/DeepAR demo on electricity dataset
This notebook complements the [DeepAR introduction notebook](https://github.com/awslabs/amazon-sagemaker-examples/blob/master/introduction_to_amazon_algorithms/deepar_synthetic/deepar_synthetic.ipynb).
Here, we will consider a real use case and show how to use DeepAR on... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.font_manager
from sklearn import svm
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from pyod.utils.data import generate_data... | github_jupyter |
# The Dataset for Pretraining BERT
:label:`sec_bert-dataset`
To pretrain the BERT model as implemented in :numref:`sec_bert`,
we need to generate the dataset in the ideal format to facilitate
the two pretraining tasks:
masked language modeling and next sentence prediction.
On one hand,
the original BERT model is pretr... | github_jupyter |
```
from regular_expression_visualization.visualize_reg import search_pattern
```
search_pattern is a helper function that cross matches several regular expressions against several strings. It visulizes the result by surrounding the matched substring in red border. Only the first matched substring is bordered.
## Sim... | github_jupyter |
```
from requests import get
from requests.exceptions import RequestException
from contextlib import closing
from bs4 import BeautifulSoup
from datetime import timedelta, date
import sys
```
## All library invoke(s)
```
base_link = "https://thegreyhoundrecorder.com.au/results/search/"
#html_file_name = link_date + "... | github_jupyter |
```
# !/usr/bin/python3
### 1. Data import
import sys ## system
import numpy as np ## Matrix Calculate
import glob ## global variable
import random ## random sample
from math import exp, gamma, log, sqrt ## exp,log,sqrt cal
import scipy.stats as ss
import time
from copy import deepcopy as dc
import time
from co... | github_jupyter |
<a href="https://colab.research.google.com/github/Pradyumna1312/ML_SelfStudy/blob/main/ML_SelfStudy_RF.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Using the iris flower dataset, create a Random Forest model in Python to categorise the type
of fl... | github_jupyter |
## Spam Classification
In this notebook we demonstrate how to classify if an image is SPAM or HAM using the SMS Spam Collection Dataset which can be found [here](https://www.kaggle.com/uciml/sms-spam-collection-dataset#spam.csv)
```
!pip install fastai==1.0.60
!pip install wget
import pandas as pd
import wget
import o... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from __future__ import division
import pickle
import os
from collections import defaultdict
import types
import numpy as np
import pandas as pd
from statsmodels.stats.anova import AnovaRM
import statsmodels.api as sm
from sensei.envs import GridWorldNavEnv, GuideEnv
from sensei... | github_jupyter |
# Hugging Face Transformers with `Pytorch`
### Text Classification Example using vanilla `Pytorch`, `Transformers`, `Datasets`
# Introduction
Welcome to this end-to-end multilingual Text-Classification example using PyTorch. In this demo, we will use the Hugging Faces `transformers` and `datasets` library together w... | github_jupyter |
# Quantum teleportation
By the end of this post, we will teleport the quantum state
$$\sqrt{0.70}\vert0\rangle + \sqrt{0.30}\vert1\rangle$$ from Alice's qubit to Bob's qubit.
Recall that the teleportation algorithm consists of four major components:
1. Initializing the state to be teleported. We will do this on Al... | github_jupyter |
```
import time
import pandas as pd
import numpy as np
import nltk
nltk.download('gutenberg')
import tensorflow as tf
keras = tf.keras
from tensorflow.keras.preprocessing.sequence import pad_sequences
from sklearn.model_selection import train_test_split
from tqdm import tqdm
import matplotlib.pyplot as plt
plt.st... | github_jupyter |
```
import numpy as np
import pandas as pd
from pathlib import Path
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler, MinMaxScaler, LabelEncoder
train_df = pd.read_csv(Path('Resources/2019loans.csv'))
test_df = pd.read_csv(Path('Resources/2020Q1lo... | github_jupyter |
```
#hide
#default_exp export
#default_cls_lvl 3
from nbdev.showdoc import show_doc
#export
from nbdev.imports import *
from fastcore.script import *
from fastcore.foundation import *
from keyword import iskeyword
import nbformat
```
# Export to modules
> The functions that transform notebooks in a library
The most ... | github_jupyter |
# base
```
import vectorbt as vbt
from vectorbt.base import column_grouper, array_wrapper, combine_fns, index_fns, indexing, reshape_fns
import numpy as np
import pandas as pd
from datetime import datetime
from numba import njit
import itertools
v1 = 0
a1 = np.array([1])
a2 = np.array([1, 2, 3])
a3 = np.array([[1, 2,... | github_jupyter |
<h4>Le but de ce document est de présenter les <b>dictionnaires</b> python.</h4>
<h1 class="alert alert-success">Les dictionnaires</h1>
<h2 class="alert alert-info">
Définition : Les dictionnaires</h2>
<p class="alert-warning">Un <span class="inline_code">dictionnaire</span> est une collection non-ordonnée (non indi... | github_jupyter |
```
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
data_path = 'Bike-Sharing-Dataset/hour.csv'
rides = pd.read_csv(data_path)
rides.head()
dummy_fields = ['season', 'weathersit', 'mnth', 'hr', 'weekday']
for each in dummy_fields... | github_jupyter |
```
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:80% !important; }</style>"))
```
## Behavorial Cloning
### Review Articles
- [An overview of gradient descent optimization algorithms](http://ruder.io/optimizing-gradient-descent/index.html#adam)
### Enrichment Readings
- [... | github_jupyter |
# Example Seldon Core Deployments using Helm
<img src="images/deploy-graph.png" alt="predictor with canary" title="ml graph"/>
## Prerequisites
You will need
- [Git clone of Seldon Core](https://github.com/SeldonIO/seldon-core)
- A running Kubernetes cluster with kubectl authenticated
- [seldon-core Python package]... | github_jupyter |
```
from PIL import Image
import numpy as np
```
先下載 MNIST 資料
```
import os
import urllib
from urllib.request import urlretrieve
dataset = 'mnist.pkl.gz'
def reporthook(a,b,c):
print("\rdownloading: %5.1f%%"%(a*b*100.0/c), end="")
if not os.path.isfile(dataset):
origin = "https://github.com/mnielse... | github_jupyter |
```
!git clone https://github.com/MinkaiXu/CGCF-ConfGen
!pip install kora -q
import kora.install.rdkit
pip install torch==1.6.0
!pip install torchvision==0.7.0
pip install torchdiffeq==0.0.1
pip install tqdm networkx scipy scikit-learn h5py tensorboard
pip install --no-index torch-scatter -f https://pytorch-geometric.c... | github_jupyter |
```
import pandas as pd
import scipy.sparse as sparse
from code.preprocessing import Dataset
from core.database.db import DB
from code.metrics import fuzzy, precision
from implicit.als import AlternatingLeastSquares
db = DB(db='recsys')
from code.preprocessing import filter_old_cards, filter_rare_cards, filter_rare_g... | github_jupyter |
# Assumptions of Linear Regression
Previously, we learned to apply linear regression on a given dataset. But it is important to note that Linear Regression have some assumptions related to the data on which it is applied and if they are not followed, it can affect its performance. These assumptions are:
1. There shou... | github_jupyter |
# Making Faces Using an Autoencoder
Autoencoders learn to compress data into a smaller frame and then reconstruct that data from that frame. When a computer encodes data this way, it is basically simplifying the data into what features it finds to be the most useful. This notebook will train an autoencoder on faces, t... | github_jupyter |
# Compute the iron sediment forcing (`fedsedflux`) supplied to the model
This notebook implements an approach to computing `fesedflux` originally in an IDL routine by J. K. Moore.
`fesedflux` includes two components:
- `fesedflux_oxic`: a constant low background value; increased in regions of high bottom horizontal c... | github_jupyter |
```
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
```
##################################################################################################################################################################################################... | github_jupyter |
# Median Combination Pedagogy
### Week of 3.29.2018
```
# python 2/3 compatibility
from __future__ import print_function
# numerical python
import numpy as np
# file management tools
import glob
import os
# good module for timing tests
import time
# plotting stuff
import matplotlib.pyplot as plt
import matplotlib.... | github_jupyter |
<a href="https://colab.research.google.com/github/ybex/CustomModules/blob/master/amld2022_forecasting_meta_learning.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# AMLD 2022 Forecasting & Meta Learning Workshop
In this notebook, we will get our h... | github_jupyter |
# How to search the IOOS CSW catalog with Python tools
This notebook demonstrates a how to query a [Catalog Service for the Web (CSW)](https://en.wikipedia.org/wiki/Catalog_Service_for_the_Web), like the IOOS Catalog, and to parse its results into endpoints that can be used to access the data.
```
import os
import s... | github_jupyter |
# Creating an agent
This notebook will go through the how to create a new agent within the tomsup framework. In this tutorial we will be making an reversed win-stay, lose-switch agent, e.g. an win-switch, lose-stay agent.
This guides assumes a basic understanding of classes in python, if you don't know these or need t... | github_jupyter |
<a href="https://colab.research.google.com/github/Muzzamal-Hameed/Deep-Learning-Models/blob/main/tennis_ball_detection.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/gdrive')
! mkdir ~/.kaggl... | github_jupyter |
```
%matplotlib inline
import warnings
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import gridspec
warnings.filterwarnings('ignore')
```
# Introduction to Pulsar Timing
[](http://mybinder.org/repo/matteobachetti/timing-lectures)
<img src="0737.png" alt... | github_jupyter |
<a href="https://colab.research.google.com/github/jeongukjae/distilkobert-sentence-encoder/blob/main/klue_roberta_kornli_simcse_tpu.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Train supervised SimCSE on KorNLI dataset using KLUE-RoBERTa large
... | github_jupyter |
# 과제1, 바텀듀오의 티어
## 라이브러리, 데이터 로드
```
import requests
import json
import pandas as pd
import numpy as np
from pandas.io.json import json_normalize
import warnings
warnings.filterwarnings(action='ignore')
from sklearn.preprocessing import StandardScaler,MinMaxScaler
from sklearn.cluster import KMeans
import matplotl... | 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 |
```
try:
import tinygp
except ImportError:
%pip install -q tinygp
try:
import george
except ImportError:
%pip install -q george
from jax.config import config
config.update("jax_enable_x64", True)
```
(george)=
# Comparison With george
One of the `tinygp` design decisions was to provide a high-leve... | github_jupyter |
# Make realistic spectra
Make our generated data look more like real data
```
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
module_path = os.path.abspath(os.path.join('../..'))
if module_path not in sys.path:
sys.path.append(... | github_jupyter |
<a href="https://colab.research.google.com/github/lordfiftyfive/Special-Projects/blob/master/JANUSPHASETHREEPOINTTWO.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#!pip install --upgrade tf-nightly tfp-nightly
#!pip uninstall tensorflow
!pip ... | github_jupyter |
### Tutorial in hamiltorch for log probabilities
* For the corresponding blog post please see: https://adamcobb.github.io/journal/hamiltorch.html
* Bayesian neural networks are left to a different notebook
```
#notes for setting by Hyunji
#install
# - git clone the following repo in google drive/Colab Notebook folde... | github_jupyter |
# Learning Virtual Values
In this tutorial, we will extend the ideas from the [previous tutorial](learning-position-auctions.ipynb). We will consider position auctions, like those found in paid search marketplaces, but focus on virtual value transformations rather than payment and allocation networks.
## Motivating ... | github_jupyter |
```
import logging
import pandas as pd
import seaborn as sns
from scipy import stats
import divisivenormalization.utils as helpers
from divisivenormalization.data import Dataset, MonkeySubDataset
helpers.config_ipython()
logging.basicConfig(level=logging.INFO)
sns.set()
sns.set_style("ticks")
# adjust sns paper co... | github_jupyter |
# Talktorial 10
# Binding site similarity and off-target prediction
#### Developed in the CADD seminars 2017 and 2018, AG Volkamer, Charité/FU Berlin
Angelika Szengel, Marvis Sydow and Dominique Sydow
**Note**: Please run this notebook cell by cell. Running all cells in one is possible also, however, a few PyMol i... | github_jupyter |
# Vladislav Abramov and Sergei Garshin DSBA182
## The Task
### Что ждем от туториала?
1. Оценить конкретную модель заданного класса. Не только сделать .fit, но и выписать полученное уравнение!
2. Автоматически подобрать модель (встроенный подбор)
3. Построить графики прогнозов, интервальные прогнозы где есть.
4. Срав... | github_jupyter |
[exercises](intro.ipynb)
```
import numpy as np
np.arange(6)
np.arange(0, 0.6, 0.1), np.arange(6) * 0.1 # two possibilities
np.arange(0.5, 1.1, 0.1), "<-- wrong result!"
np.arange(5, 11) * 0.1, "<-- that's right!"
np.linspace(0, 6, 7)
np.linspace(0, 6, 6, endpoint=False), np.linspace(0, 5, 6) # two possibilities
np.... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
```
## Load data
On connaît l'âge et l'expérience d'une personne, on veut pouvoir déduire si une personne est badass dans son domaine ou non.
```
df = pd.DataFrame({
'Age': [20,16.2,20.2,18.8,18.9,16.7,13.6,20.0,18.0,21.2,
25,3... | github_jupyter |
# Creating Customer Segments
## Introduction
In this project, I analyze a dataset containing data on various customers' annual spending amounts of diverse product categories for internal structure.
The dataset: [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/datasets/Wholesale+customers).
I have ... | github_jupyter |
```
import pandas as pd
from datetime import datetime
import numpy as np
STATUS_LOG_PATH = '../../data/status_log.csv"
TICKETS_PATH = '../../data/tickets.csv"
TICKETS_FOLDER_PATH = '../../data/tickets/"
FAQ_QUESTIONS_PATH = '../../data/FAQ_questions.txt"
DATA_PATH = '../../data/tickets_postprp.pkl'
DE_F... | github_jupyter |
# Lecture 1: Interview Style of FLAG
### Decode Ways
https://leetcode.com/problems/decode-ways/description/
```
class Solution(object):
def numDecodings(self, s):
"""
:type s: str
:rtype: int
"""
n = len(s)
if n == 0 or s[0] == '0':
return 0
fn_... | github_jupyter |
```
data_dir = '../data/'
src_file = 'Head4-Serialized-Def-ELVA.PILOT.POST-TEST.csv'
data_file = 'EN-QA-Head4-Serialized-Def-ELVA.PILOT.POST-TEST.csv'
def_file = 'Questin_ID_Definition.csv'
from qa_serializer_lang_selector import qa_serializer_lang_selector
q = qa_serializer_lang_selector(data_dir)
q.serialize_record... | github_jupyter |
# Speedup Training Using GPUs
In this tutorial, you will learn:
* How to copy graph and feature data to GPU.
* Train a GNN model on GPU.
```
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
import itertools
```
## Copy graph and feature data to GPU
We first load the Zachery's Karate cl... | github_jupyter |
### Introduction
An example of implementing the Metapath2Vec representation learning algorithm using components from the `stellargraph` and `gensim` libraries.
**References**
**1.** Metapath2Vec: Scalable Representation Learning for Heterogeneous Networks. Yuxiao Dong, Nitesh V. Chawla, and Ananthram Swami. ACM SIG... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.