text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# 1. Import libraries ``` #----------------------------Reproducible---------------------------------------------------------------------------------------- import numpy as np import tensorflow as tf import random as rn import os seed=0 os.environ['PYTHONHASHSEED'] = str(seed) np.random.seed(seed) rn.seed(seed) #sess...
github_jupyter
##### Copyright 2020 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
# LAB 5b: Deploy and predict with Keras model on Cloud AI Platform. **Learning Objectives** 1. Setup up the environment 1. Deploy trained Keras model to Cloud AI Platform 1. Online predict from model on Cloud AI Platform 1. Batch predict from model on Cloud AI Platform ## Introduction In this notebook, we'll depl...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt #%matplotlib inline # Leer la data direccion = '.\\data\\data.xlsx' # humedad relativa df_humedad_relativa = pd.read_excel(direccion, sheet_name='Hoja1') # Velocidad del viento df_velocidad_del_viento = pd.read_excel(direccion, sheet_name='Hoja...
github_jupyter
# RadarCOVID-Report ## Data Extraction ``` import datetime import json import logging import os import shutil import tempfile import textwrap import uuid import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np import pandas as pd import pycountry import retry import seaborn as sns %matplotlib in...
github_jupyter
# Advanced Analytics and Machine Learning Overview This notebook offers a basic overview of advanced analytics, some example use cases, and a basic advanced analytics workflow. ## A Short Primer on Advanced Analytics Advanced analytics refers to a variety of techniques aimed at solving the core problem of deriving i...
github_jupyter
![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/work-with-data/dataprep/how-to-guides/column-manipulations.png) # Column Manipulations Copyright (c) Microsoft Corporation. All rights reserved.<br> Licensed under the MIT License.<br> Azure ...
github_jupyter
``` import folium import pandas as pd import geopandas as gpd schools = pd.read_csv('geodata/Education_Directory.csv') schools_hartford = schools [ schools.Town == 'Hartford' ].filter(['School Name', 'Organization Type', 'Location']) # Clean up location coordinates schools_hartford.Location = schools_hartford.Location...
github_jupyter
# Programmation Orientée Objet > Découverte de la notion d'objet - toc: true - badges: true - comments: false - categories: [python, ISN] Objets et POO sont au centre de la manière Python fonctionne. Vous n'êtes pas obligé d'utiliser la POO dans vos programmes - mais comprendre le concept est essentiel pour devenir ...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#What-is-Probability-Theory?" data-toc-modified-id="What-is-Probability-Theory?-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>What is Probability Theory?</a></span><ul class="toc-item"><li><span><a href=...
github_jupyter
``` # Data manipulation import pandas as pd import numpy as np # Data Viz import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline # More Data Preprocessing & Machine Learning from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler, normalize import warni...
github_jupyter
### Dependencies for the Project ``` import pandas as pd from sqlalchemy import create_engine, inspect from db_config import password import psycopg2 ``` ### Importing the CSV file for Behavior and Attitudes ``` file = "./Resources/Behavior_and_Attitudes.csv" Behavior_and_Attitudes= pd.read_csv(file) Behavior_and_At...
github_jupyter
# Batch Normalization – Practice Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a convolutional neural network with 20 convolutional layers, followed by a fully connected layer. We'll use it to classify handwritten digits in the MNIST dataset, which should be f...
github_jupyter
# Figures (Original Submission) ### MSIT Overlay ``` import os from surfer import Brain %matplotlib qt4 fs_dir = '/autofs/space/sophia_002/users/EMOTE-DBS/freesurfs' subj_dir = os.environ["SUBJECTS_DIR"] #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# ### Define parameters #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
github_jupyter
> Texto fornecido sob a Creative Commons Attribution license, CC-BY. Todo o código está disponível sob a FSF-approved BSD-3 license.<br> > (c) Original por Lorena A. Barba, Gilbert F. Forsyth em 2017, traduzido por Felipe N. Schuch em 2020.<br> > [@LorenaABarba](https://twitter.com/LorenaABarba) - [@fschuch](https://tw...
github_jupyter
#### New to Plotly? Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/). <br>You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-fo...
github_jupyter
``` # Dependencies import pandas as pd import numpy as np import matplotlib.pyplot as plt import math import os import sklearn import sklearn.datasets from sklearn.datasets import make_regression from sklearn.ensemble import GradientBoostingClassifier np.set_printoptions(threshold=np.inf) # read in data batting = pd.r...
github_jupyter
# Momentum Trading ``` import time_series_transform as tst import pandas as pd import numpy as np from matplotlib import pyplot as plt from time_series_transform.transform_core_api.util import * from time_series_transform.stock_transform.util import * tickList = [ 'GOOGL' ] pe = tst.Portfolio_Extractor(tickList,'y...
github_jupyter
# Простые способы работы с типами Несколько встроенных функций: ``` print(callable(lambda: 1)) print(isinstance("abc", str)) print(issubclass(ValueError, Exception)) ``` И всякие магические атрибуты (https://docs.python.org/3/library/inspect.html): <table class="docutils align-default"> <colgroup> <col style="width...
github_jupyter
## 1. Setup ``` import sys sys.path.append('../..') import config import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import warnings from neural_networks.unet import UNet from neural_networks.net_utils import predict_density_maps_and_get_counts from utils.data.data_generator import DataG...
github_jupyter
# Converting Surfer Atlas .BNA (ASCII DAT) file to a Vector Layer We have an ASCII file from Surfer in the [BNA format](http://surferhelp.goldensoftware.com/subsys/subsys_gsibna_hid_gsibna_filedesc.htm) defining every building ground plan as a polygon by listing its vertices. Hence the entry for a given building is t...
github_jupyter
``` import json from adabas.api import * from adabas.datamap import * from datetime import date mask_date = lambda data, mask='%d-%m-%Y': date.fromordinal(int(data)-364).strftime(mask) #campo elementar de um grupo periódico ou campo elementar múltiplo def get_periodic(isn = 0 # isn a ser pesquisado ,g...
github_jupyter
``` import numpy as np ``` #### In this lab, we will implement the perceptron algorithm for a single layer. ![Perceptron Algorithm](pcn.png) ``` # Let's implement the algorithm on the AND logic function a = np.array([[0,0,0],[0,1,0],[1,0,0],[1,1,1]]) # AND logic table a # This is the input inputs = a[:,:2] inputs...
github_jupyter
# Deep Learning on IBM Stocks ## The Data We choose to analyse IBM history stock data which include about 13K records from the last 54 years. [From the year 1962 to this day] Each record contains: - Open price: The price in which the market in that month started at. - Close price: The price in which the market in t...
github_jupyter
# Upper bound estimate cases by region (Local Authority) This is a back-of-the envelope calculation - taking ratios from the Imperial College report and applying them directly to regional demographics in the UK. Assumes uniform infection ratio, no time dimension included here. Ratios taken from table 1 in Imperial C...
github_jupyter
## Softmax regression in plain Python Softmax regression, also called multinomial logistic regression extends [logistic regression](logistic_regression.ipynb) to multiple classes. **Given:** - dataset $\{(\boldsymbol{x}^{(1)}, y^{(1)}), ..., (\boldsymbol{x}^{(m)}, y^{(m)})\}$ - with $\boldsymbol{x}^{(i)}$ being a $...
github_jupyter
``` import glob import os python = '/g/data/e14/dbi599/miniconda3/envs/cmip/bin/python' mom_script = '/home/599/dbi599/ocean-analysis/data_processing/mom_to_cmip.py' arith_script = '/home/599/dbi599/ocean-analysis/data_processing/calc_arithmetic.py' # Control files, ocean 3D variables variables = [('temp', 'bigthetao'...
github_jupyter
<a href="https://colab.research.google.com/github/xSakix/AI_colab_notebooks/blob/master/imdb_2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # IMDB DNN Lets do the IMDB dataset with a simple DNN. The first one is in numpy and second will be done ...
github_jupyter
``` import keras keras.__version__ ``` # Classifying newswires: a multi-class classification example This notebook contains the code samples found in Chapter 3, Section 5 of [Deep Learning with Python](https://www.manning.com/books/deep-learning-with-python?a_aid=keras&a_bid=76564dff). Note that the original text fea...
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
## Neural networks for segmentation ``` ! wget https://www.dropbox.com/s/jy34yowcf85ydba/data.zip?dl=0 -O data.zip ! unzip -q data.zip ``` Your next task is to train neural network to segment cells edges. Here is an example of input data with corresponding ground truth: ``` import scipy as sp import scipy.misc impo...
github_jupyter
## 1. Get and Set Azure Credentials ``` !az login !az ad sp create-for-rbac --sdk-auth > mycredentials.json import os, json with open('mycredentials.json') as data_file: azure_session = json.load(data_file) # delete credentials file os.remove("mycredentials.json") ``` ## 2. Create Azure Resource Manager Clien...
github_jupyter
# dataframe of glycan images Lazily create a dataframe containing the images for all the glycans in array v 5.0. This may be usefulfor analysis later. ``` %reset -f ## import all required dependencies # standard imports import urllib2 import os import sys import json import StringIO import pickle # dataframe and num...
github_jupyter
# VIB: Theory **Notation** * $x$ be our input source, * $y$ be our target * $z$ be our latent representation ### Mutual Information Mutual information (MI) measures the amount of information obtained about one random variable after observing another random variable. Formally given two random variables $x$ and $y$ wit...
github_jupyter
# US Air Freight and Waterway Volumes --- A look at air and domestic waterway freight volumes, according to the US DOT Bureau of Transportation Statistics. ``` import pandas as pd import altair as alt from os import environ import re if environ.get("GITHUB_WORKFLOW"): raise RuntimeError("Requires manual updates...
github_jupyter
Fast Proportional Selection === [RETWEET] Proportional selection -- or, roulette wheel selection -- comes up frequently when developing agent-based models. Based on the code I have read over the years, researchers tend to write proportional selection as either a linear walk or a bisecting search. I compare the two ap...
github_jupyter
# INFO 3402 – Class 16: Missing data exercise [Brian C. Keegan, Ph.D.](http://brianckeegan.com/) [Assistant Professor, Department of Information Science](https://www.colorado.edu/cmci/people/information-science/brian-c-keegan) University of Colorado Boulder Copyright and distributed under an [MIT License](https...
github_jupyter
# NLP HW3 Name : Thamme Gowda USCID : 2074-6694-39 ``` from itertools import chain import nltk import pycrfsuite as crf import os, sys, glob, csv from collections import namedtuple import pandas as pd import numpy as np from collections import defaultdict as ddict beep = lambda x: os.system("echo -n '\a';sleep...
github_jupyter
# 通过PYNQ加速OPENCV函数(Sobel算子) 在阅读本部分UserGuide时,请确认已做好以下准备: * 已经按照之前的预备文档安装好依赖环境<br> * 2根HDMI传输线(对输入视频流以及输出视频流进行测试) * 一台支持HDMI的显示器(对输入视频流以及输出视频流进行测试) ## 步骤1:加载cv2pynq库 ``` import cv2pynq as cv2 ``` 在正常运行的情况下,可以看到PYNQ板卡标记为“DONE”的LED闪烁(为加载了bit文件的效果); 这是由于在封装的时候,我们在初始化阶段调用了Overlay方法给PYNQ加载了定制的bit文件: ```python def __i...
github_jupyter
``` import geopandas as gpd gpd.options.use_pygeos=False import os, sys, io from shapely import geometry import numpy as np import matplotlib.pyplot as plt from area import area import requests from functools import partial from shapely.ops import transform,linemerge, unary_union, polygonize from shapely.affinity impor...
github_jupyter
### Prepare Data Install pytorch and torchvision: ```bash conda install pytorch torchvision -c pytorch ``` Download cifar10 data and save to a simple binary file: ``` import torchvision import os, pickle import numpy as np def create_dataset(): trainset = torchvision.datasets.CIFAR10(root='./data', download=True...
github_jupyter
# Workflow Debugging When running complex computations (such as workflows) on complex computing infrastructure (for example HPC clusters), things will go wrong. It is therefore important to understand how to detect and debug issues as they appear. The good news is that Pegasus is doing a good job with the detection pa...
github_jupyter
# Character level language model - Dinosaurus Island Welcome to Dinosaurus Island! 65 million years ago, dinosaurs existed, and in this assignment they are back. You are in charge of a special task. Leading biology researchers are creating new breeds of dinosaurs and bringing them to life on earth, and your job is to ...
github_jupyter
# pyHook ``` #-*- coding:utf8 -*- from ctypes import * import pythoncom import pyHook import win32clipboard user32 = windll.user32 kernel32 = windll.kernel32 psapi = windll.psapi current_window = None def get_current_process(): # 获取前台窗口句柄 hwnd = user32.GetForeground Window() # 获得进程ID pid = c_ulon...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#Name" data-toc-modified-id="Name-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Name</a></span></li><li><span><a href="#Search" data-toc-modified-id="Search-2"><span class="toc-i...
github_jupyter
<img src="../img/logo_white_bkg_small.png" align="left" /> # Feature Engineering This worksheet covers concepts covered in the first part of the Feature Engineering module. It should take no more than 30-40 minutes to complete. Please raise your hand if you get stuck. ## Import the Libraries For this exercise, we...
github_jupyter
``` # import necessary module %matplotlib inline import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches import seaborn as sns import scipy from array_response import * import itertools from IPython.display import Image from matplotlib.gridspec import GridSpec ``` ### Parameters dec...
github_jupyter
# Tabular data ``` from fastai.gen_doc.nbdoc import * from fastai.tabular.models import * ``` [`tabular`](/tabular.html#tabular) contains all the necessary classes to deal with tabular data, across two modules: - [`tabular.transform`](/tabular.transform.html#tabular.transform): defines the [`TabularTransform`](/tabul...
github_jupyter
# Exercise 2: Markov Chains and Markov Decision Processes (MDP) This exercise deals with the formal handling of Markov chains and Markov decision processes. ## 1) Markov Chain: State Transition The graph shows the last beer problem. The nodes show the states. The arrows define the possible transitions to other sta...
github_jupyter
# Analysis - exp61 - Tuning both MLP and Conv nets. A fuller, all at once, survey of architectures. ``` import os import csv import numpy as np import torch as th import pandas as pd from glob import glob from pprint import pprint import matplotlib import matplotlib.pyplot as plt %matplotlib inline %config InlineB...
github_jupyter
# Skip-gram Word2Vec In this notebook, I'll lead you through using PyTorch to implement the [Word2Vec algorithm](https://en.wikipedia.org/wiki/Word2vec) using the skip-gram architecture. By implementing this, you'll learn about embedding words for use in natural language processing. This will come in handy when dealin...
github_jupyter
<a href="https://colab.research.google.com/github/tiwarylab/State-Predictive-Information-Bottleneck/blob/main/SPIB_Demo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # SPIB Demo 2021 This notebook aims to serve as a simple introduction to the stat...
github_jupyter
``` import time import sys from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver import ActionChains from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.webdriver.support import expecte...
github_jupyter
``` import os import time import numpy as np def load_embeddings(embeddings_path): embeddings = {} with open(embeddings_path, 'r') as file: for line in file: splits = line.split() word = splits[0] coords = np.asarray(splits[1:], dtype='float32') embeddings...
github_jupyter
# Inference from data using different Bayesian Belief Network (BBN) Structures This notebook shows how to apply different BBN structures to the same parameters. The parameters, means and covariances, are estimated from data generated from linear equations. Approximate inference is the performed on each BBN to observed...
github_jupyter
## Check Equilibrium This notebook reads files describing a structure, and the files output by Frame2D after an analysis, and checks that the forces and moments on every node are in equilibrium. It does this in the simplest way possible, using quite different logic than Frame2D, resulting in a higher degree of confide...
github_jupyter
## Annotation analisys (labelling) This notebook is an attempt to compute dynamic statistics of the Superconductor dataset tags and labels. ``` import csv import json import os import sys from difflib import SequenceMatcher from pathlib import Path from sys import argv import pysbd from bs4 import BeautifulSoup, Nav...
github_jupyter
# Autonomous driving - Car detection Welcome to your week 3 programming assignment. You will learn about object detection using the very powerful YOLO model. Many of the ideas in this notebook are described in the two YOLO papers: Redmon et al., 2016 (https://arxiv.org/abs/1506.02640) and Redmon and Farhadi, 2016 (htt...
github_jupyter
# DAPA Evaluation Workshop: Introduction & Documentation ## Introduction Welcome the OGC Testbed 16 DAPA evaluation workshop. With this Jupyter Notebook we (EOX IT Services and the German Aerospace Center - DLR) would like to provide you some introduction material, links to Jupyter Notebooks, and a documentation abou...
github_jupyter
# The Bancor Protocol Based on the whitepaper from: Eyal Hertzog, Guy Benartzi, Galia Benartzi, "The Bancor Protocol" March, 2018 8/22/18 Written for: [Horuspay.io](https://horuspay.io/) By: gunnar pope * github: https://github.com/gunnarpope * email: gunnarpope@gmail.com Forward: This script in intended to explo...
github_jupyter
# Rainbow Charts http://www.binarytribune.com/forex-trading-indicators/rainbow-charts ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import warnings warnings.filterwarnings("ignore") # fix_yahoo_finance is used to fetch data import fix_yahoo_finance as yf yf.pdr_override() # input symbo...
github_jupyter
# Correlation-based gene rankings We compute the correlation coeffients between each gene and each phenotype - we then average across all phenotypes. ``` import gc import h5py import numpy as np import pandas as pd import os import statsmodels.api as sm from scipy import stats from scipy.stats import spearmanr, pearso...
github_jupyter
# Detecting and mitigating age bias on credit decisions The goal of this tutorial is to introduce the basic functionality of AI Fairness 360 to an interested developer who may not have a background in bias detection and mitigation. ### Biases and Machine Learning A machine learning model makes predictions of an outc...
github_jupyter
<div class="contentcontainer med left" style="margin-left: -50px;"> <dl class="dl-horizontal"> <dt>Title</dt> <dd> Scatter Element</dd> <dt>Dependencies</dt> <dd>Bokeh</dd> <dt>Backends</dt> <dd><a href='./Scatter.ipynb'>Bokeh</a></dd> <dd><a href='../matplotlib/Scatter.ipynb'>Matplotlib</a></dd> <dd>...
github_jupyter
# Processing cellpy batch - ica ### `{{cookiecutter.project_name}}::{{cookiecutter.session_id}}` **Experimental-id:** `{{cookiecutter.notebook_name}}` **Short-name:** `{{cookiecutter.session_id}}` **Project:** `{{cookiecutter.project_name}}` **By:** `{{cookiecutter.author_name}}` **Date:** `{{cookiecutter.da...
github_jupyter
# Geospatial operations with Shapely: Round-Trip Reprojection, Affine Transformations, Rasterisation, and Vectorisation Sometimes we want to take a geospatial object and transform it to a new coordinate system, and perhaps translate and rotate it by some amount. We may want to rasterise the object for raster operation...
github_jupyter
``` import sys sys.path.insert(1, 'C:/Users/peter/Desktop/volatility-forecasting/midas') from volatility import GARCH from weights import Beta from base import BaseModel from helper_functions import create_matrix import pandas as pd import numpy as np import time import statsmodels.api as sm def create_sim(sim_num = ...
github_jupyter
Find the markdown blocks that say interaction required! The notebook should take care of the rest! # Import libs ``` import sys import os sys.path.append('..') from eflow.foundation import DataPipeline,DataFrameTypes from eflow.data_analysis import FeatureAnalysis, NullAnalysis from eflow.model_analysis import Classi...
github_jupyter
I visited capetown in 2018. It was my first international travel so the city remains special to me. I would love to go back there one day. Inspired by this, i choose to do a brief weather analysis on it to know the best time to visit. I cannot wait to have a taste of the fine Stellenbosch wine! The goal here is to hav...
github_jupyter
# Descobrindo o algoritmo de valorização do Cartola FC - Parte I ## Explorando o algoritmo de valorização do Cartola. Olá! Este é o primeiro tutorial da série que tentará descobrir o algoritmo de valorização do Cartola FC. Neste primeiro estudo, nós iremos: 1. Avaliar o sistema de valorizção ao longo das rodadas; 2...
github_jupyter
<img width="10%" alt="Naas" src="https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160"/> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/HubSpot_Logo.svg/220px-HubSpot_Logo.svg.png" alt="drawing" width="200" align='left'/> # Hubspot - Send sales brief <a href="https://app.naas.ai/user-r...
github_jupyter
``` from DEVDANmainloop import DEVDANmain, DEVDANmainID from DEVDANbasic import DEVDAN from utilsDEVDAN import dataLoader, plotPerformance import random import numpy as np import torch # random seed control np.random.seed(0) torch.manual_seed(0) random.seed(0) # load data dataStreams = dataLoader('../dataset/hepmass2.m...
github_jupyter
``` import os from typing import List from typing import Tuple import logging FORMAT = "%(asctime)-15s %(message)s" logging.basicConfig(format=FORMAT, level=logging.INFO, datefmt="%Y-%m-%d %H:%M") logger = logging.getLogger(__name__) from collections import defaultdict from collections import Counte...
github_jupyter
``` import xml.etree.cElementTree as ET import pandas as pd filepath ="C:/Users/walid/Desktop/Walid's XML table extraction scratch/testing_download_articles/write_test_els_paper6.xml" tree = ET.ElementTree(filepath) root = tree.getroot() root = ET.fromstring(country_data_as_string) teststring = '<coooo:yessir>' st...
github_jupyter
``` {%custom-css%} ``` {%header%} A Marker identifies a location on a map. By default, a marker uses a standard image. Markers can display custom images using the icon parameter. <h1 class="title1">Table of Contents</h1> * [Create a map with a marker](#marker1) * [Marker animation](#marker2) * [Custom icons](#marke...
github_jupyter
Make the Binary Quadratic Model for sports scheduling problem. Definitions and comments in this code are based on the following paper. Title: **SOLVING LARGE BREAK MINIMIZATION PROBLEMS IN A MIRRORED DOUBLE ROUND-ROBIN TOURNAMENT USING QUANTUM ANNEALING.** (https://arxiv.org/pdf/2110.07239.pdf) Author: - Michiya...
github_jupyter
# Scorey - Scraping, aggregating and assessing technical ability of a candidate based on publicly available sources ## Problem Statement The current interview scenario is biased towards "candidate's performance during the 2 hour interview" and doesn't take other factors into account such as candidate's competit...
github_jupyter
# 0. Magic ``` %load_ext autoreload %autoreload 2 %matplotlib inline ``` # 1. Import ``` import torch from torch import tensor from torch import nn import torch.nn.functional as F from torch.utils import data import matplotlib.pyplot as plt from pathlib import Path from IPython.core.debugger import set_trace from ...
github_jupyter
# Counterfactual with Reinforcement Learning (CFRL) on Adult Census This method is described in [Model-agnostic and Scalable Counterfactual Explanations via Reinforcement Learning](https://arxiv.org/abs/2106.02597) and can generate counterfactual instances for any black-box model. The usual optimization procedure is t...
github_jupyter
``` # default_exp inference.embeddings ``` # Embeddings > AdaptNLP Embeddings Module ``` #hide from nbverbose.showdoc import * from fastcore.test import test_eq from fastcore.xtras import is_listy #export import logging, torch from typing import List, Dict, Union from fastcore.basics import listify from collections i...
github_jupyter
# Multilayer Perceptrons with scikit-learn **XBUS-512: Introduction to AI and Deep Learning** In this exercise, we will see how to build a preliminary neural model using the familiar scikit-learn library. While scikit-learn is not a deep learning library, it does provide basic implementations of the multilayer percep...
github_jupyter
# Evolution of a fan This notebook reproduces the [fan example](https://fastscape-lem.github.io/fastscapelib-fortran/#_fan_f90) provided in the fastscapelib-fortran library. It illustrates continental transport/deposition. ``` import numpy as np import xsimlab as xs import matplotlib.pyplot as plt import fastscape %...
github_jupyter
**Appendix D – Autodiff** _This notebook contains toy implementations of various autodiff techniques, to explain how they works._ # Setup # Introduction Suppose we want to compute the gradients of the function $f(x,y)=x^2y + y + 2$ with regards to the parameters x and y: ``` def f(x,y): return x*x*y + y + 2 ``...
github_jupyter
``` import numpy as np import scipy as sp import pandas as pd import warnings import cython %load_ext Cython from iminuit import Minuit idx = pd.IndexSlice import matplotlib.pyplot as plt %matplotlib inline import clapy import clasim dargs = { 'nCells': 10000, 'mCells': 100, 'GF': 0.95, ...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/1_getting_started_roadmap/5_update_hyperparams/3_training_params/1)%20Update%20number%20of%20epochs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a...
github_jupyter
<a href="https://colab.research.google.com/github/DarekGit/FACES_DNN/blob/master/notebooks/07_03_WIDERFACE_Detectron2_DD_mobilenet_v2_test%2BScript_V2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ###[Spis Treści](https://github.com/DarekGit/FACES...
github_jupyter
``` import networkx as nx import matplotlib.pyplot as plt import warnings from custom import custom_funcs as cf warnings.filterwarnings('ignore') %matplotlib inline %load_ext autoreload %autoreload 2 ``` # Cliques, Triangles and Squares Let's pose a problem: If A knows B and B knows C, would it be probable that A kn...
github_jupyter
``` # Logistic Regression # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Social_Network_Ads.csv') X = dataset.iloc[:, [2, 3]].values y = dataset.iloc[:, 4].values # Splitting the dataset into the Training set and Test set ...
github_jupyter
``` %matplotlib notebook import numpy as np import matplotlib.pyplot as plt import matplotlib.tri as tri from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D import hdbscan from sklearn.datasets import make_blobs from deepART import dataset x, y = make_blobs(n_samples=200, n_features=2, centers=np.array([...
github_jupyter
``` import pandas as pd ``` Gonna try a test of grabbing the ICU beds **Starting with 2019 data for ease of use, I first read in the numeric data. I created new headers because they didn't bother to include them.** ``` num = pd.read_csv('../source/cost_reports/2017/HOSP10FY2017/hosp10_2017_NMRC.CSV', header=None, na...
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
# Extract FVCOM time series from aggregated OPeNDAP endpoints ``` # Plot time series data from FVCOM model from list of lon,lat locations # (uses the nearest point, no interpolation) %matplotlib inline import numpy as np import matplotlib.pyplot as plt import netCDF4 import datetime as dt import pandas as pd from Stri...
github_jupyter
<table width="100%"> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="..\images\qworld.jpg" width="35%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared by Abuzer Yak...
github_jupyter
# EventVestor: CEO Changes In this notebook, we'll take a look at EventVestor's *CEO Changes* dataset, available on the [Quantopian Store](https://www.quantopian.com/store). This dataset spans January 01, 2007 through the current day. ### Blaze Before we dig into the data, we want to tell you about how you generally...
github_jupyter
<a href="https://colab.research.google.com/github/charlesreid1/deep-learning-genomics/blob/master/keras_sklearn_cnn1d_dna_transcription_logx.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Keras and Sklearn for Deep Learning Genomics ## Variation...
github_jupyter
# Dictionaries We've been learning about *sequences* in Python but now we're going to switch gears and learn about *mappings* in Python. If you're familiar with other languages you can think of these Dictionaries as hash tables. This section will serve as a brief introduction to dictionaries and consist of: 1.)...
github_jupyter
``` import cartopy.crs as ccrs import cosima_cookbook as cc import cartopy.feature as cfeature from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER import cmocean as cm from dask.distributed import Client import matplotlib.path as mpath import matplotlib.pyplot as plt import numpy as np import xarr...
github_jupyter
# Weight Initialization In this lesson, you'll learn how to find good initial weights for a neural network. Weight initialization happens once, when a model is created and before it trains. Having good initial weights can place the neural network close to the optimal solution. This allows the neural network to come to ...
github_jupyter
## CGM Coordinates Convert station coordinates from latitude and longitude to altitude adjusted corrected geomagnetic coordinates. This is written as a notebook instead of apart of utils.py as it requires IGRF12 and AACGMv2 which can be tricky to install (at least in windows). - cgm lat - cmg lon - mlt at 0 UT - dec...
github_jupyter
``` import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.model_selection import train_test_split from tensorflow.keras.layers import Conv2D,Flatten,MaxPool2D,BatchNormalization,GlobalAveragePooling2D, Dense, Dropout from tensorflow.keras.callbac...
github_jupyter