text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Playground 4: Segmentation workflows for curvi-linear structures This notebook contains the workflows for Sec61 beta, Tom20 and lamin B1 (mitosis-specific), and serves as a starting point for developing a classic segmentation workflow for your data with curvilinear shapes. ---------------------------------------- ...
github_jupyter
# Clustering Categorical Peoples Interests - Random Forest Welcome to this project, the codes was created by Benyamin Dariadi. This project uses a dataset from kaggle. All of the datasets are come from this [link](https://www.kaggle.com/rainbowgirl/clustering-categorical-peoples-interests) Description The datasets ...
github_jupyter
# Idle tomography This tutorial demonstrates how to run idle tomography on a multi-qubits system. Idle tomography is a protocol which characterizes the errors present in an idle operation using data from a small number of intuitive circuits. If $\tilde{I}$ is the noisy idle operation being characterized and we write ...
github_jupyter
## AirBnB Seattle Analysis with CRISP-DM (Cross Industry Standard Process for Data Mining) A brief analysis example using CRISP-DM methodology. This methodology suggest a data analysis in the following steps: * Business Understanding * Data understanding * Data Preparation * Modeling * Evaluation * Deployment ### B...
github_jupyter
``` # import the necessary packages import matplotlib.pyplot as plt from imutils import paths import numpy as np import argparse import imutils import pickle import cv2 import os from sklearn.preprocessing import LabelEncoder from sklearn.svm import SVC from imutils.video import VideoStream from imutils.video import FP...
github_jupyter
# Visualizacion del Coronavirus (COVID19) Mundial con plotly por: Jose R. Zapata - https://joserzapata.github.io/ Link: https://joserzapata.github.io/post/covid19-visualizacion/ He visto en las redes sociales varias visualizaciones de los datos del COVID 19 y queria realizarlos en Python para tener la actualizacion ...
github_jupyter
This is a companion notebook for the book [Deep Learning with Python, Second Edition](https://www.manning.com/books/deep-learning-with-python-second-edition?a_aid=keras&a_bid=76564dff). For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, fig...
github_jupyter
``` import pandas as pd import numpy as np data = pd.read_csv('/home/kirill/Desktop/regex_by_comm.csv') data.head() ``` Уникальных тегов: ``` data['tag'].nunique() ``` Размер: ``` data['tag'].shape from collections import Counter from tqdm import tqdm data = data.drop(columns='Unnamed: 0', axis=1) ``` Убираем данн...
github_jupyter
# T81-558: Applications of Deep Neural Networks **Module 2: Python for Machine Learning** * Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), School of Engineering and Applied Science, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx) * For more information vi...
github_jupyter
``` #!pip install -e .. --upgrade from pyjsg.validate_json import JSGPython ``` # JSG Syntax The names of the various components defined in [Introducing JSON](https://json.org/) are referenced in ***bold italics*** in the document below. Example: A member definition defines the ***string***/***value*** pairs that may...
github_jupyter
``` # export import traitlets import time import json import base64 import ipyvuetify import ipywidgets import pandas as pd from markdown import markdown import ipyvuetify as v from nbdev.imports import * from vvapp.outputs import * from vvapp.inputs import * # default_exp app_templates #hide from nbdev.showdoc import ...
github_jupyter
**Chapter 4 – Training Models** _This notebook contains all the sample code and solutions to the exercises in chapter 4._ <table align="left"> <td> <a href="https://colab.research.google.com/github/ageron/handson-ml3/blob/main/04_training_linear_models.ipynb" target="_parent"><img src="https://colab.research.go...
github_jupyter
# Labelling Pipeline (Label & Tag) ### Interactive Audio Annotation Tool ``` import librosa import ipywidgets from IPython.display import display, Audio import matplotlib.pyplot as plt import pandas as pd import glob, os import matplotlib.gridspec as gridspec import numpy as np import re os.chdir('/home/abdullah/aveng...
github_jupyter
# this note book will demonstrate how to simulate diffraction pattern ``` import numpy as np import matplotlib.pyplot as plt import pickle import os # customized module import hexomap from hexomap import reconstruction # g-force caller from hexomap import MicFileTool # io for reconstruction rst from hexomap impor...
github_jupyter
- Import package ``` from sklearn.model_selection import GridSearchCV, train_test_split from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklearn.neighbors import KNeighborsClassifier from sklearn.linear_model import LogisticRegression from sklearn.tree import De...
github_jupyter
# Trabalhando com RDDs de pares chave/valor #### [Baseado em "Introduction to Spark with Python, by Jose A. Dianes"](https://github.com/jadianes/spark-py-notebooks) O Spark fornece funções específicas para lidar com RDDs cujos elementos são pares de chave/valor. Eles geralmente são usados para realizar agregações e o...
github_jupyter
<h2>--- Day 5: Hydrothermal Venture ---</h2> [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/oddrationale/AdventOfCode2021FSharp/main?urlpath=lab%2Ftree%2FDay05.ipynb) <p>You come across a field of <a href="https://en.wikipedia.org/wiki/Hydrothermal_vent" target="_blank">hydrothermal vents...
github_jupyter
``` import sys sys.path.append('../') import numpy as np from bareml.supervised.linear_regression import LassoRegression from bareml.utils.metrics import rmse from bareml.utils.validation import train_test_split, KFold from sklearn.linear_model import Ridge, Lasso, ElasticNet from sklearn.datasets import load_boston...
github_jupyter
## 1. Welcome to the world of data science <p>Throughout the world of data science, there are many languages and tools that can be used to complete a given task. While you are often able to use whichever tool you prefer, it is often important for analysts to work with similar platforms so that they can share their code...
github_jupyter
# Hello World! Here's an example notebook with some documentation on how to access CMIP data. ``` %matplotlib inline import xarray as xr import intake # util.py is in the local directory # it contains code that is common across project notebooks # or routines that are too extensive and might otherwise clutter # the...
github_jupyter
**Chapter 15 – Processing Sequences Using RNNs and CNNs** _This notebook contains all the sample code in chapter 15._ <table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/ageron/handson-ml2/blob/master/15_processing_sequences_using_rnns_and_cnns.ipynb"><img src="https://ww...
github_jupyter
# Simple Evolutionary Exploration Walkthrough This notebook contains instructions on how to use the SEE module, along with several examples. These instructions will cover the following parts: * [Import Image Files](#Import_Image_Files) * [Manual Search](#Manual_Search) * [Genetic Algorithm Search](#Genetic_Algorithm...
github_jupyter
``` %load_ext autoreload %autoreload 2 ``` # SED for Trappist-1 This notebook executes the lines of code presented in Filippazzo et al. (submitted to PASP). Below I generate and analyze an SED for the M8 dwarfs Trappist-1 and Gl 752B. Then I create a catalog of SEDs for analysis. ``` # Imports from astropy import uni...
github_jupyter
## Probabilistic Discriminative Models ### Multinomial Distribution Before getting into Softmax regression, we need to define what is a nultinomial distribution. A discrete random variable is said to have a multinomial distribution when it have multiple levels instead of 2 levels as was the case in binomial distributio...
github_jupyter
# Code Coverage In the [previous chapter](Fuzzer.ipynb), we introduced _basic fuzzing_ – that is, generating random inputs to test programs. How do we measure the effectiveness of these tests? One way would be to check the number (and seriousness) of bugs found; but if bugs are scarce, we need a _proxy for the likel...
github_jupyter
# Linear regression ``` import tensorflow as tf print(tf.__version__) ``` ### This is new chapter ``` %matplotlib inline import matplotlib.pyplot as plt from tensorflow.keras import Model ``` Let's create noisy data (100 points) in form of `m * X + b = Y`: ``` def make_noisy_data(w=0.1, b=0.3, n=100): x = tf.r...
github_jupyter
We are going to run the entire network on GRWL Tile and then use USGS width data for validation. This provides another avenue for validation. This mirrors the notebook for GRWL validation. ``` import rasterio import matplotlib.pyplot as plt import numpy as np from pathlib import Path import pyproj import geopandas as ...
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
``` %pylab inline ``` # General ``` import json import requests ``` ### Helper methods ``` import time def get_unix_time_minus_days(subtract_days): return int(time.time())-(86400*subtract_days) def parse_unix_date(posix_time): return datetime.datetime.utcfromtimestamp(posix_time).strftime('%Y-%m-%dT%H:%M:...
github_jupyter
``` import pandas as pds import numpy as np from pandasql import sqldf pysqldf = lambda q: sqldf(q, globals()) # define pysqldf function for queries ``` ## Load MIxS 5 enviromental package data ``` df = pds.read_excel("data/mixs_v5.xlsx", sheet_name="environmental_packages") df.head() ``` ### Find distinct terms an...
github_jupyter
# Introduction This is a basic example of using TOAST interactively for LiteBIRD simulations. This uses an extra package to help displaying things in the notebook. You can install that with `pip install wurlitzer` and restart this notebook kernel. ``` # Built-in modules import sys import os from datetime import dat...
github_jupyter
``` from itertools import combinations from collections import defaultdict import numba import pandas as pd import json ``` # Hand Ratings This notebook calculates and outputs a rating for each subset of cards in a cribbage hand (completely ignoring suit and flushes, which are going to be rare in a 5x5 grid game). W...
github_jupyter
# Des succès immédiats Avec les problèmes à suivre, vous serez amenés à mettre en œuvre rapidement les structures de contrôle. ## Un problème capital Mettez en majuscules les mots de la liste grâce à une boucle. ``` words = ["A", "Lannister", "always", "pays", "his", "debts."] ``` ## Ma liste de courses Concevez ...
github_jupyter
## Define the Convolutional Neural Network After you've looked at the data you're working with and, in this case, know the shapes of the images and of the keypoints, you are ready to define a convolutional neural network that can *learn* from this data. In this notebook and in `models.py`, you will: 1. Define a CNN w...
github_jupyter
# Visualizing Periodic Signals Using a River Plot --- ## Learning Goals By the end of this tutorial, you will: - Understand what a river plot is. - Understand when river plots are useful. - Be able to create and interpret a river plot. ## Introduction A "river plot" is a method to visualize periodic signals that v...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns from sklearn.datasets import make_classification X, y = make_classification(n_samples = 2000, n_classes = 2, weights = [1,1], random_state = 1) #no. of rows # no. of...
github_jupyter
# Best Value, Fastest Growth, Most Montentum <img src="../reports/figures/valuation.png" alt="Drawing" width="200"> ``` import pandas as pd import numpy as np import re import matplotlib.pyplot as plt import yfinance as yf from datetime import date, timedelta, datetime as dt from selenium import webdriver from seleni...
github_jupyter
``` from local_vars import root_folder data_folder = r"CirclesA" image_size = 128 batch_size = 50 import time start_time = time.time() import itertools import keras from keras.models import Sequential from keras.layers import Activation, GlobalAveragePooling2D from keras.layers.core import Dense, Dropout, Flatten f...
github_jupyter
<center><h2><strong><font color="blue">Social Network Analysis (SNA)</font></strong></h2></center> <center><h3><strong><font color="blue"><a href="https://taudata.blogspot.com">https://taudata.blogspot.com</a></font></strong></h3></center> <img alt="" src="images/covers/taudata-cover.jpg"/> <center><h2><strong><font ...
github_jupyter
# Detect Prediction Anomalies with Model Monitor Model Monitor captures the input, output and metadata for model predictions. You can continuously analyze and monitor data quality. Based on these notebooks: * https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker_model_monitor/introduction/Sag...
github_jupyter
# Getting Started Guide ## Table of Contents - [Using Coach from the Command Line](#Using-Coach-from-the-Command-Line) - [Using Coach as a Library](#Using-Coach-as-a-Library) - [Preset based - using `CoachInterface`](#Preset-based---using-CoachInterface) - [Training a preset](#Training-a-preset) - ...
github_jupyter
# DSGRN Python Interface Tutorial This notebook shows the basics of manipulating DSGRN with the python interface. ``` import DSGRN ``` ## Network The starting point of the DSGRN analysis is a network specification. We write each node name, a colon, and then a formula specifying how it reacts to its inputs. ``` netwo...
github_jupyter
# Model-Based Reinforcement Learning ## Principle We consider the optimal control problem of an MDP with a **known** reward function $R$ and subject to **unknown deterministic** dynamics $s_{t+1} = f(s_t, a_t)$: $$\max_{(a_0,a_1,\dotsc)} \sum_{t=0}^\infty \gamma^t R(s_t,a_t)$$ In **model-based reinforcement learning...
github_jupyter
``` ''' Adapted from Stanford ADMM Linear SVM code https://web.stanford.edu/~boyd/papers/admm/svm/linear_svm.html ''' import matplotlib.pyplot as plt import cvxpy as cp import numpy as np plt.rcParams.update({ "text.usetex": True, "font.family": "sans-serif", "font.sans-serif": ["Helvetica Neue"], "fon...
github_jupyter
# 2.1 Архитектура HDFS ## HDFS хорошо подходит для - Хранение больших файлов: - Терабайты, петабайты. - Миллионы, но не миллиарды файлов. - Файлы размером от 100 мб. Желательно не хранить маленькие файлы. - Стриминг данных: - Паттерн *write once / read many times*. Лучше не использовать, если данные ча...
github_jupyter
# End to End example to manage lifecycle of ML models deployed on the edge using SageMaker Edge Manager + GreenGrass v2 **SageMaker Studio Kernel**: Data Science ## Contents * Use Case * Workflow * Setup * Building and Deploying the ML Model * Deploy Wind Turbine application to EC2 with Greengrass V2 * Cleanup ## ...
github_jupyter
# Model Evaluation ``` import os import gym import gym_donkeycar import numpy as np import pandas as pd import matplotlib.pyplot as plt import cv2 as cv import time import pickle #import birds_eye_vector_space import basis_my_cv import random from pandas import Series, DataFrame from collections import deque #from ke...
github_jupyter
``` import os import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as plt from torchvision import models import numpy as np ``` ### Load ResNet50 pre-trained model ``` # Download the ResNet50 pre-trained model. resnet50_model = models.resnet50(pret...
github_jupyter
## Final Team BuzzFeed Predictor ### Step 1: Load Data and Clean it up #### A. Features: Clean Null #### B. Target: Normalize - use (freq, Impressions) and max_impressions Use Viral, Non-Viral (Pick -1 Std. Dev. as an arbitrary marker) Try Multiple Classes: 1 Buzz (Bottom quartile), 2 (Middle 50%) Buzz and 3(Top Quar...
github_jupyter
# Deep Q-Network (DQN) --- In this notebook, you will implement a DQN agent with OpenAI Gym's LunarLander-v2 environment. ### 1. Import the Necessary Packages ``` import gym import random import torch import numpy as np from collections import deque import matplotlib.pyplot as plt %matplotlib inline EXPERIMENT_NAME ...
github_jupyter
# Overview This notebook introduces you MONAI's image transformation module. ``` # Copyright 2020 MONAI Consortium # 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/l...
github_jupyter
Import Respository (Replace the Access Token) ``` !git clone https://username:<access_token>@github.com/ganeshh123/cloudGAN.git %cd /content/cloudGAN/ !ls -a -l ``` Install Requirements ``` !pip3 install -r src/requirements.txt ``` Setup ``` #Create env file import os import zipfile import sys from pathlib import ...
github_jupyter
# Experiments with word embeddings In this notebook, we'll have some fun with **<font color="magenta">word embeddings</font>**: distributed representations of words. We'll see how such an embedding can be constructed by applying principal component analysis to a suitably transformed matrix of word co-occurrence prob...
github_jupyter
# Navigation MDP [1] ``` import numpy as np from simple_rl.tasks import NavigationMDP from simple_rl.agents import QLearningAgent from simple_rl.planning import ValueIteration from simple_rl.tasks.grid_world.GridWorldStateClass import GridWorldState %matplotlib inline %load_ext autoreload %autoreload 2 np.random.seed...
github_jupyter
## 1. Sex is included; we need to update in .py ## 2. How about changing CHILDREN_COUNT to NUM_CHILDREN? ## 3. ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline HOUSEHOLD_ID = 'hhid' HOUSEHOLD_SIZE = 'hhsize' VEHICLE_COUNT = 'vehicle_count' CHILDREN_COUNT = 'numchildren' ...
github_jupyter
<a href="https://colab.research.google.com/github/JoshStrong/MAML/blob/master/CIFAR_FS_maml.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !pip install learn2learn import random import numpy as np import torch from torch import nn, optim impo...
github_jupyter
<a href="https://colab.research.google.com/github/mrdbourke/pytorch-deep-learning/blob/main/08_pytorch_paper_replicating.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # (WIP) 08. PyTorch Paper Replicating Want to recreate ViT paper: "An Image is ...
github_jupyter
# Tutorial 1.4. Introduction to Statistical Quantities in Wind Engineering ## Part 2: Extreme Value analysis ### Description: Tools for extreme values statistics are addressed with computations demonstrated for the generated signal in Part 1. Some additional exercises are proposed for individual studies. #### Studen...
github_jupyter
Wayne Nixalo - 1 Jul 2017 RNN practice in Theano -- 4th attempt Implementing dimensionality for context idea. ## Theano RNN ``` import theano import os, sys sys.path.insert(1, os.path.join('../utils')) from utils import * # from __future__ import division, print_functions path = get_file('nietzsche.txt', origin="ht...
github_jupyter
``` # This code is for adaptive GPU usage import keras.backend as K cfg = K.tf.ConfigProto() cfg.gpu_options.allow_growth = True K.set_session(K.tf.Session(config=cfg)) import datetime import pandas as pd import numpy as np ``` # Creating the Weekly DataFrame ``` def addWeek(df): # Creating Last Date Column l...
github_jupyter
<a href="http://landlab.github.io"><img style="float: left" src="../../../landlab_header.png"></a> # Quantifying river channel evolution with Landlab These exercises are based on a project orginally designed by Kelin Whipple at Arizona State University. This notebook was created by Nicole Gasparini at Tulane Universit...
github_jupyter
``` # -*- coding: utf-8 -*- import urllib2 import re import string import operator #剔除常用字函数 def isCommon(ngram): commonWords = ["the", "be", "and", "of", "a", "in", "to", "have", "it", "i", "that", "for", "you", "he", "with", "on", "do", "say", "this", "they", "is", "an", "at...
github_jupyter
# Chapter 04 -- Pandas, Part 1 <h2 id="Topics-covered:">Topics covered:</h2> <ul> <li><a href="http://nbviewer.jupyter.org/github/RandyBetancourt/PythonForSASUsers/blob/master/Chapter%2004%20--%20Pandas%2C%20Part%201.ipynb#Importing-Packages" target="_blank">Importing Packages</a></li> <li><a href="http://nbviewer....
github_jupyter
``` %pylab inline import os, time DATAFOLDER = '/home/d/Dropbox/TRAKODATA/qfib-data/' QFIB = '/home/d/Projects/qfib/qfib' point1 = np.array([1,2,3]) point2 = np.array([2,3,4]) np.linalg.norm(point1[0:3]-point2[0:3]) np.linalg.norm(point1[0]-point2[0]) np.linalg.norm(point1[1]-point2[1]) np.linalg.norm(point1[2]-point2[...
github_jupyter
``` import numpy as np import pandas as pd import time from matplotlib import pyplot as plt %matplotlib inline # from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import StratifiedKFold # from sklearn.model_selection import LeaveOneOut from sklearn.linear_model import LogisticRegression ...
github_jupyter
# Feature Selection O objetivo da seleção de recursos é duplo: queremos melhorar a eficiência computacional e reduzir o erro de generalização do modelo removendo recursos irrelevantes ou ruído. Esse tipo de abordagem é especialmente importante quando não estamos utilizando uma regularização forte. ## Benchmark ``` f...
github_jupyter
# The Image Classification Dataset :label:`sec_fashion_mnist` (~~The MNIST dataset is one of the widely used dataset for image classification, while it's too simple as a benchmark dataset. We will use the similar, but more complex Fashion-MNIST dataset~~) One of the widely used dataset for image classification is the...
github_jupyter
# Political Organizations Activity on Wikipedia aggregated by Party The parameters in the cell below can be adjusted to explore other political parties and time frames. ### How to explore other political parties? The ***organization*** parameter can be use to aggregate organizations by their party. The column `subcat...
github_jupyter
``` import os import sys import glob import pickle import itertools import random from IPython.display import Image import matplotlib import matplotlib.pyplot as plt import matplotlib.mlab as mlab from matplotlib.colors import ListedColormap from sklearn.metrics import confusion_matrix from sklearn.manifold import TS...
github_jupyter
# Example: Regenerating Data from # [J.T. Gostick et al. / JPS 173 (2007) 277–290](http://www.sciencedirect.com/science/article/pii/S0378775307009056) ## Getting Started In this tutorial, we will regenerate data from J.T. Gostick's 2007 paper [[1]](http://www.sciencedirect.com/science/article/pii/S0378775307009056). ...
github_jupyter
# Ground-State: Heisenberg model Author: Giuseppe Carleo and Filippo Vicentini (EPFL-CQSL) The goal of this tutorial is to review various neural network architectures available in NetKet, in order to learn the ground-state of a paradigmatic spin model: the spin-$1/2$ Heisenberg antiferromagnetic chain. The Hamiltoni...
github_jupyter
# 使用 Spotpy 根据[spotpy](https://github.com/thouska/spotpy)的介绍,它是一个支持模型率定及不确定性和灵敏度分析中优化技术的python框架,其简单性和灵活性使得无需复杂的代码就可以针对各类模型使用各种算法。 这里主要结合实例介绍其中水文领域经常用到的一个优化算法 SCE-UA的使用,后面再根据实际使用情况更新补充。 因为本文主要以SCE-UA为例,所以不必须贝叶斯推断相关知识,不过如果想要进一步使用 spotpy,必要的知识背景是不可少的,下面介绍框架也有一些术语涉及到了,可以参考以下资料: - [CamDavidsonPilon/Probabilistic-Progra...
github_jupyter
# Symmetric Encryption **ToDo**: - Add illustration for Symmetric Encryption - Similar to [this](https://miro.medium.com/max/1400/1*mnyITCNnRdeLfauh3Psmlw.png). - Add illustration for authenticated vs non-autenticated encryption. - Explain difference between EtM, E&M and MtE - See [this](https://en.wikipedia.org/wiki/...
github_jupyter
# Evaluation DYMOST OI: This notebook presents the evaluation of the SSH reconstructions based on the DYMOST OI ([Ubelmann et al., 2016](https://journals.ametsoc.org/view/journals/atot/33/8/jtech-d-15-0163_1.xml), [Ballarotta et al., 2020](https://journals.ametsoc.org/view/journals/atot/37/9/jtechD200030.xml)) and pe...
github_jupyter
# Text Classification Text classification is the process of assigning tags or categories to text according to its content. It’s one of the fundamental tasks in natural language processing. The text we wanna classify is given as input to an algorithm, the algorithm will then analyze the text’s content, and then categ...
github_jupyter
## Dependencies ``` import os import cv2 import shutil import random import warnings import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import imgaug as ia from imgaug import augmenters as iaa from albumentations import * from sklearn.utils import class_weight, shuffle from sk...
github_jupyter
Numba 0.44.0 Release Demo ======================= This notebook contains a demonstration of new features present in the 0.44.0 release of Numba. Whilst release notes are produced as part of the [`CHANGE_LOG`](https://github.com/numba/numba/blob/5bffb209e853dc21a44a5bd801c93672404f1fe8/CHANGE_LOG), there's nothing like...
github_jupyter
<!--NAVIGATION--> < [More IPython Resources](01.08-More-IPython-Resources.ipynb) | [Understanding Data Types in Python](02.01-Understanding-Data-Types.ipynb) > # Introduction to NumPy This chapter, along with chapter 3, outlines techniques for effectively loading, storing, and manipulating in-memory data in Python. T...
github_jupyter
# Spiral Problem This document presents a fictitious problem of learning the length of a spiral; The equation of the features $x_1$ and $x_2$ and target is given by: \begin{eqnarray} x_1 &=& \theta \cos(\theta) + \epsilon_1 ~~~~~~ x_2 = \theta \sin(\theta) + \epsilon_2 \\ y &=& \frac{1}{2}\left[ \theta \sqrt{...
github_jupyter
``` import os import codecs from datetime import datetime def join_lines(**kwargs): """ Le o arquivo de entrada, caso algum dos registros tenha quantidade de colunas diferente do cabecalho, a linha seguinte e concatenada com a atual e escrita no arquivo de saida. """ # Log: Mensagem de inicio d...
github_jupyter
``` import gdal, osr import numpy as np from skimage.graph import route_through_array import pandas as pd import matplotlib.pyplot as plt from scipy import stats import os import math from osgeo import ogr import fiona import jenkspy ``` ## For working with rasters The Raster files are converted to numpy array for fu...
github_jupyter
``` from zipline.pipeline import Pipeline from zipline.component.research import run_pipeline from zipline.pipeline.data import USEquityPricing from zipline.pipeline.factors import SimpleMovingAverage ``` ## Filters A Filter is a function from an asset and a moment in time to a boolean: ``` F(asset, timestamp) -> boo...
github_jupyter
``` # This imports the OpenContextAPI from the api.py file in the # opencontext directory. %run '../opencontext/api.py' import numpy as np import pandas as pd oc_api = OpenContextAPI() # Clear old cached records. oc_api.clear_api_cache() # This is a search url for bovid tibias. url = 'https://opencontext.org/subject...
github_jupyter
IMPORTING IMPORTANT MODULES ``` import tensorflow as tf from tensorflow.keras.datasets import fashion_mnist import numpy as np import matplotlib.pyplot as plt import numpy as np from tensorflow.keras import layers import time from tensorflow.keras.models import Sequential, load_model ``` LOADING DATASET ``` (x,_),(...
github_jupyter
#Libraries ``` import pandas as pd import os, sys, time, random import numpy as np from scipy import stats sys.path.append('../') from RASLseqTools import * sys.path.append('../RASLseqTools') import RASLseqAnalysis_STAR import seaborn %pylab inline %matplotlib inline %config InlineBackend.figure_format = 'retina' ``` ...
github_jupyter
# Entity Extraction from old-style SciSpacy NER Models These models identify the entity span in an input sentence, but don't attempt to separately link to an external taxonomy. The following variations are possible here. Replace the `MODEL_NAME, MODEL_ALIAS` line in the cell below and repeat run to extract named entit...
github_jupyter
<a id='HOME'></a> # CHAPTER 6 Oh Oh: Objects and Classes ## 物件與類別 * [6.1 什麼是物件](#Objects) * [6.2 使用class定義類別](#Class) * [6.3 繼承](#Inheritance) * [6.4 覆蓋方法](#Override) * [6.5 添加新方法](#Add) * [6.6 使用super得到父類別支援](#super) * [6.7 self](#self) * [6.8 設置與呼叫特性的屬性](#Attribute) * [6.9 使用名稱重整保持私有性](#Privacy) * [6.10 方法的類別](#Type...
github_jupyter
``` %load_ext autoreload %autoreload 2 import numpy as np import pandas as pd from scipy import signal as sg import sys sys.path.append('..') data_base = '../data/raw/dataIBM' data_exts = '.csv' targ_df = pd.read_csv(data_base+data_exts, header=None).astype('float64') idx = 2 if idx==0: from SpiCoder.Batch import T...
github_jupyter
``` %load_ext autoreload %autoreload 2 %matplotlib inline import os import pickle OMNIGLOT_DATA = os.path.join(os.getcwd(), 'omniglot/') DATASET_DIR = os.path.join(os.getcwd(), 'cluttered_omniglot/') import time import numpy as np import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (12.0, 12.0) import ...
github_jupyter
``` import quantecon as qe import matplotlib.pyplot as plt import matplotlib %matplotlib notebook %matplotlib inline %config InlineBackend.figure_format = 'retina' font = {'weight' : 'medium', 'size' : 13} matplotlib.rc('font', **font) from numba import njit, vectorize, float64 from numpy import sin, cos, sqr...
github_jupyter
# Importing the libraries ``` import pandas as pd import numpy as np import plotly.graph_objects as go import plotly.io as pio pio.renderers.default = "svg" # to make graphs visible on github import datetime as dt from sklearn.preprocessing import MinMaxScaler import tensorflow as tf import tensorflow.keras.layers a...
github_jupyter
# Parse Swedish gigaword XML > "Dataset" - toc: false - branch: master - badges: false - comments: true - categories: [swedish, gigaword, xml] ``` example = """\ <corpus id="1960-0000"> <text date="1965-02-14" datefrom="19650214" dateto="19650214" genre="news" publisher="Stockholms Tidningen " timefrom="000000" time...
github_jupyter
``` import os import torch import torch.nn as nn from datasets import get_ds from cfg import get_cfg from methods import get_method import numpy as np from sklearn.manifold import TSNE import matplotlib.pyplot as plt import matplotlib from eval.get_data import get_data os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.e...
github_jupyter
# Fun with Funnels ### By Alex Frieder ## Introduction Imagine you were just hired by a company that has runs an online marketplace. Their website allows users to sign up for an account, log in to their account, search for products, leave reviews for products, and purchase products. They've hired you because their sa...
github_jupyter
# Movies This notebook was originally authored by Abhijit Dasgupta and was adapted from [Python for Data Analysis](http://shop.oreilly.com/product/0636920023784.do) by Wes McKinney ## Objectives * What are the highest rated movies? * What is the best movie for date night? * Which movies do men and women disagree on ...
github_jupyter
# Non-Negative Matrix Factorization ##### Using NNMF to uncover spatial components of individual player contribution. Heavily inspired by [Justin Jacobs](https://twitter.com/Squared2020) 2018 blog post [Understanding Trends in the NBA: How NNMF Works](https://squared2020.com/2018/10/04/understanding-trends-in-the-nba...
github_jupyter
# Predicting Product Success When Review Data Is Available _**Using XGBoost to Predict Whether Sales will Exceed the "Hit" Threshold**_ --- --- ## Contents 1. [Background](#Background) 1. [Setup](#Setup) 1. [Data](#Data) 1. [Train](#Train) 1. [Host](#Host) 1. [Evaluation](#Evaluation) 1. [Extensions](#Extensions) ...
github_jupyter
<font face="Calibri" size="2"> <i>Open SAR Toolkit - Tutorial 1, version 1.3, July 2020. Andreas Vollrath, ESA/ESRIN phi-lab</i> </font> ![title](https://raw.githubusercontent.com/ESA-PhiLab/OpenSarToolkit/main/docs/source/_images/header_image.PNG) -------- # OST Tutorial I ## Pre-processing your first Sentine...
github_jupyter
# Conditional Probability Activity & Exercise Below is some code to create some fake data on how much stuff people purchase given their age range. It generates 100,000 random "people" and randomly assigns them as being in their 20's, 30's, 40's, 50's, 60's, or 70's. It then assigns a lower probability for young peop...
github_jupyter
# 2D Four-well potential ``` import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d import Axes3D from pydiffmap import diffusion_map as dm %matplotlib inline ``` Load sampled data: discretized Langevin dynamics at temperature T=1, friction 1, and time step size dt=0.01, with double-well poten...
github_jupyter