text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` !wget https://nlp.stanford.edu/projects/snli/snli_1.0.zip !wget http://nlp.stanford.edu/data/glove.840B.300d.zip !unzip snli_1.0.zip !unzip glove.840B.300d.zip from os.path import join as pjoin, isfile import json import numpy as np TEXT_DATA_DIR = 'snli_1.0' def load_data(tier): premise = [] hypoths...
github_jupyter
``` import datetime # Age Finder birth_year = input('what year were your born?') age = (datetime.datetime.now().year) - int(birth_year) print(f'this year you are will celebrate {age} years!') # Password Checker username = input('What is your name?') password = input('What is your password?') pass_len = len(password) ...
github_jupyter
# S47 journeys This notebook looks at S47 journeys and whether they follow the usual trajectory of S47 -> ICPC -> CPP start. The input: main flatfile CIN with data from all LAs. The output of this notebook is a table with the columns: - Source - Destination - Count - Local Authority - Demographics (gender, age, ethni...
github_jupyter
# Extract Financial Statement Values Financial statement analysis is critical to every organization to enable companies to make better economic decisions that yields more income in the future. For a given financial statement, a rulebook is followed to extract the values associated with accrual, audit status, balance s...
github_jupyter
<img src="https://juniorworld.github.io/python-workshop-2018/img/portfolio/week10.jpg" width="350px"> --- # Supervised Machine Learning - Train a model to give predictions based on **labeled data** (X + Y) - Information Retrieval: KNN - Regression: - Linear regression - Generalize Linear Model: logistic (bi...
github_jupyter
``` !git clone https://github.com/adobe-research/deft_corpus.git !unzip src.zip ``` # Loading The Data ``` from source.data_loader import DeftCorpusLoader loader = DeftCorpusLoader('deft_corpus/data') train_df, dev_df = loader.load_classification_data() train_df.head() ``` # Imports ``` import pandas as pd import n...
github_jupyter
### *The Leading Edge* # Machine learning contest 2016 **Welcome to an experiment!** You mission, should you choose to accept it, is to make the best lithology prediction you can. We want you to try to beat the accuracy score Brendon Hall achieved in his Geophyscial Tutorial (TLE, October 2016). First, read the [o...
github_jupyter
### Deep Kung-Fu with advantage actor-critic In this notebook you'll build a deep reinforcement learning agent for atari [KungFuMaster](https://gym.openai.com/envs/KungFuMaster-v0/) and train it with advantage actor-critic. ![http://www.retroland.com/wp-content/uploads/2011/07/King-Fu-Master.jpg](http://www.retroland...
github_jupyter
# OpenCV Filters Webcam In this notebook, several filters will be applied to webcam images. Those input sources and applied filters will then be displayed either directly in the notebook or on HDMI output. To run all cells in this notebook a webcam and HDMI output monitor are required. ## 1. Start HDMI output ### ...
github_jupyter
# Module 2 Tutorial 1 There are numerous open-source libraries, collections of functions, that have been developed in Python that we will make use of in this course. The first one is called NumPy and you can find the documentation [here](https://numpy.org/). It is one of the most widely-used libraries for scientific ...
github_jupyter
``` import intake import xarray as xr # open ESMCol catalog cat_url = "https://raw.githubusercontent.com/NCAR/intake-esm-datastore/master/catalogs/pangeo-cmip6.json" col = intake.open_esm_datastore(cat_url) grid_label = 'gn' # for model native grid #grid_label = 'gr' # for regridded data # search and display data ca...
github_jupyter
Want, the ability to generate various tensors and measure their properties. Pretty much, want to do unsupervised learning of matrices and tensors. Properties are defined not by their values but by how they can be composed, transformed, ... Not sure how to make this happen, but !!!. What are we generating based on? - S...
github_jupyter
``` cc.VerificationHandler.close_browser() VerificationHandler.close_browser() import numpy as np import pandas as pd from bs4.element import NavigableString % run contactsScraper.py % run contactChecker.py ContactSheetOutput.set_output(contactKeys) VerificationHandler.set_orgRecords(dm.OrgSession(orgRecords)) Verifica...
github_jupyter
# Introducing CartPole Cartpole is a classic control problem from OpenAI. https://gym.openai.com/envs/CartPole-v0/ A pole is attached by an un-actuated joint to a cart, which moves along a frictionless track. The system is controlled by applying a force of +1 or -1 to the cart. The pendulum starts upright, and the g...
github_jupyter
<center> <img src="../../img/ods_stickers.jpg"> ## Открытый курс по машинному обучению. Сессия № 2 ### <center> Автор материала: Андрей Сухарев (@fremis) ## <center> Индивидуальный проект по анализу данных </center> **План исследования** - Описание набора данных и признаков - Первичный анализ признаков - Первичны...
github_jupyter
``` #Model: CNN #Word Embedding: Pre-Trained (https://devmount.github.io/GermanWordEmbeddings/) #Dataset: 3 #based on https://github.com/keras-team/keras/blob/master/examples/pretrained_word_embeddings.py from __future__ import print_function import os import sys import numpy as np from keras.preprocessing.text import...
github_jupyter
# Example 4# Tuning the hyper-parameters of LS-SVM regression models using the scikit-learn GridsearchCV function. The synthetic data used for this purpose is the 1D Sinc function. ``` #Some imports import matplotlib.pyplot as plt import numpy as np import random import math import scipy.stats as st from sklearn.metr...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import h5py import heapq import matplotlib.colors import PIL import datetime ``` # Algorithm Custom adaptation of astar algorithm for 3D array with forced forward ``` def heuristic_function(a, b): return (b[0] - a[0]) ** 2 + (b[1] - a[1]) ...
github_jupyter
# Fully Convolutional Networks for Change Detection Example code for training the network presented in the paper: ``` Daudt, R.C., Le Saux, B. and Boulch, A., 2018, October. Fully convolutional siamese networks for change detection. In 2018 25th IEEE International Conference on Image Processing (ICIP) (pp. 4063-4067)...
github_jupyter
# Poetry Generation Generate your own AI-Poetry based on the work of female, non-binary and trans artistist using RNNs. We are using part of the [Poetry Foundation dataset from Kaggle](https://www.kaggle.com/johnhallman/complete-poetryfoundationorg-dataset) which was tagged in terms of genders and filtered out the m...
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
# `Probability Distributions` ``` %matplotlib inline # for inline plots in jupyter import matplotlib.pyplot as plt# import matplotlib import seaborn as sns import warnings warnings.simplefilter("ignore") from ipywidgets import interact styles = ['seaborn-notebook', 'seaborn', 'seaborn-darkgrid', 'classic', ...
github_jupyter
--- ### *The 11th Computational Neuroscience Winter School* # Tutorial II: Neuronal Dynamics - Point Neuron Model --- __Date:__ Jan. 21, 2022 __Content Creator:__ Songting Li, Kai Chen, Ziling Wang ## Using tutorial notebook Please download the latest version of [Jupyter Notebook](https://jupyter.org) if you want to...
github_jupyter
# 4️⃣ Zero-Shot Cross-Lingual Transfer using Adapters Beyond AdapterFusion, which we trained in [the previous notebook](https://github.com/Adapter-Hub/adapter-transformers/blob/master/notebooks/04_Cross_Lingual_Transfer.ipynb), we can compose adapters for zero-shot cross-lingual transfer between tasks. We will use the...
github_jupyter
# Time Series Analysis with Pastas *Developed by Mark Bakker, TU Delft* Required files to run this notebook (all available from the `data` subdirectory): * Head files: `head_nb1.csv`, `B58C0698001_1.csv`, `B50H0026001_1.csv`, `B22C0090001_1.csv`, `headwell.csv` * Pricipitation files: `rain_nb1.csv`, `neerslaggeg...
github_jupyter
# Day 19 - regular expressions * https://adventofcode.com/2020/day/19 The problem description amounts to a [regular expression](https://www.regular-expressions.info/); by traversing the graph of rules you can combine the string literals into a regex pattern that the Python [`re` module](https://docs.python.org/3/libr...
github_jupyter
# Kriging Example1 - Author: Mohit S. Chauhan - Date: Jan 08, 2019 In this example, Kriging is used to generate a surrogate model for a given data. In this data, sample points are generated using STS class and functional value at sample points are estimated using a model defined in python script ('python_model_funct...
github_jupyter
# sbpy.activity: dust [sbpy.activity](https://sbpy.readthedocs.io/en/latest/sbpy/activity.html) has classes and functions for models of cometary dust comae. Comet brightness can be estimated for observations of scattered light or themral emission. ## Light scattered by dust via Afρ Light scattered by coma dust can ...
github_jupyter
``` import numpy as np import pandas as pd from os.path import join as oj import os import pandas as pd import sys import inspect import datetime from scipy.stats import percentileofscore currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.p...
github_jupyter
``` import os import numpy as np import cv2 from matplotlib import pyplot as plt folder = "dataset/" haarcascade_frontalface_default_path = "haarcascade_frontalface_default.xml" haarcascade_eye_path = "haarcascade_eye.xml" face_cascade = cv2.CascadeClassifier(haarcascade_frontalface_default_path) eye_cascade = cv2.C...
github_jupyter
# <center>Big Data for Engineers &ndash; Exercises</center> ## <center>Spring 2019 &ndash; Week 9 &ndash; ETH Zurich</center> ## <center>Spark + MongoDB</center> # 1. Spark DataFrames + SQL ## 1.1 Setup the Spark cluster on Azure ### Create a cluster - Sign into the azure portal (portal.azure.com). - Search for "HD...
github_jupyter
# L05 - Bonus Notebook: Working with Heterogenous Datasets - Instructor: Dalcimar Casanova (dalcimar@gmail.com) - Course website: https://www.dalcimar.com/disciplinas/aprendizado-de-maquina - Bibliography: based on lectures of Dr. Sebastian Raschka - Course website: http://pages.stat.wisc.edu/~sraschka/teaching/ ``` ...
github_jupyter
``` import matplotlib.pyplot import numpy.random import torch.utils.data import torchvision from torch import Tensor from torch.nn import Module from torch.utils.data import DataLoader from torchvision.datasets import MNIST from torchvision.transforms import ToTensor ``` # Tutorial 1a. Logistic Regression In the firs...
github_jupyter
# Visualizing results Here, we will show some typical examples of visualizations that are used often to show results in ML studies in materials science. We will use the open-source [`ML_figures` package](https://github.com/kaaiian/ML_figures) and the example data provided by the package to generate these figures. ``...
github_jupyter
# Transfer Learning In this notebook, you will perform transfer learning to train CIFAR-10 dataset on ResNet50 model available in Keras. ## Imports ``` import os, re, time, json import PIL.Image, PIL.ImageFont, PIL.ImageDraw import numpy as np try: # %tensorflow_version only exists in Colab. %tensorflow_versio...
github_jupyter
## Aula 1 ``` import pandas as pd dados_portugues = pd.read_csv("data_set/stackoverflow_portugues.csv") dados_portugues.head() questao_portugues = dados_portugues.Questão[5] print(questao_portugues) ``` ## Aula 2 ``` dados_ingles = pd.read_csv("data_set/stackoverflow_ingles.csv") dados_ingles.head() questao_ingles =...
github_jupyter
# 3. Train_NN **Tensorboard** - Input at command: tensorboard --logdir=./log - Input at browser: http://127.0.0.1:6006 ``` import time import os import pandas as pd project_name = 'SceneClassification' step_name = 'Train_NN' time_str = time.strftime("%Y%m%d_%H%M%S", time.localtime()) run_name = project_name + '_' + ...
github_jupyter
# *Circuitos Elétricos I* ## Aula 1 ### Problema 1 A tensão e a corrente nos terminais de um elemento ideal de dois terminais são nulas para $t < 0$. Para $t ≥ 0$, são dadas por: $v(t) = 400e^{−100t}$ V, $i(t) = 5e^{−100t}$ A. Considera-se o sentido da corrente como sendo o mesmo da queda da tensão entre os termina...
github_jupyter
# Retroceso de Fase (Phase Kickback) En esta página, cubriremos un comportamiento de compuertas cuánticas controladas conocido como "retroceso de fase" (phase kickback). Este interesante efecto cuántico es un bloque de construcción en muchos algoritmos cuánticos famosos, incluido el algoritmo de factorización de Shor ...
github_jupyter
``` import pandas as pd import numpy as np ``` ## Load review dataset ``` products = pd.read_csv('amazon_baby_subset.csv') ``` ### 1. listing the name of the first 10 products in the dataset. ``` products['name'][:10] ``` ### 2. counting the number of positive and negative reviews. ``` print (products['sentiment'...
github_jupyter
# Plotting and Visualization ``` from __future__ import division from numpy.random import randn import numpy as np import os import matplotlib.pyplot as plt np.random.seed(12345) plt.rc('figure', figsize=(10, 6)) from pandas import Series, DataFrame import pandas as pd np.set_printoptions(precision=4) %matplotlib inli...
github_jupyter
``` #Importing openCV import cv2 #Displaying image image = cv2.imread('test_image.jpg') cv2.imshow('input_image', image) cv2.waitKey(0) cv2.destroyAllWindows() ``` ### Converting the image to grayscale ``` import cv2 import numpy as np image = cv2.imread('test_image.jpg') lanelines_image = np.copy(image) gray_conve...
github_jupyter
## Linear Regression Linear regression may be a good model for some of the data but there is a good chance that it will not model the spatial data (X, Y) well. This would require something such as decision trees or a neural network. Regardless, we will see how the linear regression goes. First we will import the relev...
github_jupyter
# _MiSTree Tutorial 2_ - Minimum Spanning Trees ## (1) _Basic Usage_ To construct the minimum spanning tree (MST) from a data set we will usually interact with the ``get_mst`` class. Unless you need to do something more sophisticated with the MST you will not need to use the internal functions that are used by the cl...
github_jupyter
<h1 style="font-size:35px; color:black; ">Lab 4 Iterative Phase Estimation Algorithm</h1> Prerequisite - [Ch.3.5 Quantum Fourier Transform](https://qiskit.org/textbook/ch-algorithms/quantum-fourier-transform.html) - [Ch.3.6 Quantum Phase Estimation](https://qiskit.org/textbook/ch-algorithms/quantum-pha...
github_jupyter
# Quantizing RNN Models In this example, we show how to quantize recurrent models. Using a pretrained model `model.RNNModel`, we convert the built-in pytorch implementation of LSTM to our own, modular implementation. The pretrained model was generated with: ```time python3 main.py --cuda --emsize 1500 --nhid 150...
github_jupyter
``` """ 3D forward modeling of total-field magnetic anomaly using triaxial ellipsoids (model with isotropic and anisotropic susceptibilities) """ # insert the figures in the notebook %matplotlib inline import numpy as np from fatiando import utils, gridder import triaxial_ellipsoid from mesher import TriaxialEllipsoid...
github_jupyter
<a href="https://colab.research.google.com/github/PGM-Lab/probai-2021-pyro/blob/main/Day2/notebooks/solutions_bayesian_regression_VI.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <span style="color:red">This notebook is an adapted version from </...
github_jupyter
## 範例重點 ### 學習在模型開始前檢查各個環節 1. 是否有 GPU 資源 2. 將前處理轉為函式,統一處理訓練、驗證與測試集 3. 將超參數變數化,易於重複使用函式、模型等 ``` ## 確認硬體資源 (如果你是在 Linux, 若是在 Windows, 請參考 https://blog.csdn.net/idwtwt/article/details/78017565) !nvidia-smi import os from tensorflow import keras # 本範例不需使用 GPU, 將 GPU 設定為 "無" os.environ["CUDA_VISIBLE_DEVICES"] = "" # 從 Ker...
github_jupyter
# Read csv md files and load to notes db ``` import sqlite3 import os import pandas as pd import platform import sys HOME = os.environ['HOME'] email = 'james.f.owers+mendeley@gmail.com' # http://support.mendeley.com/customer/en/portal/articles/227951-how-do-i-locate-mendeley-desktop-database-files-on-my-computer- loc ...
github_jupyter
#### Create Data Generator ``` class DataGen(tf.keras.utils.Sequence): def __init(self, ids, path, batch_size=8, image_size=64): self.ids = ids self.path = path self.batch_size = batch_size self.image_size = image_size self.on_epoch_end() def __load__(self, id_name)...
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
``` # Copyright 2021 NVIDIA Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
github_jupyter
# Keep Calm and Parquet In this workshop we will be leveraging a number of analytics tools to show the diversity of the AWS platform. We will walk through querying unoptimized csv files and converting them to Parquet to improve performance. We also want to show how you can access data in your data lake with Redshift, ...
github_jupyter
## Introduction (You can also read this article on our website, [Easy-TensorFlow](http://www.easy-tensorflow.com/basics/graph-and-session)) Why do we need tensorflow? Why are people crazy about it? In a way, it is lazy computing and offers flexibility in the way you run your code. What is this thing with flexbility a...
github_jupyter
<div style="text-align:center"> <h1> Datatypes </h1> <h2> CS3100 Monsoon 2020 </h2> </div> ## Review Previously * Function definition and application * Anonymous and recursive functions * Tail call optimisation This lecture, * Data types ## Type aliases OCaml supports the definition of aliases for existi...
github_jupyter
# OpenMM Introduction ## User Guide * [OpenMM Users Manual and Theory Guide](http://docs.openmm.org/latest/userguide/index.html) <br> The place where you should look first! Good Explanations! * Theory: [Standard Forces](http://docs.openmm.org/latest/userguide/theory.html#standard-forces) <br> If you wa...
github_jupyter
``` (require gamble racket/list) ``` #The littlest radar blip problem. This should illustrate the problems of representing uncertainty about existence, number, and origin. I think a reasonable way to generate the blips at each time step is 1. generate the real blips, with each airplane having an independe...
github_jupyter
``` #@title Copyright 2019 Google LLC. { display-mode: "form" } # 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...
github_jupyter
``` from pycuGMRES import * # //extern "C" { # void *pycumalloc(unsigned int amount, size_t unit_size, cudaError_t *err) # { # void *dev_array; # unsigned int size = amount * unit_size; # *err = cudaMalloc(&dev_array, size); # return dev_array; # } # //} # pycumalloc = get_function('pycumalloc', path...
github_jupyter
.. R33_: .. title:: R33 # Analysis of R33 Data ``` # Created on Sat May 1 15:12:38 2019 # @author: Semeon Risom # @email: semeon.risom@gmail.com # @url: https://semeon.io/d/R33-analysis # @purpose: Hub for running processing and analysis. ``` ## local import # parameters ## set current date ## load pa...
github_jupyter
#Klassifikation von Song-Texten Die Aufgabe, oder auch das Ziel besteht darin, dass man anhand von Song-Texten vorhersagt von welchem Genre ein Lied ist. Bei der Umsetzung soll man unterschiedliche Methoden verwenden und diese untereinander auch vergleichen, dabei sollen die unterschiedlichen Methoden aus dem Machine ...
github_jupyter
# Import Library ``` import pandas as pd import numpy as np import fasttext import fasttext.util from keras.layers import Input, Dense, Embedding, Conv2D, MaxPool2D from keras.layers import Reshape, Flatten, Dropout, Concatenate from keras.callbacks import ModelCheckpoint from keras.optimizers import Adam from keras.m...
github_jupyter
# Introduction to Data Science – Text Munging Exercises *COMP 5360 / MATH 4100, University of Utah, http://datasciencecourse.net/* ## NLP ### Exercise 1.1: Frequent Words Find the most frequently used words in Moby Dick which are not stopwords and not punctuation. Hint: [`str.isalpha()`](https://docs.python.org/3/lib...
github_jupyter
<div class="alert alert-block alert-info" style="margin-top: 20px"> <a href="https://cocl.us/topNotebooksPython101Coursera"> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/PY0101EN/Ad/TopAd.png" width="750" align="center"> </a> </div> <h1>Reading Files Pytho...
github_jupyter
<a href="https://colab.research.google.com/github/Hkherdekar/Covid19/blob/master/Covid19.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #!pip install apache-airflow #importing libraries import pandas as pd #Data processing import numpy as np #M...
github_jupyter
<a href="https://colab.research.google.com/github/aayushkumar20/ML-based-projects./blob/main/Lane%20Detection/Lane%20Detection.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !import os !import numpy as np !import tkinter as tk !import cv2 #Imp...
github_jupyter
作业五 相似度计算 任务描述:采用word2vec方法,进行句子相似度计算训练。 给出一个有关句子相似度的二分类数据集msr_paraphrase(包含train、test、README三个文件),其中第一列数字1代表相似,0代表不相似。 选择文件train中的string1&2部分作为训练语料,选择文件test计算句子相似度,然后与标注结果比较,输出你认为合适的分类阈值,以及该阈值下的准确率Accuracy,精确率Precision,召回率Recall和F1值(精确到小数点后两位)。 句向量相似度计算方式: 首先对句子分词,获取每个词的词向量,然后将所有的词向量相加求平均,得到句子向量,最后计算两个...
github_jupyter
``` import pandas as pd import numpy as np import seaborn as sns import folium import matplotlib.pyplot as plt from sklearn.ensemble import IsolationForest %matplotlib inline data = pd.read_csv("../data/StockX-Data-Consolidated.csv") data.info(verbose=True) ``` # 1. EDA on Target Value ``` y = pd.DataFrame(data[['Pct...
github_jupyter
# SR-SAN > Session-based Recommendation with Self-Attention Networks. Session-based recommendation aims to predict user's next behavior from current session and previous anonymous sessions. Capturing long-range dependencies between items is a vital challenge in session-based recommendation. A novel approach is propose...
github_jupyter
# <b>Object Detection with AutoML Vision</b> <br> ## <b>Learning Objectives</b> ## 1. Learn how to create and import an image dataset to AutoML Vision 1. Learn how to train an AutoML object detection model 1. Learn how to evaluate a model trained with AutoML 1. Learn how to deploy a model trained with AutoML 1. Learn...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/monk_v1/blob/master/study_roadmaps/2_transfer_learning_roadmap/3_effect_of_number_of_classes_in_dataset/3)%20Understand%20transfer%20learning%20and%20the%20role%20of%20number%20of%20dataset%20classes%20in%20it%20-%20Keras.ipynb" target="_parent"><img ...
github_jupyter
<div align="center"> <h1><img width="30" src="https://madewithml.com/static/images/rounded_logo.png">&nbsp;<a href="https://madewithml.com/">Made With ML</a></h1> Applied ML · MLOps · Production <br> Join 30K+ developers in learning how to responsibly <a href="https://madewithml.com/about/">deliver value</a> with ML. ...
github_jupyter
# Monte Carlo Methods: Lab 1 Take a look at Chapter 10 of Newman's *Computational Physics with Python* where much of this material is drawn from. ``` from IPython.core.display import HTML css_file = 'https://raw.githubusercontent.com/ngcm/training-public/master/ipython_notebook_styles/ngcmstyle.css' HTML(url=css_file...
github_jupyter
# Analyzing IMDB Data in Keras ``` # Imports import numpy as np import keras from keras.datasets import imdb from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.preprocessing.text import Tokenizer import matplotlib.pyplot as plt %matplotlib inline np.random.seed(42) ``` ...
github_jupyter
``` !pip install git+https://github.com/slremy/netsapi --user --upgrade from netsapi.challenge import * import pandas as pd import numpy as np import itertools import copy class RemyGA: ''' Simple Genetic Algorithm. https://github.com/slremy/estool/ ''' def __init__(self, num_params, # number of mo...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Containers" data-toc-modified-id="Containers-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Containers</a></span><ul class="toc-item"><li><span><a href="#1.-Tuples" data-toc-modified-id="1.-Tuples-1.1"><...
github_jupyter
``` from numpy.random import seed import numpy as np class AdalineSGD(object): def __init__(self, eta=0.01, n_iter=10, shuffle=True, random_state=None): self.eta = eta self.n_iter = n_iter self.w_initialized = False self.shuffle = shuffle if random_state: ...
github_jupyter
# Tutorial 01: Introduction *Authors: Zach del Rosario* --- This is an introduction to `py_grama`, a toolset for building and anlyzing models in Python. **Learning Goals**: By completing this notebook, you will learn: 1. How to install `py_grama` 1. How to run `py_grama` in a Jupyter notebook 1. *grama* verb classe...
github_jupyter
# Data Object Service Demo This notebook demonstrates how to use the demonstration server and client to make a simple Data Object service that makes available data from a few different sources. ## Installing the Python package First, we'll install the Data Object Service Schemas package from PyPi, it includes a Pyth...
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="#はじめに" data-toc-modified-id="はじめに-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>はじめに</a></span><ul class="toc-item"><li><span><a href="#研究の目的" data-toc-modified-id="研究の目的-1.1"><s...
github_jupyter
# Named Entity Recognition in Mandarin on a Weibo Social Media Dataset --- [Github](https://github.com/eugenesiow/practical-ml/blob/master/notebooks/Named_Entity_Recognition_Mandarin_Weibo.ipynb) | More Notebooks @ [eugenesiow/practical-ml](https://github.com/eugenesiow/practical-ml) --- Notebook to train a [...
github_jupyter
``` %matplotlib inline ``` `파이토치(PyTorch) 기본 익히기 <intro.html>`_ || `빠른 시작 <quickstart_tutorial.html>`_ || `텐서(Tensor) <tensorqs_tutorial.html>`_ || `Dataset과 Dataloader <data_tutorial.html>`_ || `변형(Transform) <transforms_tutorial.html>`_ || `신경망 모델 구성하기 <buildmodel_tutorial.html>`_ || `Autograd <autogradqs_tutorial....
github_jupyter
``` %matplotlib inline ``` Learning Hybrid Frontend Syntax Through Example =============================================== **Author:** `Nathan Inkawhich <https://github.com/inkawhich>`_ This document is meant to highlight the syntax of the Hybrid Frontend through a non-code intensive example. The Hybrid Frontend is ...
github_jupyter
The **beta-binomial** can be written as $$ y_i \sim Bin(\theta_i, n_i) $$ $$ \theta_i \sim Beta(\alpha, \beta) $$ The **posterior distribution** is approximately equivalent to $$ p(\theta, \alpha, \beta|y) \propto p(\alpha, \beta) \times p(\theta | \alpha, \beta) \times p( y| \theta, \alpha, \beta) $$ The **beta di...
github_jupyter
# Assignment 2: Deep N-grams Welcome to the second assignment of course 3. In this assignment you will explore Recurrent Neural Networks `RNN`. - You will be using the fundamentals of google's [trax](https://github.com/google/trax) package to implement any kind of deeplearning model. By completing this assignment, ...
github_jupyter
# T81-558: Applications of Deep Neural Networks **Module 7: Generative Adversarial Networks** * Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), McKelvey School of Engineering, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx) * For more information visit the...
github_jupyter
# Python Tutorial for Data Science ## Introduction to Machine Learning: Classification with k-Nearest Neighbors #### (Adapted from Data 8 Fall 2017 Project 3) #### Patrick Chao 1/21/18 # Introduction The purpose of this notebook is to serve as an elementary python tutorial introducing fundamental data science concept...
github_jupyter
``` from config import (BATCH_SIZE, CLIP_REWARD, DISCOUNT_FACTOR, ENV_NAME, EVAL_LENGTH, FRAMES_BETWEEN_EVAL, INPUT_SHAPE, LEARNING_RATE, LOAD_FROM, LOAD_REPLAY_BUFFER, MAX_EPISODE_LENGTH, MAX_NOOP_STEPS, MEM_SIZE, MIN_REPLAY_BUFFER_SIZE, P...
github_jupyter
<div style="text-align: right">NEU Skunkworks AI workshop at Northeastern with EM Lyon Business School</div> ## Predicting Ad Lift with a Neural Network ### What is lift? When one serves ads one has a choice of various channels to place ads. For an individual that choice might be to place ads on facebook, Twitter, I...
github_jupyter
### Packages ``` import numpy as np import pandas as pd import scipy import statsmodels.api as sm import matplotlib.pyplot as plt import seaborn as sns import sklearn from statsmodels.tsa.arima_model import ARIMA from arch import arch_model import seaborn as sns import yfinance import warnings warnings.filterwarnings(...
github_jupyter
# PCA for Algorithmic Trading: Eigen Portfolios ## Imports & Settings ``` import warnings warnings.filterwarnings('ignore') %matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.decomposition import PCA from sklearn.preprocessing import scale sn...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm #Data Loading data = np.genfromtxt('sgd_data.txt',delimiter = ',') x = np.zeros((40,1), dtype = np.float) y = np.zeros((40,1), dtype = np.float) for i in range(data.shape[0]): x[i] = data[i][0] f...
github_jupyter
``` import pyprob from pyprob import Model from pyprob.distributions import Normal from pyprob.distributions import Uniform from pyprob.distributions import Categorical import torch import numpy as np import math import matplotlib.pyplot as plt %matplotlib inline fig = plt.figure(); def plotDist(dist, min_vals=-10, ma...
github_jupyter
# Statistics :label:`sec_statistics` Undoubtedly, to be a top deep learning practitioner, the ability to train the state-of-the-art and high accurate models is crucial. However, it is often unclear when improvements are significant, or only the result of random fluctuations in the training process. To be able to dis...
github_jupyter
# Build and train your first deep learning model This notebook describes how to build a basic neural network with CNTK. We'll train a model on [the iris data set](https://archive.ics.uci.edu/ml/datasets/iris) to classify iris flowers. This dataset contains 4 features that describe an iris flower belonging to one of thr...
github_jupyter
# Use Your Own Inference Code with Amazon SageMaker XGBoost Algorithm _**Customized inference for computing SHAP values with Amazon SageMaker XGBoost script mode**_ --- ## Contents 1. [Introduction](#Introduction) 2. [Setup](#Setup) 3. [Training the XGBoost model](#Training-the-XGBoost-model) 4. [Deploying the XGBoos...
github_jupyter
## Dictionaries - [Download the lecture notes](https://philchodrow.github.io/PIC16A/content/basics/dictionaries.ipynb). Dictionaries (or `dict`s) are iterables, like lists, tuples, and sets. We've given them their own lecture notes because they are exceptionally useful and also somewhat more complicated than other c...
github_jupyter
# Import statements ``` from google.colab import drive drive.mount('/content/drive') from my_ml_lib import MetricTools, PlotTools import os import numpy as np import matplotlib.pyplot as plt import pickle import pandas as pd import matplotlib.pyplot as plt from matplotlib.pyplot import figure import json import dat...
github_jupyter
<div style="text-align: center; line-height: 0; padding-top: 2px;"> <img src="https://www.quantiaconsulting.com/logos/quantia_logo_orizz.png" alt="Quantia Consulting" style="width: 600px; height: 250px"> </div> # Prequential Error - Solution ``` import numpy as np from sklearn import datasets as skdatasets from riv...
github_jupyter