text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
%reload_ext autoreload
%autoreload 2
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
import os
import re
import pickle
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from aflow.entries import Entry
a = {
"compound": "Be2O2",
"auid":"aflow:ed51b7b3938f117f",
"aurl":"aflowlib.duke.edu:AFLOWDATA/ICSD_WEB/HEX/Be1O1_ICSD_15620",
"agl_thermal_conductivity_300K":"53.361",
"Egap":"7.4494"
}
A = Entry(**a)
A.kpoints
from aflow.caste... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
from keras.datasets import mnist
# Digit recognition when data is in 'pixel form'
(X_train, y_train), (X_test, y_test) = mnist.load_data()
# Shape of the pictures
X_test[4,:,:].shape
df = pd.DataFrame(X_train[0,:,:])
df
img = X_test[... | github_jupyter |
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.font_manager
from sklearn import svm
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from pyod.utils.data import generate_data... | github_jupyter |
```
from regular_expression_visualization.visualize_reg import search_pattern
```
search_pattern is a helper function that cross matches several regular expressions against several strings. It visulizes the result by surrounding the matched substring in red border. Only the first matched substring is bordered.
## Sim... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
from __future__ import division
import pickle
import os
from collections import defaultdict
import types
import numpy as np
import pandas as pd
from statsmodels.stats.anova import AnovaRM
import statsmodels.api as sm
from sensei.envs import GridWorldNavEnv, GuideEnv
from sensei... | github_jupyter |
# Hugging Face Transformers with `Pytorch`
### Text Classification Example using vanilla `Pytorch`, `Transformers`, `Datasets`
# Introduction
Welcome to this end-to-end multilingual Text-Classification example using PyTorch. In this demo, we will use the Hugging Faces `transformers` and `datasets` library together w... | github_jupyter |
# Quantum teleportation
By the end of this post, we will teleport the quantum state
$$\sqrt{0.70}\vert0\rangle + \sqrt{0.30}\vert1\rangle$$ from Alice's qubit to Bob's qubit.
Recall that the teleportation algorithm consists of four major components:
1. Initializing the state to be teleported. We will do this on Al... | github_jupyter |
```
import time
import pandas as pd
import numpy as np
import nltk
nltk.download('gutenberg')
import tensorflow as tf
keras = tf.keras
from tensorflow.keras.preprocessing.sequence import pad_sequences
from sklearn.model_selection import train_test_split
from tqdm import tqdm
import matplotlib.pyplot as plt
plt.st... | github_jupyter |
# base
```
import vectorbt as vbt
from vectorbt.base import column_grouper, array_wrapper, combine_fns, index_fns, indexing, reshape_fns
import numpy as np
import pandas as pd
from datetime import datetime
from numba import njit
import itertools
v1 = 0
a1 = np.array([1])
a2 = np.array([1, 2, 3])
a3 = np.array([[1, 2,... | github_jupyter |
```
from PIL import Image
import numpy as np
```
先下載 MNIST 資料
```
import os
import urllib
from urllib.request import urlretrieve
dataset = 'mnist.pkl.gz'
def reporthook(a,b,c):
print("\rdownloading: %5.1f%%"%(a*b*100.0/c), end="")
if not os.path.isfile(dataset):
origin = "https://github.com/mnielse... | github_jupyter |
```
import pandas as pd
import scipy.sparse as sparse
from code.preprocessing import Dataset
from core.database.db import DB
from code.metrics import fuzzy, precision
from implicit.als import AlternatingLeastSquares
db = DB(db='recsys')
from code.preprocessing import filter_old_cards, filter_rare_cards, filter_rare_g... | github_jupyter |
# Assumptions of Linear Regression
Previously, we learned to apply linear regression on a given dataset. But it is important to note that Linear Regression have some assumptions related to the data on which it is applied and if they are not followed, it can affect its performance. These assumptions are:
1. There shou... | github_jupyter |
# How to search the IOOS CSW catalog with Python tools
This notebook demonstrates a how to query a [Catalog Service for the Web (CSW)](https://en.wikipedia.org/wiki/Catalog_Service_for_the_Web), like the IOOS Catalog, and to parse its results into endpoints that can be used to access the data.
```
import os
import s... | github_jupyter |
# Creating an agent
This notebook will go through the how to create a new agent within the tomsup framework. In this tutorial we will be making an reversed win-stay, lose-switch agent, e.g. an win-switch, lose-stay agent.
This guides assumes a basic understanding of classes in python, if you don't know these or need t... | github_jupyter |
```
import logging
import pandas as pd
import seaborn as sns
from scipy import stats
import divisivenormalization.utils as helpers
from divisivenormalization.data import Dataset, MonkeySubDataset
helpers.config_ipython()
logging.basicConfig(level=logging.INFO)
sns.set()
sns.set_style("ticks")
# adjust sns paper co... | github_jupyter |
# Vladislav Abramov and Sergei Garshin DSBA182
## The Task
### Что ждем от туториала?
1. Оценить конкретную модель заданного класса. Не только сделать .fit, но и выписать полученное уравнение!
2. Автоматически подобрать модель (встроенный подбор)
3. Построить графики прогнозов, интервальные прогнозы где есть.
4. Срав... | github_jupyter |
[exercises](intro.ipynb)
```
import numpy as np
np.arange(6)
np.arange(0, 0.6, 0.1), np.arange(6) * 0.1 # two possibilities
np.arange(0.5, 1.1, 0.1), "<-- wrong result!"
np.arange(5, 11) * 0.1, "<-- that's right!"
np.linspace(0, 6, 7)
np.linspace(0, 6, 6, endpoint=False), np.linspace(0, 5, 6) # two possibilities
np.... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
```
## Load data
On connaît l'âge et l'expérience d'une personne, on veut pouvoir déduire si une personne est badass dans son domaine ou non.
```
df = pd.DataFrame({
'Age': [20,16.2,20.2,18.8,18.9,16.7,13.6,20.0,18.0,21.2,
25,3... | github_jupyter |
### Introduction
An example of implementing the Metapath2Vec representation learning algorithm using components from the `stellargraph` and `gensim` libraries.
**References**
**1.** Metapath2Vec: Scalable Representation Learning for Heterogeneous Networks. Yuxiao Dong, Nitesh V. Chawla, and Ananthram Swami. ACM SIG... | 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 |
##### 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 |
## 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 |
# 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 |
# 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 |
# 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 |
##### 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 |
# 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 |
```
# 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 |
```
%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 |
# 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>

# <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 |
# 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 |
```
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 |
[](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 |
# 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 |
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 |

Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# Azure ML Hardware Accelerated Mod... | 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 |
# 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 |
```
"""
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 |
```
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 |
# Simulation of BLER in RBF channel
```
import numpy as np
import pickle
from itertools import cycle, product
import dill
import matplotlib.pyplot as plt
from scipy.spatial.distance import cdist
```
Simulation Configuration
```
blkSize = 8
chDim = 4
# Input
inVecDim = 2 ** blkSize # 1-hot vector lengt... | 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 |
# Exploratory Analysis
## 1) Reading the data
```
import types
import pandas as pd
df_claim = pd.read_csv('https://raw.githubusercontent.com/IBMDeveloperUK/Machine-Learning-Models-with-AUTO-AI/master/Data/insurance.csv')
df_claim.head()
df_data = pd.read_csv('https://raw.githubusercontent.com/IBMDeveloperUK/Machine... | github_jupyter |
# Support Vector Machines (SVM) with Sklearn
This notebook creates and measures an [LinearSVC with Sklearn](http://scikit-learn.org/stable/modules/generated/sklearn.svm.LinearSVC.html#sklearn.svm.LinearSVC). This has more flexibility in the choice of penalties and loss functions and should scale better to large number... | github_jupyter |
```
import pandas as pd
import numpy as np
import os
import json
import altair as alt
JSON_FILE = "../results/BDNF/Recombinants/BDNF_codons_RDP_recombinationFree.fas.FEL.json"
pvalueThreshold = 0.1
def getFELData(json_file):
with open(json_file, "r") as in_d:
json_data = json.load(in_d)
return json_data... | github_jupyter |
```
import os
import django
from django.db import transaction
import random
from django_efilling.models import Instrument, InstrumentQuestion, InstrumentQuestionChoice
from django_efilling.models import (ESSAY, SINGLE_CHOICE, MULTIPLE_CHOICE, IMAGE_CHOICE, Respondent)
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
dj... | github_jupyter |
<a href="https://colab.research.google.com/github/csd-oss/vc-investmemt/blob/master/VC_Investment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# General preparation and GDrive conection
```
import pandas as pd
import matplotlib.pyplot as plt
``... | github_jupyter |
## Review Calculus using by Python
Consider a sequence of n numbers $x_0, x_1, \cdots x_{n-1}$. We will start our index at 0, to remain in accordance with Python/Numpy's index system. $x_0$ is the first number in the sequence, $x_1$ is the second number in the sequence, and so forth, so $x_j$ is the general $j+1$ numb... | github_jupyter |
# Gaussian Mixture Model
This is tutorial demonstrates how to marginalize out discrete latent variables in Pyro through the motivating example of a mixture model. We'll focus on the mechanics of parallel enumeration, keeping the model simple by training a trivial 1-D Gaussian model on a tiny 5-point dataset. See also ... | github_jupyter |
```
%matplotlib inline
```
# Cross-validation on diabetes Dataset Exercise
A tutorial exercise which uses cross-validation with linear models.
This exercise is used in the `cv_estimators_tut` part of the
`model_selection_tut` section of the `stat_learn_tut_index`.
```
from __future__ import print_function
print(_... | github_jupyter |
```
import plaidml.keras
plaidml.keras.install_backend()
import os
os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
# Importing useful libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layer... | github_jupyter |
# Optimization Methods
Until now, you've always used Gradient Descent to update the parameters and minimize the cost. In this notebook, you will learn more advanced optimization methods that can speed up learning and perhaps even get you to a better final value for the cost function. Having a good optimization algorit... | github_jupyter |
# Beacon Time Series, across the transition
Edit selector= below
Look at the beacons with the largest normalized spread.
( Steal plotMultiBeacons() from here.)
```
import math
import numpy as np
import pandas as pd
import BQhelper as bq
%matplotlib nbagg
import matplotlib.pyplot as plt
bq.project = "mlab-sandbox"... | github_jupyter |
<a href="https://colab.research.google.com/github/shakasom/MapsDataScience/blob/master/Chapter4.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Making sense of humongous location datasets
## Installations
The geospatial libraries are not pre ins... | github_jupyter |
<i>Copyright (c) Microsoft Corporation. All rights reserved.<br>
Licensed under the MIT License.</i>
<br>
# Model Comparison for NCF Using the Neural Network Intelligence Toolkit
This notebook shows how to use the **[Neural Network Intelligence](https://nni.readthedocs.io/en/latest/) toolkit (NNI)** for tuning hyperpa... | github_jupyter |
# Load MXNet model
In this tutorial, you learn how to load an existing MXNet model and use it to run a prediction task.
## Preparation
This tutorial requires the installation of Java Kernel. For more information on installing the Java Kernel, see the [README](https://github.com/awslabs/djl/blob/master/jupyter/READM... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.