text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
<a href="https://colab.research.google.com/github/NicoEssi/Machine_Learning_scikit-learn/blob/master/KNN_Classification_Demo.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # K-Nearest Neighbors (K-NN) - Demo --- One of the most popular machine l...
github_jupyter
``` import datetime lipidname = "OPPE" tail = "CCCC CDCC" link = "G G" head = "C E" description = "; A general model Phosphosatidylethanolamine (PE) lipid \n; C18:1(9c) oleic acid, and C18:0 palmitic acid\n" modeledOn="; This topology follows the standard Martini 2.0 lipid definitions and building block rule...
github_jupyter
# Problem 2: Logistic Regression and LDA You are hired by a tour and travel agency which deals in selling holiday packages. You are provided details of 872 employees of a company. Among these employees, some opted for the package and some didn't. You have to help the company in predicting whether an employee will opt ...
github_jupyter
``` from keras.preprocessing import sequence from keras.models import Sequential, Model, load_model, model_from_yaml from keras.layers import Dense, Dropout, Activation from keras.layers import Embedding from keras.layers import Conv1D, GlobalMaxPooling1D from keras.datasets import imdb import tensorflow as tf from ker...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-bike-share/auto-ml-forecasting-bike-share.png) # Automated Ma...
github_jupyter
# Importing libraries ``` import pandas as pd import tensorflow as tf import cv2 from google.colab import drive drive.mount('/content/drive') ``` # Getting images and masks There are 60 images with 4 classes. Masks have $0$ in pixels with background and Label $[1,2,3,4]$ in their channels depending on class. ``` i...
github_jupyter
# Tutorial: Adding a new image-classification model ``` import os import distiller import torch.nn as nn from distiller.models import register_user_model import distiller.apputils.image_classifier as classifier class MyModel(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d...
github_jupyter
<table width="100%"> <tr style="border-bottom:solid 2pt #009EE3"> <td style="text-align:left" width="10%"> <a href="biosignalsnotebooks.dwipynb" download><img src="../../images/icons/download.png"></a> </td> <td style="text-align:left" width="10%"> <a href="https://my...
github_jupyter
<a href="https://colab.research.google.com/github/anitamezzetti/ML_finance/blob/main/generate_dataset_multiple%20maturities.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import numpy as np import os from time import time import matplotlib.pypl...
github_jupyter
# Image features exercise *Complete and hand in this completed worksheet (including its outputs and any supporting code outside of the worksheet) with your assignment submission. For more details see the [assignments page](http://vision.stanford.edu/teaching/cs231n/assignments.html) on the course website.* We have see...
github_jupyter
# Riskfolio-Lib Tutorial: <br>__[Financionerioncios](https://financioneroncios.wordpress.com)__ <br>__[Orenji](https://www.orenj-i.net)__ <br>__[Riskfolio-Lib](https://riskfolio-lib.readthedocs.io/en/latest/)__ <br>__[Dany Cajas](https://www.linkedin.com/in/dany-cajas/)__ <a href='https://ko-fi.com/B0B833SXD' target='...
github_jupyter
___ <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a> ___ # Linear Regression with Python ** This is mostly just code for reference. Please watch the video lecture for more info behind all of this code.** Your neighbor is a real estate agent and wants some help predicting housing price...
github_jupyter
# Python Tutorial Eine minimale Einführung in Python für Studierende mit Programmiererfahrung die keinen Anspruch auf Vollständigkeit erhebt. Ausführlichere Einführungen und Tutorials finden sich an zahlreichen Stellen im Internet. Beispielsweise * [Learn Python the Hard Way](http://learnpythonthehardway.org/) * [S...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = "-1" import numpy as np from matplotlib import pyplot as plt import seaborn as sns import pandas as pd from tqdm.auto import tqdm import torch from torch import nn import gin import pickle import io from sparse_causal_model_learner_rl.trainable.gumbel_switch import Wit...
github_jupyter
# import library ``` import pandas as pd import numpy as np import pickle from sklearn import preprocessing from imblearn.under_sampling import NearMiss from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.ensemble import RandomForestClassifier, AdaBoos...
github_jupyter
# Прогнозирование временного ряда выработки электроэнергии Имеются два временных ряда: первый — это среднесуточная выработка электроэнергии ветряной установкой. Другой — среднесуточная выработка электроэнергии при помощи дизельного генератора. Оба показателя измеряются в кВт⋅ч. Помимо данных двух временных рядов име...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Time-Series-Models" data-toc-modified-id="Time-Series-Models-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Time Series Models</a></span><ul class="toc-item"><li><span><a href="#Chicago-Gun-Data" data-to...
github_jupyter
This is a companion notebook for the book [Deep Learning with Python, Second Edition](https://www.manning.com/books/deep-learning-with-python-second-edition?a_aid=keras&a_bid=76564dff). For readability, it only contains runnable code blocks and section titles, and omits everything else in the book: text paragraphs, fig...
github_jupyter
# DMI Deaths Classification ``` import pandas as pd import numpy as np from time import time from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes import BernoulliNB from sklearn.svm import SVC from sklearn.decomposition import Truncat...
github_jupyter
<a href="https://colab.research.google.com/github/kenextra/IBM-MLCert/blob/main/Webservice_Deploy_Diagram.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` %%bash pip install diagrams --quiet %%bash pip show diagrams from diagrams import Cluster, ...
github_jupyter
# Computational and Numerical Methods ## Group 16 ### Set 6 (10-09-2018): Lagrange and Newton Interpolation #### Vidhin Parmar 201601003 #### Parth Shah 201601086 ``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd import math from scipy.interpolate import lagrange as...
github_jupyter
<a href="https://colab.research.google.com/github/whitejetyeh/RBMrecommend/blob/master/RBMrecommend(July_19).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # RBMrecommend Restrictive Boltzmann Machine (RBM) is an unsupervised learning, which autom...
github_jupyter
<a href="https://www.peqnp.com"><img border="0" alt="PEQNP" src="https://raw.githubusercontent.com/maxtuno/SATX/main/SAT-X.jpg" width="640" height="400"> # SAT-X ## [![Downloads](https://pepy.tech/badge/satx)](https://pepy.tech/project/satx) ### The constraint modeling language for SAT solvers SAT-X is a language f...
github_jupyter
# Create dataset with pairs of anti-glioblastoma drugs - nanoparticles ``` import pandas as pd import numpy as np import feather ``` ## Modify datasets Read initial data for drugs: ``` df_d = pd.read_csv('./datasets/drug(neuro).csv') df_d.shape # remove duplicates in drugs data print('Before:', df_d.shape) df_d.dro...
github_jupyter
# McsPyDataTools Tutorial for files from MCS Headstages with IMU<a id='Top'></a> This tutorial shows the handling of IMU data collected from an MCS Headstage wearing an *Inertial Measurement Unit* - <a href='#Gyrosocope Data'>Gyroscope Data</a> - <a href='#Accelerometer Data'>Accelerometer Data</a> - <a href='#6DoF-E...
github_jupyter
# Lists, Tuples and Dictionaries # Creating a list - A list is a data structure in Python - It is a sequence of elements - A list is mutable, or changeable The markers of a list are ``[]`` ``` # create an empty list empty_list = [] # create a list of strings summer_months = ["June", "July", "August"] # create a m...
github_jupyter
``` %cd ../.. import ROOT import numpy as np import matplotlib.pyplot as plt from melp import Detector mu3e_detector = Detector.initFromROOT("run42_20000.root") file = ROOT.TFile("run42_20000_sorted_test.root") ttree_mu3e = file.Get("mu3e") ttree_mu3e_mc = file.Get("mu3e_mchits") ttree_mu3e.GetEntry(1199) # 1199 : 36, ...
github_jupyter
``` %reload_ext autoreload %autoreload 2 #export from nb_003 import * import nb_002 import operator from random import sample from torch.utils.data.sampler import Sampler DATA_PATH = Path('data') PATH = DATA_PATH/'caltech101' # http://www.vision.caltech.edu/Image_Datasets/Caltech101/ ``` # Caltech 101 ## Create vali...
github_jupyter
<h1>Pandas Playbook</h1> This Notebook lets you develop some intuition of the key features of *pandas* in a *query-like* way, with a minimum of python syntax: * Basic properties and functions * Frequent used operations: slicing, selection, insertion, deletion and aggregation *pandas* is a library for data explora...
github_jupyter
``` # Importing All necessary modules for model_training import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras # fetching data set from keras (X_train_full,Y_train_full),(X_test,Y_test) = keras.datasets.mnist.load_data() # Showing the shapes of tabl...
github_jupyter
``` # !wget https://huseinhouse-storage.s3-ap-southeast-1.amazonaws.com/bert-bahasa/singlish.txt with open('singlish.txt') as fopen: singlish = fopen.read().split('\n') len(singlish) import re from tqdm import tqdm import cleaning def preprocessing(string): string = re.sub( 'http\S+|www.\S+', ...
github_jupyter
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=SocialStudies/Globalization/communicati...
github_jupyter
# Sparse Ordinary Autoencoder From an example on the [Keras blog](https://blog.keras.io/building-autoencoders-in-keras.html), but with sparsity added. ``` from keras.layers import Input, Dense from keras.models import Model from keras import regularizers from keras.regularizers import Regularizer from keras import ba...
github_jupyter
# Project 1: Trading with Momentum ## Instructions Each problem consists of a function to implement and instructions on how to implement the function. The parts of the function that need to be implemented are marked with a `# TODO` comment. After implementing the function, run the cell to test it against the unit test...
github_jupyter
<h2> Shrink datasets down to mz, try to classify them, then try to combine features </h2> You'll have to... mean center and standardize all your features? ``` import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from sklearn import preprocessing from IPython.display import di...
github_jupyter
# Data For this notebook: **combined_sig_df.pkl** https://storage.googleapis.com/issue_label_bot/notebook_files/combined_sig_df.pkl **feat_df.csv** https://storage.googleapis.com/issue_label_bot/notebook_files/feat_df.csv ``` import pandas as pd from inference import InferenceWrapper, pass_through from tensorflow.ke...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from torchvision import datasets, transforms from time import time USE_CUDA = torch.cuda.is_available() USE_CUDA de...
github_jupyter
# Aggregations Aggregations are an important step while processing dataframes and tabular data in general. And therefore, they should be as simple as possible to implement. Some notable data aggregation semantics are provided by pandas, spark and the SQL language. When designing an aggregation API method, the followi...
github_jupyter
``` import sys import time from contextlib import contextmanager import lightgbm as lgb sys.path = ['../'] + sys.path from src.parser import * from src.train import * from src.util import TimeSeriesSplit from src.event_level_model import prep_events from src.dataset_helper import * @contextmanager def timer(name): ...
github_jupyter
# FINN - End-to-End Flow ----------------------------------------------------------------- In this notebook, we will show how to take a simple, binarized, fully-connected network trained on the MNIST data set and take it all the way down to a customized bitfile running on a PYNQ board. This notebook is quite lengthy...
github_jupyter
To open this notebook in Google Colab and start coding, click on the Colab icon below. <table style="border:2px solid orange" align="left"> <td style="border:2px solid orange "> <a target="_blank" href="https://colab.research.google.com/github/neuefische/ds-meetups/blob/main/01_Python_Workshop_Revisiting_Some_Fu...
github_jupyter
# API calls: Twitter This notebook introduces a simple yet powerful package developed by University of Munich researchers and called **TwitterSearch**. One can easily install it by opening the command prompt and running the following command: ``` pip install twittersearch ``` The package provides the opportunity to ea...
github_jupyter
# SP LIME ## Regression explainer with boston housing prices dataset ``` from sklearn.datasets import load_boston import sklearn.ensemble import sklearn.linear_model import sklearn.model_selection import numpy as np from sklearn.metrics import r2_score np.random.seed(1) #load example dataset boston = load_boston() ...
github_jupyter
<a href="https://colab.research.google.com/github/timeseriesAI/timeseriesAI/blob/master/tutorial_nbs/00b_How_to_use_numpy_arrays_in_fastai2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> created by Ignacio Oguiza - email: oguiza@gmail.com ## How t...
github_jupyter
If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. Uncomment the following cell and run it. ``` #! pip install datasets transformers seqeval ``` If you're opening this notebook locally, make sure your environment has an install from the last version of those l...
github_jupyter
# Decison Trees First we'll load some fake data on past hires I made up. Note how we use pandas to convert a csv file into a DataFrame: ``` import numpy as np import pandas as pd from sklearn import tree input_file = "PastHires.csv" df = pd.read_csv(input_file, header = 0) df.head() ``` scikit-learn needs everythin...
github_jupyter
# JAX Quickstart [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/jax/blob/main/docs/notebooks/quickstart.ipynb) **JAX is NumPy on the CPU, GPU, and TPU, with great automatic differentiation for high-performance machine learning research.** ...
github_jupyter
In this notebook we will look how we can use Cython to generate a faster callback and hopefully shave off some running time from our integration. ``` import json import numpy as np from scipy2017codegen.odesys import ODEsys from scipy2017codegen.chem import mk_rsys ``` The `ODEsys` class and convenience functions fro...
github_jupyter
Thus far we have seen the following data types: * integer (counting number) - `int`. * floating point number (number with decimal point) - `float`. * string (text) - `str`. * boolean (True or False value) - `bool`. In data analysis, we often want to collect together several numbers, or strings, into a *sequence*. Th...
github_jupyter
``` %matplotlib inline # Assuming we are in the notebooks directory, we need to move one up: %cd ../.. import numpy as np import pandas as pd import os import seaborn as sns import matplotlib.pyplot as plt import statsmodels.api as sm sns.set(font_scale=1.8) sns.set_style('ticks') df = pd.read_csv('./data/participa...
github_jupyter
<div style="background:#F5F7FA; height:100px; padding: 2em; font-size:14px;"> <span style="font-size:18px;color:#152935;">Want to do more?</span><span style="border: 1px solid #3d70b2;padding: 15px;float:right;margin-right:40px; color:#3d70b2; "><a href="https://ibm.co/wsnotebooks" target="_blank" style="color: #3d70b2...
github_jupyter
# <div align="center">Dealing with Imbalanced Data</div> --------------------------------------------------------------------- you can Find me on Github: > ###### [ GitHub](https://github.com/lev1khachatryan) <img src="asset/main.jpg" /> Imbalanced classes are a common problem in machine learning classification wher...
github_jupyter
# Electrode State of Health This notebook demonstrates some utilities to work with electrode State of Health (also sometimes called electrode stoichiometry), using the algorithm from Mohtat et al [1] [1] Mohtat, P., Lee, S., Siegel, J. B., & Stefanopoulou, A. G. (2019). Towards better estimability of electrode-specif...
github_jupyter
## Paramnormal Activity Perhaps the most convenient way to access the functionality of `paramnormal` is through the `activity` module. Random number generation, distribution fitting, and basic plotting are exposed through `activity`. ``` %matplotlib inline import warnings warnings.simplefilter('ignore') from numpy....
github_jupyter
# Model Training In this notebook, we'll train a LightGBM model using Amazon SageMaker, so we have an example trained model to explain. You can bring also bring your own trained models to explain. See the customizing section for more details. <p align="center"> <img src="https://github.com/awslabs/sagemaker-explai...
github_jupyter
# Word2Vec SAT Load the SAT analogies data and the pruned Word2Vec model (based on GoogleNews-vectors-negative300.bin.gz from https://code.google.com/archive/p/word2vec/), but with only the words that appear in the analogies saved. ``` import numpy import json from scipy.spatial.distance import cosine # Load the mode...
github_jupyter
# **ESRGAN with TF-GAN on TPU** ### **Overview** This notebook demonstrates the E2E process of data loading, preprocessing, training and evaluation of the [ESRGAN](https://arxiv.org/abs/1809.00219) model using TF-GAN on TPUs. To understand the basics of TF-GAN and explore more features of the library, please visit [TF...
github_jupyter
# TITANIC SURVIVAL PREDICTION <p align="center"> <img width="600" height="325" src="https://www.gifcen.com/wp-content/uploads/2021/09/titanic-gif-1.gif"> </p> RMS Titanic was a British passenger liner operated by the White Star Line that sank in the North Atlantic Ocean on 15 April 1912, after striking an iceberg du...
github_jupyter
# Boxfill Tutorial This is an in-depth introduction to the boxfill graphics method in VCS. It breaks down each of the important attributes of the graphics method, how to use them, and what effects they have on your plots. ## Setup This is just the normal setup for a plot in VCS; we get the data, retrieve a variable,...
github_jupyter
``` %run Import_Library.ipynb def avg_digits_text(data): """ Purpose: - Count the number of digits in each doc in data - Compute the average Arg: data: array of text Return: an average of number of digits in data """ avg = [] num_re = re.compi...
github_jupyter
# Example Model Servers with Seldon ## Setup Seldon Core Use the setup notebook to [Setup Cluster](seldon_core_setup.ipynb#Setup-Cluster) with [Ambassador Ingress](seldon_core_setup.ipynb#Ambassador) and [Seldon Core](seldon_core_setup.ipynb#Install-Seldon-Core). Instructions [also online](./seldon_core_setup.html). ...
github_jupyter
<a href="https://colab.research.google.com/github/wesleybeckner/python_foundations/blob/main/notebooks/solutions/SOLN_S3_Functions_and_Debugging.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Python Foundations, Session 3: Functions and Debugging...
github_jupyter
# Interactive question answering with OpenVINO This demo shows interactive question answering with OpenVINO. We use [small BERT-large-like model](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/intel/bert-small-uncased-whole-word-masking-squad-int8-0002) distilled and quantized to INT8 on SQuAD v1...
github_jupyter
# What are `Periodogram` objects? *Lightkurve* has a class specifically for dealing with periodograms of time series data. This can be useful for finding the periods of variable stars. Below is a quick example of how to find the period of an [eclipsing binary star](https://en.wikipedia.org/wiki/Binary_star#Eclipsing_b...
github_jupyter
# Métricas Una métrica es una función que define una distancia entre cada par de elementos de un conjunto. Para nuetro caso, se define una función de distancia entre los valores reales ($y$) y los valores predichos ($\hat{y}$). Defeniremos algunas métricas bajo dos tipos de contexto: modelos de regresión y modelos de...
github_jupyter
``` %matplotlib inline import datetime import matplotlib import matplotlib.pyplot as plt import tokio import tokio.tools import tokio.config matplotlib.rcParams.update({'font.size': 14}) ``` ## Define input parameters To generate a Lustre activity heat map, you must define the start time, end time, and file system of...
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
# 解析解 对于多元市场的分布,论文中使用的还是Monte Carlo Simulation的方法 ``` import numpy as np import scipy as sp N = 2 Mu = np.zeros((N, 1)) r = .6 Sigma = (1-r) * np.eye(N) + r * np.ones((N,N)) J = int(1e6) p = np.ones((N,1)) / J dd = np.random.multivariate_normal(Mu.reshape(N), Sigma, size=int(J/2)) X = np.ones((J,1)) * Mu.T + np.con...
github_jupyter
# Sentiment / Customer Intention Analysis Design & map SQL Alchemy tables with relational database's tables ## 1/ Import libraries ``` import pandas as pd import numpy as np import csv from sqlalchemy import Column, String, Integer, ForeignKey, DateTime, func, Boolean, MetaData, Table, Float from sqlalchemy.dialect...
github_jupyter
# 1.1 chABSA-datasetから訓練、テストデータを作成 - 本ファイルでは、chABSA-datasetのデータを使用して、感情分析(0:ネガティブ、1:ポジティブ)を2値クラス分類するためのデータファイル(tsv)を作成します。 - 下記サイトからchABSA-dataset.zipをダウンロードして解凍します。 https://github.com/chakki-works/chABSA-dataset データファイルは230個、文章データは2813個あります。 ``` import pandas as pd from pathlib import Path import json d...
github_jupyter
``` %load_ext autoreload %autoreload 2 %matplotlib inline import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.cluster import KMeans from sklearn.svm import SVC from sklearn.metrics import roc_auc_score, roc_curve from sklearn import preprocessing from sklearn.linear_model import Log...
github_jupyter
<font size="6" color="#0047b2" face="verdana"> <B>Notebook 03: Conditional and Booleans</B></font> ------------------------------------ You are invited to your friend's birthday party and you want to bring a cake. **If you have 3 or more eggs** you will bake a cake, **otherwise** you will get a cake from the shop. W...
github_jupyter
Welcome to the exercises for day 3 (these accompany the day 3 tutorial notebook on booleans and conditionals, available [here](https://www.kaggle.com/colinmorris/learn-python-challenge-day-3)) As always **be sure to run the setup code below** before working on the questions (and if you leave this notebook and come bac...
github_jupyter
``` #we may need some code in the ../python directory and/or matplotlib styles import sys import os sys.path.append('../python/') #set up matplotlib os.environ['MPLCONFIGDIR'] = '../mplstyles' print(os.environ['MPLCONFIGDIR']) import matplotlib as mpl from matplotlib import pyplot as plt #got smarter about the mpl con...
github_jupyter
# Activity Analysis Demonstration script This notebook draws from the demo 1 file of ActivityAnalysisToolbox_2.1 This notebook demonstrates the use of the activity analysis python library, built on pandas, scipy, numpy, and math libraries. The purpose and origins of activity analysis is explained in: Upham, F.,...
github_jupyter
# Basic Tutorial for <font color='green'> Toad</font> Toad is developed to facilitate the model development of credit risk scorecard particularly. In this tutorial, the basic use of toad will be introduced. ______ ______ The tutorial will follow the common procedure of credit risk scorecard model development: ...
github_jupyter
# Kaggle San Francisco Crime Classification ## Berkeley MIDS W207 Final Project: Sam Goodgame, Sarah Cha, Kalvin Kao, Bryan Moore ### Basic Modeling ### Environment and Data ``` # Import relevant libraries: import time import numpy as np import pandas as pd from sklearn.neighbors import KNeighborsClassifier from skle...
github_jupyter
# Postprocess data ## Anomalies In ENSO research one most often wants to work with anomaly data. Hence, data where the long time seasonality its removed. Furthermore, it is advisable for regrid all data to a common grid. Here the grid is the 2.5° x 2.5° grid from the NCAR/NCEP reananalysis. If the data was already p...
github_jupyter
# [Module 1.3] 체크 포인트를 생성을 통한 스팟 인스턴스 훈련 ### 본 워크샵의 모든 노트북은 `conda_python3` 여기에서 작업 합니다. 이 노트북은 아래와 같은 작업을 합니다. - 체크포인트를 사용하는 방법 - 기본 환경 세팅 - 데이터 세트를 S3에 업로드 - 체크 포인트를 사용한 훈련 시니라오 - 첫 번째 훈련 잡 실행 - 두 번째 훈련 잡 실행 - 훈련 잡 로그 분석 - 모델 아티펙트 저장 --- ## 세이지 메이커에서 체크포인트를 사용하는 방법 개발자 가이드 --> [체코 포인트 사용하기](https://docs....
github_jupyter
##### Copyright 2018 The TensorFlow Authors. ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
github_jupyter
<a href="https://colab.research.google.com/github/gowrithampi/deeplearning_with_pytorch/blob/main/Chapter_5_The_mechanics_of_learning.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Deep Learning with Pytorch ## Chapter 5: The Mechanics of Learnin...
github_jupyter
# Kinesis Data Analytics for SQL Applications With Amazon Kinesis Data Analytics for SQL Applications, you can process and analyze streaming data using standard SQL. The service enables you to quickly author and run powerful SQL code against streaming sources to perform time series analytics, feed real-time dashboards...
github_jupyter
# Illustration for custom layer: Softmax_cosine_sim ``` import random import numpy as np from random import shuffle import tensorflow as tf from tensorflow import keras from tensorflow.keras.activations import softmax class SoftmaxCosineSim(keras.layers.Layer): # =================================================...
github_jupyter
<a href="https://colab.research.google.com/github/GoogleCloudPlatform/training-data-analyst/blob/master/courses/fast-and-lean-data-science/06_MNIST_Estimator_to_TPUEstimator.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## MNIST Estimator to TPUEs...
github_jupyter
``` %load_ext autoreload %autoreload 2 %aimport fluidsim from paths import load_df, paths_sim ``` # Compose a function to calculate the shock population of one run ``` from peak_detection import ( detect_shocks, avg_shock_seperation_1d, avg_shock_seperation, avg_shock_seperation_from_shortname ) df_w ...
github_jupyter
# setup dataset ``` # import stuff import os import numpy as np import time import pandas as pd import torch import torch.utils.data as data from itertools import product as product import torch import torch.nn as nn import torch.nn.init as init import torch.nn.functional as F from torch.autograd import Function fro...
github_jupyter
# Regression Week 3: Assessing Fit (polynomial regression) In this notebook you will compare different regression models in order to assess which model fits best. We will be using polynomial regression as a means to examine this topic. In particular you will: * Write a function to take an SArray and a degree and retur...
github_jupyter
# Examples: Variables and Data Types ## The Interpreter ``` # The interpreter can be used as a calculator, and can also echo or concatenate strings. 3 + 3 3 * 3 3 ** 3 3 / 2 # classic division - output is a floating point number # Use quotes around strings 'dogs' # + operator can be used to concatenate strings 'do...
github_jupyter
# 解析学A 2018 黒木玄 2018年7月30日(月) 次のリンク先で綺麗に閲覧できる: * http://nbviewer.jupyter.org/github/genkuroki/Calculus/blob/master/Analysis%20A%202018.ipynb $ \newcommand\eps{\varepsilon} \newcommand\ds{\displaystyle} \newcommand\Z{{\mathbb Z}} \newcommand\R{{\mathbb R}} \newcommand\C{{\mathbb C}} \newcommand\QED{\text{□}} \newco...
github_jupyter
https://colab.research.google.com/drive/1TlIfecAt51WsskxSknGm_WOMbA6h9tF4 ``` !wget https://zenodo.org/record/1203745/files/UrbanSound8K.tar.gz !ls !tar xzvf UrbanSound8K.tar.gz !pwd import pandas as pd data = pd.read_csv('/content/UrbanSound8K/metadata/UrbanSound8K.csv') # Refer to the location of downloaded file her...
github_jupyter
``` ''' This notebook filters mapped nanoCOP data to remove: polyadenylated transcripts, 7SK transcripts, non-unique reads, and splicing intermeditates Data generated in Drexler et al. 2019 (GEO accession: GSE123191) ''' import os import sys import re import glob import pysam import pybedtools...
github_jupyter
# 中文三元组联合抽取 ## 介绍 在这个notebook中我们将使用openue库代码来训练我们自己的三元组联合抽取,使用的基础模型是`bert-base-chinese`,训练分为两步,首先训练关系分类模型,其次训练实体抽取模型。之后联合验证。 ## 数据集 在这个数据集中,使用ske数据集,具体例子如下。我们使用代码来读取`train.json`来分析一下数据。 ``` import json with open("../dataset/ske/train.json", "r") as file: for line in file.readlines(): example = json.loa...
github_jupyter
# Time Series Forecasting In this tutorial, we will demonstrate how to build a model for time series forecasting in NumPyro. Specifically, we will replicate the **Seasonal, Global Trend (SGT)** model from the [Rlgt: Bayesian Exponential Smoothing Models with Trend Modifications](https://cran.r-project.org/web/packages...
github_jupyter
``` conda install -c conda-forge textblob conda install -c conda-forge wordcloud import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sn import sklearn from textblob import TextBlob from wordcloud import WordCloud import nltk nltk.download('vader_lexicon') df= pd.read_csv(r"C:\U...
github_jupyter
# CX 4230, Spring 2016: [09] Cellular Automata The following exercises accompany the class slides on Wolfram's 1-D nearest neighbor cellular automata model. You can download a copy of those slides here: [PDF (0.7 MiB)](https://t-square.gatech.edu/access/content/group/gtc-59b8-dc03-5a67-a5f4-88b8e4d5b69a/cx4230-sp16--0...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set_style('darkgrid') import tensorflow as tf from tensorflow import keras from sklearn.model_selection import train_test_split train = pd.read_csv('train.csv') test = pd.read_csv('test.csv') plt.figure(figsize=(7, 5))...
github_jupyter
# Basic Keras Neural Network for Fashion MNIST ## Prerequisites - Complete the installation process - Keras **VIDEO TUTORIAL:** https://youtu.be/Zq4onPm-h2I ``` import syft.interfaces.keras as keras import keras as real_keras from syft import FloatTensor from syft.interfaces.keras.models import Sequential from syf...
github_jupyter
You have already seen [expressions](Expressions). You saw in [variables](variables) that we often want to give names to the results of expressions. Now we get a little more formal about what that looks like in Python. When Python gives a name to a value, that is an *assignment statement*. A *statement* is a piece o...
github_jupyter
``` %matplotlib inline import matplotlib.pyplot as plt import numpy as np import pandas as pd from sqlalchemy import create_engine from hold import connection_string engine = create_engine(f'{connection_string}', encoding='iso-8859-1', connect_args={'connect_timeout': 10}) gtdDF = pd.read_sql_table('global_terrorism', ...
github_jupyter
``` import forge from puzzle.puzzlepedia import puzzlepedia puzzle = puzzlepedia.parse(""" # NB: Column is implied from alpha-order. See #4. items in { Alarm, Chills, Dread, Terror, # Children’s Tinned Fears. Balls, Floss, Biscuits, Mints, # Monster Treats. Anger, Boredom, Laughter, Sorrow, # Salts. Collywob...
github_jupyter