text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
import trackml
from trackml.dataset import load_event
import sys
import os
sys.path.append('..')
sys.path.append('/global/homes/c/caditi97/exatrkx-iml2020/exatrkx/src/')
sys.path.append('/global/homes/c/caditi97/exatrkx-iml2020/exatrkx/src/tests')
%matplotlib inline
os.environ['TRKXINPUTDIR']="/global/cfs/cdirs/m3... | github_jupyter |
```
import tensorsignatures as ts
%matplotlib inline
from helper import hide_toggle
hide_toggle()
```
# The TensorSignatures CLI
The TensorSignatures CLI comes with six subroutines,
* `boot`: computes bootstrap intervals for a TensorSignature initialisation,
* `data`: simulates mutation count data for a TensorSignat... | github_jupyter |
```
import os
import numpy as np
import cPickle
from sklearn.metrics import roc_curve, auc
import matplotlib.pyplot as plt
import timeit
import sklearn
import cv2
import sys
import glob
sys.path.append('./recognition')
from embedding import Embedding
from menpo.visualize import print_progress
from menpo.visualize.viewm... | github_jupyter |
# Sustainable energy transitions data model
```
import pandas as pd, numpy as np, json, copy, zipfile, random, requests, StringIO
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
from IPython.core.display import Image
Image('favicon.png')
```
## Country and region name converters
```
#coun... | github_jupyter |
# Introduction to Data Science
# Lecture 21: Dimensionality Reduction
*COMP 5360 / MATH 4100, University of Utah, http://datasciencecourse.net/*
In this lecture, we'll discuss
* dimensionality reduction
* Principal Component Analysis (PCA)
* using PCA for visualization
Recommended Reading:
* G. James, D. Witten, T... | github_jupyter |

# Populations of Countries
What are the most and least populated countries in the world?
We are going to use Gapminder data from http://gapm.io/dpop to find out.
First we need to download th... | github_jupyter |
```
import pandas as pd
import numpy as np
from datetime import date, datetime
from dateutil.parser import parse
import matplotlib.pyplot as plt
# Date is up to Nov 6
date_data = pd.read_csv('/Users/liuye/ForPython/Optimal-Cryptocurrency-Trading-Strategies-Step2/Medium_Analysis/Webscrapping/kybermedium.csv')
date_data[... | github_jupyter |
# `Lib-INVENT`: Reinforcement Learning - ROCS + reaction filter
The purpose of this notebook is to illustrate the assembly of a configuration input file containing a ROCS input.
ROCS is a licensed virtual screening software based on similarity between input compounds and a specified reference (or target) molecule. Fo... | github_jupyter |
# This file has Form Recognizer Model trainign and Inferencing code
#### Read configuration file and get endpoint, key of the service
```
########### Python Form Recognizer Labeled Async Train #############
import json
import time
from requests import get, post
#read form recognizer service parameters
with open('con... | github_jupyter |
```
import sys
import os
from glob import glob
import random
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import seaborn as sns
import pysam
import h5py
from joblib import Parallel, delayed
%env KERAS_BACKEND tensorflow
im... | github_jupyter |
# (7) Signal (CPD) Search and Detection Criteria
In Part (6), we learned that any CPDs of interest in the SR 4 disk should be point sources (i.e., their size is $\ll$ the resolution) and could be pretty faint, perhaps comparable to the residuals from the circumstellar disk model. We need to develop a means of quantif... | github_jupyter |
# Demo: How to scrape multiple things from multiple pages
The goal is to scrape info about the **five top-grossing movies** for each year, for 10 years. I want the title and rank of the movie, and also, how much money did it gross at the box office. In the end I will put the scraped data into a CSV file.
```
from bs4... | github_jupyter |
```
import logging
from django.db import models
from utils.merge_model_objects import merge_instances
from fuzzywuzzy import fuzz
from tqdm import tqdm
from collections import Counter
for handler in logging.root.handlers[:]:
logging.root.removeHandler(handler)
logging.basicConfig(level=logging.INFO, format='%(leve... | github_jupyter |
# Add model: translation attention ecoder-decocer over the b3 dataset
```
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchtext import data
import pandas as pd
import unicodedata
import string
import re
import random
import copy
from contra_qa.plots.functions import simp... | github_jupyter |
Random Forests - Data Exploration
===
***
##Introduction
Now we're going to use a large and messy data set from a familiar source object and then prepare it for analysis using Random Forests.
Why do we want to use Random Forests? This will become clear very shortly.
We will use a data set of mobile phone acceleromet... | github_jupyter |
# Train a Medical Specialty Detector on SageMaker Using HuggingFace Transformers.
In this workshop, we will show how you can train an NLP classifier using trainsformers from [HuggingFace](https://huggingface.co/). HuggingFace allows for easily using prebuilt transformers, which you can train for your own use cases.
... | github_jupyter |
```
#r "./../../../../../../public/src/L4-application/BoSSSpad/bin/Release/net5.0/BoSSSpad.dll"
using System;
using ilPSP;
using ilPSP.Utils;
using BoSSS.Platform;
using BoSSS.Foundation;
using BoSSS.Foundation.XDG;
using BoSSS.Foundation.Grid;
using BoSSS.Solution;
using BoSSS.Application.XNSE_Solver;
using BoSSS.Appl... | github_jupyter |
```
import os
import sys
import numpy as np
import pandas as pd
import pysubgroup as ps
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.getcwd())),'sd-4sql\\packages'))
saved_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))),'Data\\saved-data\\')
from sd_analysis import ... | github_jupyter |
# Digit Recognizer - CNN
## Importing Libraries
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from tensorflow import keras
from tensorflow.keras import layers
from keras.utils.np_utils import... | github_jupyter |
```
import pandas as pd
import numpy as np
"""
Hypothesis: Links contain more information about duplicate data. Create a test
exploring whether further investigation is neccessary.
"""
def loadandcleandata(filepath):
"""Upload csv file and remove unneccesary columns for testing."""
# Loading .csv file
d... | github_jupyter |
# 100 pandas puzzles
Inspired by [100 Numpy exerises](https://github.com/rougier/numpy-100), here are 100* short puzzles for testing your knowledge of [pandas'](http://pandas.pydata.org/) power.
Since pandas is a large library with many different specialist features and functions, these excercises focus mainly on the... | github_jupyter |
```
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np
plt.rcParams["figure.dpi"] = 80
def remove_frame():
for spine in plt.gca().spines.values():
spine.set_visible(False)
np.random.seed(111)
# classification
from sklearn.datasets import make_blobs
X, y = make_blobs(centers=3)
... | github_jupyter |
# Quantum Phase Estimation
## Contents
1. [Overview](#overview)
1.1 [Intuition](#intuition)
1.2 [Mathematical Basis](#maths)
2. [Example: T-gate](#example_t_gate)
2.1 [Creating the Circuit](#creating_the_circuit)
2.2 [Results](#results)
3. [Getting More Precision](#getting_more_pre... | github_jupyter |
```
import shp_process
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import geopandas as gpd
import geoplot
from pysal.lib import weights
import networkx as nx
from scipy.spatial import distance
import momepy
import pickle
import math
import sys
import statsmodels.api as sm
mount_path = "/mnt/c... | github_jupyter |
## Dependencies
```
import json, glob
from tweet_utility_scripts import *
from tweet_utility_preprocess_roberta_scripts_aux import *
from transformers import TFRobertaModel, RobertaConfig
from tokenizers import ByteLevelBPETokenizer
from tensorflow.keras import layers
from tensorflow.keras.models import Model
```
# L... | github_jupyter |
```
import matplotlib.pyplot as plt
%matplotlib inline
```
텐서플로우 라이브러리를 임포트 하세요.
텐서플로우에는 MNIST 데이터를 자동으로 로딩해 주는 헬퍼 함수가 있습니다. "MNIST_data" 폴더에 데이터를 다운로드하고 훈련, 검증, 테스트 데이터를 자동으로 읽어 들입니다. `one_hot` 옵션을 설정하면 정답 레이블을 원핫벡터로 바꾸어 줍니다.
```
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_dat... | github_jupyter |
## Dependencies
```
import os
import sys
import cv2
import shutil
import random
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
import multiprocessing as mp
import matplotlib.pyplot as plt
from tensorflow import set_random_seed
from sklearn.utils import class_weight
from sklearn.model_sele... | github_jupyter |
# Welding Example #01: Basics
The goal of this small example is to introduce the main functionalities and interfaces to create and describe a simple welding application using the WelDX package.
## Imports
```
# enable interactive plots on Jupyterlab with ipympl and jupyterlab-matplotlib installed
# %matplotlib widget... | github_jupyter |
```
%load_ext watermark
%watermark -d -u -a 'Andreas Mueller, Kyle Kastner, Sebastian Raschka' -v -p numpy,scipy,matplotlib,scikit-learn
```
# SciPy 2016 Scikit-learn Tutorial
# Cross-Validation and scoring methods
In the previous sections and notebooks, we split our dataset into two parts, a training set and a tes... | github_jupyter |
In this notebook, we,
1. Create a basic stochastic Multi-Armed Bandit (MAB) environment;
2. Create a epsilon-greedy player and an adaptive epsilon-greedy player;
3. Simuate the two party two-party game between the environment and a MAB player.
```
import numpy as np
class MultiArmedBanditEnvironment:
""" Class fo... | github_jupyter |
# Diamond Practice Project
I already did the diamond project on alteryx and now I want to do it again in Python to learn some new features of the statistics and number packages.
What I found fascinating in alteryx is the tool's ability to recognise nominal data and introduce dummy variables for it directly. Back in t... | github_jupyter |
```
import os
import re
import json
import utils
import scipy
import torch
import random
import gensim
import warnings
import numpy as np
import pandas as pd
from tasks import *
from pprint import pprint
from transformers import *
from tqdm.notebook import tqdm
from sklearn.cluster import KMeans
from sklearn.neighbor... | github_jupyter |
<a href="https://colab.research.google.com/github/mrdbourke/tensorflow-deep-learning/blob/main/video_notebooks/05_transfer_learning_in_tensorflow_part_2_fine_tuning_video.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Transfer Learning with Tenso... | github_jupyter |
# 25 TFE exercises
#### 1. Import tensorflow package under the name `tf` and enable eager (★☆☆)
```
import tensorflow as tf
tf.enable_eager_execution()
```
#### 2. Check eager is enabled (★☆☆)
```
tf.executing_eagerly()
```
#### 3. Show number of GPU (★☆☆)
```
tfe = tf.contrib.eager
tfe.num_gpus()
```
#### 4. C... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
!python -m pip install --upgrade --user jax==0.2.8 jaxlib==0.1.59+cuda101 -f https://storage.googleapis.com/jax-releases/jax_releases.html
!git checkout dev;
!git pull
pwd
!python -m setup.py install
from jax.config import config
config.update("jax_debug_nans", True)
config.update... | github_jupyter |
```
# reload packages
%load_ext autoreload
%autoreload 2
```
### Choose GPU
```
%env CUDA_DEVICE_ORDER=PCI_BUS_ID
%env CUDA_VISIBLE_DEVICES=2
import tensorflow as tf
gpu_devices = tf.config.experimental.list_physical_devices('GPU')
if len(gpu_devices)>0:
tf.config.experimental.set_memory_growth(gpu_devices[0], Tr... | github_jupyter |
```
import pandas as pd
import numpy as np
train = pd.read_csv("train.csv")
train.head()
test = pd.read_csv("test.csv")
test.head()
train_id = train["id"]
test_id = test["id"]
train.drop('id', axis=1)
test.drop('id', axis=1)
train["Gender"] = train["Gender"].replace({'Male':0, 'Female':1})
train["Vehicle_Damage"] = tra... | github_jupyter |
```
#Define libraries
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Conv1D, MaxPooling1D, BatchNormalization, Flatten
from sklearn.model_selection import KFold
from keras.utils import multi_gpu_model
#from sklearn.cross_validation import StratifiedKFol... | github_jupyter |
# TP 2 - Régression
## Prédiction des prix de l'immobilier à Boston dans les années 1970
La prédiction du prix de maisons bostoniennes des années 1970, dont les données sont issues de la base *Boston House Prices*, créée par D. Harrison et D.L. Rubinfeld à l'Université de Californie à Irvine (http://archive.ics.uci.e... | 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).*
## Oversampling
[Oversampling](https://en.wikipedia.or... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/MachineLearning/clustering.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" h... | github_jupyter |
```
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
import colour
from colour.plotting import *
import pylab
from pylab import *
from matplotlib import path
from scipy.interpolate import interp1d
from scipy.integrate import simps, trapz
%matplotlib inline
rcPa... | github_jupyter |
```
# !pip install numpy --upgrade
!pip install backoff
!git clone https://github.com/solpaul/fpl-prediction.git
%cd fpl-prediction/
from fpl_predictor.util import *
import pandas as pd
import numpy as np
from tqdm import tqdm
from IPython.display import clear_output
from pathlib import Path
import tensorflow as tf
imp... | github_jupyter |
# Load Packages
```
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
```
# Pseudocode
this code below briefly explains how the whole process works
---------------
```python
data = raw_data()
#assign activity label
prevR... | github_jupyter |
##### Copyright 2018 The TensorFlow Probability Authors.
Licensed under the Apache License, Version 2.0 (the "License");
```
#@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" }
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | github_jupyter |
# Text
This notebook serves as supporting material for topics covered in **Chapter 22 - Natural Language Processing** from the book *Artificial Intelligence: A Modern Approach*. This notebook uses implementations from [text.py](https://github.com/aimacode/aima-python/blob/master/text.py).
```
from text import *
from ... | github_jupyter |
# Environment
In this file an Environment class with three diffrent methodologies is cunstructed to face with our problem. This three types of modeling is helping us for a better ovecome to tackle this issue.
برای مدلسازی مسئله ما ۳ سناریو متفاوت را در ادامه بررسی خواهیم کرد.
سناریوی اول:
در این سناریو، محیط ما که ... | github_jupyter |
```
'''Trains and evaluate a simple MLP
on the Reuters newswire topic classification task.
'''
from __future__ import print_function
import numpy as np
import keras
from keras.datasets import reuters
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.preprocessing.text i... | github_jupyter |
# Compute Hinge Loss (Empirical Risk)
The empirical risk Rn is defined as
Rn(θ)=1nn∑t=1Loss(y(t)−θ⋅x(t))
where (x(t),y(t)) is the tth training exampl
e (and there are n in total), and Loss is some loss function, such as hinge loss.
Recall from a previous lecture that the definition of hinge loss:
Lossh(z)={0if z≥1... | github_jupyter |
<a href="https://colab.research.google.com/github/krakowiakpawel9/neural-network-course/blob/master/03_keras/03_overfitting_underfitting.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
* @author: krakowiakpawel9@gmail.com
* @site: e-smartdata.org
... | github_jupyter |
```
import glob
import xml.etree.ElementTree as ET
import re
class Argument(object):
def __init__(self, id_, start, end, role, text):
self.id_ = id_
self.start = start
self.end = end
self.role = role
self.text = text
def to_string(self):
return "Argument: {id_ = ... | github_jupyter |
# bqplot
`bqplot` is a [Grammar of Graphics](https://www.cs.uic.edu/~wilkinson/TheGrammarOfGraphics/GOG.html) based interactive plotting framework for the Jupyter notebook. The library offers a simple bridge between `Python` and `d3.js` allowing users to quickly and easily build complex GUI's with layered interactions... | github_jupyter |
# Broadcasts
This notebook explains the different types of broadcast available in PyBaMM.
Understanding of the [expression_tree](./expression-tree.ipynb) and [discretisation](../spatial_methods/finite-volumes.ipynb) notebooks is assumed.
```
%pip install pybamm -q # install PyBaMM if it is not installed
import pyb... | github_jupyter |
# MLP GenCode
Wen et al 2019 used DNN to distinguish GenCode mRNA/lncRNA.
Based on K-mer frequencies, K={1,2,3}, they reported 99% accuracy.
Their CNN used 2 Conv2D layers of 32 filters of width 3x3, max pool 2x2, 25% drop, dense 128.
Can we reproduce that with MLP layers instead of CNN?
Extract features as list of K-... | github_jupyter |
```
data_path = '../../../data/3dObjects/sketchpad_repeated/feedback_pilot1_group_data.csv'
D = pd.read_csv(data_path)
# directory & file hierarchy
exp_path = '3dObjects/sketchpad_repeated'
analysis_dir = os.getcwd()
data_dir = os.path.abspath(os.path.join(os.getcwd(),'../../..','data',exp_path))
exp_dir = os.path.absp... | github_jupyter |
```
import json
import re
def load_rhythm_list():
with open("平水韵表.txt", encoding="UTF-8") as file:
rhythm_lines = file.readlines()
rhythm_dict = dict()
for rhythm_line in rhythm_lines:
rhythm_name = re.search(".*(?=[平上去入]声:)", rhythm_line).group()
rhythm_tune = re.search("[平上去入](... | github_jupyter |
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\rightarrow$Run All).
Make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE", as we... | github_jupyter |
# Expected return
By Evgenia "Jenny" Nitishinskaya and Delaney Granizo-Mackenzie
Notebook released under the Creative Commons Attribution 4.0 License.
---
A common way of evaluating a portfolio is computing its expected return, which corresponds to the reward for investing in that portfolio, and the variance of the r... | github_jupyter |
**<p style="font-size: 35px; text-align: center">Ejercicios distribuciones de Probabilidad</p>**
***<center>Miguel Ángel Vélez Guerra</center>***
<hr/>

<hr/>
<hr/>
**<p id="tocheadi... | github_jupyter |
```
import math
import time
import wikionly #script name is wikionly (no summary), class name is wiki
import re as re
import nltk
# nltk.download('wordnet')
from nltk.corpus import wordnet
import math
#Input two Wikipedia articles to compute similarity percentage
class similar:
def __init__(self,text1,text2,verbos... | github_jupyter |
```
!pip install gdown
!gdown https://drive.google.com/uc?id=1TQv6oGf3uySrXGkB4iT__4wgycVadH8F
!gdown https://drive.google.com/uc?id=12-zJnHZaRNlHweeBOk0t2yHbkyvFRsf1
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
#some libraries cause this future warnings when the newer versions will be... | github_jupyter |
# Deploy Detection Model
This notebook provides a basic introduction to deploying a trained model as either an ACI or AKS webservice with AML leveraging the azure_utils and tfod_utils packages in this repo.
Before executing the code please ensure you have a completed experiement with a trained model using either ... | github_jupyter |
## ARK Fund Analysis
- <a href=#Stock/fund-breakdown>Stock/fund breakdown</a>
- <a href=#Current-fund-holdings>Current fund holdings</a>
- <a href=#Change-in-value-during-past-two-sessions>Change in value during past two sessions</a>
- <a href=#Change-in-holdings-during-past-two-sessions>Change in holdings during past... | github_jupyter |
```
import test_module as test #바탕화면에 있는 test_module.py에서 모듈을 가져옴
radius = test.num_input() #test 모듈에 있는 num_input을 가져와라(내가만든겨)
print(test.get_circum(radius))
print(test.get_circle_area(radius))
__name__ #메인 함수인지 확인
if __name__ == '__main__':
print("get_circum(10)")
print("get_circle_area(10)")
#ipynb라 못 읽는 듯
... | github_jupyter |
# Use Case 8: Outliers
When looking at data, we often want to identify outliers, extremely high or low data points. In this use case we will show you how to use the Blacksheep package to find these in the CPTAC data. For more detailed information about the Blacksheep package see [this](https://github.com/ruggleslab/bl... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import freqopttest.util as util
import freqopttest.data as data
import freqopttest.kernel as kernel
import freqopttest.tst as tst
import freqopttest.glo as glo
import sys
# sample source
n = 3000
dim = 10
seed ... | github_jupyter |
```
import dense_correspondence_manipulation.utils.utils as utils
utils.add_dense_correspondence_to_python_path()
from dense_correspondence.training.training import *
import sys
import logging
# utils.set_default_cuda_visible_devices()
utils.set_cuda_visible_devices([0]) # use this to manually set CUDA_VISIBLE_DEVICES... | github_jupyter |
```
import pandas as pd
import numpy as np
import tensorflow as tf
from tfrecorder import TFrecorder
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
%pylab inline
```
# data
```
# Load training and eval data
mnist = tf.contrib.learn.datasets.load_dataset("mnist")
```
# how to write
```
# info ... | github_jupyter |
## Project: Visualizing the Orion Constellation
In this project you are Dr. Jillian Bellovary, a real-life astronomer for the Hayden Planetarium at the American Museum of Natural History. As an astronomer, part of your job is to study the stars. You've recently become interested in the constellation Orion, a collectio... | github_jupyter |
<table> <tr>
<td style="background-color:#ffffff;">
<a href="http://qworld.lu.lv" target="_blank"><img src="../images/qworld.jpg" width="25%" align="left"> </a></td>
<td style="background-color:#ffffff;vertical-align:bottom;text-align:right;">
prepared by <a href="http://abu.lu.... | github_jupyter |
<h2><b> GAME ENVIRONMENT CODE & BASIC FUNCTIONS</b></h2>
```
%matplotlib inline
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
import time
from game import Game
from racing_env import RaceGameEnv
from PIL import Image
from io import BytesIO
from tf_agents.environments import utils
from tf... | github_jupyter |
```
import nltk
import numpy as np
import pprint
import utils as utl
from time import time
from gensim import corpora, models, utils
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.stem.snowball import EnglishStemmer
from tqdm import tqdm
from tqdm import tqdm_notebook as tqdm
author... | github_jupyter |
```
from bids.grabbids import BIDSLayout
from nipype.interfaces.fsl import (BET, ExtractROI, FAST, FLIRT, ImageMaths,
MCFLIRT, SliceTimer, Threshold,Info, ConvertXFM,MotionOutliers)
import nipype.interfaces.fsl as fsl
from nipype.interfaces.afni import Resample
from nipype.interfaces... | github_jupyter |
## API
http://dart.fss.or.kr/api/search.xml?auth=xxxxx 사용
```
# DART Open API 를 사용하기 위해서는 인증키를 사용해야 된다
import requests
auth = 'fa2804dc433cff0900e8107d9c6afd00382f6fd9'
url_temp = 'http://dart.fss.or.kr/api/search.xml?auth={auth}'
url = url.format(auth = auth)
r = requests.get(url)
r.text[:100]
```
## 기업 개황 API ... | github_jupyter |
# Q learner with fictitious play
```
import numpy as np
from engine import RMG
from agent import RandomAgent, IndQLearningAgent, FPLearningAgent, PHCLearningAgent, Level2QAgent, WoLFPHCLearningAgent
N_EXP = 10
r0ss = []
r1ss = []
for n in range(N_EXP):
batch_size = 1
max_steps = 20
gamma = 0.96
# ... | github_jupyter |
```
import matplotlib.pyplot as plt
import pandas as pd
import datetime
import numpy as np
from sklearn.cluster import KMeans
from mpl_toolkits.mplot3d import Axes3D
from importnb import Notebook
with Notebook():
from RFM_model import RFM
from utility import Utility
from data_preprocessing import Data
trans... | github_jupyter |
## Resample data into Healpix
1. Create HEALPix grid
2. Extract data if it is still in a zip file
3. Interpolate from initial points to Healpix grid. Uses linear interpolation
4. Save file
Interpolation possibilities:
1. Interpolate only Temperature, Geopotential and TOA
2. Interpolate all files and save chuncked... | github_jupyter |
# Loading Fake Timeseries Surface Data
This notebook is designed to explore some functionality with loading DataFiles and using Loaders.
This example will require some extra optional libraries, including nibabel and nilearn! Note: while nilearn is not imported, when trying to import SingleConnectivityMeasure, if nile... | github_jupyter |
based on GM @aerdem4 Keras CNN (lofoCNN)
(this is a keras tensorflow so no need to change /.keras/keras.json)
```
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several h... | github_jupyter |
Import All Required Libraries
```
#Code : Imports
import json
import os
from langdetect import detect as detectlang, DetectorFactory
DetectorFactory.seed = 0
#from textblob import TextBlob
import zipfile
import pandas as pd
import seaborn as sns
sns.set(style="darkgrid")
import matplotlib.pyplot as plt
import re
%ma... | github_jupyter |
# Running Azure Cosmos Gremlin
I've built a lot of my own helper functions to make queries and manipulate data. I'll document them here
It isim.
First, I'm only using `nest_asyncio` to run the queries in cells. This is a requirement of how gremlinpython manages requests.
```
import sys
import pandas as pd
sys.pat... | github_jupyter |
# Bahdanau Attention
:label:`sec_seq2seq_attention`
We studied the machine translation
problem in :numref:`sec_seq2seq`,
where we designed
an encoder-decoder architecture based on two RNNs
for sequence to sequence learning.
Specifically,
the RNN encoder
transforms
a variable-length sequence
into a fixed-shape context... | github_jupyter |
<a id="title_ID"></a>
# JWST Pipeline Validation Notebook: calwebb_detector1, ramp_fitting unit tests
<span style="color:red"> **Instruments Affected**</span>: NIRCam, NIRISS, NIRSpec, MIRI, FGS
### Table of Contents
<div style="text-align: left">
<br> [Introduction](#intro)
<br> [JWST Unit Tests](#unit)
<br> ... | github_jupyter |
# Report Notes
## TODO:
* describe how equal sign is calculated in segmenatation part.
* in introduction add note that we assume the reader has a background in theory of neural networks and geometry
## Introduction
With computational resources and storage getting cheaper and cheaper, a window of possibilities opens ... | github_jupyter |
## Creating Landsat Timelapse
**Steps to create a Landsat timelapse:**
1. Pan and zoom to your region of interest.
2. Use the drawing tool to draw a rectangle anywhere on the map.
3. Adjust the parameters (e.g., start year, end year, title) if needed.
4. Check `Upload to imgur.com` if you would like to download the G... | github_jupyter |
##### Copyright 2018 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 |
# MNIST Image Classification with TensorFlow
This notebook demonstrates how to implement a simple linear image model on [MNIST](http://yann.lecun.com/exdb/mnist/) using the [tf.keras API](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/keras). It builds the foundation for this <a href="https://github.com/G... | github_jupyter |
# Indonesian VAT Numbers
## Introduction
The function `clean_id_npwp()` cleans a column containing Indonesian VAT Number (NPWP) strings, and standardizes them in a given format. The function `validate_id_npwp()` validates either a single NPWP strings, a column of NPWP strings or a DataFrame of NPWP strings, returning... | github_jupyter |
# Predicting Whether a Planet Has a Shorter Year than Earth
Using the Open Exoplanet Catalogue database: https://github.com/OpenExoplanetCatalogue/open_exoplanet_catalogue/
## Data License
Copyright (C) 2012 Hanno Rein
Permission is hereby granted, free of charge, to any person obtaining a copy of this database and a... | github_jupyter |
```
"""
You can run either this notebook locally (if you have all the dependencies and a GPU) or on Google Colab.
Instructions for setting up Colab are as follows:
1. Open a new Python 3 notebook.
2. Import this notebook from GitHub (File -> Upload Notebook -> "GITHUB" tab -> copy/paste GitHub URL)
3. Connect to an in... | github_jupyter |
# Diseño de software para cómputo científico
----
## Unidad 1: Decoradores en Python
### Agenda de la Unidad 1
---
- Orientación a objetos.
- **Decoradores**.
### Decoradores en Python
- Permiten cambiar el comportamiento de una función (*sin modificarla*)
- Reusar código fácilmente
<img align="right" width="... | github_jupyter |
# quant-econ Solutions: LQ Control Problems
Solutions for http://quant-econ.net/py/lqcontrol.html
```
%matplotlib inline
```
Common imports for the exercises
```
import numpy as np
import matplotlib.pyplot as plt
from quantecon import LQ
```
## Exercise 1
Here’s one solution
We use some fancy plot commands to ge... | github_jupyter |
```
import pandas as pd
df = pd.read_csv('telco_churn.csv')
df.head()
pd.set_option('display.max_columns', df.shape[1])
df.info()
del df['customerID']
#df['TotalCharges'] = pd.to_numeric(df['TotalCharges'])
df = df.replace(r'^\s+$', 0, regex=True)
df['TotalCharges'] = pd.to_numeric(df['TotalCharges'])
df = pd.get_dummi... | github_jupyter |
**Chapter 18 – Reinforcement Learning**
_This notebook contains all the sample code in chapter 18_.
<table align="left">
<td>
<a target="_blank" href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/18_reinforcement_learning.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_3... | github_jupyter |
```
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import cufflinks as cf
import plotly
import panel as pn
pn.extension()
cf.go_offline()
%matplotlib inline
plt.style.use('ggplot')
```
<img src="../img/logo_white_bkg_small.png" align="right" />
# Worksheet 4 - Data Visua... | github_jupyter |
# Random Clustering test `2018-08-28`
Updated (2018-08-14) Grammar Tester, server `94.130.238.118`
Each line is calculated 1x, parsing metrics tested 1x for each calculation.
The calculation table is shared as 'short_table.txt' in data folder
[http://langlearn.singularitynet.io/data/clustering_2018/Random-Cluster... | github_jupyter |
```
#just the CPU version of FAISS, will have to look deeper on how to get GPU version, but works fast enough for now
!wget https://anaconda.org/pytorch/faiss-cpu/1.2.1/download/linux-64/faiss-cpu-1.2.1-py36_cuda9.0.176_1.tar.bz2
!tar xvjf faiss-cpu-1.2.1-py36_cuda9.0.176_1.tar.bz2
!cp -r lib/python3.6/site-packages... | 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 |
# Operations on word vectors
Welcome to your first assignment of this week!
Because word embeddings are very computionally expensive to train, most ML practitioners will load a pre-trained set of embeddings.
**After this assignment you will be able to:**
- Load pre-trained word vectors, and measure similarity usi... | github_jupyter |
# 10. Programación Orientada a Objetos (POO)
El mundo real (o el mundo natural) está compuesto de objetos. Esos objetos (o entidades) se pueden representar computacionalmente para la creación de aplicaciones de software.
La POO es una técnica o una tecnología que permite simular la realidad con el fin de resolver pro... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.