code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Statistics & Data Analysis
## Req
#### Import Requirements
##### HTML formatting
```
from IPython.display import HTML
HTML("""<style type="text/css">
table.dataframe td, table.dataframe th {
max-width: none;
</style>
""")
HTML("""<style type="text/css">
table.dataframe td, table.dataframe th {
m... | github_jupyter |
<a name="top"></a>
<div style="width:1000 px">
<div style="float:right; width:98 px; height:98px;">
<img src="https://raw.githubusercontent.com/Unidata/MetPy/master/metpy/plots/_static/unidata_150x150.png" alt="Unidata Logo" style="height: 98px;">
</div>
<h1>Basic Time Series Plotting</h1>
<h3>Unidata Python Workshop... | github_jupyter |
```
import os
import numpy as np
import tensorflow as tf
from tensorflow.python.keras.datasets import mnist
from tensorflow.contrib.eager.python import tfe
# enable eager mode
tf.enable_eager_execution()
tf.set_random_seed(0)
np.random.seed(0)
if not os.path.exists('weights/'):
os.makedirs('weights/')
# constants... | github_jupyter |
This notebook contains a prototype for a workflow that would allow you to compare observations that were sampled in dicrete time to the model output in continuous time. Only the first 14 cells work, and even then they are so unbelievably slow as to be almost entirely useless.
```
import sys
sys.path.append('/ocean/kfl... | github_jupyter |
<a href="https://colab.research.google.com/github/adamuas/intuitive_intro_to_ann_ml/blob/master/Section_1_Implement_your_own_neuron_from_scratch.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# An Intuitive Introduction to Artificial Neural Network... | github_jupyter |
```
from IPython.core.display import HTML
def css_styling():
styles = open("./styles/custom.css", "r").read()
return HTML(styles)
css_styling()
```
# Introduction to Version Control
This is an introductory guide to the basic functions of Git version control software and the GitHub code hosting site that we wi... | github_jupyter |
# Trace Simple Image Classifier
Task: trace and explain the dimensionality of each tensor in a simple image classifier.
## Setup
```
from fastai.vision.all import *
from fastbook import *
matplotlib.rc('image', cmap='Greys')
```
Get some example digits from the MNIST dataset.
```
path = untar_data(URLs.MNIST_SAMP... | github_jupyter |
# ANCOM: WGS
```
library(tidyverse)
library(magrittr)
source("/Users/Cayla/ANCOM/scripts/ancom_v2.1.R")
```
## T2
```
t2 <- read_csv('https://github.com/bryansho/PCOS_WGS_16S_metabolome/raw/master/DESEQ2/WGS/T2/T2_filtered_greater_00001.csv')
head(t2,n=1)
t2.meta <- read_csv('https://github.com/bryansho/PCOS_WGS_16S... | github_jupyter |
```
import json
import os
from pathlib import Path
import matplotlib
matplotlib.rcParams['font.family'] = ['Noto Serif CJK JP']
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import datasets
from sklearn.metrics import brier_score_loss
from sklearn.calibration import calibration_curve
ROOT = Path('/... | github_jupyter |
<h1>Table of Contents<span class="tocSkip"></span></h1>
<div class="toc"><ul class="toc-item"></ul></div>
```
!pip install tensorflow-addons
!pip install lifelines
!pip install scikit-plot
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow import keras
from sklearn.model_selection import train_te... | github_jupyter |
```
import pandas as pd
import numpy as np
from sklearn.model_selection import cross_val_score
from collections import Counter
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import GradientBoosting... | github_jupyter |
# TensorFlow BYOM: Train with Custom Training Script, Compile with Neo, and Deploy on SageMaker
In this notebook you will compile a trained model using Amazon SageMaker Neo. This notebook is similar to the [TensorFlow MNIST training and serving notebook](https://github.com/aws/amazon-sagemaker-examples/blob/master/sag... | github_jupyter |
[](https://pythonista.io)
[*D3.js*](https://d3js.org/) es una biblioteca de Javascript especializada en la creación de documentos orientados a datos (Data Driven Documents) capaz de acceder a los recursos de un documento HTML mediante selecciones.
*D3.js* no contiene... | github_jupyter |
# Data Science Session 4
John Michael Hernandez Valerio is inviting you to a scheduled Zoom meeting.
Topic: Rafael's Data Science Class 4
Time: Mar 29, 2021 08:00 AM Beijing, Shanghai
Join Zoom Meeting
https://us04web.zoom.us/j/75939938727?pwd=dVJhTXNydTV2TGxJUVZ1QVZaUnByUT09
Meeting ID: 759 3993 8727
Passcode: KNa... | github_jupyter |
# Bento Activity Recognition Tutorial:
This notebook has been designed for the bento activity challenge recognition competition with the the aim of providing the basic knowledge of Human Activity Recognition by MOCAP.
It has been made by Nazmun Nahid.
# Library import:
Here we are going to use pandas(https://pandas.... | github_jupyter |
# Date+Time Basics
**Inhalt:** Mit Zeit-Datentyp umgehen
**Nötige Skills:** Erste Schritte mit Pandas
**Lernziele:**
- Text in Zeit konvertieren
- Zeit in Text konvertieren
- Zeit-Informationen extrahieren
- Einfache Zeit-Operationen
## Libraries
```
import pandas as pd
from datetime import datetime
from datetime ... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from igp2 import AgentState
from igp2.data.data_loaders import InDDataLoader
from igp2.data.episode import Frame
from igp2.data.scenario import InDScenario, ScenarioConfig
from igp2.opendrive.map import Map
from igp2.opendrive.plot_map import p... | github_jupyter |
```
#!jupyter nbextension enable --py widgetsnbextension --sys-prefix
#!jupyter serverextension enable voila --sys-prefix
%matplotlib widget
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import display, clear_output
output1 = widgets.Output()
output2 = widgets.Out... | github_jupyter |
# $$User\ Defined\ Metrics\ Tutorial$$
[](https://colab.research.google.com/github/catboost/tutorials/blob/master/custom_loss/custom_loss_and_metric_tutorial.ipynb)
# Contents
* [1. Introduction](#1.\-Introduction)
* [2. Classification](#2.\-Cl... | github_jupyter |
# Nombre: Oscar Esaú Peralta Rosales
## Procesamiento de Lenguaje Natural
## Práctica 3: Bolsas de Términos y esquemas de pesado
### Lectura simple de datos
```
import os
import re
import math
from keras.preprocessing.text import Tokenizer
def get_texts_from_file(path_corpus, path_truth):
tr_txt = []
tr_y =... | github_jupyter |
[Table of Contents](./table_of_contents.ipynb)
# The Extended Kalman Filter
```
from __future__ import division, print_function
%matplotlib inline
#format the book
import book_format
book_format.set_style()
```
We have developed the theory for the linear Kalman filter. Then, in the last two chapters we broached the ... | github_jupyter |
# Kinetic Energy
Mean and Eddy Kinetic Energy
## Theory
For a hydrostatic ocean like MOM5, the relevant kinetic energy per mass is
$$ KE = \frac{1}{2} (u^2 + v^2).$$
The vertical velocity component, $w$, does not appear in the mechanical energy budget. It is very much subdominant. But more fundamentally, it simpl... | github_jupyter |
```
import numpy as np, pandas as pd
import matplotlib.pyplot as plt
#Exception case for using sklearn: to split the dataset
from sklearn import model_selection
#Create a simple dataset
X =pd.DataFrame( np.linspace(0.1,1,1001))
test = X
test[test >=0.85] = 1
test[test < 0.85] = 0
# thus the dataset is such that if obs... | github_jupyter |
```
import os
import sys
import random
import math
import re
import time
import numpy as np
import cv2
import matplotlib
import matplotlib.pyplot as plt
# Root directory of the project
ROOT_DIR = os.getenv("MRCNN_HOME", "/Mask_RCNN")
# Import Mask RCNN
sys.path.append(ROOT_DIR) # To find local version of the library... | github_jupyter |
Complex Laplacian and its eigenmodes are parameterized by $\alpha$ and $k$.
---
Theory and math behind the eigenmodes:
The simplest possible dynamic behavior of a damped system is the first order differential equation with one term, and it's rate of exponential decay is governed by a rate contant $\beta$:
\begin{equ... | github_jupyter |
```
%matplotlib inline
```
Loading data in PyTorch
=======================
PyTorch features extensive neural network building blocks with a simple,
intuitive, and stable API. PyTorch includes packages to prepare and load
common datasets for your model.
Introduction
------------
At the heart of PyTorch data loading u... | github_jupyter |
# Large Scale Training with VISSL Training (mixed precision, LARC, ZeRO etc)
In this tutorial, show configuration settings that users can set for training large models.
You can make a copy of this tutorial by `File -> Open in playground mode` and make changes there. DO NOT request access to this tutorial.
# Using LA... | github_jupyter |
# Logistic Regression with a Neural Network mindset
Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone your intuitions about deep learning.... | github_jupyter |
# Funciones generadoras
Por regla general, cuando queremos crear una lista de algún tipo, lo que hacemos es crear la lista vacía, y luego con un bucle varios elementos e ir añadiendolos a la lista si cumplen una condición:
```
[numero for numero in [0,1,2,3,4,5,6,7,8,9,10] if numero % 2 == 0 ]
```
También vimos cómo ... | github_jupyter |
<img src="images/QISKit-c copy.gif" alt="Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook" width="250 px" align="left">
# Hadamard Action: Approach 2
## Jupyter Notebook 2/3 for the Teach Me QISKIT Tutorial Competition
- Connor Fieweger
<img src="images/hadamar... | github_jupyter |
### Verify Installation
```
import torch
# get Pytorch version
torch.__version__
# import torchvision
import torchvision
# get torchvision version
torchvision.__version__
# checking if cuda is available
torch.cuda.is_available()
# get number of cuda/gpu devices
torch.cuda.device_count()
# get cuda/gpu device id
torc... | github_jupyter |
# Introduction to Python
An introduction to Python for middle and high school students using Python 3 syntax.

## Getting started
We're assuming that you already have Python 3.6 or higher installed. If not, go to Python.org to downlo... | github_jupyter |
Good morning! You have completed the math trail on car plate numbers in a somewhat (semi-)automated way.
Can you actually solve the same tasks with code? Read on and you will be amazed how empowering programming can be to help make mathematics learning more efficient and productive! :)
# Task
Given the incomplete ca... | github_jupyter |
# Using a new function to evaluate or evaluating a new acquisition function
In this notebook we describe how to integrate a new fitness function to the testing framework as well as how to integrate a new acquisition function.
```
import numpy as np
import matplotlib.pyplot as plt
# add the egreedy module to the path... | github_jupyter |
```
from dgpsi import dgp, kernel, combine, lgp, path, emulator, Poisson, Hetero, NegBin
import numpy as np
import matplotlib.pyplot as plt
```
# Example 1 on heteroskedastic Gaussian likelihood
```
n=12
X=np.linspace(0,1,n)[:,None]
#Create some replications of input positions so that each input position will six dif... | github_jupyter |
## Sentiment Analysis - Tweets
I have a dataset downloaded with some tweets from analytics vidhya. I'll be implementing my own sentiment analysis trainer using this dataset and a bunch of tools that I learnt recently.
```
import pandas as pd
import spacy
import numpy as np
nlp = spacy.load('en_core_web_md')
dataset ... | github_jupyter |
<a href="https://colab.research.google.com/github/mlelarge/dataflowr/blob/master/Notebooks/02_backprop_full_colab.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Simple implementation of backprop
Here we implement a simple backpropagation algorit... | github_jupyter |
# Sitios dinámicos y Selenium
```
import requests
from bs4 import BeautifulSoup
url = 'https://www.latam.com/es_co/apps/personas/booking?fecha1_dia=13&fecha1_anomes=2020-10&auAvailability=1&ida_vuelta=ida&vuelos_origen=Bogot%C3%A1&from_city1=BOG&vuelos_destino=Miami&to_city1=BUE&flex=1&vuelos_fecha_salida_ddmmaaaa=06/... | github_jupyter |
<h1 align="center">TensorFlow Neural Network Lab</h1>
<img src="image/notmnist.png">
In this lab, you'll use all the tools you learned from *Introduction to TensorFlow* to label images of English letters! The data you are using, <a href="http://yaroslavvb.blogspot.com/2011/09/notmnist-dataset.html">notMNIST</a>, consi... | github_jupyter |
# **Assignment 3 (From Scratch)**
## **Penalized Logistic Ridge Regression CV with Batch Gradient Decent**
- **Programmers:**
- Shaun Pritchard
- Ismael A Lopez
- **Date:** 11-15-2021
- **Assignment:** 3
- **Prof:** M.DeGiorgio
<hr>
### **Overview: Assignment 3**
- In this assignment you will still be analyzi... | github_jupyter |
## Тестирование даунсемплинга, низкочастотных фильтров и параметров синусоидальных волн
```
import numpy as np
from matplotlib import pyplot as plt
from pydub import AudioSegment
from scipy.fft import rfft, rfftfreq, irfft
plt.rcParams["figure.figsize"] = (20,5)
# Парсим pydub AudioSegment в numpy массив уровней квант... | github_jupyter |
# Properties of ELGs in DR7 Imaging
The purpose of this notebook is to quantify the observed properties (particulary size and ellipticity) of ELGs using DR7 catalogs of the COSMOS region. We use the HST/ACS imaging of objects in this region as "truth."
J. Moustakas
2018 Aug 15
```
import os, warnings, pdb
import ... | github_jupyter |
```
# default_exp core
```
# hmd_newspaper_dl
> Download Heritage made Digital Newspaper from the BL repository
The aim of this code is to make it easier to download all of the [Heritage Made Digital Newspapers](https://bl.iro.bl.uk/collections/353c908d-b495-4413-b047-87236d2573e3?locale=en) from the British Library'... | github_jupyter |
<img src="../figures/HeaDS_logo_large_withTitle.png" width="300">
<img src="../figures/tsunami_logo.PNG" width="600">
[](https://colab.research.google.com/github/Center-for-Health-Data-Science/PythonTsunami/blob/fall2021/Conditionals/Conditions... | github_jupyter |
# Getting Started with gensim
This section introduces the basic concepts and terms needed to understand and use `gensim` and provides a simple usage example.
## Core Concepts and Simple Example
At a very high-level, `gensim` is a tool for discovering the semantic structure of documents by examining the patterns o... | github_jupyter |
# Hello, Clojure
Hello World
```
(println "Hello, world!") ; Say hi
;; Double semicolons are used if the comment is all alone on its own line
(println "Hello, world!") ; A single semicolon is used at the end of a line with some code
```
Basic string manipulation
```
;; Concat strings
(str "Clo" "jure")
;; Concat ... | github_jupyter |
# Simple Test between NumPy and Numba
$$
\Gamma = \sqrt{\frac{\eta_H}{\eta_V} \kappa^2 + \eta_H \zeta_H}
$$
```
import numba
import cython
import numexpr
import numpy as np
%load_ext cython
# Used cores by numba can be shown with (xy default all cores are used):
#print(numba.config.NUMBA_DEFAULT_NUM_THREADS)
# This... | github_jupyter |
# **G.G.: Good Game?** by Matthew Tran
## March 14, 2022
## **Introduction**
In the modern age, video games have become a modern past time enjoyed by many people of various ages. A now lucrative industry, video games come in a variety of genres, experiences, and platforms. When asked about successful video games, a ... | github_jupyter |
```
import os
import pandas as pd
import numpy as np
import json
import pickle
from collections import defaultdict
from pathlib import Path
from statistics import mean, stdev
from sklearn.metrics import ndcg_score, dcg_score
import matplotlib.pyplot as plt
import seaborn as sns
import torch
import os, sys
parentPath ... | github_jupyter |
```
import numpy as np
import torch
from torch import nn, optim
import matplotlib.pyplot as plt
from neurodiffeq import diff
from neurodiffeq.ode import IVP, solve_system, Monitor, ExampleGenerator, Solution, _trial_solution
from neurodiffeq.networks import FCNN, SinActv
from scipy.special import roots_legendre
... | github_jupyter |
# imports
```
import sys; sys.path.append(_dh[0].split("knowknow")[0])
from knowknow import *
```
# User settings
```
database_name = "sociology-wos"
pubyears = None
if 'wos' in database_name:
pubyears = load_variable("%s.pubyears" % database_name)
print("Pubyears loaded for %s entries" % len(pubyears.keys()... | github_jupyter |
# Classifying Fashion-MNIST
Now it's your turn to build and train a neural network. You'll be using the [Fashion-MNIST dataset](https://github.com/zalandoresearch/fashion-mnist), a drop-in replacement for the MNIST dataset. MNIST is actually quite trivial with neural networks where you can easily achieve better than 9... | github_jupyter |
<center><em>Copyright by Pierian Data Inc.</em></center>
<center><em>For more information, visit us at <a href='http://www.pieriandata.com'>www.pieriandata.com</a></em></center>
# KNN Project Exercise
Due to the simplicity of KNN for Classification, let's focus on using a PipeLine and a GridSearchCV tool, since thes... | github_jupyter |
# Testing
## Introduction
When programming, it is very important to know that the code we have written does what it was intended. Unfortunately, this step is often skipped in scientific programming, especially when developing code for our own personal work.
Researchers sometimes check that their code behaves correct... | github_jupyter |
```
!python --version
# In case issues with installation of tensortrade, Install the version below using that way
# https://github.com/tensortrade-org/tensortrade/issues/229#issuecomment-633164703
# version: https://github.com/tensortrade-org/tensortrade/releases/tag/v1.0.3
!pip install -U tensortrade==1.0.3 ta matplot... | github_jupyter |
Copyright 2019 Google LLC.
SPDX-License-Identifier: Apache-2.0
**Notebook Version** - 1.0.0
```
# Install datacommons
!pip install --upgrade --quiet git+https://github.com/datacommonsorg/api-python.git@stable-1.x
```
# Analyzing Income Distribution
The American Community Survey (published by the US Census) annually... | github_jupyter |
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Import the dataset
us = pd.read_csv('US ND prediction/us_disaster_declarations.csv')
us.head()
# checking for null values
us.isnull().sum()
# shape of dataset
us.shape
# Getting the dates coloumn
li = us['declaration_date... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Deep Learning
## Project: Build a Traffic Sign Recognition Classifier
In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is required that cannot be included i... | github_jupyter |
```
# coding: utf-8
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
import seaborn as sn
from pymongo import MongoClient
from pandas.plotting import scatter_matrix
%matplotlib inline
from pymongo import MongoClient
client = MongoClient("mongodb://analytics:coc... | github_jupyter |
# Keyboard shortcuts
In this notebook, you'll get some practice using keyboard shortcuts. These are key to becoming proficient at using notebooks and will greatly increase your work speed.
First up, switching between edit mode and command mode. Edit mode allows you to type into cells while command mode will use key p... | github_jupyter |
<a href="https://colab.research.google.com/github/SR2090/Image-Classification-MNIST/blob/main/ImageClassificationUsingCNN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from ... | github_jupyter |
# Evaluation of a QA System
EXECUTABLE VERSION: [colab](https://colab.research.google.com/github/deepset-ai/haystack/blob/master/tutorials/Tutorial5_Evaluation.ipynb)
To be able to make a statement about the performance of a question-answering system, it is important to evalute it. Furthermore, evaluation allows to d... | github_jupyter |
## Importing dependencies and loading the data
```
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import load_boston
dataset=load_boston()
dataset
```
### So in the given data there are certain features and target prices of houses in boston. So let's... | github_jupyter |
# Move Files
```
import numpy as np
import pandas as pd
import os
from datetime import datetime
import shutil
import random
pd.set_option('max_colwidth', -1)
```
# Create list of current files
```
SAGEMAKER_REPO_PATH = r'/home/ec2-user/SageMaker/classify-streetview'
ORIGINAL_IMAGE_PATH = os.path.join(SAGEMAKER_REPO... | github_jupyter |
## Main Driver Notebook for Training Graph NNs on TSP for Edge Classification
### MODELS
- GatedGCN
- GCN
- GAT
- GraphSage
- GIN
- MoNet
- MLP
### DATASET
- TSP
### TASK
- Edge Classification, i.e. Classifying each edge as belonging/not belonging to the optimal TSP solution set.
```
"""
IMPORTING LIBS
... | github_jupyter |
# k-Nearest Neighbor (kNN) exercise
#### This assignment was adapted from Stanford's CS231n course: http://cs231n.stanford.edu/
The kNN classifier consists of two stages:
- During training, the classifier takes the training data and simply remembers it
- During testing, kNN classifies every test image by comparing t... | github_jupyter |
<img src="images/usm.jpg" width="480" height="240" align="left"/>
# MAT281 - Laboratorio N°03
## Objetivos del laboratorio
* Reforzar conceptos básicos de análisis no supervisado.
## Contenidos
* [Problema 01](#p1)
<a id='p1'></a>
## I.- Problema 01
<img src="https://freedesignfile.com/upload/2013/06/Car-logos-... | github_jupyter |
# Introduction to Qiskit
Welcome to the Quantum Challenge! Here you will be using Qiskit, the open source quantum software development kit developed by IBM Quantum and community members around the globe. The following exercises will familiarize you with the basic elements of Qiskit and quantum circuits.
To begin, let... | github_jupyter |
```
from pythonosc import dispatcher, osc_server
from pythonosc.udp_client import SimpleUDPClient
import time
deflating = False
def print_volume_handler(unused_addr, args, volume):
global deflating, deflateStartTime
print("[{0}] ~ {1}".format(args, volume))
if (volume > 1090 or deflating):
... | 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 |
# Using Variational Autoencoder to Generate Faces
In this example, we are going to use VAE to generate faces. The dataset we are going to use is [CelebA](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html). The dataset consists of more than 200K celebrity face images. You have to download the Align&Cropped Images from t... | github_jupyter |
<img src="../Pics/MLSb-T.png" width="160">
<br><br>
<center><u><H1>LSTM and GRU on Sentiment Analysis</H1></u></center>
```
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.log_device_placement = True
sess = tf.Sess... | github_jupyter |
The PyData ecosystem has a number of core Python data containers that allow users to work with a wide array of datatypes, including:
* [Pandas](http://pandas.pydata.org): DataFrame, Series (columnar/tabular data)
* [XArray](http://xarray.pydata.org): Dataset, DataArray (multidimensional arrays)
* [Dask](http://dask.py... | github_jupyter |
```
import pickle
with open('cleaned_texts.pickle', 'rb') as handle:
texts = pickle.load(handle)
with open('labels.pickle', 'rb') as handle:
labels = pickle.load(handle)
MAX_NB_WORDS = 100000 # max no. of words for tokenizer
MAX_SEQUENCE_LENGTH = 400 # max length of each entry (sentence), including padding... | github_jupyter |
```
import os
import tarfile
from six.moves import urllib
DOWNLOAD_ROOT = "https://raw.githubusercontent.com/ageron/handson-ml/master/"
HOUSING_PATH = "datasets/housing"
HOUSING_URL = DOWNLOAD_ROOT + HOUSING_PATH + "/housing.tgz"
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
def load_housing_... | github_jupyter |
```
import numpy as np
import random
import time
import torch
from x_transformers.x_transformers import XTransformer
import torch
from run_experiment import *
from generate_data import *
```
## Variables
```
from sklearn.model_selection import ParameterGrid
TAG = 'improve_score_2paper_55len'
TASK_NAME = 'reverse'
... | github_jupyter |
# Automated Machine Learning
**Continuous retraining using Pipelines and Time-Series TabularDataset**
## Contents
1. [Introduction](#Introduction)
2. [Setup](#Setup)
3. [Compute](#Compute)
4. [Run Configuration](#Run-Configuration)
5. [Data Ingestion Pipeline](#Data-Ingestion-Pipeline)
6. [Training Pipeline](#Training... | github_jupyter |
```
# Python Libraries
%matplotlib inline
import pickle
import numpy as np
import pandas as pd
import matplotlib
from keras.datasets import cifar10
from keras import backend as K
# Custom Networks
from networks.lenet import LeNet
from networks.pure_cnn import PureCnn
from networks.network_in_network import NetworkInN... | github_jupyter |
```
import matplotlib.pyplot as plt
%matplotlib inline
plt.scatter([1700, 2100, 1900, 1300, 1600, 2200], [53000, 65000, 59000, 41000, 50000, 68000])
plt.show()
x = [1300, 1400, 1600, 1900, 2100, 2300]
y = [88000, 72000, 94000, 86000, 112000, 98000]
plt.scatter(x, y, s=32, c='cyan', alpha=0.5)
plt.show()
plt.bar(x, y, w... | github_jupyter |
```
from __future__ import division
import pandas as pd
import numpy as np
import os
import re
import copy
from pprint import pprint
from glob import glob
import cPickle as pkl
```
### Functions to generate blocks of trials
Localizer, cognitive, and limbic
```
def create_localizer_block_single_effector(n_trials, resp... | github_jupyter |
```
from pathlib import Path
import pandas as pd
import numpy as np
import xarray as xr
import gcsfs
from typing import List
import io
import hashlib
import os
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import torch
from torch import nn
import torch.nn.functional as F
import pytorch_lightning as... | github_jupyter |
<a class="anchor" id="2nd-bullet">
### 1.1. Import the needed libraries
</a>
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# data partition
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from sklearn.preprocessing import ... | github_jupyter |
# Exercise Set 5: Python plotting
*Morning, August 15, 2018
In this Exercise set we will work with visualizations in python, using two powerful plotting libraries. We will also quickly touch upon using pandas for exploratory plotting.
```
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import... | github_jupyter |

[](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Healthcare/6.Clinical_Context_Spell_Checker.ipynb)
<H... | github_jupyter |
### Hipótese 1 (MLPRegressor)
`Matheus Raz (mrol@cin.ufpe.br)`
`João Paulo Lins (jplo@cin.ufpe.br)`
#### É possível prever o número de vendas globais de um game baseado no seu gênero, rating, publisher e plataforma?
```
from IPython.display import display
import numpy as np
import pandas as pd
from sklearn.neural_n... | github_jupyter |
```
from datetime import datetime
import numpy as np
import pandas as pd
import sklearn
from sklearn.linear_model import LinearRegression
#parse data
from sklearn import preprocessing
from sklearn.preprocessing import LabelEncoder
#label encoding on categorical data
#FAMA 49CRSP Common Stocks
df = pd.read_csv('FA... | github_jupyter |
<font face=楷体 size=6><b>黑人抬棺人脸检测:</b>
<font face=楷体 size=5><b>背景:</b>
<font face=楷体 size=3>黑人抬棺这么火,怎么能不用paddlehub试一试呢?
<br>
<font face=楷体 size=3>临近期末,准备考试,还要准备考研,555,明明有好点子,但是没时间做,先出一个黑人抬棺的视频8
<font face=楷体 size=5><b>结果:</b>
<font face=楷体 size=3>在我的B站上: <a href=https://www.bilibili.com/video/BV1Sk4y1r7Zz>http... | github_jupyter |
# Monte Carlo Methods
In this notebook, you will write your own implementations of many Monte Carlo (MC) algorithms.
While we have provided some starter code, you are welcome to erase these hints and write your code from scratch.
### Part 0: Explore BlackjackEnv
We begin by importing the necessary packages.
```
i... | github_jupyter |
**Aims**:
- extract the omics mentioned in multi-omics articles
**NOTE**: the articles not in PMC/with no full text need to be analysed separately, or at least highlighted.
```
%run notebook_setup.ipynb
import pandas
pandas.set_option('display.max_colwidth', 100)
%vault from pubmed_derived_data import literature, li... | github_jupyter |
# [Advent of Code 2019: Day 4](https://adventofcode.com/2019/day/4)
<h2>--- Day 4: Secure Container ---</h2><p>You arrive at the Venus fuel depot only to discover it's protected by a password. The Elves had written the password on a sticky note, but someone <span title="Look on the bright side - isn't it more secure ... | github_jupyter |
```
from django.template import Context
from django.template.base import Token
from django.template.base import Parser
from django.template.base import Template
from django.template.base import TokenType
from django.core.management import call_command
from wagtail_srcset.templatetags.wagtail_srcset_tags import srcse... | github_jupyter |
<a href="https://colab.research.google.com/github/kylehounslow/gdg_workshop/blob/master/notebooks/hello_tensorflow.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Hello TensorFlow!
This notebook is a gentle introduction to TensorFlow.
Mostly t... | github_jupyter |
# Example PV curve
The purpose of this document is to showcase how a Q-V hysteresis loop can be transformed to a P-E hysteresis loop, as shown in the paper
```
import pair_conformal as pair_conformal
import infinite_fourier as infinite_fourier
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import... | github_jupyter |
## Experiment
```
experiment_label = 'rforest01'
```
### Aim:
* compare basic random forest to best logreg
### Findings:
* ROC on training hugs the top left; overfitting.
* Next: increase min samples per leaf.
## Set up
```
import pandas as pd
import numpy as np
from joblib import dump, load # simpler than pickl... | github_jupyter |
# 训练你的物体检测器
```
!pip install gluoncv
import gluoncv as gcv
import mxnet as mx
```
# 准备训练集
```
import os
class DetectionDataset(gcv.data.VOCDetection):
CLASSES = ['cocacola', 'noodles', 'hand']
def __init__(self, root):
self._im_shapes = {}
self._root = os.path.expanduser(root)
self._... | github_jupyter |
# Simple Evolutionary Exploration Walkthrough
This notebook contains instructions on how to use the SEE module, along with several examples. These instructions will cover the following parts:
* [Import Image Files](#Import_Image_Files)
* [Manual Search](#Manual_Search)
* [Genetic Algorithm Search](#Genetic_Algorithm... | github_jupyter |
# Demonstrating sparkmagic
## This notebook will demonstrate how we can use the spark magic to interspere our Python code with code that is running against a Spark cluster
Let’s say we’re working in an IPython notebook and we want to use Spark to analyze some data. So, we'll load `sparkmagic` in order to be able to t... | github_jupyter |
<img width="10%" alt="Naas" src="https://landen.imgix.net/jtci2pxwjczr/assets/5ice39g4.png?w=160"/>
# Hugging Face - Ask boolean question to T5
<a href="https://app.naas.ai/user-redirect/naas/downloader?url=https://raw.githubusercontent.com/jupyter-naas/awesome-notebooks/master/Hugging%20Face/Hugging_Face_Ask_boolean_... | github_jupyter |
## Goes over modeling, starting from modeling tables.
### We're using modeling tables which were prepared based on 12 hours worth of vital sign data from each patient, as well as medication history during the stay, and patient characteristics.
### The model predicts the probability of having a rapid response team event... | github_jupyter |
```
import numpy as np
import pickle
import scipy
import combo
import os
import urllib
import ssl
import matplotlib.pyplot as plt
%matplotlib inline
ssl._create_default_https_context = ssl._create_unverified_context
def download():
if not os.path.exists('data/s5-210.csv'):
if not os.path.exists('data'):
... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.