text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# In this notebook a Q learner with dyna will be trained and evaluated. The Q learner recommends when to buy or sell shares of one particular stock, and in which quantity (in fact it determines the desired fraction of shares in the total portfolio value). ``` # Basic imports import os import pandas as pd import matplo...
github_jupyter
``` import cv2 import numpy as np import matplotlib.pyplot as plt %matplotlib inline img = cv2.imread("../imori.jpg") plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) plt.show() def bgr_to_gray(img): b = img[:, :, 0].copy() g = img[:, :, 1].copy() r = img[:, :, 2].copy() output_image = (0.2126*r + 0.715...
github_jupyter
# Predictions with Faster RCNN We need to install coco tools. ``` #!pip install pycocotools-windows import pycocotools import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from PIL import Image from PIL import ImageDraw import torch import torch.utils.data import torchvision from torchv...
github_jupyter
*Sebastian Raschka* last modified: 04/03/2014 <hr> I am really looking forward to your comments and suggestions to improve and extend this tutorial! Just send me a quick note via Twitter: [@rasbt](https://twitter.com/rasbt) or Email: [bluewoodtree@gmail.com](mailto:bluewoodtree@gmail.com) <hr> ### Problem Cate...
github_jupyter
##### Copyright 2021 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
# 04: Matrix - An Exercise in Parallelism An early use for Spark has been Machine Learning. Spark's `MLlib` of algorithms contains classes for vectors and matrices, which are important for many ML algorithms. This exercise uses a simpler representation of matrices to explore another topic; explicit parallelism. The s...
github_jupyter
# Text Analysis - Dictionary of the Spanish language - **Created by: Andrés Segura-Tinoco** - **Created on: Aug 20, 2020** - **Created on: Aug 02, 2021** - **Data: Dictionary of the Spanish language** ### Text Analysis 1. Approximate number of words in the DSL 2. Number of words with acute accent in Spanish language 3...
github_jupyter
``` import pandas as pds import sklearn as skl import seaborn as sns import numpy as num planetas = pds.read_csv("cumulative.csv") planetas.replace('',num.nan,inplace = True) planetas.dropna(inplace = True) ``` # Para demonstrarmos o funcionamento das diferentes funções de Kernel num SVM, vamos pegar um database não-t...
github_jupyter
``` import math import numpy as np import h5py import matplotlib.pyplot as plt import scipy #from PIL import Image from scipy import ndimage import tensorflow as tf from tensorflow.python.framework import ops from cnn_utils import * from sklearn.decomposition import PCA from scipy.stats.mstats import zscore # This is t...
github_jupyter
# Federated Learning with Clara Train SDK Medical data is sensitive and needs to be protected. And even after anonymization processes, it is often infeasible to collect and share patient data from several institutions in a centralised data lake. This poses challenges for training machine learning algorithms, such as...
github_jupyter
# 2.04 Figure 4 --- Author: Riley X. Brady Date: 11/19/20 This plots the distribution of biogeochemical tracers at their statistical origin relative to their 1000 m crossing. See notebook `1.03` for the calculation of tracers at their memory time origin and `1.04` for finding their ambient mixed layer temperatures....
github_jupyter
##### Copyright 2019 The TensorFlow Probability Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of th...
github_jupyter
YAML support is provided by PyYAML at http://pyyaml.org/. This notebook depends on it. ``` import yaml ``` The following cell provides an initial example of a *note* in our system. A *note* is nothing more than a YAML document. The idea of notetaking is to keep it simple, so a note should make no assumptions about ...
github_jupyter
# 1. LGDE.com 일별 지표생성 실습 1일차 (정답) #### 주피터 노트북 단축키 (Windows 환경) | 단축키 | 설명 | 기타 | | --- | --- | --- | | Alt+Enter | 현재 셀 실행 + 다음 셀 추가 | 초기 개발 시에 주로 사용 | | Shift+Enter | 현재 셀 실행 + 다음 셀 이동 | 전체 테스트 시에 주로 사용 | | Ctrl+Enter | 현재 셀 실행 + 이동 안함 | 하나씩 점검 혹은 디버깅 시에 사용 | | Ctrl+/ | 주석 적용 및 해제 | Shift 키로 여러 줄을 선택하고 주석 및 해제 사용 | ...
github_jupyter
# lhorizon example 1: where was GALEX in May 2003? Imagine that you are examining a portion of the observational data record of the GALEX space telescope from May 2003 and you realize that there is an anomaly that might be explicable by a barycentric time offset. A SPK SPICE kernel for GALEX may exist somewhere, but y...
github_jupyter
<a href="https://colab.research.google.com/github/conference-submitter/jax-md/blob/master/notebooks/flocking.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Copyright JAX MD Authors Licensed under the Apache License, Version 2.0 (the "License"); yo...
github_jupyter
``` import pandas import matplotlib as mpl import xarray as xr import numpy as np import datetime as dt dir_cmc='F:/data/sst/cmc/CMC0.2deg/v2/' dir_cmc_clim='F:/data/sst/cmc/CMC0.2deg/v2/climatology/' def get_filename(lyr,idyjl): podaac_dir_v3 = 'https://podaac-opendap.jpl.nasa.gov/opendap/allData/ghrsst/data/GDS2...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' import pickle import numpy as np import pandas as pd import skimage.io as io import matplotlib.pyplot as plt %matplotlib inline import warnings warnings.filterwarnings("ignore") from keras.applications.resnet50 import preprocess_input from keras.models import Mode...
github_jupyter
##### Copyright 2020 The OpenFermion Developers ``` #@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 ...
github_jupyter
# Evaluate a trained encoder Notebook Author: Aniket Tekawade, Argonne National Laboratory, atekawade@anl.gov This notebook will run some tests on a trained encoder-decoder model to (1) visualize the latent space clusters (2) evaluate segmentation accuracy (3) something else (4) and something else. ### Set paths...
github_jupyter
# Benchmark ML Computation Speed In this notebook, we test the computational performance of [digifellow](https://digifellow.swfcloud.de/hub/spawn) jupyterhub performance against free access like *Colab* and *Kaggle*. The baseline of this comparison is an average PC *(Core i5 2.5GHz - 8GB RAM - No GPU)* The task of t...
github_jupyter
<h1> <b>Homework 2</b></h1> <i>Alejandro J. Rojas<br> ale@ischool.berkeley.edu<br> W261: Machine Learning at Scale<br> Week: 02<br> Jan 26, 2016</i></li> <h2>HW2.0. </h2> What is a race condition in the context of parallel computation? Give an example. What is MapReduce? How does it differ from Hadoop? Which programm...
github_jupyter
``` import numpy as np import sys sys.path.append('../external/Transformer_modules/') sys.path.append('../src/') import torch, torch.nn as nn import torch.nn.functional as F from modules import MultiHeadAttention, PositionwiseFeedForward import mnist %load_ext autoreload %autoreload 2 import torch, torch.nn as nn impor...
github_jupyter
# Motivación: Redes Neuronales Convolucionales La información que extraemos de las entradas sensoriales a menudo está determinada por su contexto. Con las imágenes, podemos suponer que los píxeles cercanos están estrechamente relacionados y su información colectiva es más relevante cuando se toma como una unidad. Por ...
github_jupyter
# Investigating the historical running data to evaluate my performance (Session summaries) Many runners use third-party apps to track running activities. These apps and its companion website provide many visual charts with analytical metrics to help runners review their running performances to set up new training plan...
github_jupyter
# Import necessary depencencies ``` import pandas as pd import numpy as np import text_normalizer as tn import model_evaluation_utils as meu np.set_printoptions(precision=2, linewidth=80) ``` # Load and normalize data ``` dataset = pd.read_csv(r'movie_reviews.csv') # take a peek at the data print(dataset.head()) r...
github_jupyter
[Sascha Spors](https://orcid.org/0000-0001-7225-9992), Professorship Signal Theory and Digital Signal Processing, [Institute of Communications Engineering (INT)](https://www.int.uni-rostock.de/), Faculty of Computer Science and Electrical Engineering (IEF), [University of Rostock, Germany](https://www.uni-rostock.de/en...
github_jupyter
# PixdosepiX-OpenKBP---2020-AAPM-Grand-Challenge- ## Introduction The aim of the OpenKBP Challenge is to advance fair and consistent comparisons of dose prediction methods for knowledge-based planning (KBP). Participants of the challenge will use a large dataset to train, test, and compare their prediction methods, u...
github_jupyter
# <b>Document AI features demo 1</b> The AIServiceVisionClient offers the document <b>text detection</b> feature. This notebook aims to provide overall clarity about the feature to the user in terms of requirements, usage and the output of the API.<br> <ul> <li>The raw output is saved as <code>response_document_de...
github_jupyter
# Convolutional Networks So far we have worked with deep fully-connected networks, using them to explore different optimization strategies and network architectures. Fully-connected networks are a good testbed for experimentation because they are very computationally efficient, but in practice all state-of-the-art resu...
github_jupyter
Wayne Nixalo - 2017-Jun-12 17:27 Code-Along of Lesson 5 JNB. Lesson 5 NB: https://github.com/fastai/courses/blob/master/deeplearning1/nbs/lesson5.ipynb [Lecture](https://www.youtube.com/watch?v=qvRL74L81lg) ``` import theano %matplotlib inline import sys, os sys.path.insert(1, os.path.join('utils')) import utils;...
github_jupyter
# Barycenters of persistence diagrams Theo Lacombe https://tlacombe.github.io/ ## A statistical descriptor in the persistence diagram space This tutorial presents the concept of barycenter, or __Fréchet mean__, of a family of persistence diagrams. Fréchet means, in the context of persistence diagrams, were initiall...
github_jupyter
# Dataframe basics ### Dr. Tirthajyoti Sarkar, Fremont, CA 94536 ### Apache Spark Apache Spark is one of the hottest new trends in the technology domain. It is the framework with probably the highest potential to realize the fruit of the marriage between Big Data and Machine Learning. It runs fast (up to 100x faster th...
github_jupyter
## Driver code for training models to learn pipeline 1 x pipeline 2 transform maps - Note: currently using output after atlas-based grouping - Atlas used: aparc (Freesurfer) DKT-31 Mindboggle (ANTs: https://mindboggle.readthedocs.io/en/latest/labels.html) ``` import sys import numpy as np import pandas as pd import it...
github_jupyter
# 基于 BipartiteGraphSage 的二部图无监督学习 二部图是电子商务推荐场景中很常见的一种图,GraphScope提供了针对二部图处理学习任务的模型。本次教程,我们将会展示GraphScope如何使用BipartiteGraphSage算法在二部图上训练一个无监督学习模型。 本次教程的学习任务是链接预测,通过计算在图中用户顶点和商品顶点之间存在边的概率来预测链接。 在这一任务中,我们使用GraphScope内置的BipartiteGraphSage算法在 [U2I](http://graph-learn-dataset.oss-cn-zhangjiakou.aliyuncs.com/u2i.zip) 数据集...
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
# Object Detection @Edge with SageMaker Neo + Pytorch Yolov5 **SageMaker Studio Kernel**: Data Science In this exercise you'll: - Get a pre-trained model: Yolov5 - Prepare the model to compile it with Neo - Compile the model for the target: **X86_64** - Get the optimized model and run a simple local test ...
github_jupyter
# K-Fold Cross Validation + Grid Search cv + Principal Componenet Analysis + Kernel SVM on Wine Dataset GridSearchCV implements a “fit” method and a “predict” method like any classifier except that the parameters of the classifier used to predict is optimized by cross-validation. ... This enables searching over any se...
github_jupyter
``` from __future__ import print_function, division import pickle import torch import sys # sys.path.append('../../res/') from loader import synthetic_loader # from loader import city_scapes_loader import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable import numpy as np impo...
github_jupyter
# Building a Regression Model for a Financial Dataset In this notebook, you will build a simple linear regression model to predict the closing AAPL stock price. The lab objectives are: * Pull data from BigQuery into a Pandas dataframe * Use Matplotlib to visualize data * Use Scikit-Learn to build a regression model `...
github_jupyter
<a href="https://colab.research.google.com/github/chemaar/python-programming-course/blob/master/Lab_5_Data_Structures_Lists_Strings_STUDENT.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Lab 5: Data structures: Lists and strings In this notebook...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '' import sentencepiece as spm sp_model = spm.SentencePieceProcessor() sp_model.Load('prepare/sp10m.cased.ms-en.model') import tensorflow as tf import tensorflow_text import struct unknown = b'\xff\xff\xff\xff' def load_graph(frozen_graph_filename): with tf.gfil...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Distributed Tensorflow with Horovod In this tutorial, you will train a word2vec model in TensorFlow using distributed training via [Horovod](https://github.com/uber/horovod). ## Prerequisites * Understand the [architecture an...
github_jupyter
# Imports ``` import sys import numpy as np import matplotlib.pyplot as plt from sklearn import svm from sklearn.decomposition import PCA from sklearn.pipeline import make_pipeline from sklearn.preprocessing import MinMaxScaler from sklearn.externals import joblib import torch import torchvision import torchvisi...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#Initialize-Environment" data-toc-modified-id="Initialize-Environment-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Initialize Environment</a></div><div class="lev1 toc-item"><a href="#Load-Toy-Data" data-toc-modified-id="Load-Toy-Data-2"><span class="toc-...
github_jupyter
## Exercise L3 - 1: Diagnose Dataset Level and Select Last Encounter ### Instructions - Given the dataset, convert the dataset to a longitudinal level but select only the last encounter for each patient. - Assume that that the order of encounter IDs is indicative of the time for encounter. In other words a lower numbe...
github_jupyter
Generalized Method of Moments ============================= *Generalized method of moments* (GMM) is an estimation principle that extends *method of moments*. It seeks the parameter that minimizes a quadratic form of the moments. It is particularly useful in estimating structural models in which moment conditions can ...
github_jupyter
![](https://images.unsplash.com/photo-1602084551218-a28205125639?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80) <div class = 'alert alert-block alert-info' style = 'background-color:#4c1c84; color:#eeebf1; border-width:5px; ...
github_jupyter
``` import torch import time import torch.nn as nn import torch.optim as optim from torch.utils.data import Dataset,DataLoader import pandas as pd import numpy as np !pip install transformers==3.3.1 !pip install sentencepiece import sentencepiece from transformers import AutoModel, AutoTokenizer from torch i...
github_jupyter
``` # Copyright 2022 Google LLC # # 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 agreed to in writi...
github_jupyter
# Energy Meter Examples ## Monsoon Power Monitor *NOTE*: the **monsoon.py** tool is required to collect data from the power monitor. Instructions on how to install it can be found here: https://github.com/ARM-software/lisa/wiki/Energy-Meters-Requirements#monsoon-power-monitor. ``` import logging from conf import L...
github_jupyter
<a href="https://colab.research.google.com/github/conquerv0/Pynaissance/blob/master/1.%20Basic%20Framework/Data_Visualization.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Data Visualization Guide This notebook features data visualization techni...
github_jupyter
# Doc2Vec to wikipedia articles We conduct the replication to **Document Embedding with Paragraph Vectors** (http://arxiv.org/abs/1507.07998). In this paper, they showed only DBOW results to Wikipedia data. So we replicate this experiments using not only DBOW but also DM. ## Basic Setup Let's import Doc2Vec module. ...
github_jupyter
<img src='images/pic1.jpg'/> ``` import warnings warnings.filterwarnings("ignore") import pandas as pd import sqlite3 import csv import matplotlib.pyplot as plt import seaborn as sns import numpy as np from wordcloud import WordCloud import re import os from sklearn.model_selection import GridSearchCV f...
github_jupyter
# Interact with decay data in ENDF-6 format (MF=8, MT=457) First import `sandy` and other packages importing for formatting and postprocessing that are used in this notebook. ``` import os import yaml from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" import s...
github_jupyter
``` # This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O...
github_jupyter
# NLP (Natural Language Processing) with Python This is the notebook that goes along with the NLP video lecture! In this lecture we will discuss a higher level overview of the basics of Natural Language Processing, which basically consists of combining machine learning techniques with text, and using math and statist...
github_jupyter
``` import panel as pn pn.extension() ``` The ``FloatSlider`` widget allows selecting selecting a numeric floating-point value within a set bounds using a slider. For more information about listening to widget events and laying out widgets refer to the [widgets user guide](../../user_guide/Widgets.ipynb). Alternativ...
github_jupyter
In this note book, I * replicate some of the simulations in the paers, and * add some variations of my own. <table align="left"> <td> <a target="_blank" href="https://colab.research.google.com/github/facebookresearch/mc/blob/master/notebooks/simulations_py.ipynb"><img src="https://www.tensorflow.org/images/colab...
github_jupyter
``` import pymongo import os import pandas as pd import yaml from collections import Counter from datetime import datetime import sys SRC = os.path.join(os.path.dirname(os.path.dirname(os.getcwd())), "src") sys.path.append(SRC) from content_api.details_utils import extract_from_details, cs_extract_text, cs_extract_link...
github_jupyter
Blankenbach Benchmark Case 2a ====== Temperature dependent convection ---- This is a benchmark case of two-dimensional, incompressible, bottom heated, temperature dependent convection. This example is based on case 2a in Blankenbach *et al.* 1989 for a single Rayleigh number ($Ra = 10^7$). Here a temperature field t...
github_jupyter
#Demo: Interpolator *This script provides a few examples on using the Interpolator class. Last updated: April 14, 2015. Copyright (C) 2014 Randall Romero-Aguilar Licensed under the MIT license, see LICENSE.txt* *Interpolator* is a subclass of *Basis*. * A *Basis* object contains data to compute the interpolation ma...
github_jupyter
``` import matplotlib.pyplot as plt import pandas as pd import numpy as np MAX_EVALUE = 1e-2 ``` # Data Overview This notebook provides an overview of source datasets - training, testing and 3k bacteria. # Training data ## ClusterFinder BGCs (positives) ** Used for: Model training ** CSV file with protein domains...
github_jupyter
# Homework: Understanding Performance using a LinkedIn Dataset This homework focuses on understanding performance using a LinkedIn dataset. It is the same dataset that was used in the module entitled "Modeling Data and Knowledge". ``` !pip install pandas !pip install numpy !pip install matplotlib !pip install pymong...
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
# Initialization ``` !pip install -U sentence-transformers from sentence_transformers import SentenceTransformer, util import torch import json import numpy as np import pandas as pd ISSUES_FILE = 'drive/MyDrive/bugs_data/eall.csv' CUSTOM_MODEL_PATH = 'drive/MyDrive/bugs_data/models/paraphrase-distilroberta-base-v1-ea...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline from torch.utils.data import Dataset, DataLoader import torch import torchvision import torch.nn as nn import torch.optim as optim from torch.nn import functional as F device = torch.device("cuda" i...
github_jupyter
``` import pandas as pd # data package import matplotlib.pyplot as plt # graphics import datetime as dt import numpy as np from census import Census # This is new... import requests, io # internet and input tools import zipfile as zf # zip file tools import os #import weighted...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import dill as pickle from sklearn.model_selection import train_test_split, GridSearchCV, cross_val_score from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.pipeline import Pipeline from sklearn....
github_jupyter
# This notebook demonstrates how to download the netcdf POES data files (in netcdf format) for a given date range (there are multiple files per day), process them to get auroral boundary (equatorward) and plot it! ``` import os import datetime from poes import dwnld_poes, get_aur_bnd, poes_plot_utils from davitpy impo...
github_jupyter
# Model-Centric Federated Learning for Mobile - MNIST Example This notebook will walk you through creating a simple model and a training plan, and hosting both as a federated learning process for further training using OpenMined mobile FL workers. This notebook is similar to "[MCFL - Create Plan](mcfl_create_plan.ipy...
github_jupyter
## Classes for callback implementors ``` from fastai.gen_doc.nbdoc import * from fastai.callback import * from fastai.basics import * ``` fastai provides a powerful *callback* system, which is documented on the [`callbacks`](/callbacks.html#callbacks) page; look on that page if you're just looking for how to use exi...
github_jupyter
# 1. SETTINGS ``` # libraries import pandas as pd import numpy as np from sklearn.metrics import roc_auc_score from sklearn.model_selection import StratifiedKFold import lightgbm as lgb import seaborn as sns import matplotlib.pyplot as plt # garbage collection import gc gc.enable() # pandas options pd.set_option("disp...
github_jupyter
``` from openrtdynamics2.dsp import * import math import numpy as np import openrtdynamics2.lang, openrtdynamics2.dsp as dy import openrtdynamics2.py_execute as dyexe import openrtdynamics2.targets as tg import os import matplotlib.pyplot as plt #%matplotlib widget # https://github.com/matplotlib/ipympl from vehicle...
github_jupyter
``` import tensorflow as tf from keras.backend.tensorflow_backend import set_session # config = tf.ConfigProto() # config.gpu_options.allocator_type = 'BFC' #A "Best-fit with coalescing" algorithm, simplified from a version of dlmalloc. # config.gpu_options.per_process_gpu_memory_fraction = 0.3 # config.gpu_options.all...
github_jupyter
``` import random import os from PIL import Image import numpy as np import matplotlib.pyplot as plt import copy import pickle #generate stats from collections import defaultdict from collections import Counter %matplotlib inline import json #load categories yolo and coco names import numpy as np x = np.loadtxt('categ...
github_jupyter
<a href="https://colab.research.google.com/github/moh2236945/Natural-language-processing/blob/master/Apply%20features%20extrating%20and%20text%20normalization.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import re import pandas as pd import m...
github_jupyter
# T1046 - Network Service Scanning Adversaries may attempt to get a listing of services running on remote hosts, including those that may be vulnerable to remote software exploitation. Methods to acquire this information include port scans and vulnerability scans using tools that are brought onto a system. Within clo...
github_jupyter
# Heart Desease Prediction Execise: Predict if a patient has a heart disease or not. We have a data which classified if patients have heart disease or not according to features in it. We will try to use this data to create a model which tries predict if a patient has this disease or not. Dataset = https://archive.ics...
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
This notebook runs various solvers for a single step and dumps out some variables -- it is intended for unit testing. At the moment, it is required to be at the top-level `pyro/` directory, because not all the functions find pyro's home directory on their own. ``` from pyro import Pyro ``` ## advection ``` solver =...
github_jupyter
# A sample example to tuning the hyperparameters of Prophet classifier is shown as usecase. ``` from mango.tuner import Tuner from mango.domain.distribution import loguniform param_dict = {"changepoint_prior_scale": loguniform(-3, 4), 'seasonality_prior_scale' : loguniform(1, 2) } ``` # us...
github_jupyter
# 23mer Regression analysis ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import rc from itertools import cycle import pickle import sklearn.manifold from sklearn.metrics import roc_curve, auc, r2_score, mean_squared_error, make_scorer from sklearn.model_selection import t...
github_jupyter
## CSc 4222 - Cyber Security | Assignment 2 ### Bryan W. Nonni ### Password Salt System Implementation and Brutal Force Cracker ### 1. Implementation of the Password Salt System In this section, students are required to implement a password salt verification system. With the given UID and Hash files, students need t...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') !pip install picklable_itertools !pip install fuel !pip install foolbox %reload_ext autoreload %autoreload 2 %matplotlib inline import numpy as np PROJECT_DIR = "/content/drive/My Drive/2018/Colab_Deep_Learning/one_class_neural_networks/" import sys,os ...
github_jupyter
# Vector Norm ``` import numpy as np from scipy import signal from scipy.spatial import distance A = np.array([1+1j, 2+2j, 3+3j, 4+4j, 5+5j]) B = np.array([6-6j, 7-7j, 8-8j, 9-9j, 10-10j]) C = np.array([2,3,5,7,11]) Z = np.array([0,0,0,0,0]) D = np.array([A,B]) ``` For every complex inner product space V(-,-), we ca...
github_jupyter
# COVID-19 Drug Repurposing via gene-compounds relations This example shows how to do drug repurposing using DRKG even with the pretrained model. ## Collecting COVID-19 related disease At the very beginning we need to collect a list of associated genes for Corona-Virus(COV) in DRKG. ``` import pandas as pd import num...
github_jupyter
``` """ You can run either this notebook locally (if you have all the dependencies and a GPU) or on Google Colab. Instructions for setting up Colab are as follows: 1. Open a new Python 3 notebook. 2. Import this notebook from GitHub (File -> Upload Notebook -> "GITHUB" tab -> copy/paste GitHub URL) 3. Connect to an in...
github_jupyter
``` import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd matplotlib.__version__, np.__version__, pd.__version__ ``` ## 2 Plots side by side ``` plt.clf() # sample data x = np.linspace(0.0,100,50) y = np.random.uniform(low=0,high=10,size=50) # create figure and axes fig, axes = p...
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
``` import pandas as pd import numpy as np import os import datetime import simplejson import git import sys repo = git.Repo("./", search_parent_directories=True) homedir = repo.working_dir def makeHMMUnSupData(Input, colname, fipsname): #Takes input dataframe, and gives out HMM format of Input data, a list of list...
github_jupyter
``` import numpy as np import pandas as pd # Code to read csv file into colaboratory: !pip install -U -q PyDrive from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDrive from google.colab import auth from oauth2client.client import GoogleCredentials auth.authenticate_user() gauth = GoogleAuth() gauth...
github_jupyter
# Fuzzing with Grammars In the chapter on ["Mutation-Based Fuzzing"](MutationFuzzer.ipynb), we have seen how to use extra hints – such as sample input files – to speed up test generation. In this chapter, we take this idea one step further, by providing a _specification_ of the legal inputs to a program. Specifying ...
github_jupyter
## widgets.image_cleaner fastai offers several widgets to support the workflow of a deep learning practitioner. The purpose of the widgets are to help you organize, clean, and prepare your data for your model. Widgets are separated by data type. ``` from fastai.vision import * from fastai.widgets import DatasetFormat...
github_jupyter
# WalMart Trip Type ``` import pandas as pd import numpy as np import scipy.stats as stats import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import statsmodels as sm import math import tools plt.rcParams["figure.figsize"] = (10, 8) mpl.style.use('bmh') %matplotlib inline df = pd.read_csv...
github_jupyter
# Masked vs cropped implementation for Gated PixelCNN Hi all, in this notebook we will compare the masked implemntation of the convolutions from the Gated PixelCNN versus the alternative sugexted in the paper, the use of convolutions operaritions with appropriate croppings and padding to achieve the same result. Let's...
github_jupyter
# Comparing two Counters Today we will look at a way of scoring the significance of differences between frequency distributions, based on a method called "Fightin' Words" by Monroe, Colaresi, and Quinn. ``` import re, sys, glob, math import numpy from collections import Counter from matplotlib import pyplot ``` 1. W...
github_jupyter
# 1-Getting Started Always run this statement first, when working with this book: ``` from scipy import * from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" ``` ## Numbers ``` 2 ** (2 + 2) 1j ** 2 # A complex number 1. + 3.0j # Another complex number ``` ##...
github_jupyter
# Road Follower - Train Model In this notebook we will train a neural network to take an input image, and output a set of x, y values corresponding to a target. We will be using PyTorch deep learning framework to train ResNet18 neural network architecture model for road follower application. ``` import torch import ...
github_jupyter
<h1 align="center"> Logistic Regression (Preloaded Dataset) </h1> scikit-learn comes with a few small datasets that do not require to download any file from some external website. The digits dataset we will use is one of these small standard datasets. These datasets are useful to quickly illustrate the behavior of the...
github_jupyter