text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Analyize Google Chrome history Idea and initial code taken from the [Analyzing Browser History Using Python and Pandas](https://applecrazy.github.io/blog/posts/analyzing-browser-hist-using-python/) blogpost by __AppleCrazy__. ``` %matplotlib inline import os import pandas as pd import numpy as np import sqlite3 imp...
github_jupyter
<table align="left" width="100%"> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="../images/qworld.jpg" width="35%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared...
github_jupyter
# Welcome Spokane .NET User Group! ``` //Not explicitly needed #r "System.CommandLine" //Other NuGet packages: #r "nuget:<package name>" using System.CommandLine; using System.CommandLine.Builder; using System.CommandLine.Parsing; using System.CommandLine.Invocation; using System.CommandLine.IO; using Syste...
github_jupyter
# 概率 :label:`sec_prob` 简单地说,机器学习就是做出预测。 根据病人的临床病史,我们可能想预测他们在下一年心脏病发作的*概率*。 在飞机喷气发动机的异常检测中,我们想要评估一组发动机读数为正常运行情况的概率有多大。 在强化学习中,我们希望智能体(agent)能在一个环境中智能地行动。 这意味着我们需要考虑在每种可行的行为下获得高奖励的概率。 当我们建立推荐系统时,我们也需要考虑概率。 例如,假设我们为一家大型在线书店工作,我们可能希望估计某些用户购买特定图书的概率。 为此,我们需要使用概率学。 有完整的课程、专业、论文、职业、甚至院系,都致力于概率学的工作。 所以很自然地,我们在这部分的目标不是教授你整个科目...
github_jupyter
<i>Copyright (c) Microsoft Corporation. All rights reserved.</i> <i>Licensed under the MIT License.</i> # Apply Diversity Metrics ## -- Compare ALS and Random Recommenders on MovieLens (PySpark) In this notebook, we demonstrate how to evaluate a recommender using metrics other than commonly used rating/ranking met...
github_jupyter
# Traveling Salesman Problem (TSP) solved with Genetic Algorithms. The Traveling Salesman Problem is a classic optimization problem that has as objective to calculate the most efficient way to visit N cities with minimum travelled distance. We will use a basic genetic algorithm to solve this problem by finding an opt...
github_jupyter
<br> # Painters Identification using ConvNets ### Marco Tavora <br> ## Index - [Building Convolutional Neural Networks](#convnets) - [Small ConvNets](#smallconvnets) - [Imports for Convnets](#importconvnets) - [Preprocessing](#keraspreprocessing) - [Training the model](#traincnn) ...
github_jupyter
# Demo Collect Rook Usage ``` import pandas as pd import hvplot.pandas # noqa from rooki.client import Rooki # Available hosts hosts = { 'demo': 'rook.dkrz.de', 'dkrz': 'rook3.cloud.dkrz.de', 'ceda': 'rook-wps1.ceda.ac.uk', } # Use cache cache_id = { 'ceda': '1f8181bc-d351-11eb-9402-005056aba41c', ...
github_jupyter
``` import os import json import psycopg2 import pandas as pd import geopandas as gpd from geopandas import GeoSeries, GeoDataFrame import folium import fiona from pyproj import Proj, transform import osmnx as ox import networkx as nx import matplotlib.colors as colors import matplotlib.cm as cm from shapely.ops import...
github_jupyter
``` from sys import modules IN_COLAB = 'google.colab' in modules if IN_COLAB: !pip install -q ir_axioms[examples] python-terrier # Start/initialize PyTerrier. from pyterrier import started, init if not started(): init(tqdm="auto") from pyterrier.datasets import get_dataset, Dataset # Load dataset. dataset_na...
github_jupyter
STAT 453: Deep Learning (Spring 2020) Instructor: Sebastian Raschka (sraschka@wisc.edu) - Course website: http://pages.stat.wisc.edu/~sraschka/teaching/stat453-ss2020/ - GitHub repository: https://github.com/rasbt/stat453-deep-learning-ss20 - Runs on CPU (not recommended here) or GPU (if available) # ResNet-34 Convo...
github_jupyter
# 4.2.2 Dependence on the Node Degree ``` %load_ext autoreload %autoreload 2 %matplotlib notebook from sensible_raw.loaders import loader from world_viewer.cns_world import CNSWorld from world_viewer.glasses import Glasses import pandas as pd import matplotlib.pyplot as plt import numpy as np import networkx as nx fro...
github_jupyter
# Create all possible tSNE This is a quick and dirty script to create all possible tSNEs. ``` # %load ../start.py # Imports import os import sys from pathlib import Path from tempfile import TemporaryDirectory import string import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as ...
github_jupyter
# High-level CNTK Example ``` # Parameters EPOCHS = 10 N_CLASSES=10 BATCHSIZE = 64 LR = 0.01 MOMENTUM = 0.9 GPU = True LOGGER_URL='msdlvm.southcentralus.cloudapp.azure.com' LOGGER_USRENAME='admin' LOGGER_PASSWORD='password' LOGGER_DB='gpudata' LOGGER_SERIES='gpu' import numpy as np import os import sys import cntk fr...
github_jupyter
``` #A notebook for Tweet Sentiment Analysis by Jonathan Ivy import tweepy import re import pickle import matplotlib.pyplot as plt import numpy as np from tweepy import OAuthHandler #does the job of authenticating our client machine with Twitter server #Now initialize all keys we need, and they should be entered in the...
github_jupyter
# SQLAlchemy-Mutable examples ## SQAlchemy setup ``` from sqlalchemy_mutable import Mutable, MutableType, MutableModelBase, Query, partial from sqlalchemy import Column, Integer, String, create_engine from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy.ext.declarative import declarative_base fr...
github_jupyter
## Lagrange interpolation Given $(n+1)$ distinct points $\{q_i\}_{i=0}^n$ in the interval $[0,1]$, we define the *Lagrange interpolation* operator $\mathcal{L}^n$ the operator $$ \mathcal{L}^n : C^0([0,1]) \mapsto \mathcal{P}^n $$ which satisfies $$ (\mathcal{L}^n f)(q_i) = f(q_i), \qquad i=0,\dots,n. $$ This operato...
github_jupyter
# Concept extraction from text ## 1. Loading text file into string ### Option 1. Downloading a wikipedia article's text ``` from bs4 import BeautifulSoup import requests url = 'https://en.wikipedia.org/wiki/Star' source = requests.get(url).text soup = BeautifulSoup(source,'lxml') text_set = soup.find_all(['p']) ...
github_jupyter
``` import matplotlib.pyplot as plt import numpy import pandas import tqdm import hetmech.hetmat import hetmech.degree_group import hetmech.degree_weight import hetmech.pipeline %matplotlib inline hetmat = hetmech.hetmat.HetMat('../../data/hetionet-v1.0.hetmat/') metapaths = ['DaGbC', 'SpDpS', 'SEcCrCtD', 'CiPCiCtD']...
github_jupyter
``` %matplotlib inline import numpy as np import pandas as pd import math from scipy import stats import pickle from causality.analysis.dataframe import CausalDataFrame from sklearn.linear_model import LinearRegression import datetime import matplotlib import matplotlib.pyplot as plt matplotlib.rcParams['font.sans-seri...
github_jupyter
# Chapter 6: Sections 2-3 ``` %pylab inline ``` ## 6.2 Nearest-Neighbor Density Estimation This method was first proposed by Dressler 1980 in an astrophysical context. The implied point density at a position $x$ is $\hat{f}_{K}(x) = \frac{K}{V_{D}(d_{K})}$ or more simply $\hat{f}_{K}(x) = \frac{C}{d^{D}_{K}}$ Th...
github_jupyter
# Processing a HCP Dataset Here we have run an HCP dataset through DSI Studio using the recommended parameters from the documentation. This includes * Gradient unwarping * Motion/Eddy correction * TopUp The images (dwi mask, dwi data and graddev files) were downloaded directly from connectomedb.org. The resu...
github_jupyter
# Continuous Signals *This Jupyter notebook is part of a [collection of notebooks](../index.ipynb) in the bachelors module Signals and Systems, Communications Engineering, Universität Rostock. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Standard Si...
github_jupyter
# Setup ``` ### Libraries import pandas as pd from IPython.display import display ### Python OBDC bridge import pyodbc ### IRIS Python Native API import irisnative ### others... import time ### SQL Connection parameters dsn = 'IRIS IntegeratedML monitor' server = 'irisimlsvr' port = '51773' database = 'USER' userna...
github_jupyter
# Predicting Whether a Breast Cancer Sample is Benign or Malignant ## Learning Objectives: 1. Understand what SageMaker Script Mode is, and how it can be leveraged. 2. Read in data from S3 to SageMaker 3. User prebuilt SageMaker containers to build, train, and deploy customer sklearn model 4. Use batch transform to ...
github_jupyter
# WS2332 - Project 7 - Lecture 2 Miguel Bessa <div> <img src=docs/tudelft_logo.jpg width=300px></div> **What:** Lab Session 1 of course WS2332 (Project 7): Introduction to Machine Learning * Today's lecture focuses on **regression via supervised learning in 1D** **How:** Jointly workout this notebook * GitHub: https...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '2' import tensorflow as tf import numpy as np from tensor2tensor.data_generators import problem_hparams from tensor2tensor.models import evolved_transformer from tensor2tensor.models import transformer from tensor2tensor.utils import optimize import json with open('t...
github_jupyter
<a href="https://colab.research.google.com/github/hemanthsunny/machine_learning/blob/master/Neural_network_layers.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> *Reference* https://medium.com/fintechexplained/what-are-hidden-layers-4f54f7328263 ``...
github_jupyter
### Cybenko Equations Printing equations using the coeficients obtained in cybenko_approx.ipynb ``` import numpy as np import math def sigmoid(x): return 1 / (1 + np.exp(-x)) def calc_iter(episode,n): weights = nn_parameters[n][0] biases = nn_parameters[n][1] ip_h_weights = weights[0][0] h_...
github_jupyter
# Unsupervised methods In this lesson, we'll cover unsupervised computational text anlalysis approaches. The central methods covered are TF-IDF and Topic Modeling. Both of these are common approachs in the social sciences and humanities. [DTM/TF-IDF](#dtm)<br> [Topic modeling](#topics)<br> ### Today you will * Unde...
github_jupyter
# Parameter identification example Here is a simple toy model that we use to demonstrate the working of the inference package $\emptyset \xrightarrow[]{k_1} X \; \; \; \; X \xrightarrow[]{d_1} \emptyset$ ### Run the MCMC algorithm to identify parameters from the experimental data In this demonstration, we will try...
github_jupyter
# For External users You can open this notebook in [Google Colab](https://colab.research.google.com/github/google/meterstick/blob/master/confidence_interval_display_demo.ipynb). ## Installation You can install from pip for the stable version ``` #@test {"skip": true} !pip install meterstick ``` or from GitHub for ...
github_jupyter
``` #Given a map consisting of known poses and a start and end pose, find the optimal path between using A* #Generate the relative motion in se2 between poses. #This is straight line motion. #Also implements cubic interpolation for a smooth trajectory across all points in path. import matplotlib.pyplot as plt import nu...
github_jupyter
## 载入 `dmind` 插件 ``` %load_ext dmind ``` ## 载入 `dmind` 需要的附件 ``` %dmindheader ``` ## text 格式 ``` %%dmind text DMind 是一个 jupyter notebook 插件 是一个思维导图插件 ``` ## markdown 格式, 逻辑结构图 ``` %%dmind markdown right # DMind使用文档 ## 安装 ### pip install dmind ## 使用 ### 载入插件 #### %load_ext dmind ### 载入需要的附件 #### %dmindh...
github_jupyter
## 1 - '시퀀스 투 시퀀스' 신경망 학습 이 시리즈에서는 PyTorch 및 TorchText를 사용하여 한 시퀀스에서 다른 시퀀스로 이동하는 기계 학습 모델을 구축 할 것입니다. 이것은 독일어에서 영어로의 번역에서 수행되지만, 모델은 요약과 같이 한 시퀀스에서 다른 시퀀스로 이동하는 것과 관련된 모든 문제에 적용될 수 있습니다. 이 첫 번째 노트북에서는 [Sequence to Sequence Learning with Neural Networks](https://arxiv.org/abs/1409.3215)의 모델을 구현하여 일반적인 개념들을 간단하게 이해하...
github_jupyter
# Lab Environment for BIA Pipeline This notebook instance will act as the lab environment for setting up and triggering changes to our pipeline. This is being used to provide a consistent environment, gain some familiarity with Amazon SageMaker Notebook Instances, and to avoid any issues with debugging individual lap...
github_jupyter
# Ising fitter for capped homopolymer repeat proteins. Authors: Doug Barrick, Jacob D. Marold, Kathryn Geiger-Schuller, Tural Aksel, Ekaterina Poliakova-Georgantas, Sean Klein, Kevin Sforza, Mark Peterson This notebook performs an Ising model fit to consensus Ankyrin repeat proteins (cANK). It reads data from Aviv d...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import base LAST_N = 15 def get_success_and_fail_numbers_at_each_task(): grouped_users = base.get_dataset_and_group_by_user() number_of_target_fails_top = {} number_of_target_success_top = {} number_of_target_fails_som = {} ...
github_jupyter
#data make ``` import numpy as np import matplotlib.pyplot as plt def make_data(dimention=2): #正常データの作成(2次元) x1 = np.random.normal(1, 0.3, (1, 100)) y1 = np.random.normal(1, 0.3, (1, 100)) x2 = np.random.normal(1.5, 0.3, (1, 100)) y2 = np.random.normal(1.5, 0.3, (1, 100)) #テストデータの作成(2次元) ...
github_jupyter
# PharmSci 175/275 (UCI) ## What is this?? The material below is an instructional session/lecture on docking, scoring and pose prediction from Drug Discovery Computing Techniques, PharmSci 175/275 at UC Irvine. Extensive materials for this course, as well as extensive background and related materials, are available o...
github_jupyter
[Source](https://www.dataquest.io/blog/pandas-python-tutorial/) Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, and makes importing and analyzing data much easier. Pandas builds on packages like NumPy and...
github_jupyter
## 加载模型 ``` import os GPUID='0'##调用GPU序号 os.environ["CUDA_VISIBLE_DEVICES"] = GPUID import torch from apphelper.image import xy_rotate_box,box_rotate,solve import model import cv2 import numpy as np import cv2 def plot_box(img,boxes): blue = (0, 0, 0) #18 tmp = np.copy(img) for box in boxes: cv2.r...
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
# Live Updating and Interactive Plots ## 1 Plotting Live data In our work, We are often required to plot Live data. * **psutil**: Cross-platform lib for process and system monitoring in Python https://github.com/giampaolo/psutil ```text python3 -m pip install psutil ``` ### 1.1 Python Script * matplotlib.py...
github_jupyter
# Funzioni 1 - introduzione ## [Scarica zip esercizi](../_static/generated/functions.zip) [Naviga file online](https://github.com/DavidLeoni/softpython-it/tree/master/functions) Una funzione prende dei parametri e li usa per produrre o riportare qualche risultato. <div class="alert alert-warning"> **ATTENZIONE** ...
github_jupyter
# 5.3.1 The Validation Set Approach ``` # imports and setup import numpy as np import pandas as pd pd.set_option('precision', 2) # number precision for pandas pd.set_option('display.max_rows', 12) pd.set_option('display.float_format', '{:20,.2f}'.format) # get rid of scientific notation # load data auto = pd.read_cs...
github_jupyter
# CS155 Project 3 - Shakespearean Sonnets: Pre-processing data **Author:** Liting Xiao **Description:** this notebook pre-processes the Shakespeare's sonnet datasets for training. ``` import re import pickle import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams.update({'font.size':...
github_jupyter
``` import os import matplotlib.pyplot as plt from matplotlib.pyplot import imshow import scipy.io import scipy.misc import numpy as np import pandas as pd import PIL import tensorflow as tf from skimage.transform import resize from keras import backend as K from keras.layers import Input, Lambda, Conv2D from keras.mo...
github_jupyter
``` !pip install ipynb import numpy as np import os from time import time import pandas as pd import matplotlib.pyplot as plt from matplotlib.ticker import NullFormatter import seaborn as sns import ipynb sns.set(style="darkgrid") import warnings #warnings.simplefilter(action='ignore', category=IntegrationWarning) from...
github_jupyter
``` # default_exp models.XCMPlus ``` # XCM: An Explainable Convolutional Neural Network for Multivariate Time Series Classification > This is an unofficial PyTorch implementation of XCM created by Ignacio Oguiza. **References:** * Fauvel, K., Lin, T., Masson, V., Fromont, É., & Termier, A. (2020). XCM: An Explainab...
github_jupyter
# Geocomputing course Welcome to geocomputing! ## Day 1. Introduction to Python - Installation flailing - Quick course overview - [**Intro to Python**](../notebooks/Intro_to_Python.ipynb) - Lightning talks - A couple of quick demos - [**Intro to Python**](../notebooks/Intro_to_Python.ipynb) &mdash; continued - Che...
github_jupyter
``` import numpy as np from complete import * import pickle from simtk import unit ``` i will start by extracting benzene in solvent and running the vanilla `annealed_importance_sampling` on it ``` with open('benzene_methylbenzene.solvent.factory.pkl', 'rb') as f: factory = pickle.load(f) with open('benzene_methy...
github_jupyter
# Sentiment Analysis - CP322 ## Riley Huston (190954880) | Samson Goodenough (190723380) | Shailendra Singh () ``` # import libraries import nltk import pandas as pd import sklearn import re from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer from nltk.stem.porter import PorterStemmer fro...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import sympy sympy.init_printing(use_latex='mathjax') %matplotlib inline ``` ## 적분 - 적분(integral)은 미분과 반대되는 개념이다. - 부정적분(indefinite integral) - 정적분(definite integral) #### 부정적분(indefinite integral) - 부정적분은 정확하게 미분과 반대되는 개념, 즉 반-미분(anti-deriv...
github_jupyter
# 22 - Model Deployment by [Alejandro Correa Bahnsen](albahnsen.com/) version 0.1, May 2016 ## Part of the class [Practical Machine Learning](https://github.com/albahnsen/PracticalMachineLearningClass) This notebook is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License] ## Agenda: 1....
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from scipy import signal import scipy import scipy.io as sio import copy import pylab as pl import time from IPython import display ``` ## Chirp parameters ``` start_freq = 770000 band_freq = 80000 duration = 0.0004 samples_one_second = 10000000 rate = samples_on...
github_jupyter
These class functions are the adversarial attack systems for NER; if entities == True an entity attack is performed, if entities == False an entity context attack is performed. It has options for performing a Random Attack (default is set to False). ``` import argparse import glob import logging import os import rando...
github_jupyter
``` !unzip "/content/drive/MyDrive/Colab Notebooks/curso word2vec/cbow_s300.zip" !unzip "/content/drive/MyDrive/Colab Notebooks/curso word2vec/skip_s300.zip" ``` ## Libs Usadas ``` import nltk import string import numpy as np import pandas as pd from gensim.models import KeyedVectors from sklearn.dummy import DummyCl...
github_jupyter
# Taxon name information ## Input Name Enter the taxon name. ``` #@title String fields taxonNameFull = 'Solanum baretiae' #@param {type:"string"} taxonName = taxonNameFull.split(" ") ``` ## Initialisation ### Importing Libraries ``` !pip install -q SPARQLWrapper !pip install -q pykew import requests import jso...
github_jupyter
# Earthquake plots ``` def ProduceSpatialQuakePlot(Observations, FitPredictions): current_time = timenow() print_red( current_time + " Produce Spatial Earthquake Plots " + config.experiment + " " + config.comment ) dayindexmax = Num_Seq - Plottingdelay Numdates = 4 denom = 1.0 / np.floa...
github_jupyter
# Profiling PyTorch Multi GPU Single Node Training Job with Amazon SageMaker Debugger This notebook will walk you through creating a PyTorch training job with the SageMaker Debugger profiling feature enabled. It will create a multi GPU single node training using Horovod. ## 1. Create a Training Job with Profiling Ena...
github_jupyter
# 0 - Setup Notebook Pod ## 0.1 - Run in Jupyter Bash Terminal ```bash # create application-default credentials gcloud auth application-default login ``` # 1 - Initialize SparkSession ``` import pyspark from pyspark.sql import SparkSession # construct spark_jars list spark_jars = ["https://storage.googleapis.com/ha...
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
## VENRON-Electricity Dataset preprocessing for Fonduer This script is used to pre-process the spreadsheets in order to apply the cell annotations from the prediction json files or the corresponding manually labeled annotation range sheet. ``` import os import pandas as pd import json # First create xlsx output folde...
github_jupyter
# Workshop DL01: Deep Neural Networks ## Agenda: - Introduction to deep learning - Apply DNN to MNIST dataset and IEEE fraud dataset For this workshop we are gonna talk about deep learning algorithms and train DNN models with 2 datasets. We will first start with an easier dataset as demonstration, namely the MNIST ...
github_jupyter
# Structured natural language processing with Pandas and spaCy (code) ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import spacy nlp = spacy.load("en_core_web_sm") sns.set_style("whitegrid") from IPython.core.display import display, HTML display(HTML("<style>.conta...
github_jupyter
# Deep Dreams (with Caffe) Credits: Forked from [DeepDream](https://github.com/google/deepdream) by Google This notebook demonstrates how to use the [Caffe](http://caffe.berkeleyvision.org/) neural network framework to produce "dream" visuals shown in the [Google Research blog post](http://googleresearch.blogspot.ch/...
github_jupyter
``` %load_ext autoreload %autoreload 2 import ipyrad import ipyrad.analysis as ipa import ipcoal import matplotlib.pyplot as plt import msprime import numpy as np import toytree import toyplot print(ipyrad.__version__) # Many loci def simloci(sample_size_pop1=10, sample_size_pop2=10, get_pis=Fal...
github_jupyter
# Instructions To start, go to Kernal -> 'Restart and Run All' -> 'Restart and Run All Cells' replace the wallet address in the cell below with the address you want to analyse ``` # Bearwhale wallet v2 : 9eyXNatnA6YM4tS1TjadEA6TFrd9bdufbFuykV89iX9vE9RBZZe # v1 : 9hyDXH72HoNTiG2pvxFQwxAhWBU8CrbvwtJDtnYoa4jfpaSk1d3 ta...
github_jupyter
# A Simple Autoencoder We'll start off by building a simple autoencoder to compress the MNIST dataset. With autoencoders, we pass input data through an encoder that makes a compressed representation of the input. Then, this representation is passed through a decoder to reconstruct the input data. Generally the encoder...
github_jupyter
# FLASK ----------------------- Usaremos Python y una biblioteca llamada **Flask** para escribir nuestro propio servidor web, implementando funciones adicionales. Flask también es un **framework**, donde se establece un conjunto de convenciones para la utilización de sus librerias. Por ejemplo, al igual que otras li...
github_jupyter
# Union of MSigDB overlaps and DGIdb results #### Overview Aggregate the lists from step 5 into gene sets. the genes\_, dgidb\_, and gsea\_ files generated by step5 no longer exist. Instead, load the json from step 5 and generate those files in a tmpdir. Then, run the R script, reading from a tmpdir, and storing t...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.png) # Automated Ma...
github_jupyter
# Goal The aim of this notebook is to compare the mappability of profiles obtained with the different databases on CAMI challenge data # Init ``` library(tidyverse) library(stringr) library(forcats) library(cowplot) library(data.table) library(glue) ``` # Var ``` work_dir = "/ebio/abt3_projects/Struo/struo_benchma...
github_jupyter
# Face Filter By Joshua Franklin and Tiffany Phan.<br> Created for the CSCI 4622 - Machine Learning final project. ``` import os import io import json import requests import numpy as np import matplotlib.pyplot as plt from typing import Tuple from PIL import Image from keras import Sequential from keras.layers impor...
github_jupyter
``` # Code to get landmarks from mediapipe and then create a bounding box around dip joints to segment them # for further analysis # Use distance transform to further correct the landmarks from mediapipe # See if you can get tip indices from drawing a convex hull around hand?? # NOTE: Current code works on already ...
github_jupyter
``` from __future__ import print_function import numpy as np import tensorflow as tf from six.moves import cPickle as pickle from six.moves import range pickle_file = 'SVHN.pickle' with open(pickle_file, 'rb') as f: save = pickle.load(f) #train_dataset = save['train_dataset'] train_labels = save['train_labels'] ...
github_jupyter
## Murine bone-marrow derived macrophages https://data.broadinstitute.org/bbbc/BBBC020/ ## Make a torch dataset ``` from segmentation.datasets import BroadDataset ``` ### Show some images ``` %matplotlib inline import matplotlib.pyplot as plt #base = '/Users/nicholassofroniew/Documents/BBBC/BBBC020_v1/BBBC020_v1-c...
github_jupyter
""" This notebook describes how one can use pickle library to save files so that the TensorFlow Kernel can be used with Desi condition_spectra function. Saving files like this has two major advantages: (1) It saves a lot of time as one does not have to run the condition_spectra function everytime before training th...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
``` import numpy as np # most recent version is here: https://github.com/NSLS-II-LIX/pyXS from pyxs import Data2D,Mask from pyxs.ext import RQconv def RotationMatrix(axis, angle): if axis=='x' or axis=='X': rot = np.asarray( [[1., 0., 0.], [0., np.cos(angle), -np.sin(angle)], ...
github_jupyter
``` import numpy as np from qiskit import Aer, IBMQ from qiskit.utils import QuantumInstance from qiskit.circuit import QuantumCircuit, ParameterVector from qiskit.opflow import StateFn, Z, I, CircuitSampler, Gradient, Hessian from qiskit.algorithms.optimizers import GradientDescent import matplotlib.pyplot as plt # Co...
github_jupyter
``` import pandas as pd import numpy as np import csv import networkx as nx import matplotlib.pyplot as plt import os import sys from scipy.stats import hypergeom #Builiding-up INTERSECTION Interactome graph intersect = pd.read_csv("intersection_interactome.tsv", sep = '\t') G_int = nx.from_pandas_edgelist(intersect,...
github_jupyter
# Read datasets ``` import pandas as pd countries_of_the_world = pd.read_csv('../datasets/countries-of-the-world.csv') countries_of_the_world.head() mpg = pd.read_csv('../datasets/mpg.csv') mpg.head() student_data = pd.read_csv('../datasets/student-alcohol-consumption.csv') student_data.head() survey_data = pd.read_c...
github_jupyter
``` import warnings warnings.filterwarnings('ignore') import random import numpy as np import matplotlib.pyplot as plt import seaborn as sns import glob from PIL import Image import cv2 %matplotlib inline # tweaks for libraries np.set_printoptions(precision=4, linewidth=1024, suppress=True) plt.style.use('seaborn') s...
github_jupyter
### Generating `publications.json` partitions This is a template notebook for generating metadata on publications - most importantly, the linkage between the publication and dataset (datasets are enumerated in `datasets.json`) Process goes as follows: 1. Import CSV with publication-dataset linkages. Your csv should h...
github_jupyter
``` # plotting libraries import matplotlib import matplotlib.pyplot as plt # numpy (math) libary import numpy as np # Constants n0 = 3.48 # standard refractive index n2 = 5e-14 # [cm²/W] intensity-dependent refractive index e0 = 8.85418782e-12 # vacuum permittivity epsilon_0 c0 = 299792458 # speed of light in vacuum c...
github_jupyter
``` # Initialize Otter import otter grader = otter.Notebook() ``` # A 2016 Election Analysis ``` import numpy as np from datascience import * # These lines set up graphing capabilities. import matplotlib %matplotlib inline import matplotlib.pyplot as plt plt.style.use('fivethirtyeight') import warnings warnings.simp...
github_jupyter
# 8 Puzzle solver * Parsa KamaliPour - 97149081 * In this repository we're going to solve this puzzle using $ A^* $ and $ IDA $ #### imports: ``` import copy import pandas as pd import numpy as np import collections import heapq ``` #### Test case 1: ``` input_puzzle_1 = [ [1, 2, 3], [4, 0, 5], [7, 8, ...
github_jupyter
# Statistical Downscaling and Bias-Adjustment `xclim` provides tools and utilities to ease the bias-adjustement process through its `xclim.sdba` module. Almost all adjustment algorithms conform to the `train` - `adjust` scheme, formalized within `TrainAdjust` classes. Given a reference time series (ref), historical si...
github_jupyter
``` %matplotlib inline ``` Introduction to PyTorch *********************** Introduction to Torch's tensor library ====================================== All of deep learning is computations on tensors, which are generalizations of a matrix that can be indexed in more than 2 dimensions. We will see exactly what this...
github_jupyter
# Lab 10.3.1 Visdom Example **Jonathan Choi 2021** **[Deep Learning By Torch] End to End study scripts of Deep Learning by implementing code practice with Pytorch.** If you have an any issue, please PR below. [[Deep Learning By Torch] - Github @JonyChoi](https://github.com/jonychoi/Deep-Learning-By-Torch) Here, we ...
github_jupyter
# Deep Learning & Art: Neural Style Transfer Welcome to the second assignment of this week. In this assignment, you will learn about Neural Style Transfer. This algorithm was created by Gatys et al. (2015) (https://arxiv.org/abs/1508.06576). **In this assignment, you will:** - Implement the neural style transfer alg...
github_jupyter
# Planet Data Collection Using the Open Exoplanet Catalogue database: https://github.com/OpenExoplanetCatalogue/open_exoplanet_catalogue/ ## Data License Copyright (C) 2012 Hanno Rein Permission is hereby granted, free of charge, to any person obtaining a copy of this database and associated scripts (the "Database"),...
github_jupyter
# Fast Style Transfer with FastEstimator In this notebook we will demonstrate how to do a neural image style transfer with perceptual loss as described in [Perceptual Losses for Real-Time Style Transfer and Super-Resolution](https://cs.stanford.edu/people/jcjohns/papers/eccv16/JohnsonECCV16.pdf). Typical neural style ...
github_jupyter
# Introduction to Python Ported to python from http://htmlpreview.github.io/?https://github.com/andrewpbray/oiLabs-base-R/blob/master/intro_to_r/intro_to_r.html First, we need to import the libraries that we need. By convention, we apply aliases that we can use to reference the libraries later. `pandas` contains class...
github_jupyter
# 1. Frame the Problem - Descriptive - Exploratory - Inferential # 2. Acquire the Data > "Data is the new oil" - Download from an internal system - Obtained from client, or other 3rd party - Extracted from a web-based API - Scraped from a website - Extracted from a PDF file - Gathered manually and recorded We wil...
github_jupyter
# Getting started with TensorFlow (Eager Mode) **Learning Objectives** - Understand difference between Tensorflow's two modes: Eager Execution and Graph Execution - Practice defining and performing basic operations on constant Tensors - Use Tensorflow's automatic differentiation capability ## Introduction **Eag...
github_jupyter
## Deep Compressive Object Decoder (DCOD) Implementation and proof of work. ``` import os import random import numpy as np import pandas as pd import matplotlib import matplotlib.pyplot as plt from network import deep_decoder import tensorflow as tf from tensorflow.keras import layers as ls, activations as acts import...
github_jupyter
``` %reload_ext autoreload %autoreload 2 %matplotlib inline from fastai.nlp import * from sklearn.linear_model import LogisticRegression ``` ## IMDB dataset and the sentiment classification task The [large movie review dataset](http://ai.stanford.edu/~amaas/data/sentiment/) contains a collection of 50,000 reviews fr...
github_jupyter