text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Top Influential Features for Cats and Dogs This file compares the top 50 features that influence the three main outcomes (adoption, euthanasia/died, and transfer) from both the xgboost and logistic models, and finds the matching entries from both models. ``` # Import dependencies import pandas as pd import numpy as...
github_jupyter
# Name Data preparation by executing an Apache Beam job in Cloud Dataflow # Labels GCP, Cloud Dataflow, Apache Beam, Python, Kubeflow # Summary A Kubeflow Pipeline component that prepares data by submitting an Apache Beam job (authored in Python) to Cloud Dataflow for execution. The Python Beam code is run with Cloud...
github_jupyter
``` import lifelines import pymc as pm from pyBMA.CoxPHFitter import CoxPHFitter import matplotlib.pyplot as plt import numpy as np from numpy import log from datetime import datetime import pandas as pd %matplotlib inline ``` The first step in any data analysis is acquiring and munging the data Our starting data set...
github_jupyter
# CS5489- Machine Learning # Lecture 9a - Convolutional Neural Networks (CNNs) ## Dr. Antoni B. Chan ### Dept. of Computer Science, City University of Hong Kong # Outline - Convolutional neural network (CNN) - Regularization ``` # setup %matplotlib inline import IPython.core.display # setup output image forma...
github_jupyter
## Test the Numerical Libraries being Used ``` import os import numpy as np import theano import theano.tensor as T import time def show_config(): print("OMP_NUM_THREADS = %s" % os.environ.get('OMP_NUM_THREADS','#CAREFUL : OMP_NUM_THREADS Not-defined!')) print("theano.con...
github_jupyter
``` import ray ray.init(plasma_directory="/workspaces/sefik/temp") import modin.pandas as modin import time import pandas as pd tic = time.time() modin_df = modin.read_csv("/workspaces/sefik/train.csv") toc = time.time() modin_time = toc-tic print("Lasts ",modin_time," seconds in Modin") #---------------------------- t...
github_jupyter
``` import akshare as ak import json import pandas as pd import sys import datetime import os import pandas as pd import pyecharts.options as opts from pyecharts.charts import Line from pyecharts.commons.utils import JsCode from pyecharts import options as opts from pyecharts.charts import Scatter from pyecharts.option...
github_jupyter
# 1. Setup Paths ``` import os CUSTOM_MODEL_NAME = 'my_ssd_mobnet' PRETRAINED_MODEL_NAME = 'ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8' PRETRAINED_MODEL_URL = 'http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz' TF_RECORD_SCRIPT_NAME = 'generate...
github_jupyter
# LeNet Lab Solution ![LeNet Architecture](lenet.png) Source: Yan LeCun ## Load Data Load the MNIST data, which comes pre-loaded with TensorFlow. You do not need to modify this section. ``` from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", reshape=False) X_...
github_jupyter
## Getting ROC Curve **Author**: Thodoris Petropoulos **Label**: Evaluating Models ### Scope The scope of this notebook is to provide instructions on how to get ROC Curve data of a specific model using the Python API. ### Background Insights provided by the ROC Curve are helpful in evaluating the performance of mac...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/AssetManagement/export_TimeSeries2.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_b...
github_jupyter
Back to **[Fan](https://fanwangecon.github.io/)**'s R4Econ Homepage **[Table of Content](https://fanwangecon.github.io/R4Econ/)** # Constrained Share Parameters to Unconstrained Parameters Sometimes, the parameters we are optimizing over are constrained, we might be optimizing by choosing $a,b,c$. They sum up ot $1$,...
github_jupyter
``` # Load the Numpy package, and rename to "np" import numpy as np ``` ### Iteration ### It is often the case in programming – especially when dealing with randomness – that we want to repeat a process multiple times. We know the numpy function `random.randint` claims to choose randomly between the integers in the ...
github_jupyter
## Q-learning This notebook will guide you through implementation of vanilla Q-learning algorithm. You need to implement QLearningAgent (follow instructions for each method) and use it on a number of tests below. ``` #XVFB will be launched if you run on a server import os if type(os.environ.get("DISPLAY")) is not st...
github_jupyter
# Prepare data for training dataframe The aim is to produce a training table where each `order_id` is mapped to all coupons available in the departments from which products were selected in that order on the date the order was made, along with information (`True`/`False`) if such available coupon was used in that orde...
github_jupyter
``` import io import os import json import re from text_to_num import alpha2digit from PIL import Image import base64 from io import BytesIO # Imports the Google Cloud client library from google.cloud import vision from google.cloud.vision import types os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "Key.json" im = I...
github_jupyter
<img src="images/dask_horizontal.svg" align="right" width="30%"> # Distributed, Advanced ## Distributed futures ``` from dask.distributed import Client c = Client(n_workers=4) c.cluster ``` In chapter Distributed, we showed that executing a calculation (created using delayed) with the distributed executor is identi...
github_jupyter
# NEB using ASE ### 1. Setting up an EAM calculator. Suppose we want to calculate the minimum energy path of adatom diffusion on a (100) surface. We first need to choose an energy model, and in ASE, this is done by defining a "calculator". Let's choose our calculator to be Zhou's aluminum EAM potential, which we've u...
github_jupyter
``` import mglearn import matplotlib.pyplot as plt %matplotlib inline #mglearn.plots.plot_logistic_regression_graph() mglearn.plots.plot_single_hidden_layer_graph() mglearn.plots.plot_two_hidden_layer_graph() ``` # Dependencies ``` import pandas as pd import numpy as np from sklearn.model_selection import train_test...
github_jupyter
# Strategy Analysis with **Pandas TA** and AI/ML * This is a **Work in Progress** and subject to change! * Contributions are welcome and accepted! * Examples below are for **educational purposes only**. * **NOTE:** The **watchlist** module is independent of Pandas TA. To easily use it, copy it from your local pandas_ta...
github_jupyter
# Part 2: Secure Model Serving with Syft Keras Now that you have a trained model with normal Keras, you are ready to serve some private predictions. We can do that using Syft Keras. To secure and serve this model, we will need three TFEWorkers (servers). This is because TF Encrypted under the hood uses an encryption ...
github_jupyter
# Microsoft Azure - DP100 > This note helps you to prepare the Azure Assoicate Data Scientist DP-100 exam. I took DP100 in Mar 2021 and includes some important notes for study. Particularly, syntax types questions are very common. You need to study the lab and make sure you understand and remember some syntax to pass t...
github_jupyter
# Finding Image Logs ## Go find them! ``` %matplotlib inline import os import pandas as pd import dlisio import matplotlib.pyplot as plt import numpy as np import numpy.lib.recfunctions as rfn folderpath = r"C:\Users\aruss\Documents\FORCE Data" ``` #### Assumptions: Data is compiled into static and dynamic images (...
github_jupyter
*best viewed in [nbviewer](https://nbviewer.jupyter.org/github/CambridgeSemiticsLab/BH_time_collocations/blob/master/results/notebooks/3_head_lexemes.ipynb)* # Time Adverbial Distribution and Collocations ## Head Lexemes ### Cody Kingham <a href="../../../docs/sponsors.md"><img height=200px width=200px align="left" sr...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt ``` # Define your model and create a residual function In this example, we want to fit a cubic polynomial of the form $y = ax^3 + bx^2 + cx + d$ to data. For later convenience, we'll create a simple method to evaluate the polynomial, although t...
github_jupyter
``` # -*- coding: utf-8 -*- """ This program makes learning ev-gmm. """ # __future__ module make compatible python2 and python3 from __future__ import division, print_function # basic modules import os import os.path import time # for warning ignore import warnings #warning.filterwarnings('ignore') # for file syste...
github_jupyter
``` '''This script is a demo of how labels of each mutation types are added''' import pandas as pd import re import numpy as np from itertools import chain df_rearrangement = pd.read_excel('report_rearrangement.xlsx') df_rearrangement.fillna(0,inplace = True) df_rearrangement def deletion_check(protospacer, pattern): ...
github_jupyter
### Script for generating prediction CSV files for Dev and Test sets **GA-Ensembling weights and individual model predictions already available** ``` import pandas as pd import numpy as np # Reading CSV from link def read_csv_from_link(url): path = 'https://drive.google.com/uc?export=download&id='+url.split('/')[...
github_jupyter
## Tune Model Parameters Like in previous years, I'm going to use `RandomizedSearchCV` to tune the params. I tried grid search, but realised that tuning the models individually missed some params and functionality from the wrapper class (like filtering by minimum season, and adding column names to the `DataFrameConver...
github_jupyter
Branching GP Regression on synthetic data -- *Alexis Boukouvalas, 2017* Branching GP regression with Gaussian noise on the hematopoiesis data described in the paper "BGP: Gaussian processes for identifying branching dynamics in single cell data". This notebook shows how to build a BGP model and plot the posterior mo...
github_jupyter
# Groupby Architecture ## Problem Pandas has a well-designed groupby architecture, but when developing against it I often hit three challenges: * It involves 4 to 5 classes, which can be hard to keep track of. * Its design is similar to Categoricals--but what class names `codes`, another might name `labels`. * Corre...
github_jupyter
<!--NOTEBOOK_HEADER--> *This notebook contains material from [nbpages](https://jckantor.github.io/nbpages) by Jeffrey Kantor (jeff at nd.edu). The text is released under the [CC-BY-NC-ND-4.0 license](https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode). The code is released under the [MIT license](https://opens...
github_jupyter
# Start of the analysis notebook **Author : Benjamin Thomitzni, Nils Oberhof, Marco Bauer** *Date : 11.03* *Affiliation : Team 4, IWR, Dreuw* Place the required modules in the top, followed by required constants and global functions. ``` # required modules import numpy as np import matplotlib.pyplot as plt imp...
github_jupyter
# Multi-Label Baseline Models This is the notebook containing End-To-End models for multi-label classification of CRO's, for both level using TF-IDF as input features for a set of classifiers ``` ############################## CONFIG ############################## # Task config TASK = "binary" #@param ["multi-label",...
github_jupyter
``` %run Config/ImgConfig.ipynb ``` - **Student:** Adam Napora (ID 18197892) - **Supervisor:** Alessio Benavoli - **Date:** 23 August 2020 - **Course:** MSc in Artificial Intelligence, 2019/2020 - **Faculty:** Science and Engineering - **Title:** Enriched Camera Monitoring System with Computer Vision and Machine Learn...
github_jupyter
# ShapRFECV vs sklearn RFECV In this section we will compare the performance of the model trained on the features selected using the probatus [ShapRFECV](https://ing-bank.github.io/probatus/api/feature_elimination.html) and the [sklearn RFECV](https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection...
github_jupyter
``` import pandas as pd import pyspark.sql.functions as F from datetime import datetime from pyspark.sql.types import * from pyspark import StorageLevel import numpy as np pd.set_option("display.max_rows", 1000) pd.set_option("display.max_columns", 1000) pd.set_option("mode.chained_assignment", None) from pyspark.ml i...
github_jupyter
<center> <img src="https://gitlab.com/ibm/skills-network/courses/placeholder101/-/raw/master/labs/module%201/images/IDSNlogo.png" width="300" alt="cognitiveclass.ai logo" /> </center> # **Space X Falcon 9 First Stage Landing Prediction** ## Web scraping Falcon 9 and Falcon Heavy Launches Records from Wikipedia ...
github_jupyter
#### New to Plotly? Plotly's Python library is free and open source! [Get started](https://plotly.com/python/getting-started/) by downloading the client and [reading the primer](https://plotly.com/python/getting-started/). <br>You can set up Plotly to work in [online](https://plotly.com/python/getting-started/#initiali...
github_jupyter
# Práctica 3: Regresión Logística Multi-clase y Redes Neuronales Mario Quiñones Pérez y Guillermo García Patiño Lenza ## Parte 1: Regresión logística multi-clase ### Visualización de los datos En esta parte nos encargamos de crear dos funciones, la principal que usaremos en toda la práctica (cargaDatos), que servir...
github_jupyter
Using kernels in GPflow -- *James Hensman 2016* GPflow comes with a range of kernels that can be combined to make new kernels. In this notebook, we examine some of the kernels, show how kernels can be combined, discuss the active_dims feature and show how one can build a new kernel. ``` import gpflow import numpy a...
github_jupyter
<h3>Step 1: Import the requests library</h3> ``` import requests ``` <h3>Step 2: Send an HTTP request, get the response, and save in a variable</h3> ``` response = requests.get("http://www.epicurious.com/search/Tofu+Chili") ``` <h3>Step 3: Check the response status code to see if everything went as planned</h3> <li...
github_jupyter
``` import os import sys import re import json import numpy as np import pandas as pd from collections import defaultdict module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) module_path = os.path.abspath(os.path.join('../onmt')) if module_path not in sys.p...
github_jupyter
# Differentiation ``` # With all python examples, beware that python can't handle numbers too small so some results will be inaccurate import matplotlib.pyplot as plt import numpy as np ``` ### Limits limits are useful in functions to achieve (or get as close as possible to) the result. $$\lim_{x\to c}f(x) = L$$ I...
github_jupyter
**What is a Matrix?** A matrix is a 2-dimensional array that has m number of rows and n number of columns. In other words, matrix is a combination of two or more vectors with the same data type. Note: It is possible to create more than two dimensions arrays with R. ![](https://lh3.googleusercontent.com/-5tIe91y_Bw0/...
github_jupyter
![](https://raw.githubusercontent.com/dimitreOliveira/MachineLearning/master/Kaggle/Microsoft%20Malware%20Prediction/Microsoft_logo.png) <h1><center>Microsoft Malware Prediction</center></h1> <h2><center>Can you predict if a machine will soon be hit with malware?</center></h2> ### Dependencies ``` #@title import warn...
github_jupyter
<a href="https://colab.research.google.com/github/AI4Finance-Foundation/ElegantRL/blob/master/tutorial_BipedalWalker_v3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **BipedalWalker-v3 Example in ElegantRL** # **Task Description** [BipedalWalk...
github_jupyter
<a href="https://www.nvidia.com/en-us/deep-learning-ai/education/"> <img src="images/DLI Header.png" alt="Header" style="width: 400px;"/> </a> # Improving your Model Now that you've learned to successfully train a model, let's work towards a state of the art model. In this lab, we'll learn the levers that you, as a d...
github_jupyter
<a href="https://colab.research.google.com/github/CPJKU/partitura_tutorial/blob/main/content/Partitura_tutorial.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # An Introduction to Symbolic Music Processing with Partitura Partitura is python 3 pack...
github_jupyter
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a> $ \newcommand{\bra}[1]{\langle #1|} $ $ \newcommand{\ket}[1]{|#1\rangle} $ $ \newcommand{\braket}[2]{\langle #1|#2\rangle} $ $ \newcommand{\dot}[2]{ #1 \cdot #2} $ $ \newcommand{\biginner}[2]{\left\langle...
github_jupyter
``` import numpy as np ``` # Scalar operations This is simply done with the multiplication operator (`*`) in Python, where one of the objects is a scalar and the other is a Numpy array. This is notated for a scalar $s$ and a matrix $A$ as: $$C = sA$$ Scalar multiplication is commutative: $$C = sA = As$$ Create exa...
github_jupyter
<a href="https://colab.research.google.com/github/imfreeman1/StartGitHubDeskTop/blob/main/%5BE_03%5DCat_nose2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import os import cv2 import matplotlib.pyplot as plt import numpy as np import dlib my_...
github_jupyter
# Preparing and Analysing Expert Evaluation ## Imports ``` import pandas as pd import numpy as np import scipy as sp from scipy.linalg import eigh import matplotlib.pyplot as plt import matplotlib as matplotlib import networkx as nx from networkx.algorithms import bipartite from argparse import Namespace import rando...
github_jupyter
# Publications markdown generator for academicpages Takes a TSV of publications with metadata and converts them for use with [academicpages.github.io](academicpages.github.io). This is an interactive Jupyter notebook ([see more info here](http://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/what_is_jupyter....
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # AutoML 03: Remote Execution using Batch AI In this example we use the scikit-learn's [digit dataset](http://scikit-learn.org/stable/datasets/index.html#optical-recognition-of-handwritten-digits-dataset) to showcase how you ca...
github_jupyter
<H1>N.B: This example is not currently working due to issues with recently updated dependencies</H1> ``` %matplotlib inline import os import netCDF4 import numpy as np from geophys_utils import NetCDFGridUtils from geophys_utils import NetCDFLineUtils from geophys_utils import get_gdal_wcs_dataset, get_gdal_grid_value...
github_jupyter
# Sector Neutral ## Install packages ``` import sys !{sys.executable} -m pip install -r requirements.txt import cvxpy as cvx import numpy as np import pandas as pd import time import os import quiz_helper import matplotlib.pyplot as plt %matplotlib inline plt.style.use('ggplot') plt.rcParams['figure.figsize'] = (14, ...
github_jupyter
## _*Using Qiskit Aqua for set packing problems*_ Given a collection $S$ of subsets of a set $X$, the set packing problem tries to find the subsets that are pairwise disjoint (in other words, no two of them share an element). The goal is to maximize the number of such subsets. We will go through three examples to sho...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D2_HiddenDynamics/W3D2_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neuromatch Academy: Week 3, Day 2, Tutorial 2 # Hidden Mar...
github_jupyter
# CNTK 204: Sequence to Sequence Networks with Text Data ## Introduction and Background This hands-on tutorial will take you through both the basics of sequence-to-sequence networks, and how to implement them in the Microsoft Cognitive Toolkit. In particular, we will implement a sequence-to-sequence model to perform...
github_jupyter
# Calculating Rydberg atom transition frequencies The wavelength of the transition between the $n_1$th and $n_2$th levels is given by, \begin{equation} \frac{1}{\lambda} = R_{M} \left( \frac{1}{(n_1-\delta_1)^2} - \frac{1}{(n_2-\delta_2)^2} \right) \end{equation} where $\delta_x$ are the quantum defects, and $R_...
github_jupyter
``` import cartopy.crs as ccrs import cosima_cookbook as cc import cartopy.crs as ccrs import cosima_cookbook as cc import cartopy.feature as cft from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER import cmocean as cm from dask.distributed import Client import matplotlib.path as mpath import matp...
github_jupyter
<!--HEADER--> [*NBBinder test on a collection of notebooks about some thermodynamic properperties of water*](https://github.com/rmsrosa/nbbinder) <!--BADGES--> <a href="https://nbviewer.jupyter.org/github/rmsrosa/nbbinder/blob/master/tests/nb_export_builds/nb_water_md/02.00-Data.md"><img align="left" src="https://img....
github_jupyter
# Plotting with Python: Introduction to `Matplotlib` One of the most important skills when working with Python, especially in a scientific setting, is learning how to plot data. While the process for getting to these plots may seem difficult at first, with enough practice (and with referencing the plotting documentati...
github_jupyter
# Neural Network **Learning Objectives:** * Use the `DNNRegressor` class in TensorFlow to predict median housing price The data is based on 1990 census data from California. This data is at the city block level, so these features reflect the total number of rooms in that block, or the total number of people who liv...
github_jupyter
# Image Registration and Combination using the JWST Level 3 Pipeline - MIRI example Stage 3 image (Image3, calwebb_image3) processing is intended for combining the calibrated data from multiple exposures (e.g., a dither or mosaic pattern) into a single distortion corrected product. Before being combined, the exposures...
github_jupyter
``` %matplotlib inline import os import numpy as np import matplotlib.pyplot as plt from matplotlib import colors bool_cmap = colors.ListedColormap([(1, 1, 1, 0), 'black']) from fastadjust.io import h5read from flyion import initialize, fly from flyion.trajectory import final_position, trajectory # constants from scipy...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt import os.path as op import pickle import tensorflow as tf from tensorflow import keras from keras.models import Model,Sequential,load_model from keras.layers import Input, Embedding from keras.layers import Dense, Bidirectional from keras...
github_jupyter
# Unsupervised learning ### AutoEncoders An autoencoder, is an artificial neural network used for learning efficient codings. The aim of an autoencoder is to learn a representation (encoding) for a set of data, typically for the purpose of dimensionality reduction. <img src ="imgs/autoencoder.png" width="25%"> Un...
github_jupyter
# Introduction to Feature Engineering **Learning Objectives** * Improve the accuracy of a model by using feature engineering * Understand there's two places to do feature engineering in Tensorflow 1. Using the `tf.feature_column` module 2. In the input functions ## Introduction Up until now we've been...
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
# Statistics in Python In this section, we will cover how you can use Python to do some statistics. There are many packages to do so, but we will focus on four: - [pandas](https://pandas.pydata.org/) - [scipy's stats module](https://docs.scipy.org/doc/scipy/reference/stats.html) - [statsmodels](http://www.statsmodels...
github_jupyter
contributed by: Tobias Rasse Max Planck Institute for Heart and Lung Research 61231 Bad Nauheim, Germany tobias.rasse@mpi-bn.mpg.de Images recorded by: Tobias Rasse with a Samsung Galaxy S6 Active Smartphone, CC-BY 4.0 Licence ``` import pickle import numpy as np ``` ## General description of OpSeF The analysis pi...
github_jupyter
# Úloha 1 - určovanie príbuznosti pomocou kompresie ``` import gzip def loadfasta(filename,verbose=0): """ Parses a classically formatted and possibly compressed FASTA file into a dictionary where the key for a sequence is the first part of its header without any white space; if verbose ...
github_jupyter
<!--BOOK_INFORMATION--> <img align="left" style="padding-right:10px;" src="figures/PDSH-cover-small.png"> *This notebook contains an excerpt from the [Python Data Science Handbook](http://shop.oreilly.com/product/0636920034919.do) by Jake VanderPlas; the content is available [on GitHub](https://github.com/jakevdp/Pytho...
github_jupyter
<center><h1><b><span style="color:blue">Fitting</span></b></h1></center> #### **Quick intro to the following packages** - The core package `iminuit`. - Model building and a word on the affiliated package `zfit`. <center> &nbsp;<br><h1><b>iminuit</b></h1> <h2><b><span style="color:green">Python wrapper to Minuit2 min...
github_jupyter
``` from pathlib import Path import sys; sys.path.insert(0, str(Path('src').absolute())) import os cwd =os.getcwd() import ast import inspect from IPython.display import Markdown as md def flink(title: str, name: str=None): # name is method name if name is None: name = title.replace('`', '') # meh ...
github_jupyter
## Sample 1.2 for Astrostatistics This sample displays some simple but important codes from which you can quickly learn how to program by python, in the context of astronomy. ``` import numpy as np ``` Here, I show the frequently used data type in python. ``` ''' Data type ''' #list a = [1, 3., 'rrr'] print(a) print...
github_jupyter
## Dependencies ``` import json from tweet_utility_scripts import * from transformers import TFDistilBertModel, DistilBertConfig from tokenizers import BertWordPieceTokenizer from tensorflow.keras.models import Model from tensorflow.keras import optimizers, metrics, losses from tensorflow.keras.callbacks import EarlyS...
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
# Changes In The Daily Growth Rate > Changes in the daily growth rate for select countries. - comments: true - author: Thomas Wiecki - categories: [growth] - image: images/covid-growth.png - permalink: /growth-analysis/ ``` #hide from pathlib import Path loadpy = Path('load_covid_data.py') if not loadpy.exists(): ...
github_jupyter
# NLP model creation and training ``` from fastai.gen_doc.nbdoc import * from fastai.text import * from fastai import * ``` The main thing here is [`RNNLearner`](/text.learner.html#RNNLearner). There are also some utility functions to help create and update text models. ``` show_doc(RNNLearner, doc_string=False) ``...
github_jupyter
``` import msiwarp as mx from msiwarp.util.read_sbd import read_sbd_meta, read_spectrum_fs from msiwarp.util.warp import to_mz, peak_density_mz, plot_range, get_mx_spectrum, generate_mean_spectrum import matplotlib.pyplot as plt import numpy as np # scaling to test impact of sigma on alignment performance sigma_1 = 2...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '3' import xlnet import numpy as np import tensorflow as tf from tqdm import tqdm import model_utils import pickle import json pad_sequences = tf.keras.preprocessing.sequence.pad_sequences import sentencepiece as spm from prepro_utils import preprocess_text, encode_ids...
github_jupyter
This notebook demonstrates how to create an analysis ready spatialite database for borehoel data. All data has been processed filtered and the depths corrected onto to metres below ground level. Induction and gamma data are resampled to 5cm intervals and are on the same table. Neil Symington neil.symington@ga.gov.au ...
github_jupyter
``` import os,sys import pandas as pd import numpy as np %matplotlib inline import matplotlib from matplotlib import pyplot as plt ``` # Get the data sorted ## Temperature from environment DB ``` temp = pd.read_csv("/home/prokoph/CTA/ArrayClockSystem/WRS/MonitoringWRSS/weather_Jan13.csv",index_col=0, parse_dates=Tru...
github_jupyter
<a href="https://colab.research.google.com/github/souravgopal25/DeepLearnigNanoDegree/blob/master/NumpyReFresher.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Numpy Refresher ``` # Use the numpy library import numpy as np def prepare_inputs(inp...
github_jupyter
# Introduction to Deep Learning. Lecture ## Introduction ### As a part of ML <div style="width:image width px; font-size:80%; text-align:center; float: left; padding-left-right-top-bottom:0.5em; border-style: solid; border-color: rgba(211, 211, 211, 0.000); ...
github_jupyter
# $\color{blue}{\text{Final Project }}$ ## $\color{blue}{\text{Group AU }}$ ## $\color{blue}{\text{Project Subject:}}$ Stock market indices in Israel and the United States, Number of coronavirus infections in the US And their effects on each other <div> <img src="https://raw.githubusercontent.com/ArielHezi/DS_Stock...
github_jupyter
``` # Standard imports import pandas as pd import matplotlib.pyplot as plt import numpy as np import time # Insert path to mavenn beginning of path import os import sys abs_path_to_mavenn = os.path.abspath('../../') sys.path.insert(0, abs_path_to_mavenn) # Load mavenn import mavenn print(mavenn.__path__) # Load examp...
github_jupyter
``` %matplotlib inline import pandas as pd import numpy as np from numpy.linalg import inv, eig, svd from numpy.random import uniform, randn, seed from itertools import repeat import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.decomposition import PCA from sklearn.datasets import load_...
github_jupyter
**Reinforcement Learning with TensorFlow & TRFL: Deep Q Network** * Introduce the Deep Q Network (DQN) and its key parts * Show how TRFL Q learning works with DQN * Customize target network updating with TRFL's flexible usage Outline: 1. Introduce CartPole 2. Introduce DQN 3. TRFL Q learning using DQN and loss output ...
github_jupyter
# Day and Night Image Classifier --- The day/night image dataset consists of 200 RGB color images in two categories: day and night. There are equal numbers of each example: 100 day images and 100 night images. We'd like to build a classifier that can accurately label these images as day or night, and that relies on f...
github_jupyter
# Computer Vision We import `numpy` (as before) and `mahotas` (for image processsing/computer vision): ``` import numpy as np import mahotas as mh ``` Make plots inline: ``` %matplotlib inline ``` ## Basic image processing First example: ``` image = mh.imread('scene00.jpg') from matplotlib import pyplot as plt fi...
github_jupyter
``` %load_ext autoreload %autoreload 2 import datetime import os, sys import numpy as np import matplotlib.pyplot as plt import casadi as cas import pickle import copy as cp import argparse PROJECT_PATH = '/home/nbuckman/Dropbox (MIT)/DRL/2020_01_cooperative_mpc/mpc-multiple-vehicles/' sys.path.append(PROJECT_PATH)...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import dataset_builder as db ACT_LABELS = ["dws","ups", "wlk", "jog", "std"] TRIAL_CODES = { ACT_LABELS[0]:[1,2,11], ACT_LABELS[1]:[3,4,12], ACT_LABELS[2]:[7,8,15], ACT_LABELS[3]:[9,16], ACT_LABELS[4]:[6,14], } import tensorf...
github_jupyter
# Regularization of linear regression model In this notebook, we will see the limitations of linear regression models and the advantage of using regularized models instead. Besides, we will also present the preprocessing required when dealing with regularized models, furthermore when the regularization parameter need...
github_jupyter
<h1> Create TensorFlow wide-and-deep model </h1> This notebook illustrates: <ol> <li> Creating a model using the high-level Estimator API </ol> ``` # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BUCKET'] = BUCKE...
github_jupyter
``` from bokeh.plotting import figure from bokeh.io import output_notebook,show import numpy as np output_notebook() ``` # Bayes Theorem Mini-Lab This lab is a chance to work with Bayes Theorem. The underlying dataset is a collection of SMS (text) messages that were labelled as either 'junk' or 'real' as part of an ...
github_jupyter
# Prédiction de la note des vins Le notebook compare plusieurs de modèles de régression. ``` %matplotlib inline import warnings warnings.simplefilter('ignore') from papierstat.datasets import load_wines_dataset df = load_wines_dataset() X = df.drop(['quality', 'color'], axis=1) y = yn = df['quality'] from sklearn.mod...
github_jupyter