text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Assignment Q1. Write the Python program to create an instance of an OrderedDict using the given dictionary and sort dictionary during the creation and print members of the dictionary in reverse order? Expected OutputAngola 244. Andorra 376. Algeria 213. Afghanistan 93. Albania 355. In rever...
github_jupyter
# Part 1: Building an Item-Item Recommender If you use Netflix, you will notice that there is a section titled "Because you watched Movie X", which provides recommendations for movies based on a recent movie that you've watched. This is a classic example of an item-item recommendation. In this tutorial, we will gene...
github_jupyter
# 24. Perception **24.1** In the shadow of a tree with a dense, leafy canopy, one sees a number of light spots. Surprisingly, they all appear to be circular. Why? After all, the gaps between the leaves through which the sun shines are not likely to be circular. **24.2** Consider a picture of a white sphere floating i...
github_jupyter
# Introduction This notebooks presents simple **Multi-Layer Perceptron** in Keras model to solve **College Admissions** problem **Contents** * [College Admissions Dataset](#College-Admissions-Dataset) - load and preprocess dataset * [Keras Model](#Keras-Model) - define and train neural net # Imports ``` import num...
github_jupyter
### 2D Stochastic Gaussian Simulation in Python for Engineers and Geoscientists ### with GSLIB's IK3D Program Converted to Python #### Michael Pyrcz, Associate Professor, University of Texas at Austin #### Contacts: [Twitter/@GeostatsGuy](https://twitter.com/geostatsguy) | [GitHub/GeostatsGuy](https://github...
github_jupyter
``` import os import sys import re from pathlib import Path from collections import namedtuple from yaml import load from IPython.display import display, HTML, Markdown import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns # Project level imports from l...
github_jupyter
# HuberRegressor with StandardScaler & QuantileTransformer This Code template is for the regression analysis using a HuberRegressor with feature transformation technique QuantileTransformer and feature rescaling technique StandardScaler ### Required Packages ``` import warnings import numpy as np import pandas as p...
github_jupyter
# (1) Manual Data Cleaning and Engineering This introductory notebook focuses on the following aspects of a data processing pipeline, and hopefully proves that these steps are vital to any data application: * **Data Insights & Visualizations** * **Data Cleaning** * **Data Imputation** * **Manual Feature Engineering** ...
github_jupyter
# Markov Chain basics Andrey Markov was a Russian mathematician who studied stochastic processes. Markov was particularly interested in systems that follow a chain of linked events. In 1906, Markov produced interesting results about discrete processes that he called chain. A **Markov Chain** has a set of states S={s0,s...
github_jupyter
___ <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> ___ # TensorFlow Basics Remember to reference the video for full explanations, this is just a notebook for code reference. You can import the library: ``` import tensorflow as tf print(tf.__version__) ``` ### Simple Constants Let...
github_jupyter
## Image In-painting with OpenVINO™ This notebook demonstrates how to use an image in-painting model with OpenVINO. We use [GMCNN model](https://github.com/shepnerd/inpainting_gmcnn) from [Open Model Zoo](https://github.com/openvinotoolkit/open_model_zoo/). This model is able to create something very similar to the ori...
github_jupyter
# Hook callbacks This provides both a standalone class and a callback for registering and automatically deregistering [PyTorch hooks](https://pytorch.org/tutorials/beginner/former_torchies/nn_tutorial.html#forward-and-backward-function-hooks), along with some pre-defined hooks. Hooks can be attached to any [`nn.Module...
github_jupyter
``` %%writefile agent_ddqn.py from lux.game import Game from lux.game_map import Cell, RESOURCE_TYPES, Position from lux.game_objects import Unit from lux.constants import Constants from lux.game_constants import GAME_CONSTANTS from lux import annotate import math, sys import numpy as np import random from lux.game imp...
github_jupyter
``` # load the entirety of De agricultura import os div1_fp = os.path.expanduser('~/cltk_data/latin/text/latin_text_latin_library/cicero/divinatione1.txt') div2_fp = os.path.expanduser('~/cltk_data/latin/text/latin_text_latin_library/cicero/divinatione2.txt') with open(div1_fp) as fo: div1 = fo.read() with open(...
github_jupyter
``` import keras print(keras.__version__) import tensorflow print(tensorflow.__version__) import numpy as np print(np.__version__) from keras_tqdm import TQDMNotebookCallback from keras.applications.densenet import DenseNet201 from keras.preprocessing import image from keras.applications.densenet import preprocess_i...
github_jupyter
# Chaînes de caractères (string) Une chaine de caractères est une sequence de lettres. Elle est délimité par des guillemets * simples ou * doubles. ## Un index dans une chaîne Chaque élement peut être accédé par un **indice** entre crochets. ``` fruit = 'banane' fruit[0] ``` L'indexation commence avec zéro. L'in...
github_jupyter
[&larr; Back to Index](index.html) # About This Site **musicinformationretrieval.com** is a collection of instructional materials for music information retrieval (MIR). These materials contain a mix of casual conversation, technical discussion, and Python code. These pages, including the one you're reading, are aut...
github_jupyter
## Make plot ERF 2019 This script uses code produced by Bill Collins to produce an emission based estimate of ERF in 2019 vs 1750 based on Thornhill et al 2021. Thornhill, Gillian D., William J. Collins, Ryan J. Kramer, Dirk Olivié, Ragnhild B. Skeie, Fiona M. O’Connor, Nathan Luke Abraham, et al. “Effective Radia...
github_jupyter
# Classification Classification is a technique or model which attempts to get some conclusion from observed values in classification problem. Models which perform classification tasks are usually called Classifiers. Classifiers are usually used in face recognition, spam identification etc # Steps for building a Class...
github_jupyter
``` import datetime def FormatDate(Date,Format): """ @Input: Date: date object eg. datetime.date(2002, 3, 4) Format: string - each individual date parts must be defined within DateSwitch object and must its length must be between 2-4 letters and starts with a capital letter @Note: ta...
github_jupyter
### Data Visualization #### `matplotlib` - from the documentation: https://matplotlib.org/3.1.1/tutorials/introductory/pyplot.html `matplotlib.pyplot` is a collection of command style functions that make matplotlib work like MATLAB. <br> Each pyplot function makes some change to a figure: e.g., creates a figure, crea...
github_jupyter
<h2 align="center">Room Occupancy Detection Using Sensor Data</h2> <img src="https://i.imgur.com/cEEtXzX.png" width="560" height="480"></img> ### Task 1: Introduction and Importing Libraries ``` import pandas as pd import matplotlib.pyplot as plt %matplotlib inline #so we get graphs and output within notebook imp...
github_jupyter
# Exp 98 analysis See `./informercial/Makefile` for experimental details. ``` import os import numpy as np from IPython.display import Image import matplotlib import matplotlib.pyplot as plt %matplotlib inline %config InlineBackend.figure_format = 'retina' import seaborn as sns sns.set_style('ticks') matplotlib.r...
github_jupyter
## Predicting Prescriber induced Overdose ### DATA SCIENCE IMMERSIVE FINAL CAPE STONE This capestone was initaited with an idea that why are so much more physicians presecribing medications that can lead to overdose. I have worked with patients for more than a year in a clinic as well as a hospital and saw significan...
github_jupyter
## Checkpoints Design Pattern This notebook demonstrates how to set up checkpointing in Keras. The model tries to predict whether or not a ride includes a toll. ### Creating dataset Create dataset from BigQuery. The dataset consists of 19 millions rows and will not comfortably fit into memory. ``` import tensorflo...
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
``` import numpy as np import scipy as sp import scipy.stats import matplotlib.pyplot as plt import math as mt import scipy.special import seaborn as sns plt.style.use('fivethirtyeight') from statsmodels.graphics.tsaplots import plot_acf import pandas as pd ``` # <font face="gotham" color="orange"> Gibbs Sampling Algo...
github_jupyter
# 🚀 Snorkel Intro Tutorial: Data Labeling In this tutorial, we will walk through the process of using Snorkel to build a training set for classifying YouTube comments as spam or not spam. The goal of this tutorial is to illustrate the basic components and concepts of Snorkel in a simple way, but also to dive into the...
github_jupyter
# 作業 : (Kaggle)鐵達尼生存預測 https://www.kaggle.com/c/titanic # [作業目標] - 試著模仿範例寫法, 在鐵達尼生存預測中, 觀察填補缺值以及 標準化 / 最小最大化 對數值的影響 # [作業重點] - 觀察替換不同補缺方式, 對於特徵的影響 (In[4]~In[6], Out[4]~Out[6]) - 觀察替換不同特徵縮放方式, 對於特徵的影響 (In[7]~In[8], Out[7]~Out[8]) ``` # 做完特徵工程前的所有準備 (與前範例相同) import pandas as pd import numpy as np import copy from skle...
github_jupyter
#* You must include a written description of three observable trends based on the data. 1. The temperature of a city is hotter the closer it is to 0 latitude. 2. The humidity of a city is not determined by it's latitude. 3. The wind speed does not seem to be affected by the latitude. ``` # Dependencies and Setup ...
github_jupyter
# Using SoS with iPython Using sos magic within iPython allows you to run sos within an iPython session. It does not provide a full-blown SoS system but on the other hand you can use all the iPython features that you are familiar with. ## Setting up ipython sos magic is installed by default when you install sos. A p...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Goal" data-toc-modified-id="Goal-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Goal</a></span></li><li><span><a href="#Var" data-toc-modified-id="Var-2"><span class="toc-item-num">2&nbsp;&nbsp;</span>Va...
github_jupyter
``` # import libraries import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms from torch.utils.tensorboard import SummaryWriter from utils import device, get_num_correct, RunBuilder from network import Network # The output of torchvision datasets ...
github_jupyter
``` !git clone https://github.com/deepanrajm/Covid-19.git !pip uninstall -y tensorflow keras !pip install tensorflow==1.14 keras==2.1.2 from keras.models import Sequential from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Dense import matplot...
github_jupyter
# AMLD workshop by L2F – Learn to Forecast Welcome to the "Machine Learning Competition: Tennis Analysis" workshop at AMLD 2019, organized by [L2F – Learn to Forecast](https://www.l2f.ch/)! Starting from Jeff Sackman's crowdsourced [Match Charting Project](https://github.com/JeffSackmann/tennis_MatchChartingProject) ...
github_jupyter
*This notebook is part of course materials for CS 345: Machine Learning Foundations and Practice at Colorado State University. Original versions were created by Asa Ben-Hur. The content is availabe [on GitHub](https://github.com/asabenhur/CS345).* *The text is released under the [CC BY-SA license](https://creativecom...
github_jupyter
# TF-Slim Walkthrough This notebook will walk you through the basics of using TF-Slim to define, train and evaluate neural networks on various tasks. It assumes a basic knowledge of neural networks. ## Table of contents <a href="#Install">Installation and setup</a><br> <a href='#MLP'>Creating your first neural netwo...
github_jupyter
# Title _Brief abstract/introduction/motivation. State what the chapter is about in 1-2 paragraphs._ _Then, have an introduction video:_ ``` from fuzzingbook_utils import YouTubeVideo YouTubeVideo("w4u5gCgPlmg") ``` **Prerequisites** * _Refer to earlier chapters as notebooks here, as here:_ [Earlier Chapter](Fuzze...
github_jupyter
## week10: seq2seq practice ### Generating names with recurrent neural networks This time you'll find yourself delving into the heart (and other intestines) of recurrent neural networks on a class of toy problems. Struggle to find a name for the variable? Let's see how you'll come up with a name for your son/daughter...
github_jupyter
``` # !git clone https://github.com/openai/gpt-2.git # !mv gpt-2 gpt_2 # !python3 gpt_2/download_model.py 345M # !pip3 install regex --user # !wget https://raw.githubusercontent.com/minimaxir/gpt-2-simple/master/gpt_2_simple/src/accumulate.py from gpt_2.src import model, encoder from accumulate import AccumulatingOptim...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@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.o...
github_jupyter
# Process Deforestation Data from Hansen et al. In this notebook we will process the tree cover and deforestation data from Hansen et al. This map data is divided into 504 granules of 10x10 degrees, spanning from 60 degrees South to 80 degrees North ``` import numpy as np import rasterio import PIL from PIL import Im...
github_jupyter
# Analyze using Pandas This workbook shows how to do data analysis using pandas set-based operations on the data. ``` import pandas as pd %matplotlib inline from matplotlib import pyplot as plt from matplotlib import pylab pylab.rcParams['figure.figsize'] = (13, 7) fn = "datasets/lunch_10.csv" dset = pd.read_csv( f...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt inputfile='./Top10.xlsx' data=pd.read_excel(inputfile,dtype={'TradingDate':np.datetime64,'Symbol':str}) data=data[['TradingDate','Symbol','ShortName','NetInflow']] data['operation']=np.where(data['NetInflow']>0,1,-1) inputfile1='./TRD_Dalyr1.xls...
github_jupyter
# User's Guide, Chapter 6: Streams (II): Hierarchies, Recursion, and Flattening We ended Chapter 4 (:ref:`Streams (I) <usersGuide_04_stream1>`.) with a :class:`~music21.stream.Stream` that was contained within another `Stream` object. Let's recreate that class: ``` from music21 import * note1 = note.Note("C4") note...
github_jupyter
# Master Script 7: Calculate bootstrapping bias-corrected cross-validation (BBC-CV) area under the receiver operating characteristic curve (AUC) and classification metrics Shubhayu Bhattacharyay <br> University of Cambridge <br> Johns Hopkins University <br> email address: sb2406@cam.ac.uk ## Contents: ### I. Initial...
github_jupyter
## Pseudo-random number generators <!-- AUTHOR: Philip B. Stark --> **Philip B. Stark** <br/> [stark@stat.berkeley.edu](mailto:stark@stat.berkeley.edu) ## Properties of PRNGs + dimension of output - commonly 32 bits, but some have more + number of states - dimension of state space in bits - sometime...
github_jupyter
# Classifying OUV using GRU sequence model + Attention ## Imports ``` import sys sys.executable from argparse import Namespace from collections import Counter import json import os import re import string import random import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.function...
github_jupyter
# Sentiment analysis of football comments Code to plot sentiment timelines from match threads from reddit ## Setup To rerun, you need to set up praw (e.g. setting up client_id and client_secret). See [this tutorial](https://praw.readthedocs.io/en/stable/getting_started/quick_start.html) for more details. Then...
github_jupyter
## Overview To facilitate graph analysis, we need to support sharing layouts between graphs, something I haven't seen done very well elsewhere. In particular, it should be possible to: * &#x2713; "Pin" a few key vertices while letting the layout handle the remaining vertices. * &#x2713; Render a graph using another ...
github_jupyter
This notebook will help you to access the chemical abundance tracks that you see in paper 1 figure 17 but for all elements. You can use it to compare it to your own model/data. ``` %pylab inline ``` We load the results from the best parameter Chempy run: ``` # Single zone models for sun, arcturus and cas with defaul...
github_jupyter
<a href="https://colab.research.google.com/github/gowrithampi/deeplearning_with_pytorch/blob/main/Chapter_7_Telling_birds_from_airplanes_Learning_from_images.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### Chapter 7 of the book Deep Learning wit...
github_jupyter
``` # Basic import %matplotlib inline import matplotlib.pyplot as plt import numpy as np from copy import deepcopy, copy from scipy.stats import norm import pdb import tensorflow as tf from tensorflow.keras.layers import Embedding, Flatten, Dense, Dropout, Dot, Concatenate from tensorflow.keras.models import Model tf....
github_jupyter
# Finding Out The Actual Cause For Breaking Of Machines In Company!!! ``` ### Importing some useful libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns ``` ### Fetching data from the given url ``` url="https://raw.githubusercontent.com/anshupandey/Machine_Learning_T...
github_jupyter
#### Extract patches from data_processedv0 (WSI) and make data_processedv4 with subfolder named images and masks folder using sliding window technique Do train validation split on data_processedv4 to make data_processedv5 ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.col...
github_jupyter
# Evaluate a Siamese model: Ungraded Lecture Notebook ``` import trax.fastmath.numpy as np ``` ## Inspecting the necessary elements In this lecture notebook you will learn how to evaluate a Siamese model using the accuracy metric. Because there are many steps before evaluating a Siamese network (as you will see in t...
github_jupyter
# Adversarial Audio Examples This notebook demonstrates how to use the ART library to create adversarial audio examples. --- ## Preliminaries Before diving into the different steps necessary, we walk through some initial work steps ensuring that the notebook will work smoothly. We will 1. set up a small configura...
github_jupyter
``` #format the book from __future__ import division, print_function %matplotlib inline import sys sys.path.insert(0, '..') import book_format book_format.set_style() ``` # Interactions This is a collection of interactions, mostly from the book. If you have are reading a print version of the book, or are reading it o...
github_jupyter
<a href="https://colab.research.google.com/github/SLCFLAB/Data-Science-Python/blob/main/Day%209/9_3_safe_driver_data(optional).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> 다음 코드는 optional 코드로, 데이터가 크기 때문에 런타임 유형변경을 해주어야 합니다. 먼저, 런타임 -> 런타임 유형 변경...
github_jupyter
``` import pymysql import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import numpy as np import transformations import config %matplotlib inline conn = pymysql.connect(config.host, user=config.username,port=config.port, passwd=config.password) #gather all historical da...
github_jupyter
### You can access the UNSW datasets used in our study from the links below. [ UNSW - IOT TRAFFIC TRACES - IEEE TMC 2018](https://iotanalytics.unsw.edu.au/iottraces) [ UNSW - IOT BENIGN AND ATTACK TRACES - ACM SOSR 2019](https://iotanalytics.unsw.edu.au/attack-data) ### Since these data are very large, we filter the...
github_jupyter
<img src="../../../images/banners/python-practice.png" width="600"/> # <img src="../../../images/logos/python.png" width="23"/> 01. Practice Session > Covering Data Types, Functions, and IO. ## <img src="../../../images/logos/toc.png" width="20"/> Table of Contents * [1. `print` output?](#1._`print`_output?) *...
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
``` import tensorflow as tf deep_learning = tf.constant('Deep Learning') session=tf.Session() session.run(deep_learning) a=tf.constant(2) b=tf.constant(2) multiply=tf.multiply(a,b) session.run(multiply) weights = tf.Variable(tf.random_normal([10,10],stddev=0.5),name='weights') weights from read_data import get_minibatc...
github_jupyter
``` #importing libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns #reading data df=pd.read_csv("train.csv") df.head() df.info() df.shape[0] ``` # CHECKING FOR COUNT OF NULL VALUES ``` df.isnull().sum() df.isnull().sum()/df.shape[0]*100.0 df=df.drop(columns="Unnamed:...
github_jupyter
``` # HACK: use project root as the working directory from pathlib import Path while Path.cwd().name != 'language-model-toxicity': %cd .. import sys, os import argparse import numpy as np import pandas as pd import json from random import sample from tqdm.auto import tqdm import seaborn as sns import matplotlib.p...
github_jupyter
<a href="https://colab.research.google.com/drive/1F1rtlQY0vZ9BVTtP7CuvyeBv2hEOpPTo?usp=sharing" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> By [Ibrahim Sobh](https://www.linkedin.com/in/ibrahim-sobh-phd-8681757/) # Image classification with MLP-Mixe...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/Monk_Object_Detection/blob/master/example_notebooks/4_efficientdet/train%20-%20without%20val.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Installation - Run these commands ...
github_jupyter
``` %matplotlib inline %reload_ext autoreload %autoreload 2 from fastai.conv_learner import * from fastai.dataset import * from fastai.models.resnet import vgg_resnet50 import json torch.cuda.set_device(3) torch.backends.cudnn.benchmark=True ``` ## Data ``` PATH = Path('data/carvana') MASKS_FN = 'train_masks.csv' ME...
github_jupyter
Deep Learning Models -- A collection of various deep learning architectures, models, and tips for TensorFlow and PyTorch in Jupyter Notebooks. - Author: Sebastian Raschka - GitHub Repository: https://github.com/rasbt/deeplearning-models ``` %load_ext watermark %watermark -a 'Sebastian Raschka' -v -p torch ``` - Runs ...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import nltk nltk.download('punkt') from nltk.tokenize import word_tokenize from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential from kera...
github_jupyter
<center> <img src="./img/ods_stickers.jpg"> ## Открытый курс по машинному обучению. Сессия № 3 Автор материала: программист-исследователь Mail.ru Group, старший преподаватель Факультета Компьютерных Наук ВШЭ Юрий Кашницкий. Материал распространяется на условиях лицензии [Creative Commons CC BY-NC-SA 4.0](https://creati...
github_jupyter
# The Rankine Cycle Analysis with Simple Abstraction Michael J. Moran, Howard N. Shapiro, Daisie D. Boettner, Margaret B. Bailey. Fundamentals of Engineering Thermodynamics(7th Edition). John Wiley & Sons, Inc. 2011 **Chapter 8 : Vapor Power Systems:** **1** EXAMPLE 8.1 Analyzing an Ideal Rankine Cycle P438 **2**...
github_jupyter
``` import sys sys.path.insert(0, '..') import matplotlib from matplotlib import pyplot as plt from matplotlib import ticker, style from datetime import date, timedelta from config import Config import pandas as pd import numpy as np from sqlalchemy import create_engine plt.rcParams["figure.figsize"] = [20,12] ...
github_jupyter
# MAT281 - Laboratorio N°01 <a id='p1'></a> ## Problema 01 ### a) Calcular el número $\pi$ En los siglos XVII y XVIII, James Gregory y Gottfried Leibniz descubrieron una serie infinita que sirve para calcular $\pi$: $$\displaystyle \pi = 4 \sum_{k=1}^{\infty}\dfrac{(-1)^{k+1}}{2k-1} = 4(1-\dfrac{1}{3}+\dfrac{1}{5}...
github_jupyter
``` import json import sys sys.dont_write_bytecode = True import numpy as np import datetime import random import math import core base = "BTC" #base = "ETH" #base = "LTC" quote = "USDT" historymins = 60*24*30*4 #60*24*30*4 interval = 10 dtend = datetime.datetime.strptime('2018-04-24 00:00', '%Y-%m-%d %H...
github_jupyter
### Basic orienatation to `ticdat`, `pandas` and developing engines for Opalytics One of the advantages of Python is that it has "batteries included". That is to say, there is a rich set of libraries available for installation. Of course, with such a large collection of libraries to choose from, it's natural to wonder...
github_jupyter
<a href="https://colab.research.google.com/github/henrywoo/MyML/blob/master/Copy_of_nlu_2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #### Copyright 2018 Google LLC. ``` # Licensed under the Apache License, Version 2.0 (the "License"); # you ma...
github_jupyter
# Understanding the FFT Algorithm The goal of this notebook is to dive into the Cooley-Tukey FFT algorithm, explaining the symmetries that lead to it, and to show some straightforward Python implementations putting the theory into practice. My hope is that this exploration will give data scientists like myself a more...
github_jupyter
<p style="font-family: Arial; font-size:3.75em;color:purple; font-style:bold"><br> Pandas</p><br> *pandas* is a Python library for data analysis. It offers a number of data exploration, cleaning and transformation operations that are critical in working with data in Python. *pandas* build upon *numpy* and *scipy* pr...
github_jupyter
# INM363 Deep Active Learning Network for Medical Image Segmentation ## Initial + Preprocessed Data Exploration ### Aaron Mir (Student Number: 160001207) ### https://github.com/Assassinsarms/Deep-Active-Learning-Network-for-Medical-Image-Segmentation ``` import os from glob import glob import sys import matplotlib....
github_jupyter
``` import pandas as pd import numpy as np from tqdm.auto import tqdm df_test = pd.read_csv("../dataset/original/test.csv", escapechar="\\") sub = pd.read_csv("/Users/alessiorussointroito/Downloads/sub_prova.csv.xls") df_test['linked_id'] = df_test.record_id.str.split("-") df_test['linked_id'] = df_test.linked_id.apply...
github_jupyter
## BoilerPlate command It’s standard practice to start the notebook with the following three lines; they ensure that any edits to libraries you make are reloaded here automatically, and also that any charts or images displayed are shown in this notebook. ``` %reload_ext autoreload %autoreload 2 %matplotlib inline ```...
github_jupyter
``` # default_exp keras_for_researchers ``` Everything you need to know to use Keras & TF 2.0 for deep learning research. ## Setup ``` import tensorflow as tf from tensorflow import keras ``` ## Introduction Are you a machine learning researcher? Do you publish at NeurIPS and push the state-of-the-art in CV and NL...
github_jupyter
# Merging, Joining, and Concatenating > There are 3 main ways of combining DataFrames together: Merging, Joining and Concatenating. In this lecture we will discuss these 3 methods with examples. ### Example DataFrames ``` import pandas as pd # For having gridlines %%HTML <style type="text/css"> table.dataframe td, t...
github_jupyter
``` %matplotlib inline ``` # 2D Optimal transport for different metrics 2D OT on empirical distributio with different gound metric. Stole the figure idea from Fig. 1 and 2 in https://arxiv.org/pdf/1706.07650.pdf ``` # Author: Remi Flamary <remi.flamary@unice.fr> # # License: MIT License import numpy as np impor...
github_jupyter
# Quickstart <div style="display:inline-block;"> <img src="https://raw.githubusercontent.com/heidelbergcement/hcrystalball/master/docs/_static/hcrystal_ball_logo_black.svg" width="150px"> </div> We are glad this package caught your attention, so let's try to briefly showcase its power. ### Data In this tutorial,...
github_jupyter
``` %matplotlib inline ``` # Optimizing Model Parameters Now that we have a model and data it's time to train, validate and test our model by optimizing it's parameters on our data. Training a model is an iterative process; in each iteration (called an *epoch*) the model makes a guess about the output, calculates the...
github_jupyter
``` import os import csv import time import platform import datetime import pandas as pd import networkx as nx from graph_partitioning import GraphPartitioning, utils cols = ["WASTE", "CUT RATIO", "EDGES CUT", "TOTAL COMM VOLUME", "MODULARITY", "LONELINESS", "NETWORK PERMANENCE", "NORM. MUTUAL INFO", "EDGE CUT WEIGHT"...
github_jupyter
# Deploy Web App on Azure Container Services (AKS) In this notebook, we will set up an Azure Container Service which will be managed by Kubernetes. We will then take the Docker image we created earlier that contains our app and deploy it to the AKS cluster. Then, we will check everything is working by sending an image...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#Generating-random-data" data-toc-modified-id="Generating-random-data-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Generating random data</a></div><div class="lev1 toc-item"><a href="#Applying-a-Welch-t-test-to-the-data" data-toc-modified-id="Applying-a-W...
github_jupyter
# GDP and life expectancy Richer countries can afford to invest more on healthcare, on work and road safety, and other measures that reduce mortality. On the other hand, richer countries may have less healthy lifestyles. Is there any relation between the wealth of a country and the life expectancy of its inhabitants? ...
github_jupyter
# Simple Linear Regression > Implementing a simple linear regression model from scratch using the ordinary least squares method. Computing the regression function and its coefficients. Calculating the data variance and standard deviation. - toc: true - author: Oluwaleke Umar Yusuf - badges: true - comments: true - ima...
github_jupyter
# Requirements - Python 3.6.2 (NOT python 3.7) - Sign up for an Intrinio account at https://intrinio.com/ and obtain an API key. Subscription to the 'US Fundamentals and Stock Prices' subscription (free, trial or paid) is required. Python libaries: - TensorFlow r1.13 - keras - requests - pandas - matplotlib - seabor...
github_jupyter
# A short example of ctaplot functions ``` import ctaplot import numpy as np import matplotlib.pyplot as plt ctaplot.set_style('slides') ``` ## Generate some dummy data ``` size = 1000 simu_energy = 10**np.random.uniform(-2, 2, size) reco_energy = simu_energy**(0.9) source_alt = 3. source_az = 1.5 simu_alt = source_...
github_jupyter
# Spacy Tutorial ``` import spacy ! pipenv install spacy spacy.info() nlp = spacy.blank("en") nlp? nlp_es = spacy.blank("es") nlp_de = spacy.blank("de") # xx doc = nlp("Brandon's the quick brown fox jumped over the lazy dog! Thirty") for token in doc: print(f"{token.text}") tok = doc[5] type(tok) span1 = doc[3:6] ...
github_jupyter
# Load your own MXNet BERT model In the previous [example](https://github.com/deepjavalibrary/djl/blob/master/jupyter/BERTQA.ipynb), you run BERT inference with the model from Model Zoo. You can also load the model on your own pre-trained BERT and use custom classes as the input and output. In general, the MXNet BERT...
github_jupyter
``` # %matplotlib inline %matplotlib notebook try: reload # Python 2.7 except NameError: try: from importlib import reload # Python 3.4+ except ImportError: from imp import reload # Python 3.0 - 3.3 from matplotlib import pyplot as plt from matplotlib import rc rc('text', usetex...
github_jupyter
``` import cv2 import numpy as np ``` The following class implements a very simple traffic light classifier. It will be tested on images taken from Udacity's Simulator as well as real world traffic lights. ``` class Traffic_Light_Classifier(object): """ This class implements a very simple traffic light classi...
github_jupyter
# Water detection with several sensors Let's use EOReader for water detection, using several sensors over the same area ## Imports ``` # Imports import os import numpy as np import xarray as xr ``` ## Core functions - A function loading the Normalized Water Index (`NDWI`) - A function extracting water through a thre...
github_jupyter