text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` import sys sys.path.append("/Users/msachde1/Downloads/Research/Development/mgwr/") import warnings warnings.filterwarnings("ignore") from mgwr.gwr import GWR import pandas as pd import numpy as np from spglm.family import Gaussian, Binomial, Poisson from mgwr.gwr import MGWR from mgwr.sel_bw import Sel_BW import mu...
github_jupyter
# Hidden Markov Models ### Problem Statement The following problem is from the Udacity course on Artificial Intelligence (Thrun and Norvig), chapter 11 (HMMs and filters). It involves a simple scenario where a person's current emotional state is determined by the weather on that particular day. The task is to find th...
github_jupyter
## Finding entity classes in embeddings In this notebook we're going to use embeddings to find entity classes and how they correlate with other things ``` %matplotlib inline from sklearn import svm from keras.utils import get_file import os import gensim import numpy as np import random import requests import geopan...
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
``` # Install TensorFlow !pip install tensorflow-gpu try: %tensorflow_version 2.x # Colab only. except Exception: pass import tensorflow as tf print(tf.__version__) print(tf.test.gpu_device_name()) print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU'))) #imports some required libr...
github_jupyter
``` print("hello world") 1 + (3 * 4) + 5 (1 + 3) * (4 + 5) 2**4 temperature = 72.5 print("temperature") print(temperature) type(temperature) day_of_week = 3 type(day_of_week) day = "tuesday" type(day) print(day) whos day_of_week + 1 print(day) print(temperature) day_of_week day_of_week + 1 day_of_week = 4 day_of_week d...
github_jupyter
# Cross Validation Splitting our datasetes into train/test sets allows us to test our model on unseen examples. However, it might be the case that we got a lucky (or unlucky) split that doesn't represent the model's actual performance. To solve this problem, we'll use a technique called cross-validation, where we use...
github_jupyter
# FloPy ### A quick demo of how to control the ASCII format of numeric arrays written by FloPy load and run the Freyberg model ``` import sys import os import platform import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt # run installed version of flopy or add local path try: import flop...
github_jupyter
### Simple Residual model in Keras This notebook is simply for testing a resnet-50 inspired model built in Keras on a numerical signs dataset. ``` import keras import numpy as np import matplotlib.pyplot as plt from keras import layers from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalizati...
github_jupyter
# UCI Metro dataset ``` import pandas as pd import os from pathlib import Path from config import data_raw_folder, data_processed_folder from timeeval import Datasets import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (20, 10) dataset_collection_name = "Metro" source_folder = Path(data...
github_jupyter
## Practice: Dealing with Word Embeddings Today we gonna play with word embeddings: train our own little embedding, load one from gensim model zoo and use it to visualize text corpora. This whole thing is gonna happen on top of embedding dataset. __Requirements:__ `pip install --upgrade nltk gensim bokeh umap-lea...
github_jupyter
``` import numpy as np import cv2 import mediapipe as mp import tensorflow as tf import time mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles mp_hands = mp.solutions.hands # load model tflite_save_path = 'model/model.tflite' interpreter = tf.lite.Interpreter(model_path=tflite_save...
github_jupyter
# Rule Scorer Example The Rule Scorer is used to generate scores for a set of rules based on a labelled dataset. ## Requirements To run, you'll need the following: * A rule set (specifically the binary columns of the rules as applied to a dataset). * The binary target column associated with the above dataset. ----...
github_jupyter
Importando as Dependências ``` import os import copy # os.chdir('corpora') from scripts.anntools import Collection from pathlib import Path import nltk nltk.download('punkt') ``` Leitura de Arquivo ``` c = Collection() for fname in Path("original/training/").rglob("*.txt"): c.load(fname) ``` Acesso a uma instâ...
github_jupyter
# SU Deep Learning with Tensorflow: Python & NumPy Tutorial Python 3 and NumPy will be used extensively throughout this course, so it's important to be familiar with them. One can also check the website's tutorial for further preparation: https://deep-learning-su.github.io/python-numpy-tutorial/ ## Python 3 If yo...
github_jupyter
# How do I create my own dataset? So Caffe2 uses a binary DB format to store the data that we would like to train models on. A Caffe2 DB is a glorified name of a key-value storage where the keys are usually randomized so that the batches are approximately i.i.d. The values are the real stuff here: they contain the ser...
github_jupyter
# Significance Tests with PyTerrier ``` import pyterrier as pt import pandas as pd RUN_DIR='/mnt/ceph/storage/data-in-progress/data-teaching/theses/wstud-thesis-probst/retrievalExperiments/runs-ecir22/' RUN_DIR_MARCO_V2='/mnt/ceph/storage/data-in-progress/data-teaching/theses/wstud-thesis-probst/retrievalExperiments/...
github_jupyter
# 5 minutes intro to IPython for ROOT users In this notebook we show how to use inside IPython __ROOT__ (C++ library, de-facto standard in High Energy Physics). This notebook is aimed to help __ROOT__ users. Working using ROOT-way loops is very slow in python and in most cases useless. You're proposed to use `root_...
github_jupyter
# High-level Chainer Example ``` import os os.environ['CHAINER_TYPE_CHECK'] = '0' import sys import numpy as np import math import chainer import chainer.functions as F import chainer.links as L from chainer import optimizers from chainer import cuda from common.params import * from common.utils import * cuda.set_max_...
github_jupyter
# Gases: Perfect and Semiperfect Models In this Notebook we will use `PerfectIdealGas` and `SemiperfectIdealGas` classes from **pyTurb**, to access the thermodynamic properties with a Perfect Ideal Gas or a Semiperfect Ideal Gas approach. Both classes acquire the thermodynamic properties of different species from the ...
github_jupyter
# General parameters ``` import files import utils import os import models import numpy as np from tqdm.autonotebook import tqdm import pandas as pd from sklearn.preprocessing import OneHotEncoder import datetime import seaborn as sns import matplotlib as mpl from matplotlib.backends.backend_pgf import FigureCanvasPgf...
github_jupyter
<a href="https://colab.research.google.com/github/lionelsamrat10/machine-learning-a-to-z/blob/main/Deep%20Learning/Convolutional%20Neural%20Networks%20(CNN)/convolutional_neural_network_samrat_with_10_epochs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/...
github_jupyter
<div align="Right"><font size="1">https://github.com/mrola/jupyter_themes_preview<br>Ola Söderström - 2018</font></div> ----- <p align="center"><font size="6">Jupyter notebook for testing out different themes</font></p> ----- # import libs ``` %matplotlib inline import os import sys import numpy as np import panda...
github_jupyter
# Linear regression from scratch Powerful ML libraries can eliminate repetitive work, but if you rely too much on abstractions, you might never learn how neural networks really work under the hood. So for this first example, let's get our hands dirty and build everything from scratch, relying only on autograd and NDAr...
github_jupyter
... ***CURRENTLY UNDER DEVELOPMENT*** ... ## Simulate Monthly Mean Sea Level using a multivariate-linear regression model based on the annual SST PCs inputs required: * WaterLevel historical data from a tide gauge at the study site * Historical and simulated Annual PCs (*from Notebook 01*) in this notebook: ...
github_jupyter
# Exact GP Regression with Multiple GPUs and Kernel Partitioning In this notebook, we'll demonstrate training exact GPs on large datasets using two key features from the paper https://arxiv.org/abs/1903.08114: 1. The ability to distribute the kernel matrix across multiple GPUs, for additional parallelism. 2. Partiti...
github_jupyter
## Purpose: Try different models-- Part5. ### Penalized_SVM. ``` # import dependencies. import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split, GridSearchCV from sklearn.svm import S...
github_jupyter
### 当涉及圆形子数组时,有两种情况。 1、情况1:没有交叉边界的最大子数组总和 2、情况2:具有交叉边界的最大子数组总和 写下一些小写的案例,并考虑案例2的一般模式。 记住为输入数组中的所有元素都为负数做一个角点案例句柄。 <img src='https://assets.leetcode.com/users/brianchiang_tw/image_1589539736.png'> ``` class Solution: def maxSubarraySumCircular(self, A) -> int: array_sum = 0 ...
github_jupyter
``` import tensorflow as tf import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import rc from IPython import display import os rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) rc('text', usetex=True) path = "rt-polaritydata/rt-polaritydata/" pos_path = os.path.join...
github_jupyter
``` import pandas as pd from sklearn.metrics import classification_report !ls train = pd.read_csv('../Post Processing/data/postproc_train.csv') val = pd.read_csv('../Post Processing/data/postproc_val.csv') test = pd.read_csv('../Post Processing/data/postproc_test.csv') test_gt = pd.read_csv('../../data/english_test_wit...
github_jupyter
# Visualizing CNN Layers --- In this notebook, we load a trained CNN (from a solution to FashionMNIST) and implement several feature visualization techniques to see what features this network has learned to extract. ### Load the [data](http://pytorch.org/docs/stable/torchvision/datasets.html) In this cell, we load in...
github_jupyter
# "Text Classification with Roberta - Does a Twitter post actually announce a diasater?" - toc:true - branch: master - badges: true - comments: true - author: Peiyi Hung - categories: [category, project] - image: "images/tweet-class.png" ``` import numpy as np import pandas as pd from fastai.text.all import * import ...
github_jupyter
<a href="https://colab.research.google.com/github/google/jax-md/blob/main/notebooks/talk_demo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #@title Import & Util !pip install -q git+https://www.github.com/google/jax !pip install -q git+https:...
github_jupyter
# IBM Cloud Pak for Data - Multi-Cloud Virtualization Hands-on Lab ## Introduction Welcome to the IBM Cloud Pak for Data Multi-Cloud Virtualization Hands on Lab. In this lab you analyze data from multiple data sources, from across multiple Clouds, without copying data into a warehouse. This hands-on lab uses live d...
github_jupyter
``` import pandas as pd d = pd.read_csv("YouTube-Spam-Collection-v1/Youtube01-Psy.csv") d.tail() len(d.query('CLASS == 1')) len(d.query('CLASS == 0')) len(d) from sklearn.feature_extraction.text import CountVectorizer vectorizer = CountVectorizer() dvec = vectorizer.fit_transform(d['CONTENT']) dvec analyze = vectorizer...
github_jupyter
# Jupyter-Specific Functionality While GAP does provide a lot of useful functionality by itself on the command line, it is enhanced greatly by the numerous features that Jupyter notebooks have to offer. This notebook attempts to provide some insight into how Jupyter notebooks can improve the workflow of a user who is a...
github_jupyter
# Kurulum ve Gerekli Modullerin Yuklenmesi ``` from google.colab import drive drive.mount('/content/gdrive') import sys import os import pandas as pd import matplotlib.pyplot as plt import matplotlib import matplotlib.pyplot as plt import numpy as np import nltk import os from nltk import sent_tokenize, word_tokenize ...
github_jupyter
## <small> Copyright (c) 2017-21 Andrew Glassner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, ...
github_jupyter
# PyTorch Basics ``` import torch import numpy as np torch.manual_seed(1234) ``` ## Tensors * Scalar is a single number. * Vector is an array of numbers. * Matrix is a 2-D array of numbers. * Tensors are N-D arrays of numbers. #### Creating Tensors You can create tensors by specifying the shape as arguments. Here...
github_jupyter
# Support Vector Machines Let's create the same fake income / age clustered data that we used for our K-Means clustering example: ``` import numpy as np #Create fake income/age clusters for N people in k clusters def createClusteredData(N, k): np.random.seed(1234) pointsPerCluster = float(N)/k X = [] ...
github_jupyter
``` from google.colab import drive drive.mount('/content/drive') import tensorflow as tf # run on training variation of powerlaw: # path for fine tuning: !python3 "/content/drive/MyDrive/PhD work/Projects/parameter estimation/Window method Supervised autoencoder with fine tuning/script.py" # path for stage 1: !python3...
github_jupyter
# Getting Started In this tutorial, you will know how to - use the models in **ConvLab-2** to build a dialog agent. - build a simulator to chat with the agent and evaluate the performance. - try different module combinations. - use analysis tool to diagnose your system. Let's get started! ## Environment setup Run th...
github_jupyter
# Jetsoncar Rosey V2 Tensorflow 2.0, all in notebook, optimized with RT ``` import tensorflow as tf print(tf.__version__) tf.config.experimental.list_physical_devices('GPU') # If device does not show and using conda env with tensorflow-gpu then try restarting computer # verify the image data directory import os data_...
github_jupyter
# Transfer learning & fine-tuning **Author:** [fchollet](https://twitter.com/fchollet)<br> **Date created:** 2020/04/15<br> **Last modified:** 2020/05/12<br> **Description:** Complete guide to transfer learning & fine-tuning in Keras. ## Setup ``` import numpy as np import tensorflow as tf from tensorflow import ker...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Sandford+-2020,-Section-3:-Methods" data-toc-modified-id="Sandford+-2020,-Section-3:-Methods-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Sandford+ 2020, Section 3: Methods</a></span><ul class="toc-ite...
github_jupyter
<img style="float: center;" src="images/CI_horizontal.png" width="600"> <center> <span style="font-size: 1.5em;"> <a href='https://www.coleridgeinitiative.org'>Website</a> </span> </center> Ghani, Rayid, Frauke Kreuter, Julia Lane, Adrianne Bradford, Alex Engler, Nicolas Guetta Jeanrenaud, Graham Henke...
github_jupyter
``` from datetime import datetime import backtrader as bt import pandas as pd import numpy as np import vectorbt as vbt df = pd.DataFrame(index=[datetime(2020, 1, i + 1) for i in range(9)]) df['open'] = [1, 1, 2, 3, 4, 5, 6, 7, 8] df['high'] = df['open'] + 0.5 df['low'] = df['open'] - 0.5 df['close'] = df['open'] data...
github_jupyter
# Gaussian mixture model The model in prototyped with TensorFlow Probability and inferecne is performed with variational Bayes by stochastic gradient descent. Details on [Wikipedia](https://en.wikipedia.org/wiki/Mixture_model#Gaussian_mixture_model). Some codes are borrowed from [Brendan Hasz](https://brendanhasz.g...
github_jupyter
# Direct optimal control of a pendulum We want to control an inverted pendulum and stabilize it in the upright position. The equations in Hamiltonian form describing an inverted pendulum with a torsional spring are as following: $$\begin{equation} \begin{bmatrix} \dot{q}\\ \dot{p}\\ \end{bmatrix} = \begin{bm...
github_jupyter
``` import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np from IPython.display import display ``` ## Exercise 1 You've just been hired at a real estate investment firm and they would like you to build a model for pricing houses. You are given a dataset that contains data for hou...
github_jupyter
# Knowledge Graph Triplet Generate MS text -> EN Knowledge Graph Triplet. <div class="alert alert-info"> This tutorial is available as an IPython notebook at [Malaya/example/knowledge-graph-triplet](https://github.com/huseinzol05/Malaya/tree/master/example/knowledge-graph-triplet). </div> <div class="alert ale...
github_jupyter
``` import os mingw_path = 'C:\\Users\\a1\\mingw\\mingw64\\bin' os.environ['PATH'] = mingw_path + ';' + os.environ['PATH'] import xgboost as xgb import pandas as pd import matplotlib.pyplot as plt import numpy as np %matplotlib inline train = pd.read_csv('new_train_mean_cl.csv') test = pd.read_csv('new_test_mean_cl.c...
github_jupyter
# Access and mosaic Planet NICFI monthly basemaps > A guide for accessing monthly Planet NICFI basemaps, selecting data by a defined AOI and mosaicing to produce a single image. You will need a configuration file named `planet_api.cfg` (simple text file with `.cfg` extension will do) to run this notebook. It should b...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Array/spectral_unmixing.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href...
github_jupyter
# Lists Data Structure: A data structure is a collection of data elements (such as numbers or characters—or even other data structures) that is structured in some way, for example, by numbering the elements. The most basic data structure in Python is the "sequence". -> List is one of the Sequence Data structure ...
github_jupyter
<div align="right"><a href="https://github.com/lucasliano/Medidas1">Link Github</a></div> <img src="logo.jpg" width="400"></img> <div align="center"> <h1>Resúmen Teórico de Medidas Electrónicas 1</h1> <h2>Incertidumbre</h2> <h3>Liaño, Lucas</h3> </div> # Contenidos - **Introducción** - **Marco Teóri...
github_jupyter
### Analyze Auto sales trend and verify if RCF detects abrupt shift in sales #### Years: 2005 to 2020. This period covers recession due to housing crisis in 2008, followed by recovery and economic impact due to Covid ### Data Source: Monthly New Vehicle Sales for the United States Automotive Market ### https://www.goo...
github_jupyter
``` import glob import os import warnings import geopandas import matplotlib import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.colors import pandas import seaborn from cartopy import crs as ccrs from mpl_toolkits.axes_grid1 import make_axes_locatable # from geopandas/geoseries.py:358, when ...
github_jupyter
``` #@title Copyright 2021 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
# Prominent paths originating from epilepsy to a Compound ``` import math import pandas from neo4j import GraphDatabase from tqdm.notebook import tqdm import hetnetpy.readwrite import hetnetpy.neo4j from src.database_utils import get_db_connection epilepsy_id = 'DOID:1826' # Get top ten most important metapaths for...
github_jupyter
``` from hyperneat.spatial_node import SpatialNode, SpatialNodeType from hyperneat.substrate import Substrate from hyperneat.evolution import Hyperneat from neat.genes import ConnectionGene, NodeGene, NodeType from neat.genome import Genome from neat.activation_functions import ActivationFunction from neat.neural_netw...
github_jupyter
### Task Video : #### Dataset Link: Dataset can be found at " /data/videos/ " in the respective challenge's repo. #### Description: Video series is just a sequence of images arranged in a specific order. Images of that sequence are called frames. Therefore, in video intelligence tasks, we take advantage of the tempor...
github_jupyter
# *Data Visualization and Statistics* Gallery of Matplotlib examples: [https://matplotlib.org/gallery.html](https://matplotlib.org/gallery.html) ``` ## First, let's import some packages. import os from pprint import pprint from textblob import TextBlob import numpy as np from scipy import stats import pandas as pd ...
github_jupyter
### Introduction This is a `View` Notebook to show an `IntSlider` widget either in an interactive Notebook or in a `Voila` Dashboard mode that will then print the [Fibonnaci sequence](https://en.wikipedia.org/wiki/Fibonacci_number) answer for that number. It will also show how long it takes each handler to calculate t...
github_jupyter
## 1. Meet Dr. Ignaz Semmelweis <p><img style="float: left;margin:5px 20px 5px 1px" src="https://s3.amazonaws.com/assets.datacamp.com/production/project_20/img/ignaz_semmelweis_1860.jpeg"></p> <!-- <img style="float: left;margin:5px 20px 5px 1px" src="https://s3.amazonaws.com/assets.datacamp.com/production/project_20/d...
github_jupyter
# Time-energy fit 3ML allows the possibility to model a time-varying source by explicitly fitting the time-dependent part of the model. Let's see this with an example. First we import what we need: ``` from threeML import * import matplotlib.pyplot as plt from jupyterthemes import jtplot %matplotlib inline jtplot...
github_jupyter
<a name="top"></a> <div style="width:1000 px"> <div style="float:right; width:98 px; height:98px;"> <img src="https://raw.githubusercontent.com/Unidata/MetPy/master/metpy/plots/_static/unidata_150x150.png" alt="Unidata Logo" style="height: 98px;"> </div> <h1>Hodographs</h1> <h3>Unidata Python Workshop</h3> <div styl...
github_jupyter
``` import holoviews as hv hv.extension('bokeh') hv.opts.defaults(hv.opts.Curve(width=500), hv.opts.Image(width=500, colorbar=True, cmap='Viridis')) import numpy as np import scipy.signal import scipy.fft from IPython.display import Audio ``` # Diseño de sistemas y filtros IIR Un filtro FIR de buena...
github_jupyter
# The Schrödinger equation #### Let's have some serious fun! We'll look at the solutions of the Schrödinger equation for a harmonic potential. ``` from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import math from math import pi as Pi import...
github_jupyter
``` import pandas as pd # movies dataset movies = pd.read_pickle('./dataset/movies/movies.p') print(movies.shape) movies.head() #taglines dataset taglines = pd.read_pickle('./dataset/movies/taglines.p') print(taglines.shape) taglines.head() ``` ## Filter joins - semi join - anti join Mutation join vs filter join - ...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np from sklearn import datasets from sklearn.decomposition import PCA ``` ### Generate a dataset ``` xy = np.random.multivariate_normal([0,0], [[10,7],[7,10]],1000) plt.plot(xy[:,0],xy[:,1],"o") plt.show() ``` ### Create a Principle Component An...
github_jupyter
``` %matplotlib inline import numpy as np import pylab as plt import ccgpack as ccg from itertools import product from matplotlib.colors import LogNorm cl = np.load('../data/cl_planck_lensed.npy') sfs = ccg.StochasticFieldSimulator(cl) nside = 1024 size = 30 ms = [] for i in range(4): ms.append(sfs.simulate(nside,...
github_jupyter
# Counterfactual explanations with ordinally encoded categorical variables This example notebook illustrates how to obtain [counterfactual explanations](https://docs.seldon.io/projects/alibi/en/latest/methods/CFProto.html) for instances with a mixture of ordinally encoded categorical and numerical variables. A more el...
github_jupyter
# Batch correction What is batch correction? A "Batch" is when experiments have been performed at different times and there's some obvious difference between them. Single-cell experiments are often inherently "batchy" because you can only perform so many single cell captures at once, and you do multiple captures, over...
github_jupyter
``` import numpy as np import cv2 import tensorflow as tf face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') model = tf.keras.models.load_model("/home/d3adsh0t/Tunex/8") # EMOTIONS = ["angry" ,"disgust","scared", "happy", "sad", "surprised","neutral"] # EMOTIONS=["angry", # "disgust", ...
github_jupyter
# Chapter 7: n-step Bootstrapping ## 1. n-step TD Prediction - Generalize one-step TD(0) method - Temporal difference extends over n-steps ![n-step methods](assets/7.1.n-step.png) - Want to update estimated value $v_\pi(S_t)$ of state $S_t$ from: $$S_t,R_{t+1},S_{t+1},R_{t+1},...,R_T,S_T$$ - for *MC*, target is...
github_jupyter
This script takes the notebook with RNA and DNA BSID's and collects information for the corresponding samples from fusion summary files, breakpoint density files, GISTIC CNA broad_values file and FPKM files ``` import argparse import pandas as pd import numpy as np import zipfile import statistics import scipy f...
github_jupyter
``` # importing libraries import h5py import scipy.io as io import PIL.Image as Image import numpy as np import os import glob from matplotlib import pyplot as plt from scipy.ndimage.filters import gaussian_filter import scipy from scipy import spatial import json from matplotlib import cm as CM from image import * fro...
github_jupyter
<a href="https://colab.research.google.com/github/arjunparmar/VIRTUON/blob/main/Harshit/SwapNet_Experimentation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` from google.colab import drive drive.mount('/content/drive') ## Imports import os imp...
github_jupyter
<table style="float:left; border:none"> <tr style="border:none"> <td style="border:none"> <a href="https://bokeh.org/"> <img src="assets/bokeh-transparent.png" style="width:50px" > </a> </td> <td style="border:n...
github_jupyter
``` from pathlib import Path import os import shlex import shutil import subprocess import pandas as pd names_rows_stability = [ ['dg', 1], # totalEnergy ['backbone_hbond', 2], ['sidechain_hbond', 3], ['van_der_waals', 4], ['electrostatics', 5], ['solvation_polar', 6], ['solvation_hydroph...
github_jupyter
# Classifying OUV using NGram features and MLP ## Imports ``` import sys sys.executable from argparse import Namespace from collections import Counter import json import os import re import string import random import numpy as np import pandas as pd import torch import torch.nn as nn import torch.nn.functional as F i...
github_jupyter
# Overlap matrices This notebook will look at different ways of plotting overlap matrices and making them visually appealing. One way to guarantee right color choices for color blind poeple is using this tool: https://davidmathlogic.com/colorblind ``` %pylab inline import pandas as pd import seaborn as sbn sbn.set_st...
github_jupyter
*Accompanying code examples of the book "Introduction to Artificial Neural Networks and Deep Learning: A Practical Guide with Applications in Python" by [Sebastian Raschka](https://sebastianraschka.com). All code examples are released under the [MIT license](https://github.com/rasbt/deep-learning-book/blob/master/LICEN...
github_jupyter
# Object and Scene Detection using Amazon Rekognition This notebook provides a walkthrough of [object detection API](https://docs.aws.amazon.com/rekognition/latest/dg/labels.html) in Amazon Rekognition to identify objects. ``` import boto3 from IPython.display import HTML, display, Image as IImage from PIL import Ima...
github_jupyter
# 5. Statistical Packages in Python for Mathematicians Statisticians use the following packages in Python: - Data creation: `random` - Data analysis/manipulation: `pandas`, `scikit-learn` - Statistical functions: `scipy.stats` - Statistical data visualization: `matplotlib`, `seaborn` - Statistical data exploration: `...
github_jupyter
# Analysis for the floor control detection (FCD) model and competitor models This notebook analyses the predictions of the FCD model and the competitor models discussed in the paper and show how they are compared over a few performance measurements. It also includes some stats about the dataset and the annotated floor...
github_jupyter
# 3D Object Detection Evaluation Tutorial Welcome to the 3D object detection evaluation tutorial! We'll walk through the steps to submit your detections to the competition server. ``` from av2.evaluation.detection.eval import evaluate from av2.evaluation.detection.utils import DetectionCfg from pathlib import Path fr...
github_jupyter
# Synthetic seismic: wedge We're going to make the famous wedge model, which interpreters can use to visualize the tuning effect. Then we can extend the idea to other kinds of model. ## Make a wedge earth model ``` import matplotlib.pyplot as plt import numpy as np length = 80 # x range depth = 200 # z range ``` ...
github_jupyter
``` #@title Environment Setup import glob BASE_DIR = "gs://download.magenta.tensorflow.org/models/music_vae/colab2" print('Installing dependencies...') !apt-get update -qq && apt-get install -qq libfluidsynth1 fluid-soundfont-gm build-essential libasound2-dev libjack-dev !pip install -q pyfluidsynth !pip install -qU...
github_jupyter
# Download Data This notebook downloads the necessary data to replicate the results of our paper on Gender Inequalities on Wikipedia. Note that we use a file named `dbpedia_config.py` where we set which language editions we will we study, as well as where to save and load data files. By [Eduardo Graells-Garrido](htt...
github_jupyter
# Quantum Cryptography: Quantum Key Distribution *** ### Contributors: A.J. Rasmusson, Richard Barney Have you ever wanted to send a super secret message to a friend? Then you need a key to encrypt your message, and your friend needs the same key to decrypt your message. But, how do you send a super secret key to your...
github_jupyter
_ELMED219-2021_. Alexander S. Lundervold, 10.01.2021. # Natural language processing and machine learning: a small case-study This is a quick example of some techniques and ideas from natural language processing (NLP) and some modern approaches to NLP based on _deep learning_. > Note: we'll take a close look at what ...
github_jupyter
``` pip install jupyter-dash pip install dash_daq pip install --ignore-installed --upgrade plotly==4.5.0 ``` At this point, restart the runtime environment for Colab ``` import pandas as pd import numpy as np import datetime import matplotlib.pyplot as plt import random import scipy.stats import plotly.express as px ...
github_jupyter
This Notebook is a short example of how to use the Ising solver implemented using the QAOA algorithm. We start by declaring the import of the ising function. ``` from grove.ising.ising_qaoa import ising from mock import patch ``` This code finds the global minima of an Ising model with external fields of the form $...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import ListedColormap from ml.data import create_lineal_data from ml.visualization import decision_boundary %matplotlib inline ``` # Función de coste y gradiente ## Generación de datos ### Entrenamiento ``` np.random.seed(0) # Para hac...
github_jupyter
# Notebook served by Voilà #### Notebook copied from https://github.com/ChakriCherukuri/mlviz <h2>Gradient Descent</h2> * Given a the multi-variable function $\large {F(x)}$ differentiable in a neighborhood of a point $\large a$ * $\large F(x)$ decreases fastest if one goes from $\large a$ in the direction of the neg...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/GetStarted/02_adding_data_to_qgis.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_bl...
github_jupyter
``` import os import sys import numpy as np import matplotlib.pyplot as plt from scipy import stats import pickle from tqdm.notebook import tqdm from tqdm import trange %matplotlib inline def read_list_of_arrays(filename): A = pickle.load(open(filename, 'rb')) if len(A) == 3: print(A[1][0], A[2][0]...
github_jupyter
# SP via class imbalance Example [test scores](https://www.brookings.edu/blog/social-mobility-memos/2015/07/29/when-average-isnt-good-enough-simpsons-paradox-in-education-and-earnings/) SImpson's paradox can also occur due to a class imbalance, where for example, over time the value of several differnt subgroups all ...
github_jupyter