text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# 09 Strain Gage This is one of the most commonly used sensor. It is used in many transducers. Its fundamental operating principle is fairly easy to understand and it will be the purpose of this lecture. A strain gage is essentially a thin wire that is wrapped on film of plastic. <img src="img/StrainGage.png" wi...
github_jupyter
``` #export from fastai.basics import * from fastai.tabular.core import * from fastai.tabular.model import * from fastai.tabular.data import * #hide from nbdev.showdoc import * #default_exp tabular.learner ``` # Tabular learner > The function to immediately get a `Learner` ready to train for tabular data The main fu...
github_jupyter
# Aerospike Connect for Spark - SparkML Prediction Model Tutorial ## Tested with Java 8, Spark 3.0.0, Python 3.7, and Aerospike Spark Connector 3.0.0 ## Summary Build a linear regression model to predict birth weight using Aerospike Database and Spark. Here are the features used: - gestation weeks - mother’s age - fat...
github_jupyter
## Concurrency with asyncio ### Thread vs. coroutine ``` # spinner_thread.py import threading import itertools import time import sys class Signal: go = True def spin(msg, signal): write, flush = sys.stdout.write, sys.stdout.flush for char in itertools.cycle('|/-\\'): status = char + ' ' + msg ...
github_jupyter
## Problem 1 --- #### The solution should try to use all the python constructs - Conditionals and Loops - Functions - Classes #### and datastructures as possible - List - Tuple - Dictionary - Set ### Problem --- Moist has a hobby -- collecting figure skating trading cards. His card collection has been growing, an...
github_jupyter
# Classification on Iris dataset with sklearn and DJL In this notebook, you will try to use a pre-trained sklearn model to run on DJL for a general classification task. The model was trained with [Iris flower dataset](https://en.wikipedia.org/wiki/Iris_flower_data_set). ## Background ### Iris Dataset The dataset c...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Algorithms/landsat_radiance.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" ...
github_jupyter
``` %cd /Users/Kunal/Projects/TCH_CardiacSignals_F20/ from numpy.random import seed seed(1) import numpy as np import os import matplotlib.pyplot as plt import tensorflow tensorflow.random.set_seed(2) from tensorflow import keras from tensorflow.keras.callbacks import EarlyStopping from tensorflow.keras.regularizers im...
github_jupyter
# basic operation on image ``` import cv2 import numpy as np impath = r"D:/Study/example_ml/computer_vision_example/cv_exercise/opencv-master/samples/data/messi5.jpg" img = cv2.imread(impath) print(img.shape) print(img.size) print(img.dtype) b,g,r = cv2.split(img) img = cv2.merge((b,g,r)) cv2.imshow("image",img) cv2....
github_jupyter
Create a list of valid Hindi literals ``` a = list(set(list("ऀँंःऄअआइईउऊऋऌऍऎएऐऑऒओऔकखगघङचछजझञटठडढणतथदधनऩपफबभमयरऱलळऴवशषसहऺऻ़ऽािीुूृॄॅॆेैॉॊोौ्ॎॏॐ॒॑॓॔ॕॖॗक़ख़ग़ज़ड़ढ़फ़य़ॠॡॢॣ।॥॰ॱॲॳॴॵॶॷॸॹॺॻॼॽॾॿ-"))) len(genderListCleared),len(set(genderListCleared)) genderListCleared = list(set(genderListCleared)) mCount = 0 fCount = 0 nCount = 0 f...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib import seaborn as sns import matplotlib.pyplot as plt pd.set_option('display.max_colwidth', -1) default = pd.read_csv('./results/results_default.csv') new = pd.read_csv('./results/results_new.csv') selected_cols = ['model','hyper','metric','value'] default = ...
github_jupyter
``` from xml.dom import expatbuilder import numpy as np import matplotlib.pyplot as plt import struct import os # should be in the same directory as corresponding xml and csv eis_filename = '/example/path/to/eis_image_file.dat' image_fn, image_ext = os.path.splitext(eis_filename) eis_xml_filename = image_fn + ".xml" ``...
github_jupyter
Our best model - Catboost with learning rate of 0.7 and 180 iterations. Was trained on 10 files of the data with similar distribution of the feature user_target_recs (among the number of rows of each feature value). We received an auc of 0.845 on the kaggle leaderboard #Mount Drive ``` from google.colab import drive ...
github_jupyter
``` #r "nuget:Microsoft.ML,1.4.0" #r "nuget:Microsoft.ML.AutoML,0.16.0" #r "nuget:Microsoft.Data.Analysis,0.1.0" using Microsoft.Data.Analysis; using XPlot.Plotly; using Microsoft.AspNetCore.Html; Formatter<DataFrame>.Register((df, writer) => { var headers = new List<IHtmlContent>(); headers.Add(th(i("index")))...
github_jupyter
# Chapter 8 - Applying Machine Learning To Sentiment Analysis ### Overview - [Obtaining the IMDb movie review dataset](#Obtaining-the-IMDb-movie-review-dataset) - [Introducing the bag-of-words model](#Introducing-the-bag-of-words-model) - [Transforming words into feature vectors](#Transforming-words-into-feature-ve...
github_jupyter
<a href="https://colab.research.google.com/github/satyajitghana/TSAI-DeepNLP-END2.0/blob/main/09_NLP_Evaluation/ClassificationEvaluation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` ! pip3 install git+https://github.com/extensive-nlp/ttc_nlp ...
github_jupyter
# MultiGroupDirectLiNGAM ## Import and settings In this example, we need to import `numpy`, `pandas`, and `graphviz` in addition to `lingam`. ``` import numpy as np import pandas as pd import graphviz import lingam from lingam.utils import print_causal_directions, print_dagc, make_dot print([np.__version__, pd.__ver...
github_jupyter
## Accessing TerraClimate data with the Planetary Computer STAC API [TerraClimate](http://www.climatologylab.org/terraclimate.html) is a dataset of monthly climate and climatic water balance for global terrestrial surfaces from 1958-2019. These data provide important inputs for ecological and hydrological studies at g...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Automated Machine Learning _**ディープラーンニングを利用したテキスト分類**_ ## Contents 1. [事前準備](#1.-事前準備) 1. [自動機械学習 Automated Machine Learning](2.-自動機械学習-Automated-Machine-Learning) 1. [結果の確認](#3.-結果の確認) ## 1. 事前準備 本デモンストレーションでは、AutoML の深層学習...
github_jupyter
# Spark SQL Spark SQL is arguably one of the most important and powerful features in Spark. In a nutshell, with Spark SQL you can run SQL queries against views or tables organized into databases. You also can use system functions or define user functions and analyze query plans in order to optimize their workloads. Th...
github_jupyter
## Как выложить бота на HEROKU *Подготовил Ян Пиле* Сразу оговоримся, что мы на heroku выкладываем **echo-Бота в телеграме, написанного с помощью библиотеки [pyTelegramBotAPI](https://github.com/eternnoir/pyTelegramBotAPI)**. А взаимодействие его с сервером мы сделаем с использованием [flask](http://flask.pocoo.org...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import numba from tqdm import tqdm import eitest ``` # Data generators ``` @numba.njit def event_series_bernoulli(series_length, event_count): '''Generate an iid Bernoulli distributed event series. series_length: length of the event series event_cou...
github_jupyter
# Lalonde Pandas API Example by Adam Kelleher We'll run through a quick example using the high-level Python API for the DoSampler. The DoSampler is different from most classic causal effect estimators. Instead of estimating statistics under interventions, it aims to provide the generality of Pearlian causal inference....
github_jupyter
# Welcome to the Datenguide Python Package Within this notebook the functionality of the package will be explained and demonstrated with examples. ### Topics - Import - get region IDs - get statstic IDs - get the data - for single regions - for multiple regions ## 1. Import **Import the helper functions 'g...
github_jupyter
# Chapter 4 `Original content created by Cam Davidson-Pilon` `Ported to Python 3 and PyMC3 by Max Margenot (@clean_utensils) and Thomas Wiecki (@twiecki) at Quantopian (@quantopian)` ______ ## The greatest theorem never told This chapter focuses on an idea that is always bouncing around our minds, but is rarely ma...
github_jupyter
``` # Copyright 2020 Erik Härkönen. All rights reserved. # This file is licensed to you under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. You may obtain a copy # of the License at http://www.apache.org/licenses/LICENSE-2.0 # Unless required by app...
github_jupyter
# Hyperparameter tuning with Cloud AI Platform **Learning Objectives:** * Improve the accuracy of a model by hyperparameter tuning ``` import os PROJECT = 'qwiklabs-gcp-faf328caac1ef9a0' # REPLACE WITH YOUR PROJECT ID BUCKET = 'qwiklabs-gcp-faf328caac1ef9a0' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-east1' # REP...
github_jupyter
``` # In this exercise you will train a CNN on the FULL Cats-v-dogs dataset # This will require you doing a lot of data preprocessing because # the dataset isn't split into training and validation for you # This code block has all the required inputs import os import zipfile import random import tensorflow as tf from t...
github_jupyter
``` # Confidence interval and bias comparison in the multi-armed bandit # setting of https://arxiv.org/pdf/1507.08025.pdf import numpy as np import pandas as pd import scipy.stats as stats import time import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set(style='white', palette='colorblind', c...
github_jupyter
<a href="https://colab.research.google.com/github/s-mostafa-a/pytorch_learning/blob/master/simple_generative_adversarial_net/MNIST_GANs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import torch from torchvision.transforms import ToTensor, Nor...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt dataset1=pd.read_csv('general_data.csv') dataset1.head() dataset1.columns dataset1 dataset1.isnull() dataset1.duplicated() dataset1.drop_duplicates() dataset3=dataset1[['Age','DistanceFromHome','Education','MonthlyIncome', 'NumCompaniesWorked', ...
github_jupyter
# ADVANCED TEXT MINING - 본 자료는 텍스트 마이닝을 활용한 연구 및 강의를 위한 목적으로 제작되었습니다. - 본 자료를 강의 목적으로 활용하고자 하시는 경우 꼭 아래 메일주소로 연락주세요. - 본 자료에 대한 허가되지 않은 배포를 금지합니다. - 강의, 저작권, 출판, 특허, 공동저자에 관련해서는 문의 바랍니다. - **Contact : ADMIN(admin@teanaps.com)** --- ## WEEK 02-2. Python 자료구조 이해하기 - 텍스트 데이터를 다루기 위한 Python 자료구조에 대해 다룹니다. --- ### 1. 리...
github_jupyter
# Tutorial 2. Solving a 1D diffusion equation ``` # Document Author: Dr. Vishal Sharma # Author email: sharma_vishal14@hotmail.com # License: MIT # This tutorial is applicable for NAnPack version 1.0.0-alpha4 ``` ### I. Background The objective of this tutorial is to present the step-by-step solution of a 1D diffus...
github_jupyter
``` import tensorflow as tf from tensorflow.keras.callbacks import TensorBoard import os import matplotlib.pyplot as plt import numpy as np import random import cv2 import time training_path = "fruits-360_dataset/Training" test_path = "fruits-360_dataset/Test" try: STATS = np.load("stats.npy", allow_pickle=True...
github_jupyter
# <span style="color:Maroon">Trade Strategy __Summary:__ <span style="color:Blue">In this code we shall test the results of given model ``` # Import required libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import os np.random.seed(0) import warnings warnings.filterwarnings('ignore') #...
github_jupyter
``` import numpy as np import math import matplotlib.pyplot as plt input_data = np.array([math.cos(x) for x in np.arange(200)]) plt.plot(input_data[:50]) plt.show X = [] Y = [] size = 50 number_of_records = len(input_data) - size for i in range(number_of_records - 50): X.append(input_data[i:i+size]) Y.append(input...
github_jupyter
# Monte Carlo Integration with Python ## Dr. Tirthajyoti Sarkar ([LinkedIn](https://www.linkedin.com/in/tirthajyoti-sarkar-2127aa7/), [Github](https://github.com/tirthajyoti)), Fremont, CA, July 2020 --- ### Disclaimer The inspiration for this demo/notebook stemmed from [Georgia Tech's Online Masters in Analytics (...
github_jupyter
This illustrates the datasets.make_multilabel_classification dataset generator. Each sample consists of counts of two features (up to 50 in total), which are differently distributed in each of two classes. Points are labeled as follows, where Y means the class is present: | 1 | 2 | 3 | Color | |--- |--- |--- |--...
github_jupyter
[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb) # Kalman Filter Math ``` #format the book %matplotlib inline from __future__ import division, print_function from book_format import load_style load_style() ``` If you've gotten th...
github_jupyter
``` # Copyright 2021 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
# Classes For more information on the magic methods of pytho classes, consult the docs: https://docs.python.org/3/reference/datamodel.html ``` class DumbClass: """ This class is just meant to demonstrate the magic __repr__ method """ def __repr__(self): """ I'm giving this method a docstring ...
github_jupyter
# Estimation on real data using MSM ``` from consav import runtools runtools.write_numba_config(disable=0,threads=4) %matplotlib inline %load_ext autoreload %autoreload 2 # Local modules from Model import RetirementClass import figs import SimulatedMinimumDistance as SMD # Global modules import numpy as np import p...
github_jupyter
<a href="https://colab.research.google.com/github/clemencia/ML4PPGF_UERJ/blob/master/Exemplos_DR/Exercicios_DimensionalReduction.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Mais Exercícios de Redução de Dimensionalidade Baseado no livro "Pytho...
github_jupyter
# Working with Pytrees [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/jax/blob/main/docs/jax-101/05.1-pytrees.ipynb) *Author: Vladimir Mikulik* Often, we want to operate on objects that look like dicts of arrays, or lists of lists of dicts...
github_jupyter
``` import CNN2Head_input import tensorflow as tf import numpy as np SAVE_FOLDER = '/home/ubuntu/coding/cnn/multi-task-learning/save/current' _, smile_test_data = CNN2Head_input.getSmileImage() _, gender_test_data = CNN2Head_input.getGenderImage() _, age_test_data = CNN2Head_input.getAgeImage() def eval_smile_gend...
github_jupyter
# Problem Simulation Tutorial ``` import pyblp import numpy as np import pandas as pd pyblp.options.digits = 2 pyblp.options.verbose = False pyblp.__version__ ``` Before configuring and solving a problem with real data, it may be a good idea to perform Monte Carlo analysis on simulated data to verify that it is poss...
github_jupyter
<a href="https://colab.research.google.com/github/ai-fast-track/timeseries/blob/master/nbs/index.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # `timeseries` package for fastai v2 > **`timeseries`** is a Timeseries Classification and Regression p...
github_jupyter
# The Extended Kalman Filter 선형 칼만 필터 (Linear Kalman Filter)에 대한 이론을 바탕으로 비선형 문제에 칼만 필터를 적용해 보겠습니다. 확장칼만필터 (EKF)는 예측단계와 추정단계의 데이터를 비선형으로 가정하고 현재의 추정값에 대해 시스템을 선형화 한뒤 선형 칼만 필터를 사용하는 기법입니다. 비선형 문제에 적용되는 성능이 더 좋은 알고리즘들 (UKF, H_infinity)이 있지만 EKF 는 아직도 널리 사용되서 관련성이 높습니다. ``` %matplotlib inline # HTML(""" # <style> # .ou...
github_jupyter
# Documenting Classes It is almost as easy to document a class as it is to document a function. Simply add docstrings to all of the classes functions, and also below the class name itself. For example, here is a simple documented class ``` class Demo: """This class demonstrates how to document a class. ...
github_jupyter
<img src="images/strathsdr_banner.png" align="left"> # An RFSoC Spectrum Analyzer Dashboard with Voila ---- <div class="alert alert-box alert-info"> Please use Jupyter Labs http://board_ip_address/lab for this notebook. </div> The RFSoC Spectrum Analyzer is an open source tool developed by the [University of Strathc...
github_jupyter
``` import pathlib import lzma import re import os import datetime import copy import numpy as np import pandas as pd # Makes it so any changes in pymedphys is automatically # propagated into the notebook without needing a kernel reset. from IPython.lib.deepreload import reload %load_ext autoreload %autoreload 2 impor...
github_jupyter
<img src="https://storage.googleapis.com/arize-assets/arize-logo-white.jpg" width="200"/> # Arize Tutorial: Surrogate Model Feature Importance A surrogate model is an interpretable model trained on predicting the predictions of a black box model. The goal is to approximate the predictions of the black box model as cl...
github_jupyter
``` import numpy as np from keras.models import Model from keras.layers import Input from keras.layers.pooling import GlobalMaxPooling1D from keras import backend as K import json from collections import OrderedDict def format_decimal(arr, places=6): return [round(x * 10**places) / 10**places for x in arr] DATA = O...
github_jupyter
# Water quality ## Setup software libraries ``` # Import and initialize the Earth Engine library. import ee ee.Initialize() ee.__version__ # Folium setup. import folium print(folium.__version__) # Skydipper library. import Skydipper print(Skydipper.__version__) import matplotlib.pyplot as plt import numpy as np import...
github_jupyter
# Batch Normalization – Practice Batch normalization is most useful when building deep neural networks. To demonstrate this, we'll create a convolutional neural network with 20 convolutional layers, followed by a fully connected layer. We'll use it to classify handwritten digits in the MNIST dataset, which should be f...
github_jupyter
# Country Economic Conditions for Cargo Carriers This report is written from the point of view of a data scientist preparing a report to the Head of Analytics for a logistics company. The company needs information on economic and financial conditions is different countries, including data on their international trade,...
github_jupyter
I want to analyze changes over time in the MOT GTFS feed. Agenda: 1. [Get data](#Get-the-data) 3. [Tidy](#Tidy-it-up) ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import partridge as ptg from ftplib import FTP import datetime import re import zipfile import os %m...
github_jupyter
# Saving and Loading Models In this notebook, I'll show you how to save and load models with PyTorch. This is important because you'll often want to load previously trained models to use in making predictions or to continue training on new data. ``` %matplotlib inline %config InlineBackend.figure_format = 'retina' i...
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
``` #default_exp dataset.dataset #export import os import torch import transformers import pandas as pd import numpy as np import Hasoc.config as config #hide df = pd.read_csv(config.DATA_PATH/'fold_df.csv') #hide df.head(2) #hide from sklearn.preprocessing import LabelEncoder le = LabelEncoder() le.fit_transform(df.t...
github_jupyter
``` # Install libraries !pip -qq install rasterio tifffile # Import libraries import os import glob import shutil import gc from joblib import Parallel, delayed from tqdm import tqdm_notebook import h5py import pandas as pd import numpy as np import datetime as dt from datetime import datetime, timedelta import matplo...
github_jupyter
# Explore endangered languages from UNESCO Atlas of the World's Languages in Danger ### Input Endangered languages - https://www.kaggle.com/the-guardian/extinct-languages/version/1 (updated in 2016) - original data: http://www.unesco.org/languages-atlas/index.php?hl=en&page=atlasmap (published in 2010) Countries of...
github_jupyter
# Function to list overlapping Landsat 8 scenes This function is based on the following tutorial: http://geologyandpython.com/get-landsat-8.html This function uses the area of interest (AOI) to retrieve overlapping Landsat 8 scenes. It will also output on the scenes with the largest portion of overlap and with less t...
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
# <span style="color: #B40486">BASIC PYTHON FOR RESEARCHERS</span> _by_ [**_Megat Harun Al Rashid bin Megat Ahmad_**](https://www.researchgate.net/profile/Megat_Harun_Megat_Ahmad) last updated: April 14, 2016 ------- ## _<span style="color: #29088A">8. Database and Data Analysis</span>_ --- <span style="color: #00...
github_jupyter
# Spectral encoding of categorical features About a year ago I was working on a regression model, which had over a million features. Needless to say, the training was super slow, and the model was overfitting a lot. After investigating this issue, I realized that most of the features were created using 1-hot encoding ...
github_jupyter
# Multivariate SuSiE and ENLOC model ## Aim This notebook aims to demonstrate a workflow of generating posterior inclusion probabilities (PIPs) from GWAS summary statistics using SuSiE regression and construsting SNP signal clusters from global eQTL analysis data obtained from multivariate SuSiE models. ## Methods o...
github_jupyter
``` import keras from keras.applications import VGG16 from keras.models import Model from keras.layers import Dense, Dropout, Input from keras.regularizers import l2, activity_l2,l1 from keras.utils import np_utils from keras.preprocessing.image import array_to_img, img_to_array, load_img from keras.applications.vgg16 ...
github_jupyter
# Guided Investigation - Anomaly Lookup __Notebook Version:__ 1.0<br> __Python Version:__ Python 3.6 (including Python 3.6 - AzureML)<br> __Required Packages:__ azure 4.0.0, azure-cli-profile 2.1.4<br> __Platforms Supported:__<br> - Azure Notebooks Free Compute - Azure Notebook on DSVM __Data Source Re...
github_jupyter
<a href="https://colab.research.google.com/github/dribnet/clipit/blob/future/demos/CLIP_GradCAM_Visualization.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # CLIP GradCAM Colab This Colab notebook uses [GradCAM](https://arxiv.org/abs/1610.02391) ...
github_jupyter
``` # Reload when code changed: %load_ext autoreload %reload_ext autoreload %autoreload 2 %pwd import sys import os path = "../" sys.path.append(path) #os.path.abspath("../") print(os.path.abspath(path)) import os import core import logging import importlib importlib.reload(core) try: logging.shutdown() impor...
github_jupyter
# Chapter 4: Linear models [Link to outline](https://docs.google.com/document/d/1fwep23-95U-w1QMPU31nOvUnUXE2X3s_Dbk5JuLlKAY/edit#heading=h.9etj7aw4al9w) Concept map: ![concepts_LINEARMODELS.png](attachment:c335ebb2-f116-486c-8737-22e517de3146.png) #### Notebook setup ``` import numpy as np import pandas as pd impo...
github_jupyter
``` try: import saspy except ImportError as e: print('Installing saspy') %pip install saspy import pandas as pd # The following imports are only necessary for automated sascfg_personal.py creation from pathlib import Path import os from shutil import copyfile import getpass # Imports without the setup check...
github_jupyter
<a href="https://colab.research.google.com/github/isb-cgc/Community-Notebooks/blob/master/MachineLearning/How_to_build_an_RNAseq_logistic_regression_classifier_with_BigQuery_ML.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # How to build an RNA-se...
github_jupyter
# FireCARES ops management notebook ### Using this notebook In order to use this notebook, a single production/test web node will need to be bootstrapped w/ ipython and django-shell-plus python libraries. After bootstrapping is complete and while forwarding a local port to the port that the ipython notebook server w...
github_jupyter
``` import sys sys.path.append("/Users/sgkang/Projects/DamGeophysics/codes/") from Readfiles import getFnames from DCdata import readReservoirDC %pylab inline from SimPEG.EM.Static import DC from SimPEG import EM from SimPEG import Mesh ``` Read DC data ``` fname = "../data/ChungCheonDC/20150101000000.apr" survey = r...
github_jupyter
# FloPy ## Using FloPy to simplify the use of the MT3DMS ```SSM``` package A multi-component transport demonstration ``` import os import sys import numpy as np # run installed version of flopy or add local path try: import flopy except: fpth = os.path.abspath(os.path.join('..', '..')) sys.path.append(f...
github_jupyter
# Introduction In a prior notebook, documents were partitioned by assigning them to the domain with the highest Dice similarity of their term and structure occurrences. The occurrences of terms and structures in each domain is what we refer to as the domain "archetype." Here, we'll assess whether the observed similari...
github_jupyter
``` import pandas as pd import praw import re import datetime as dt import seaborn as sns import requests import json import sys import time ## acknowledgements ''' https://stackoverflow.com/questions/48358837/pulling-reddit-comments-using-python-praw-and-creating-a-da...
github_jupyter
# Residual Networks Welcome to the second assignment of this week! You will learn how to build very deep convolutional networks, using Residual Networks (ResNets). In theory, very deep networks can represent very complex functions; but in practice, they are hard to train. Residual Networks, introduced by [He et al.](h...
github_jupyter
# Project 3 Sandbox-Blue-O, NLP using webscraping to create the dataset ## Objective: Determine if posts are in the SpaceX Subreddit or the Blue Origin Subreddit We'll utilize the RESTful API from pushshift.io to scrape subreddit posts from r/blueorigin and r/spacex and see if we cannot use the Bag-of-words algorithm...
github_jupyter
Note: This notebook was executed on google colab pro. ``` !pip3 install pytorch-lightning --quiet from google.colab import drive drive.mount('/content/drive') import os os.chdir('/content/drive/MyDrive/Colab Notebooks/atmacup11/experiments') ``` # Settings ``` EXP_NO = 27 SEED = 1 N_SPLITS = 5 TARGET = 'target' GR...
github_jupyter
# Essential Objects This tutorial covers several object types that are foundational to much of what pyGSTi does: [circuits](#circuits), [processor specifications](#pspecs), [models](#models), and [data sets](#datasets). Our objective is to explain what these objects are and how they relate to one another at a high lev...
github_jupyter
# Day and Night Image Classifier --- The day/night image dataset consists of 200 RGB color images in two categories: day and night. There are equal numbers of each example: 100 day images and 100 night images. We'd like to build a classifier that can accurately label these images as day or night, and that relies on f...
github_jupyter
##### Copyright 2018 The AdaNet 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 agre...
github_jupyter
``` import numpy as np import matplotlib.pylab as plt def Weight(phi,A=5, phi_o=0): return 1-(0.5*np.tanh(A*((np.abs(phi)-phi_o)))+0.5) def annot_max(x,y, ax=None): x=np.array(x) y=np.array(y) xmax = x[np.argmax(y)] ymax = y.max() text= "x={:.3f}, y={:.3f}".format(xmax, ymax) if not ax: ...
github_jupyter
# Description This task is to do an exploratory data analysis on the balance-scale dataset ## Data Set Information This data set was generated to model psychological experimental results. Each example is classified as having the balance scale tip to the right, tip to the left, or be balanced. The attributes are the ...
github_jupyter
# Summarizing Emails using Machine Learning: Data Wrangling ## Table of Contents 1. Imports & Initalization <br> 2. Data Input <br> A. Enron Email Dataset <br> B. BC3 Corpus <br> 3. Preprocessing <br> A. Data Cleaning. <br> B. Sentence Cleaning <br> C. Tokenizing <br> 4. Store Data <br> A. Local...
github_jupyter
``` from google.colab import drive drive.mount('/content/gdrive') import pandas as pd import numpy as np import csv #DATA_FOLDER = '/content/gdrive/My Drive/101/results/logreg/' subfolders = [] for a in range(1,7): for b in range(6,0,-1): subfolders.append('+1e-0'+str(a)+'_+1e-0'+str(b)) classifiers = ['...
github_jupyter
By now basically everyone ([here](http://datacolada.org/2014/06/04/23-ceiling-effects-and-replications/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+DataColada+%28Data+Colada+Feed%29), [here](http://yorl.tumblr.com/post/87428392426/ceiling-effects), [here](http://www.talyarkoni.org/blog/2014/06/01/there-i...
github_jupyter
# Build a Traffic Sign Recognition Classifier Deep Learning Some improvements are taken : - [x] Adding of convolution networks at the same size of previous layer, to get 1x1 layer - [x] Activation function use 'ReLU' instead of 'tanh' - [x] Adaptative learning rate, so learning rate is decayed along to training phase ...
github_jupyter
# Simulating Grover's Search Algorithm with 2 Qubits ``` import numpy as np from matplotlib import pyplot as plt %matplotlib inline ``` Define the zero and one vectors Define the initial state $\psi$ ``` zero = np.matrix([[1],[0]]); one = np.matrix([[0],[1]]); psi = np.kron(zero,zero); print(psi) ``` Define the ga...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Visualization/image_color_ramp.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank...
github_jupyter
# Ingeniería de Características En las clases previas vimos las ideas fundamentales de machine learning, pero todos los ejemplos asumían que ya teníamos los datos numéricos en un formato ordenado de tamaño ``[n_samples, n_features]``. En la realidad son raras las ocasiones en que los datos vienen así, _llegar y llevar...
github_jupyter
# Pre-training VGG16 for Distillation ``` import torch import torch.nn as nn from src.data.dataset import get_dataloader import torchvision.transforms as transforms import numpy as np import matplotlib.pyplot as plt DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu") print(DEVICE) SEED = 0 BATCH...
github_jupyter
# _Mini Program - Working with SQLLite DB using Python_ ### <font color=green>Objective -</font> <font color=blue>1. This program gives an idea how to connect with SQLLite DB using Python and perform data manipulation </font><br> <font color=blue>2. There are 2 ways in which tables are create below to help you unders...
github_jupyter
# Neural network hybrid recommendation system on Google Analytics data model and training This notebook demonstrates how to implement a hybrid recommendation system using a neural network to combine content-based and collaborative filtering recommendation models using Google Analytics data. We are going to use the lea...
github_jupyter
# Supervised Learning: Finding Donors for *CharityML* > Udacity Machine Learning Engineer Nanodegree: _Project 2_ > > Author: _Ke Zhang_ > > Submission Date: _2017-04-30_ (Revision 3) ## Content - [Getting Started](#Getting-Started) - [Exploring the Data](#Exploring-the-Data) - [Preparing the Data](#Preparing-the-Da...
github_jupyter
# Feature Extraction In machine learning, feature extraction aims to compute values (features) from images, intended to be informative and non-redundant, facilitating the subsequent learning and generalization steps, and in some cases leading to better human interpretations. These features may be handcrafted (manually ...
github_jupyter
### Regular Expressions Regular expressions are `text matching patterns` described with a formal syntax. You'll often hear regular expressions referred to as 'regex' or 'regexp' in conversation. Regular expressions can include a variety of rules, for finding repetition, to text-matching, and much more. As you advance ...
github_jupyter