code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# work on the tree ``` %reload_ext autoreload %autoreload 2 import sys from pathlib import Path my_happy_flow_path = str(Path('../../src').resolve()) my_lib_path = str(Path('my_lib').resolve()) if my_lib_path not in sys.path: sys.path.append(my_lib_path) if my_happy_flow_path not in sys.path: sys.path.app...
github_jupyter
``` import glob import time import os import pandas as pd import sklearn.metrics from sklearn.preprocessing import MinMaxScaler import pickle from argparse import ArgumentParser, Namespace import random import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from torch.utils.data import D...
github_jupyter
# Autolabel TMA Cores ## This notebook is an example: create a copy before running it or you will get merge conflicts! **NOTE**: Before running this notebook for the first time, make sure you've coregistered your instrument using the *update coregistration parameters* section of `1_set_up_toffy.ipynb`. This will ens...
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
# Features and Objectives This doc is mostly text, explaining the general concept of features, listing the ones defined in rai, and explaining how they define objectives for optimization. At the bottom there are also examples on the collision features. ## Features We assume a single configuration $x$, or a whole se...
github_jupyter
``` !pip install python-dotenv from dotenv import load_dotenv, find_dotenv # find .env automatically by walking up directories until it's found dotenv_path = find_dotenv() #load up the entries as enviroment variables load_dotenv(dotenv_path) # extrating env var using os.environ.get import os KAGGLE_USERNAME = os.enviro...
github_jupyter
# Задание 2.2 - Введение в PyTorch Для этого задания потребуется установить версию PyTorch 1.0 https://pytorch.org/get-started/locally/ В этом задании мы познакомимся с основными компонентами PyTorch и натренируем несколько небольших моделей.<br> GPU нам пока не понадобится. Основные ссылки: https://pytorch.org/t...
github_jupyter
# Lab 07.1: Relationships Between Categorical Variables This lab is presented with some revisions from [Dennis Sun at Cal Poly](https://web.calpoly.edu/~dsun09/index.html) and his [Data301 Course](http://users.csc.calpoly.edu/~dsun09/data301/lectures.html) ### When you have filled out all the questions, submit via [T...
github_jupyter
<a href="https://colab.research.google.com/github/PPatrickGU/ROB311/blob/master/TP4_SVM.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **ROB311 TP4** ### **Implementation of the algorithm of SVM to identify the handwriting number** *Author: Y...
github_jupyter
``` import pandas as pd import numpy as np from matplotlib import pyplot as plt import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.model_selection import GridSearchCV from sklearn.metrics import confusion_matrix, classification_report from sklearn.metrics import accuracy_score from...
github_jupyter
##### Training and Tuning La principal razón del anterior notebook ha sido probar varios modelos de la forma más rápida posible, ver sus métricas y los impactos de diversos cambios. El principal problema (hasta ahora) con la versión de PyCaret es que al desplegar el modelo es un objeto de la misma librería, haciendo q...
github_jupyter
# Kerja Gaya Gesek Sparisoma Viridi<sup>1</sup>, Muhammad Ervandy Rachmat<sup>2</sup> <br> Program Studi Sarjana Fisika, Institut Teknologi Bandung <br> Jalan Gensha 10, Bandung 40132, Indonesia <br> <sup>1</sup>dudung@gmail.com, https://github.com/dudung <br> <sup>2</sup>rachmatervandy@gmail.com, https://github.com/E...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # The NRPy+ Jupyter Tutorial Style Guide / Template ## Auth...
github_jupyter
## Progressive Elaboration of Tasks [Progressive elaboration](https://project-management-knowledge.com/definitions/p/progressive-elaboration/) is the process of adding additional detail and fidelity to the project plan as additional or more complete information becomes available. The process of progressive elaboration...
github_jupyter
# *Import Libraries* ``` import scipy.io import numpy as np from matplotlib import pyplot as plt import sys sys.path.append('/home/bhustali/.conda/envs/tf2/svcca-master') import cca_core ``` # Simple Example ``` # # assume A_fake has 20 neurons and we have their activations on 2000 datapoints # A_fake = np.random.r...
github_jupyter
# Walk through all streets in a city Preparation of the examples for the challenge: find the shortest path through a set of streets. ``` import matplotlib.pyplot as plt %matplotlib inline from jyquickhelper import add_notebook_menu add_notebook_menu() ``` ## Problem description Find the shortest way going through a...
github_jupyter
### Data Visualization #### `matplotlib` - from the documentation: https://matplotlib.org/3.1.1/tutorials/introductory/pyplot.html `matplotlib.pyplot` is a collection of command style functions <br> Each pyplot function makes some change to a figure <br> `matplotlib.pyplot` preserves ststes across function calls ```...
github_jupyter
<h1>Phi K Correlation</h1> Phi K correlation is a newly emerging correlation cofficient with following advantages: - it can work consistently between categorical, ordinal and interval variables - it can capture non-linear dependency - it reverts to the Pearson correlation coefficient in case of a bi-variate normal in...
github_jupyter
Author: Saeed Amen (@thalesians) - Managing Director & Co-founder of [the Thalesians](http://www.thalesians.com) ## Introduction With the UK general election in early May 2015, we thought it would be a fun exercise to demonstrate how you can investigate market price action over historial elections. We shall be using ...
github_jupyter
``` import pandas as pd #This is the Richmond USGS Data gage river_richmnd = pd.read_csv('JR_Richmond02037500.csv') river_richmnd.dropna(); #Hurricane data for the basin - Names of Relevant Storms - This will be used for getting the storms from the larger set JR_stormnames = pd.read_csv('gis_match.csv') # Bring in the ...
github_jupyter
# Amazon SageMaker - Debugging with custom rules [Amazon SageMaker](https://aws.amazon.com/sagemaker/) is managed platform to build, train and host maching learning models. Amazon SageMaker Debugger is a new feature which offers the capability to debug machine learning models during training by identifying and detectin...
github_jupyter
# Bayesian Hierarchical Linear Regression Author: [Carlos Souza](mailto:souza@gatech.edu) Probabilistic Machine Learning models can not only make predictions about future data, but also **model uncertainty**. In areas such as **personalized medicine**, there might be a large amount of data, but there is still a relati...
github_jupyter
# 1- Importing libraries ``` import ast import json import requests import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt %matplotlib inline from matplotlib.ticker import StrMethodFormatter from matplotlib.dates import DateFormatter from sklearn.preprocessing import MinMaxScaler ...
github_jupyter
<a href="https://colab.research.google.com/github/st24hour/tutorial/blob/master/Neural_Style_Transfer_with_Eager_Execution_question.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neural Style Transfer with tf.keras ## Overview 이 튜토리얼에서 우리는 딥러닝을...
github_jupyter
``` # Dependencies and Setup import matplotlib.pyplot as plt import pandas as pd import numpy as np import requests import gmaps import os import json # Import API key from api_keys import g_key # Loan CSV file generated from WeatherPy Folder weather_data_to_load = "../WeatherPy/weather_df.csv" weather_data = pd.read_...
github_jupyter
# 0 - Information # 1 - Packages ``` # Math packages import numpy as np from scipy import optimize from scipy.stats import norm # Graphix packages import matplotlib.pyplot as plt import seaborn as sns sns.set() # Progress bar from tqdm import tqdm ``` # 2 - Séparation exacte du spectre ## Question 2.1 ``` def ge...
github_jupyter
# Node2Vec representation learning with Stellargraph components <table><tr><td>Run the latest release of this notebook:</td><td><a href="https://mybinder.org/v2/gh/stellargraph/stellargraph/master?urlpath=lab/tree/demos/embeddings/keras-node2vec-embeddings.ipynb" alt="Open In Binder" target="_parent"><img src="https:/...
github_jupyter
## [Bag of Words Meets Bags of Popcorn | Kaggle](https://www.kaggle.com/c/word2vec-nlp-tutorial#part-3-more-fun-with-word-vectors) # 튜토리얼 파트 3, 4 * [DeepLearningMovies/KaggleWord2VecUtility.py at master · wendykan/DeepLearningMovies](https://github.com/wendykan/DeepLearningMovies/blob/master/KaggleWord2VecUtility.py...
github_jupyter
``` # Uncomment and run this cell if you're on Colab or Kaggle # !git clone https://github.com/nlp-with-transformers/notebooks.git # %cd notebooks # from install import * # install_requirements(is_chapter10=True) # hide from utils import * setup_chapter() ``` # Training Transformers from Scratch > **Note:** In this c...
github_jupyter
# Introduction to Reinforcement Learning This Jupyter notebook and the others in the same folder act as supporting materials for **Chapter 21 Reinforcement Learning** of the book* Artificial Intelligence: A Modern Approach*. The notebooks make use of the implementations in `rl.py` module. We also make use of the imple...
github_jupyter
``` ### duffing oscillator import matplotlib import numpy as np from numpy import zeros, linspace, pi, cos, array import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Polygon from matplotlib.patches import Circle from matplotlib.collections import PatchCollection from matplotlib.path impo...
github_jupyter
# Sample authors while controlling for year-of-first-publication For each editor, this notebook samples a set of authors whose year-of-first-publication matches that of the editor. For the sake of demonstration, we picked a subset of authors to match against so that the code could finish in a reasonable amount of time...
github_jupyter
Import Packages ``` import pandas as pd pd.set_option('display.max_columns', None) import numpy as np from sklearn import preprocessing import time from datetime import datetime, date, time from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" import warnings warnin...
github_jupyter
# Part 4: Projects and Automated ML Pipeline This part of the MLRun getting-started tutorial walks you through the steps for working with projects, source control (git), and automating the ML pipeline. MLRun Project is a container for all your work on a particular activity: all the associated code, functions, jobs/w...
github_jupyter
# SGT ($\beta \neq 0 $) calculation for fluids mixtures with SAFT-$\gamma$-Mie In this notebook, the SGT ($\beta \neq 0 $) calculations for fluid mixtures with ```saftgammamie``` EoS are illustrated. When using $\beta \neq 0 $, the cross-influence parameters are computed as $c_{ij} = (1-\beta_{ij})\sqrt{c_{ii}c_{jj}}...
github_jupyter
# Water Risk Classification: Data Wrangling ## Setup ``` import numpy as np import pandas as pd import geopandas as gpd import requests, zipfile, io, os, tarfile import rasterio as rio from rasterio import plot from rasterstats import zonal_stats import rasterio.warp, rasterio.shutil import rioxarray # for the exten...
github_jupyter
$\newcommand{\To}{\Rightarrow}$ ``` import os os.chdir('..') from kernel.type import TFun, BoolType, NatType from kernel import term from kernel.term import Term, Var, Const, Lambda, Abs, Bound, Nat, Or, Eq, Forall, Exists, Implies, And from data import nat from logic import basic from syntax.settings import settings ...
github_jupyter
``` import re import os import random import numpy as np import pandas as pd import tensorflow as tf import matplotlib.pyplot as plt try: tpu = tf.distribute.cluster_resolver.TPUClusterResolver() print("Device:", tpu.master()) tf.config.experimental_connect_to_cluster(tpu) tf.tpu.experimental.initializ...
github_jupyter
# LAB 5 - Maps Here we will jump in and make some maps based upon what you have learned making the volcano map and the topography maps of where you grew up in the previous two steps of this Lab. ## Navigation - [Maps 1.1](PHYS3070-LabMD.1.1.ipynb) - [Maps 1.2](PHYS3070-LabMD.1.2.ipynb) - [Maps 1.3](PHYS3070-LabM...
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
This notebook is used for some basic exploration on modelled data. #Importing the data The following code imports the necessary packages and creates convinient shortcut functions. As well as assures the plots will appear in this notebook within the Out. ``` from __future__ import division, print_function import netC...
github_jupyter
# Perturbation cost trajectories for gaussian noise of different sizes vs uniform noise of different sizes ``` import os os.chdir("../") import sys import json from argparse import Namespace import numpy as np from sklearn import metrics from sklearn.metrics import pairwise_distances as dist import matplotlib.pyplot a...
github_jupyter
# Introduction: Writing Patent Abstracts with a Recurrent Neural Network The purpose of this notebook is to develop a recurrent neural network using LSTM cells that can generate patent abstracts. We will look at using a _word level_ recurrent neural network and _embedding_ the vocab, both with pre-trained vectors and ...
github_jupyter
``` from pathlib import Path import os import os.path as op from pkg_resources import resource_filename as pkgrf import shutil import cubids TEST_DATA = pkgrf("cubids", "testdata") def test_data(tmp_path): data_root = tmp_path / "testdata" shutil.copytree(TEST_DATA, str(data_root)) assert len(list(data_roo...
github_jupyter
# Collaboration and Competition --- You are welcome to use this coding environment to train your agent for the project. Follow the instructions below to get started! ### 1. Start the Environment Run the next code cell to install a few packages. This line will take a few minutes to run! ``` !pip -q install ./pyth...
github_jupyter
``` import pandas as pd import numpy as np import os import glob import nltk.data from __future__ import division # Python 2 users only import nltk, re, pprint from nltk import word_tokenize from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics.pairwise import linear_kernel from nltk.corpus ...
github_jupyter
## Kaggle Advance House Price Prediction Using PyTorch * https://docs.fast.ai/tabular.html * https://www.fast.ai/2018/04/29/categorical-embeddings/ * https://yashuseth.blog/2018/07/22/pytorch-neural-network-for-tabular-data-with-categorical-embeddings/ ``` import pandas as pd ``` ### Importing the Dataset ``` df=...
github_jupyter
# Creating and grading assignments This guide walks an instructor through the workflow for generating an assignment and preparing it for release to students. ## Accessing the formgrader extension The formgrader extension provides the core access to nbgrader's instructor tools. After the extension has been installed,...
github_jupyter
<a href="https://colab.research.google.com/github/williamsdoug/CTG_RP/blob/master/CTG_RP_Train_Model.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Generate Datasets and Train Model ``` #! rm -R images ! ls %reload_ext autoreload %autoreload 2 %...
github_jupyter
# Music Generation with RNNs ``` # Import Tensorflow 2.0 %tensorflow_version 2.x import tensorflow as tf # Download and import the MIT 6.S191 package !pip install mitdeeplearning import mitdeeplearning as mdl # Import all remaining packages import numpy as np import os import time import functools from IPython impo...
github_jupyter
``` # Developer: Halmon Lui # Implement a Hash Table using Linear Probing from scratch class HashTable: def __init__(self, length=11): self.hash_list = [None for _ in range(length)] self.length = length self.item_count = 0 # hash key where m is size of table def _hash(self,...
github_jupyter
# Targeting Direct Marketing with Amazon SageMaker XGBoost _**Supervised Learning with Gradient Boosted Trees: A Binary Prediction Problem With Unbalanced Classes**_ ## Background Direct marketing, either through mail, email, phone, etc., is a common tactic to acquire customers. Because resources and a customer's at...
github_jupyter
## Dependencies ``` import os import cv2 import shutil import random import warnings import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from tensorflow import set_random_seed from sklearn.utils import class_weight from sklearn.model_selection import train_test_split from sklea...
github_jupyter
# Linear Regression (OLS) ### Key Equation: $Ax =b ~~ \text{for} ~~ n \times p+1 $ Linear regression - Ordinary Least Square (OLS) is the most basic form of supervised learning. In this we have a target variable (y) and we want to establish a linear relationship with a set of features (x<sub>1</sub>, x<sub>2</sub>, ...
github_jupyter
# ISM Lecture 3 continued in week 04 Part 1 Solutions This content is authored by Maria Boutchkova for use in the University of Edinbugh Business School Investment and Securities Markets course in Autumn 2020. Make sure to have watched the videos preceeding this Notebook and have covered the slides. Detailed explana...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt ``` ## Introduction Machine learning literature makes heavy use of probabilistic graphical models and bayesian statistics. In fact, state of the art (SOTA) architectures, such as [variational autoencoders][vae-blog] (VAE) or [generative adversa...
github_jupyter
``` import numpy as np import utils import librosa import keras from keras.utils import to_categorical from keras.models import load_model from keras.models import Sequential from keras.layers import MaxPooling2D,Conv2D,Flatten,Activation,Dense,Dropout,BatchNormalization from keras.optimizers import Adamax from sklearn...
github_jupyter
# Lab 6-2: Fancy Softmax Classification Author: Seungjae Lee (이승재) ## Imports ``` import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim # For reproducibility torch.manual_seed(1) ``` ## Cross-entropy Loss with `torch.nn.functional` PyTorch has `F.log_soft...
github_jupyter
# Online pipeline for Feldman lab ``` from pathlib import Path import numpy as np import matplotlib.pyplot as plt from pprint import pprint import time from spikeextractors import SpikeGLXRecordingExtractor, NwbSortingExtractor from spiketoolkit.sortingcomponents import detect_spikes from spiketoolkit.curation import...
github_jupyter
# Astronomy 8824 - Numerical and Statistical Methods in Astrophysics ## Statistical Methods Topic I. High Level Backround These notes are for the course Astronomy 8824: Numerical and Statistical Methods in Astrophysics. It is based on notes from David Weinberg with modifications and additions by Paul Martini. David's...
github_jupyter
# <p style="text-align: center;"> Self Driving Car in OpenAI Gym using Imitation Learning and Reinforcement Learning</p> ![title](https://miro.medium.com/max/1575/1*IQfXahuDuh0pgVE5fMpiFQ.gif ) # <p style="text-align: center;"> 1.0 Abstract </p> <a id='abstract'></a> We all know self-driving cars is one of the hottes...
github_jupyter
# DC 2019- ُSuccessful Business Start **Your Name:** Amin Aria # Small buisinesses success ``` %matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt import sklearn DC19 = pd.read_csv('..\sbdc_data_merged.csv') # Show the first 5 rows of data, just to demostrate it has loaded DC19...
github_jupyter
# Earthquakes In this notebook we'll try and model the intensity of earthquakes, basically replicating one of the examples in [this](http://user.it.uu.se/~thosc112/dahlin2014-lic.pdf) paper. To that end, let's first grab the data we need from USGS. We then filter the data to only include earthquakes of a magnitude 7.0...
github_jupyter
# Analysis of one-year trace of gut microbiome This notebook records the code used for analyzing data from [Gibbons _et. al._ (2017)](http://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005364). ## Load required packages ``` library(beem) library(grid) library(ggplot2) library(ggsci) library(igraph...
github_jupyter
``` ##from the vscode file... data_fix_season_cut_down ... import pandas as pd import numpy as np ##import all the files ##file paths Kaggle_path = "/Users/joejohns/data_bootcamp/Final_Project_NHL_prediction/Data/Kaggle_Data_Ellis/" mp_path = "/Users/joejohns/data_bootcamp/Final_Project_NHL_prediction/Data/Money...
github_jupyter
# Analysis of DNA-MERFISH for CTP11 by Pu Zheng 2022.02.15 analysis for dataset: \\10.245.74.158\Chromatin_NAS_1\20220307-P_brain_CTP11_from_0303 This data is DNA of uncleared MERFISH RNA: \\10.245.74.158\Chromatin_NAS_0\20220303-P_brain_M1_nonclear_adaptor ``` %run "..\..\Startup_py3.py" sys.path.append(r".....
github_jupyter
``` import wandb import nltk from nltk.stem.porter import * from torch.nn import * from torch.optim import * import numpy as np import pandas as pd import torch,torchvision import random from tqdm import * from torch.utils.data import Dataset,DataLoader stemmer = PorterStemmer() PROJECT_NAME = 'kickstarter-NLP-v3' devi...
github_jupyter
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/education-toolkit/blob/main/03_getting-started-with-transformers.ipynb) 💡 **Welcome!** We’ve assembled a toolkit that university instructors and organizers can use to easily prepare labs,...
github_jupyter
<table style="border: none" align="center"> <tr style="border: none"> <th style="border: none"><font face="verdana" size="4" color="black"><b> Demonstrate adversarial training using ART </b></font></font></th> </tr> </table> In this notebook we demonstrate adversarial training using ART on the MNIST dat...
github_jupyter
``` import numpy as np import tensorflow as tf import pyreadr import pandas as pd import keras from keras.layers import Dense,Dropout,BatchNormalization from keras.models import Sequential,Model from keras.callbacks import ModelCheckpoint,EarlyStopping,ReduceLROnPlateau from keras.optimizers import Adam from keras.regu...
github_jupyter
``` !git clone https://github.com/altaga/Facemask-Opt-Dataset import numpy as np import matplotlib import matplotlib.pyplot as plt import azureml from azureml.core import Workspace, Run ws = Workspace.from_config() experiment_name = 'deeplearning_facemask' from azureml.core import Experiment exp = Experimen...
github_jupyter
# The pyabf Cookbook: Using `ABF.memtest` This page demonstrates how to access the abf membrane test data. For theoretical details about membrane properties, how to measure them, and how to computationally create and analyze membrane test data see the [membrane test theory and simulation](memtest-simulation.ipynb) pag...
github_jupyter
# Title of the work ``` import pickle import logging import numpy as np import pandas as pd import tensorflow as tf from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from matplotlib import rcParams rcParams['font.size'] = 14 import seaborn as sns import matplotlib....
github_jupyter
# Part 3: Serving In this part we will user MLRun's **serving runtime** to deploy our trained models from the previous stage a `Voting Ensemble` using **max vote** logic. We will also use MLRun's **Feature store** to receive the online **Feature Vector** we define in the preveious stage. We will: - Define a model cl...
github_jupyter
Ordinal Regression -- Ordinal regression aims at fitting a model to some data $(X, Y)$, where $Y$ is an ordinal variable. To do so, we use a `VPG` model with a specific likelihood (`gpflow.likelihoods.Ordinal`). ``` import gpflow import numpy as np import matplotlib %matplotlib inline matplotlib.rcParams['figure.figsi...
github_jupyter
<a href="https://colab.research.google.com/github/noorhaq/Google_Colab/blob/master/Welcome_To_Colaboratory.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <p><img alt="Colaboratory logo" height="45px" src="/img/colab_favicon.ico" align="left" hspace...
github_jupyter
<div class="contentcontainer med left" style="margin-left: -50px;"> <dl class="dl-horizontal"> <dt>Title</dt> <dd> QuadMesh Element</dd> <dt>Dependencies</dt> <dd>Matplotlib</dd> <dt>Backends</dt> <dd><a href='./QuadMesh.ipynb'>Matplotlib</a></dd> <dd><a href='../bokeh/QuadMesh.ipynb'>Bokeh</a></dd> </dl> </div> ...
github_jupyter
# `ricecooker` exercises This mini-tutorial will walk you through the steps of running a simple chef script `ExercisesChef` that creates two exercises nodes, and four exercises questions. ### Running the notebooks To follow along and run the code in this notebook, you'll need to clone the `ricecooker` repository, c...
github_jupyter
``` import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import json import cx_Oracle import os import pandas as pd os.environ['TNS_ADMIN'] = '/home/opc/adj_esportsdb' !pip install dataprep !pip install dask !pip install pandas_profiling ## install packages !pip ...
github_jupyter
# PENSA Tutorial Using GPCRmd Trajectories Here we show some common functions included in PENSA, using trajectories of a G protein-coupled receptor (GPCR). We retrieve the molecular dynamics trajectories for this tutorial from [GPCRmd](https://submission.gpcrmd.org/home/), an online platform for collection and curation...
github_jupyter
# Pandas cheat sheet This notebook has some common data manipulations you might do while working in the popular Python data analysis library [`pandas`](https://pandas.pydata.org/). It assumes you're already are set up to analyze data in pandas using Python 3. (If you're _not_ set up, [here's IRE's guide](https://docs...
github_jupyter
# IPython Magic Commands Here we'll begin discussing some of the enhancements that IPython adds on top of the normal Python syntax. These are known in IPython as *magic commands*, and are prefixed by the ``%`` character. These magic commands are designed to succinctly solve various common problems in standard data ana...
github_jupyter
![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/deployment/accelerated-models/accelerated-models-quickstart.png) Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Azure ML Hardware Accelerated Mod...
github_jupyter
## Faisal Akhtar ## College Roll No.: 17/1409 Q2)<br> Iris plants dataset (already available in Scikit Learn) has the following characteristics:<br> Number of Instances: 150 (50 in each of three classes)<br> Number of Attributes: 4 numeric, predictive attributes and the class<br> Attribute Information: sepal length in...
github_jupyter
# Import Libraries ``` #import urllib2 from io import StringIO import os import xmltodict import pandas as pd from datetime import datetime import statsmodels.api as sm from scipy.stats import linregress import matplotlib.pyplot as plt import numpy as np import sys import requests import pymannkendall as mk import g...
github_jupyter
``` import graphlab ``` # Load some text data - from wikipedia, page on people ``` people = graphlab.SFrame('people_wiki.gl/') people.head() len(people) ``` # Explore the dataset and checkout the text it contains ``` obama = people[people['name'] == 'Barack Obama'] obama obama['text'] clooney = people[people['name'...
github_jupyter
<h1> 2c. Loading large datasets progressively with the tf.data.Dataset </h1> In this notebook, we continue reading the same small dataset, but refactor our ML pipeline in two small, but significant, ways: <ol> <li> Refactor the input to read data from disk progressively. <li> Refactor the feature creation so that it i...
github_jupyter
# Documentation > 201025: This notebook generate embedding vectors for pfam_motors, df_dev, and motor_toolkit from the models that currently finished training: - lstm5 - evotune_lstm_5_balanced.pt - evotune_lstm_5_balanced_target.pt - mini_lstm_5_balanced.pt - mini_l...
github_jupyter
``` %matplotlib inline ``` # K-means Clustering The plots display firstly what a K-means algorithm would yield using three clusters. It is then shown what the effect of a bad initialization is on the classification process: By setting n_init to only 1 (default is 10), the amount of times that the algorithm will be ...
github_jupyter
# Задание 1.2 - Линейный классификатор (Linear classifier) В этом задании мы реализуем другую модель машинного обучения - линейный классификатор. Линейный классификатор подбирает для каждого класса веса, на которые нужно умножить значение каждого признака и потом сложить вместе. Тот класс, у которого эта сумма больше,...
github_jupyter
# Performing measurements using QCoDeS parameters and DataSet This notebook shows some ways of performing different measurements using QCoDeS parameters and the [DataSet](DataSet-class-walkthrough.ipynb) via a powerful ``Measurement`` context manager. Here, it is assumed that the reader has some degree of familiarity...
github_jupyter
# Activations functions. > Activations functions. Set of act_fn. Activation functions, forked from https://github.com/rwightman/pytorch-image-models/timm/models/layers/activations.py Mish: Self Regularized Non-Monotonic Activation Function https://github.com/digantamisra98/Mish fastai forum discussion https:/...
github_jupyter
# CZ4042 Neural Networks & Deep Learning ## Assignment - 1: Part A, Question 5 > Gupta Jay > U1822549K > School of Computer Science and Engineering > Nanyang Technological University, Singapore ## Imports ``` # Setting the seed here is sufficient. # If you don't plan to use these starter code, make sure you a...
github_jupyter
# MLP 107 ``` from google.colab import drive PATH='/content/drive/' drive.mount(PATH) DATAPATH=PATH+'My Drive/data/' PC_FILENAME = DATAPATH+'pcRNA.fasta' NC_FILENAME = DATAPATH+'ncRNA.fasta' import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import ShuffleSplit from skl...
github_jupyter
``` """ You can run either this notebook locally (if you have all the dependencies and a GPU) or on Google Colab. Instructions for setting up Colab are as follows: 1. Open a new Python 3 notebook. 2. Import this notebook from GitHub (File -> Upload Notebook -> "GITHUB" tab -> copy/paste GitHub URL) 3. Connect to an in...
github_jupyter
``` from baselines.ppo2.ppo2 import learn from baselines.ppo2 import defaults from baselines.common.vec_env import VecEnv, VecFrameStack from baselines.common.cmd_util import make_vec_env, make_env from baselines.common.models import register import tensorflow as tf @register("custom_cnn") def custom_cnn(): def net...
github_jupyter
This exercise will test your ability to read a data file and understand statistics about the data. In later exercises, you will apply techniques to filter the data, build a machine learning model, and iteratively improve your model. The course examples use data from Melbourne. To ensure you can apply these techniques...
github_jupyter
# Random Forest Classifier ``` # Load the packages import warnings warnings.filterwarnings("ignore") import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import GridSearchCV from sklearn.metrics import classification_report # Load the data train_df = p...
github_jupyter
``` import numpy as np import math import tensorflow as tf from tensorflow.contrib.layers import fully_connected import time import random import matplotlib.pyplot as plt import heapq from mpl_toolkits.mplot3d import Axes3D tf.VERSION %matplotlib inline ``` ## Finite Element Model of the Space Frame Element ``` def P...
github_jupyter
#### demo: training a DND LSTM on a contextual choice task This is an implementation of the following paper: ``` Ritter, S., Wang, J. X., Kurth-Nelson, Z., Jayakumar, S. M., Blundell, C., Pascanu, R., & Botvinick, M. (2018). Been There, Done That: Meta-Learning with Episodic Recall. arXiv [stat.ML]. Retrieved fro...
github_jupyter