text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# DAE 4 Descriptive Statistics Author: - | Sofia Dahl, sof@create.aau.dk\ Dept. Architecture, Design and Media Technology, Aalborg University Copenhagen --- ## Learning goals After working your way through this notebook you should be able to.. - Explain what is meant by 'population' and 'sample' - Plot and sum...
github_jupyter
# SSD300 Training Tutorial This tutorial explains how to train an SSD300 on the Pascal VOC datasets. The preset parameters reproduce the training of the original SSD300 "07+12" model. Training SSD512 works simiarly, so there's no extra tutorial for that. The same goes for training on other datasets. You can find a su...
github_jupyter
<img src="../../../images/qiskit_header.png" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" align="middle"> # Pulse Schedules The `pulse` module allows quantum experiments to be described at the level of pulses. For IBMQ devices these are microwave puls...
github_jupyter
## NYC Neighborhood School Quality Metric: # Buying a Home in NYC: What Neighborhoods are the Best Value? ### Applying Data Science Tools to Understand NYC's Residential Real Estate Fundamentals Josh Grasso | joshgrasso@gmail.com This project seeks to understand the fundamental factors that explain differences in...
github_jupyter
# Keyword Filter This notebook generates keyword-filtered versions of the pre-filtered datasets (those filtered by evidence duplicates). More specifically, for each task, a list of keywords is created first. Then, all text-triple pairs that contain one of these keywords in their evidence are filtered out. ``` # Impor...
github_jupyter
# Logistic Regression with Linear and Polynomial Features ``` import pandas as pd from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn import metrics import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import PolynomialFeatur...
github_jupyter
# [LEGALST-123] Lab 24: Morality and Sentiment Analysis This lab will cover morality and sentiment analysis using the *Moral Foundations Theory* with dictionary-based analysis, connecting to topic modeling and classifications ideas from previous labs. ### Table of Contents [The Data](#section data)<br> [Goal and Ques...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import scipy.linalg as la import scipy.signal as sp import numpy.random as rnd import ssid %matplotlib inline # Just a helper for defining plants def generalizedPlant(A,B,C,D,Cov,dt): CovChol = la.cholesky(Cov,lower=True) NumStates = len(A) B1 = CovCh...
github_jupyter
# TSG003 - Show BDC Spark sessions ## Steps ### Common functions Define helper functions used in this notebook. ``` # Define `run` function for transient fault handling, suggestions on error, and scrolling updates on Windows import sys import os import re import platform import shlex import shutil import datetime ...
github_jupyter
"With whom do users initiate?" Mlogit Modeling === Multiple notes in other places about this... ``` %reload_ext autoreload %autoreload 2 %matplotlib inline import os import re import pandas as pd import numpy as np from collections import Counter, defaultdict import sqlite3 from tqdm import tqdm import random import...
github_jupyter
## <center> Solving Linear Systems Using `Numpy` </center>## ``` import numpy as np ``` ### Linear Systems ### An $m\times n$ [linear system of equations](https://en.wikipedia.org/wiki/System_of_linear_equations) is a collection of linear equations: $$ \begin{eqnarray*} a_{11}x_1 + a_{12}x_2 + \cdots...
github_jupyter
``` #@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 agreed to in writing, software # distributed u...
github_jupyter
### ``Regularization`` - Keras * **Regularization** is a set of techniques that can prevent overfitting in neural networks and thus improve the accuracy of a Deep Learning model when facing completely new data from the problem domain. 1. **Overfitting** One of the most important aspects when training neural networks...
github_jupyter
# 2.3 高斯分布 高斯分布,又叫正态分布,是连续变量经常使用的一个分布模型,一维的高斯分布如下: $$ \mathcal{N}\left(x\left|~\mu,\sigma^2\right.\right) = \frac{1}{(2\pi\sigma^2)^{1/2}} \exp\left\{-\frac{1}{2\sigma^2}(x-\mu)^2\right\} $$ 其中 $\mu$ 是均值,$\sigma$ 是方差。 $D$-维的高斯分布如下: $$ \mathcal{N}\left(\mathbf x\left|~\mathbf{\mu, \Sigma}\right.\right) = \frac{1}{(...
github_jupyter
``` # Copyright 2020 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
``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns import random import time sns.set() def get_vocab(file, lower = False): with open(file, 'r') as fopen: data = fopen.read() if lower: data = data.lower() vocab = list(set(data)) return data, vocab def embed_to_o...
github_jupyter
``` import os import json import clang.cindex import clang.enumerations import csv import numpy as np import os import re import warnings warnings.filterwarnings('ignore') # set the config try: clang.cindex.Config.set_library_path("/usr/lib/x86_64-linux-gnu") clang.cindex.Config.set_library_file('/usr/lib/x86_...
github_jupyter
<!-- TODO: Self-organizing maps and hexagonal grids (Kohonen 1982; Huysmans et al. 2006a; Seret et al. 2012). A SOM --> <!-- TODO: DBScan, TSNE, <https://speakerdeck.com/lmcinnes/umap-uniform-manifold-approximation-and-projection-for-dimension-reduction> --> <!-- TODO: Good overview and connections to optimization <ht...
github_jupyter
# Workflow 1, Module 3, Question 2 ## What proteins produce agent [x]? Let's run Q1 and use the endogenous output of that. ### Expand service ``` robokop_server = 'robokop.renci.org' import requests import pandas as pd def expand(type1,identifier,type2,rebuild=None,csv=None,predicate=None): url=f'http://{roboko...
github_jupyter
## 1: Jeopardy Questions ``` import pandas as pd jeopardy = pd.read_csv('jeopardy.csv') jeopardy.head() jeopardy.columns jeopardy.columns = ['Show Number', 'Air Date', 'Round', 'Category', 'Value', 'Question', 'Answer'] ``` ## 2: Normalizing Text ``` import re def norm(string): string = string.lower() string...
github_jupyter
# 텍스트 데이터 전처리 딥러닝을 위한 텍스트 데이터를 준비하는 방법 딥러닝 모형에서는 텍스트를 수치로 변환하여 처리해야 한다. 원시 텍스트(raw text)를 딥러닝 모델에 직접 공급할 수 없다. 텍스트 데이터는 기계 학습 및 심층 학습 모델의 입력 또는 출력으로 사용할 숫자로 인코딩되어야 한다. * 텍스트 데이터를 빠르게 준비하는 데 사용할 수있는 편리한 방법. * BoW(Bag of Word) * Tokenizer API # BoW(Bag of Word) 텍스트나 단어를 사용하기 전에 수치 형태로 변환하는 전처리 과정을 거쳐야 한다....
github_jupyter
# OUTDATED, the examples moved to the manual ## See https://empymod.readthedocs.io/en/stable/examples ---- # Comparison between full wavefield and diffusive approximation for a fullspace Play around to see that the difference is getting bigger for - higher frequencies, - higher eperm/mperm. ``` import numpy as np i...
github_jupyter
## 1--Spec with Ferry Downstream Task ## Wav Temporal Order Self-Supervised Learning from Birdsong Applied to Ferry Motor Classification. Self-Supervised Model, Extracted Weights, and Load into Custom Model Last Updated Date June 10 ``` from __future__ import print_function %matplotlib inline import matplotlib as plt...
github_jupyter
This notebook verifies math in Appendix A. Perspective effect in Oh & Evans 2020. ``` from sympy import symbols, simplify, latex from sympy import cos, sin, Matrix, diff, N import numpy as np ra, dec = symbols('alpha, delta') vra,vdec,vr = symbols(r'v_\alpha, v_\delta, v_r') vx,vy,vz = symbols('v_x v_y v_z') delta_ra...
github_jupyter
<h1> Preprocessing using tf.transform and Dataflow </h1> This notebook illustrates: <ol> <li> Creating datasets for Machine Learning using tf.transform and Dataflow </ol> <p> While Pandas is fine for experimenting, for operationalization of your workflow, it is better to do preprocessing in Apache Beam. This will also...
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
##### salimt Below is code with a link to a happy or sad dataset which contains 80 images, 40 happy and 40 sad. Create a convolutional neural network that trains to 100% accuracy on these images, which cancels training upon hitting training accuracy of >.999 Hint -- it will work best with 3 convolutional layers. `...
github_jupyter
# H0 Hyperparameter Tuning - ResConvLSTM #### Author: Jayant Verma #### Cognibit Solutions LLP Derived from https://arxiv.org/pdf/1610.03022.pdf, 1. No conv(3x3)/2 used 2. Added an extra dense layer of 256 units 83.8% on val set ``` import sys import os import tensorflow as tf sys.path.append("../libs") from cla...
github_jupyter
# Bayesian Normal Density This notebook illustrate how to use a Bayesian Normal density model with the [beer framework](https://github.com/beer-asr/beer). The Normal distribution is a fairly basic model but it is used extenslively in other model as a basic building block. ``` # Add "beer" to the PYTHONPATH import sys...
github_jupyter
# Variant Calling Workflow: ![variant_calling_workflow.png](variant_calling_workflow.png) ## Setting up ### Download the reference genome for E. coli REL606: ``` !mkdir -p data/ref_genome !curl -L -o data/ref_genome/ecoli_rel606.fasta.gz ftp://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/017/985/GCA_000017985.1_ASM1798v...
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
# Cox-PH and DeepSurv In this notebook we will train the [Cox-PH method](http://jmlr.org/papers/volume20/18-424/18-424.pdf), also known as [DeepSurv](https://bmcmedresmethodol.biomedcentral.com/articles/10.1186/s12874-018-0482-1). We will use the METABRIC data sets as an example A more detailed introduction to the `p...
github_jupyter
### Tutorial in hamiltorch for log probabilities * For the corresponding blog post please see: https://adamcobb.github.io/journal/hamiltorch.html * Bayesian neural networks are left to a different notebook ``` import torch import hamiltorch import matplotlib.pyplot as plt %matplotlib inline hamiltorch.set_random_seed...
github_jupyter
# Running the fleet of Virtual Wind Turbines and Edge Devices **SageMaker Studio Kernel**: Data Science After visualizing the data and training/optimizing/packaging the Anomaly detection model, its time to deploy it and test your virtual fleet. In this exercise you will run a local application written in Python3 that...
github_jupyter
# Face Recognition Welcome! In this assignment, you're going to build a face recognition system. Many of the ideas presented here are from [FaceNet](https://arxiv.org/pdf/1503.03832.pdf). In the lecture, you also encountered [DeepFace](https://research.fb.com/wp-content/uploads/2016/11/deepface-closing-the-gap-to-huma...
github_jupyter
# Python Job Interview Questions 1) What is Python? - Python is a high-level, interactive and object-oriented language. - Python is a very readable language. 2) What are some key features of Python? - Object Oriented - Free - open source - It has a large community. - Simple and understandable....
github_jupyter
## feature reduction Data can be loaded downloaded [here](https://drive.google.com/drive/folders/1yZI5v3ws3b8GZMl_ACe4TO_qebdS2fUz?usp=sharing). The data is contained in the `srp_raw01.zip` and has to be moved to `/data/raw`. The resulting folder structure looks like this: `/data/raw/n`, `/data/raw/o` and `/data/raw/x...
github_jupyter
<a href="https://colab.research.google.com/github/cedro3/data-efficient-gans/blob/master/DiffAugment_GAN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Data-Efficient GANs with DiffAugment ## セットアップ ``` # tensorflow 1.15.0 のインストール !pip uninstal...
github_jupyter
<img width="10%" alt="Naas" src="https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160"/> # CCXT - Calculate Support and Resistance <a href="https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/CCXT/CCXT_Calculate_Support_and_Resistance...
github_jupyter
<a href="https://colab.research.google.com/github/AbuKaisar24/Machine-Learning-Algorithms-Performance-Measurement-for-Bengali-News-Sentiment-Classification.-/blob/master/Bengali_Newspaper_Sentiment_Analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>...
github_jupyter
Current and near-term quantum computers suffer from imperfections, as we repeatedly pointed it out. This is why we cannot run long algorithms, that is, deep circuits on them. A new breed of algorithms started to appear since 2013 that focus on getting an advantage from imperfect quantum computers. The basic idea is ext...
github_jupyter
# Readability indices # Cognitive Load Simulation Cognitive load is the resources your working memory has to use during problem solving and learning activities. Total cognitive load = intrinsic cognitive load + extrinsic cognitive load + germane cognitive load Intrinsic cognitive load = cognitive load associated wi...
github_jupyter
# Event data One of the main benfits of working with kloppy that it loads metadata with the event data. This metadata includes teams (name, ground and provider id) and players (name, jersey number, optional position and provider id). Using this metadata it becomes very easy to an analyse that is usable by humans, beca...
github_jupyter
# Introduction In this article, we discuss how to construct a Geometric Brownian Motion(GBM) simulation using Python. While building the script, we also explore the intuition behind GBM model. I will not be getting into theoretical background of its derivation. It's beyond the scope of this article. I care more about ...
github_jupyter
# **03_gen_supplement.ipynb**: This ipython notebook interprets MAC results. Running this entire script generates a single file containing a summary of MAC results - `ENSEMBLE_DIR/supplementary/Supplementary File XYZ.xlsx` This code replaces previous results and is not additive like 01 and 02 .py scripts. Must be ...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Lists" data-toc-modified-id="Lists-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Lists</a></span><ul class="toc-item"><li><span><a href="#Indexing" data-toc-modified-id="Indexing-1.1"><span class="toc-i...
github_jupyter
``` %pylab inline import pandas as pd import logging import imp from rpy2.robjects import numpy2ri RANDOM_SEED = 0 numpy2ri.activate() import fairtest.utils.log as fairtest_log imp.reload(fairtest_log) fairtest_log.set_params(filename='fairtest.log', level=logging.INFO) from fairtest import DataSource import fairtest...
github_jupyter
``` import json, sys, os, requests import altair as alt from altair import expr, datum import matplotlib.pyplot as plt import numpy as np import pandas as pd eco_git_home = ( "https://raw.githubusercontent.com/EconomicsObservatory/ECOvisualisations/main/" ) vega_embed = requests.get(eco_git_home + "guidelines/html/...
github_jupyter
# Deep Learning Explained # Module 3 - Lab - Introduction to Deep Neural Networks ## 1.0 Overview This lesson introduces you to the basics of neural network architecture in the form of deep forward networks. This architecture is the quintessential deep neural net architecture. In this lab you will learn the followi...
github_jupyter
``` import pandas as pd import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import time import seaborn as sns sns.set() dataset = pd.read_csv('HistoricalQuotes.csv') del dataset['date'] del dataset['volume'] dataset.head() count = 0; temp = dataset.iloc[0, 0] while temp > 10: temp /= 10.0; co...
github_jupyter
# Summarize results at cell-type level for the purpose of contrasting results across species 1. Proportion of FDR < 10% at various parameter for scDRS. 2. Cell type level p-value for scDRS 3. Geary's C statistics for 10kb, 1000 genes default settings. 4. LDSC-SEG p-value ``` %load_ext lab_black %load_ext autoreload %a...
github_jupyter
# Exp 95 analysis See `./informercial/Makefile` for experimental details. ``` import os import numpy as np from IPython.display import Image import matplotlib import matplotlib.pyplot as plt %matplotlib inline %config InlineBackend.figure_format = 'retina' import seaborn as sns sns.set_style('ticks') matplotlib.r...
github_jupyter
# Numpy Practice - Author: Alireza Dirafzoon - Contributions are welcome :) ``` import numpy as np ### array() a = [1, 2, 3] x = np.array(a) x = np.asarray(a) x x.tolist() x.astype(np.float32) ### arange() np.arange(3) np.arange(0,7,2) np.arange(3, -1, -1) ### zeros, ones, eye, linspace np.zeros(3) np.zeros((3,3))...
github_jupyter
# Tutorial 2: Training a spiking neural network on a simple vision dataset Friedemann Zenke (https://fzenke.net) > For more details on surrogate gradient learning, please see: > Neftci, E.O., Mostafa, H., and Zenke, F. (2019). Surrogate Gradient Learning in Spiking Neural Networks. > https://arxiv.org/abs/1901.09948...
github_jupyter
## Calculate the GPS Distance with the Haversine Formula * Dan Couture [@MathYourLife](https://twitter.com/MathYourLife), [github](https://github.com/MathYourLife) * 2015-03-05 ### Problem I've got the start and end gps location from an excursion across town and need to determine the travel distance start: 43.0...
github_jupyter
# About this file Data normalization takes a csv file, and outputs a set of public CSV's with one column and private ordering files. Each public file is associated with a corresponding private file. The public file consists of a shuffled column. The first line is the column name, and the rest of the file consists o...
github_jupyter
# Desafio #9 ### Instalação de libs requeridas ``` !pip install opencv-python imutils pandas matplotlib # Libs de apoio import pandas as pd import numpy as np import matplotlib.pyplot as plt from IPython.display import Image, display import os , random , json , requests import types import pandas as pd # Libs para c...
github_jupyter
# Building an image classifier using the Sequential API for Tensorflow ## Getting started with Fashion MNIST ``` import tensorflow as tf from tensorflow import keras import numpy as np from sklearn.utils import shuffle import matplotlib.pyplot as plt import random print(tf.__version__) print(keras.__version__) #Bui...
github_jupyter
``` from collections import defaultdict from pathlib import Path import re import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import toml import tqdm def logdir2df(logdir): """convert tf.events files in a log...
github_jupyter
# Búsqueda Tabú La librería **Pyristic** incluye una clase llamada `TabuSearch` que facilita la implementación de una metaheurística basada en Búsqueda Tabú para resolver problemas de minimización. Para poder utilizar esta clase es necesario: 1. Definir: * La función objetivo $f$. * La lista de restricciones....
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc" style="margin-top: 1em;"><ul class="toc-item"><li><span><a href="#0.1-Motivation" data-toc-modified-id="0.1-Motivation-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>0.1 Motivation</a></span></li><li><span><a href="#0.3-Open-Source" data-toc-mo...
github_jupyter
# Vinicius Augusto de Souza - RA: 1997530 ------------------------------------------------------------------------------------------------------------------------------- ``` import tensorflow as tf import numpy as np import pandas as pd from sklearn.metrics import classification_report, confusion_matrix import matplo...
github_jupyter
``` # import libraries import pandas as pd import matplotlib.pyplot as plt import numpy as np import seaborn as sb from matplotlib import rcParams %matplotlib inline rcParams['figure.figsize'] = 5, 4 sb.set_style('whitegrid') # take a look at 10 head of data file data = pd.read_csv("~/Downloads/creditcard.csv") data.h...
github_jupyter
## Final Notebook Submission Please fill out: * Student name: * Student pace: self paced / part time / full time * Scheduled project review date/time: * Instructor name: * Blog post URL: ``` import pandas as pd import numpy as np import seaborn as sns from sklearn.preprocessing import OneHotEncoder from sklearn.li...
github_jupyter
# Results: XXXX Scaled <b> MIL </b> <i>stratified k fold Validation</i> is performed. Metrics: <br> - AUC - Accuracie ### Import Libraries ``` import sys,os import warnings os.chdir('/Users/josemiguelarrieta/Documents/MILpy') sys.path.append(os.path.realpath('..')) from sklearn.utils import shuffle import...
github_jupyter
# Object Detection Demo Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/master/research/object_de...
github_jupyter
# nlp-transform-snippets creates snippets out of large text files ``` !pip3 install wget==3.2 import wget import logging import numpy as np import os import re import shutil import sys import tarfile import time # file name for training data zip input_filename = os.environ.get('input_filename ', 'data.zip') # result...
github_jupyter
# Final Project: Classifying Flowers It's nearing the end of year and it's time we work on one final project. First we learned about AI, and now we are going to combine it with web scraping. The first thing we are going to do is create a neural network to classify the flowers. Then I will direct you to a website where ...
github_jupyter
# Preferential Bayesian Optimization: Dueling-Thompson Sampling Implementation of the algorithm by Gonzalez et al (2017). ``` import numpy as np import gpflow import tensorflow as tf import tensorflow_probability as tfp import matplotlib.pyplot as plt import sys import os import datetime import pickle from gpflow.ut...
github_jupyter
# Entities Recognition <div class="alert alert-info"> This tutorial is available as an IPython notebook at [Malaya/example/entities](https://github.com/huseinzol05/Malaya/tree/master/example/entities). </div> <div class="alert alert-warning"> This module only trained on standard language structure, so it is no...
github_jupyter
**[WGT-01]** Specify the TensorFlow version. ``` %tensorflow_version 2.x ``` **[WGT-02]** Import modules. ``` import numpy as np import copy, random, time from tensorflow.keras import layers, models from IPython.display import clear_output ``` **[WGT-03]** Define a function to get the field data. ``` def get_fi...
github_jupyter
# binary classification example - titanic dataset ``` import warnings warnings.filterwarnings('ignore') %load_ext autoreload %autoreload 2 import copy import numpy as np import pandas as pd import databricks.koalas as ks from pandas.testing import assert_frame_equal from pandas.testing import assert_series_equal from ...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline import warnings warnings.filterwarnings('ignore') from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder from sklearn.linear_model import LogisticRegression ...
github_jupyter
``` # Use centrailzed training to compare with federated learning epochs = 30 n_train_items = 12800 import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset from torchvision import datasets, transforms import numpy as np import opacus from opacu...
github_jupyter
# Análise de Dados com Python Neste notebook, utilizaremos dados de automóveis para analisar a influência das características de um carro em seu preço, tentando posteriormente prever qual será o preço de venda de um carro. Utilizaremos como fonte de dados um arquivo .csv com dados já tratados em outro notebook. Caso ...
github_jupyter
# 학습된 NarrativeKoGPT2을 이용한 Text Generation ## 1.Google Drive 연동 - 모델 파일과 학습 데이터가 저장 되어있는 구글 드라이브의 디렉토리와 Colab을 연동. ### 1.1 Google Drive 연동 아래 코드를 실행후 나오는 URL을 클릭하여 나오는 인증 코드 입력 ``` from google.colab import drive drive.mount('/content/drive') ``` **Colab 디렉토리 아래 NarrativeKoGPT2 경로 확인** ``` !ls drive/'My Drive'/'Col...
github_jupyter
# Liver Disorders Data Set Arm Identefication # Importing the important libraries ``` import pandas as pd import numpy import sys %matplotlib inline import matplotlib.pyplot as plt from pandas.plotting import scatter_matrix import numpy as np import time import sklearn from IPython.display import set_matplotlib_fo...
github_jupyter
``` import pandas as pd # demo 验证 train_df = pd.read_csv('Data/Movie_RS.csv',nrows=10000) print(train_df.shape) train_df.head(1) # 去除空值 train_df.dropna(axis=0, how='any', inplace=True) train_df.info() !pip install lightfm from sklearn.metrics.pairwise import cosine_similarity from lightfm import LightFM, cross_validati...
github_jupyter
## Calculating inter-annotators agreement #### This script generates 8 additional files: 1. batches_annotators.json – a list of annotators per batch 2. k_alpha_per_batch_4_options.csv – Krippendorff's alpha per batch for all 4 options 3. k_alpha_per_batch_2_options.csv – Krippendorff's alpha per batch for 2 options ('...
github_jupyter
Copyright (c) Microsoft Corporation. Licensed under the MIT License. # Library Imports ``` data_lake_account_name = '' # Synapse Workspace ADLS file_system_name = 'data' table_name = "c360_data.preparedinferencedata" #AML workspace details subscription_id = "" resource_group = "" workspace_name = "" import azure...
github_jupyter
``` import tensorflow as tf #import wave import glob import scipy.io.wavfile as wavfile import numpy as np from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline global SMP_RATE SMP_RATE = 16000 def getWaveName(wavepath): return wavepath.split('/')[-1] def findWave(wavefile,path): r = gl...
github_jupyter
# Introduction to Data Science – Lecture 2 – Python Hi there, welcome to our first coding lecture. We will be using Python, a popular data science programming language in the lectures, homeworks, and projects. As part of Homework 0, you should have already setup Python, IPython and Jupyter notebooks, so it's time to g...
github_jupyter
# Lesson 4 - Euler—McLaurin evaluation time: 30 min ## Learning outcomes Python: - lambda functions - recursive functions SageMath: - symbolic and numerical integrals - plotting To check on the Riemann Hypothesis we need to be able to evaluate $\zeta$ to the left of the real part = 1. We can not rely on the de...
github_jupyter
``` import torch, torchvision print(torch.__version__, torch.cuda.is_available()) !python -m pip install -q 'git+https://github.com/facebookresearch/detectron2.git' import pandas as pd import numpy as np import pandas as pd from tqdm import tqdm from tqdm import tqdm_notebook as tqdm # progress bar from datetime impor...
github_jupyter
<img src = "./media/walmart.png" width = 400 height = 400> ``` import pandas as pd sales = pd.read_csv('./dataset/walmart_data.csv') sales sales.drop(['MarkDown1', 'MarkDown2', 'MarkDown3', 'MarkDown4', 'MarkDown5', 'Size'], inplace=True, axis=1) sales sales.rename(columns={'Store':'store', 'Typ...
github_jupyter
``` import matplotlib.pyplot as plt import seaborn as sns import os import pandas as pd import numpy as np %matplotlib inline sns.set_context('talk') sns.set_style('ticks') import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = (10,6) sim_name = 'test_schedule_v7' outdir = f'fig/{sim_name}' if not os.path.exi...
github_jupyter
# LAB 4a: Creating a Sampled Dataset. **Learning Objectives** 1. Setup up the environment 1. Sample the natality dataset to create train/eval/test sets 1. Preprocess the data in Pandas dataframe ## Introduction In this notebook, we'll read data from BigQuery into our notebook to preprocess the data within a Panda...
github_jupyter
#Trends Places To Sheets Via Query Move using a WOEID query. #License Copyright 2020 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 Unl...
github_jupyter
# Train and Deploy Your First Machine Learning Model on Amazon SageMaker ## Create SageMaker session A SageMaker session needs to be initialized in order to start interacting the SageMaker service. ``` import boto3 import re import os import numpy as np import pandas as pd import sagemaker as sage boto_session = b...
github_jupyter
# Survey Analysis: Summary Tables and Statistical Tests This notebook summarizes survey responses from the original and amended flu surveys. It generates Tables 1, 2, 3 and S1 and reproduces the statistical tests reported in the paper. ``` import pandas as pd import numpy as np import scipy.stats as stats ``` ### L...
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-hierarchical-timeseries/auto-ml-forecasting-hierarchical-times...
github_jupyter
# GPU :label:`sec_use_gpu` 在 :numref:`tab_intro_decade`中, 我们回顾了过去20年计算能力的快速增长。 简而言之,自2000年以来,GPU性能每十年增长1000倍。 本节,我们将讨论如何利用这种计算性能进行研究。 首先是如何使用单个GPU,然后是如何使用多个GPU和多个服务器(具有多个GPU)。 我们先看看如何使用单个NVIDIA GPU进行计算。 首先,确保你至少安装了一个NVIDIA GPU。 然后,下载[NVIDIA驱动和CUDA](https://developer.nvidia.com/cuda-downloads) 并按照提示设置适当的路径。 当这些准备工作完成...
github_jupyter
``` import pickle import os import numpy as np import pandas as pd import os import glob def read_lines(fn): if not os.path.exists(fn): return [] with open(fn, 'r', encoding='utf-8') as f: text = f.read() lines = text.split("\n") if lines[-1] == '': return lines[:-1] else: ...
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/classification-bank-marketing-all-features/auto-ml-classification-bank-mar...
github_jupyter
``` # Useful for debugging %load_ext autoreload %autoreload 2 import sys, os root = os.path.join(os.getcwd(), '../') sys.path.append(root) from matplotlib import pyplot as plt import matplotlib %matplotlib inline %config InlineBackend.figure_format = 'retina' from gpt.gpt_distgen import run_gpt_with_distgen GPT_IN...
github_jupyter
<a href="https://colab.research.google.com/github/ritesh-chafer/coronavirus-analysis/blob/master/Coronavirus_Dataset_Enrichment.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') ls '/con...
github_jupyter
``` library(caret, quiet=TRUE); library(base64enc) library(httr, quiet=TRUE) ``` # Build a Model ``` set.seed(1960) create_model = function() { model <- train(Species ~ ., data = iris, method = "nnet", trace = FALSE) return(model) } # dataset model = create_model() pred <- predict(model, as.matrix(i...
github_jupyter
# Brainiak Tutorials Environment Setup for Google CoLab ## Install Brainiak and code dependencies <i>(Approx install time 1 minute)</i> ``` !pip install deepdish ipython matplotlib nilearn notebook pandas seaborn watchdog !pip install pip\<10 !pip install git+https://github.com/brainiak/brainiak ``` ## Git-clone hel...
github_jupyter
# Functional data This notebook links various functional layers to ET cells across GB. Various methods are used based on the nature of input data, from areal interpolation to zonal statistics. All data are furhter measured within a relevant spatial context. ## Population estimates Population estimates are linked us...
github_jupyter
``` import ncbi_genome_download as ngd import os, re, gzip from ete3 import NCBITaxa import os ncbi = NCBITaxa() workpath = os.path.join("../" + "NCBITaxa/") try: os.mkdir(workpath) except FileExistsError: print("File exists:"+workpath) def getTaxid(namelist): # Get Taxon id accessid = [] for i in n...
github_jupyter