code stringlengths 2.5k 150k | kind stringclasses 1
value |
|---|---|
# Heap Maps
A heat map is a two-dimensional representation of data in which values are represented by colors. A simple heat map provides an immediate visual summary of information.
```
from beakerx import *
data = [[533.08714795974, 484.92105712087596, 451.63070008303896, 894.4451947886148, 335.44965728686225, 64... | 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 |
# Adversarial Examples
Let's start out by importing all the required libraries
```
import os
import sys
sys.path.append(os.path.join(os.getcwd(), "venv"))
import numpy as np
import torch
import torchvision.transforms as transforms
from matplotlib import pyplot as plt
from torch import nn
from torch.autograd import... | github_jupyter |
# Introduccion a la Inteligencia Artificial
Veremos dos ejercicios con para entender el concepto de inteligencia artificial
## Objeto Rebotador
En el siguiente ejercicio, realizaremos un objeto que al chocar con una de las paredes, este cambie de direccion y siga con su camino
```
!pip3 install ColabTurtle
```
Lla... | github_jupyter |
# Pi Estimation Using Monte Carlo
In this exercise, we will use MapReduce and a Monte-Carlo-Simulation to estimate $\Pi$.
If we are looking at this image from this [blog](https://towardsdatascience.com/how-to-make-pi-part-1-d0b41a03111f), we see a unit circle in a unit square:
, and then separates those into position and velocity to calculate a new, predicted state. It uses a constant velocity motion model.
**In this exercise, we'll be improving this function, and using ma... | github_jupyter |
##### Copyright 2021 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 a Different Corpus
zh_segment makes it easy to use a different corpus for word segmentation.
If you simply want to "teach" the algorithm a single phrase it doesn't know then read [this StackOverflow answer](http://stackoverflow.com/questions/20695825/english-word-segmentation-in-nlp).
Now, let's get a new co... | github_jupyter |
# Checking Container Dwell Times
This works with the CSV export of ConFlowGen.
Import libraries
```
import os
import pathlib
import ipywidgets as widgets
import pandas as pd
from IPython.display import Markdown
import matplotlib.pyplot as plt
from matplotlib import gridspec
```
Select input data
```
folder_of_this... | github_jupyter |
# 2019 Formula One World Championship
<div style="text-align: justify">
A Formula One season consists of a series of races, known as Grands Prix (French for ''grand prizes' or 'great prizes''), which take place worldwide on purpose-built circuits and on public roads. The results of each race are evaluated usin... | github_jupyter |
<a href="https://colab.research.google.com/github/JSJeong-me/KOSA-Big-Data_Vision/blob/main/Model/99_kaggle_credit_card_analysis_and_prediction.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Importing Packages
```
import pandas as pd
import nump... | github_jupyter |
# Sequence to Sequence Learning
:label:`sec_seq2seq`
As we have seen in :numref:`sec_machine_translation`,
in machine translation
both the input and output are a variable-length sequence.
To address this type of problem,
we have designed a general encoder-decoder architecture
in :numref:`sec_encoder-decoder`.
In this... | github_jupyter |
# Seaborn In Action
Seaborn is a data visualization library that is based on **Matplotlib**. It is tightly integrated with Pandas library and provides a high level interface for making attractive and informative statistical graphics in Python.
This Notebook introduces the basic and essential functions in the seaborn ... | github_jupyter |
<font size = "5"> **[Image Tools](2_Image_Tools.ipynb)** </font>
<hr style="height:2px;border-top:4px solid #FF8200" />
# Selective Fourier Transform
part of
<font size = "4"> **pyTEMlib**, a **pycroscopy** library </font>
Notebook by
Gerd Duscher
Materials Science & Engineering<br>
Joint Institute of Advan... | github_jupyter |
```
import time
import networkx as nx
from nfp.preprocessing import features_graph
import numpy as np
import pandas as pd
dataIni = pd.read_csv('Oads_Mo2C_catalysts_graphml.csv')
dataIni['graphFileName'] = dataIni['graphFileName'].str.slice_replace(0,0,repl='Oads_Mo2C_graphml/')
print(dataIni.graphFileName)
# Prepare g... | github_jupyter |
# Stage 1: Correlation for individual enhancers
```
import pandas as pd
import numpy as np
import time, re, datetime
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.stats import zscore
import random
from multiprocessing import Pool,cpu_count
num_processors = cpu_count()
print(... | github_jupyter |
If you're opening this Notebook on colab, you will probably need to install 🤗 Transformers and 🤗 Datasets. Right now this requires the current master branch of both. Uncomment the following cell and run it.
```
#! pip install git+https://github.com/huggingface/transformers.git
#! pip install git+https://github.com/h... | github_jupyter |
# How to recover a known planet in Kepler data
This tutorial demonstrates the basic steps required to recover a transiting planet candidate in the Kepler data.
We will show how you can recover the signal of [Kepler-10b](https://en.wikipedia.org/wiki/Kepler-10b), the first rocky planet that was discovered by Kepler! K... | github_jupyter |
**Note**: Click on "*Kernel*" > "*Restart Kernel and Run All*" in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) *after* finishing the exercises to ensure that your solution runs top to bottom *without* any errors. If you cannot run this file on your machine, you may want to open it [in the cloud <img heigh... | github_jupyter |
# Introduction to Machine Learning
(The examples in this notebook were inspired by my work for EmergentAlliance, the Scikit-Learn documentation and Jason Brownlee's "Machine Learning Mastery with Python")
In this short intro course we will focus on predictive modeling. That means that we want to use the models to mak... | github_jupyter |
<!--<img width=700px; src="../img/logoUPSayPlusCDS_990.png"> -->
<p style="margin-top: 3em; margin-bottom: 2em;"><b><big><big><big><big>Introduction to Pandas</big></big></big></big></b></p>
```
%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
pd.options.display.max_rows = 8
... | github_jupyter |
```
print('Meu nome é: Gabriel Moraes Barros ')
print('Meu RA é: 192801')
%matplotlib inline
import matplotlib.pyplot as plot
from IPython import display
import sys
import numpy as np
import numpy.random as nr
import keras
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau
from keras.prepr... | github_jupyter |
# Data Distribution vs. Sampling Distribution: What You Need to Know
This notebook is accompanying the article [Data Distribution vs. Sampling Distribution: What You Need to Know](https://www.ealizadeh.com/blog/statistics-data-vs-sampling-distribution/).
Subscribe to **[my mailing list](https://www.ealizadeh.com/subs... | github_jupyter |
## Test "best of two" classifier
This notebook test a classifier that operates in two layers:
- First we use a SVM classifier to label utterances with high degree of certainty.
- Afterwards we use heuristics to complete the labeling
```
import os
import sys
import pandas as pd
import numpy as np
import random
import... | github_jupyter |
```
import torch
import torchvision
import matplotlib.pyplot as plt
import numpy as np
```
# Classifying Digits with K-Nearest-Neighbors (KNN)
This is a very simple implementation of classifying images using the k-nearest-neighbors algorithm. The accuracy is pretty good for how simple the algorithm is. The parameters... | github_jupyter |
# Distributed data parallel BERT training with TensorFlow2 and SMDataParallel
HSMDataParallel is a new capability in Amazon SageMaker to train deep learning models faster and cheaper. SMDataParallel is a distributed data parallel training framework for TensorFlow, PyTorch, and MXNet.
This notebook example shows how t... | github_jupyter |
# Continuous Control
---
In this notebook I will implement the distributed disttributional deep determenstic policy gradients (D4PG) algorithm.
#### different algorithm can also be used to solve this problem such as :
'''
1 - Deep determenstic policy gradients (DDPG)
2 - Proximal policy optimization (PP... | github_jupyter |
# NewEgg.Com WebScraping Program For Laptops - Beta v1.0
### - April 2020
---
```
# Import dependencies.
import os
import re
import time
import glob
import random
import datetime
import requests
import pandas as pd
from re import search
from splinter import Browser
from playsound import playsound
from bs4 import ... | github_jupyter |
```
from IPython.display import display, HTML
display(HTML(data="""
<style>
div#notebook-container { width: 99%; }
div#menubar-container { width: 99%; }
div#maintoolbar-container { width: 99%; }
</style>
"""))
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy... | github_jupyter |
```
%load_ext autoreload
%autoreload 2
import sklearn
from sklearn import datasets
iris = datasets.load_iris()
iris
iris.feature_names
print(iris.data.shape, iris.data.dtype)
iris.target
iris.target_names
import numpy as np
from chainer_chemistry.datasets.numpy_tuple_dataset import NumpyTupleDataset
# All dataset is ... | github_jupyter |
<a href="https://colab.research.google.com/github/aks1981/ML/blob/master/P2S10.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Twin-Delayed DDPG
Complete credit goes to this [awesome Deep Reinforcement Learning 2.0 Course on Udemy](https://www.ud... | github_jupyter |
# Web predictions
The purpose of this notebook is to experiment with making predictions from "raw" accumulated user values, that
could for instance be user input from a web form.
```
import findspark
findspark.init()
findspark.find()
import pyspark
from pyspark import SparkContext, SparkConf
from pyspark.sql import ... | github_jupyter |
# Lecture 9 - Motor Control
### Introduction to modeling and simulation of human movement
https://github.com/BMClab/bmc/blob/master/courses/ModSim2018.md
* In class:
```
import numpy as np
#import pandas as pd
#import pylab as pl
import matplotlib.pyplot as plt
import math
%matplotlib notebook
```
### Muscle proper... | github_jupyter |
# Time Series analysis of O'hare taxi rides data
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.model_selection import TimeSeriesSplit, cross_validate, GridSearchCV
pd.set_... | github_jupyter |
# Lesson 04: Numpy
- Used for working with tensors
- Provides vectors, matrices, and tensors
- Provides mathematical functions that operate on vectors, matrices, and tensors
- Implemented in Fortran and C in the backend
```
import numpy as np
```
## Making Arrays
```
arr = np.array([1, 2, 3])
print(arr, type(arr), ... | github_jupyter |
```
import torch
import numpy as np
import pandas as pd
import matchzoo as mz
print('matchzoo version', mz.__version__)
ranking_task = mz.tasks.Ranking(losses=mz.losses.RankHingeLoss())
ranking_task.metrics = [
mz.metrics.NormalizedDiscountedCumulativeGain(k=3),
mz.metrics.NormalizedDiscountedCumulativeGain(k=5... | github_jupyter |
# Document embeddings in BigQuery
This notebook shows how to do use a pre-trained embedding as a vector representation of a natural language text column.
Given this embedding, we can use it in machine learning models.
## Embedding model for documents
We're going to use a model that has been pretrained on Google News... | github_jupyter |
## Pumpkin Pricing
Load up required libraries and dataset. Convert the data to a dataframe containing a subset of the data:
- Only get pumpkins priced by the bushel
- Convert the date to a month
- Calculate the price to be an average of high and low prices
- Convert the price to reflect the pricing by bushel quantit... | github_jupyter |
<table width="100%"> <tr>
<td style="background-color:#ffffff;">
<a href="http://qworld.lu.lv" target="_blank"><img src="../images/qworld.jpg" width="35%" align="left"> </a></td>
<td style="background-color:#ffffff;vertical-align:bottom;text-align:right;">
prepared by Abuzer Yak... | github_jupyter |
# DLISIO in a Nutshell
## Importing
```
%matplotlib inline
import os
import pandas as pd
import dlisio
import matplotlib.pyplot as plt
import numpy as np
import numpy.lib.recfunctions as rfn
import hvplot.pandas
import holoviews as hv
from holoviews import opts, streams
from holoviews.plotting.links import DataLink... | github_jupyter |
```
# Import modules
import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
import math
from sklearn.model_selection import train_test_split
import sklearn.metrics as metrics
#keras
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.preprocessing.image im... | github_jupyter |
# Example 5: Quantum-to-quantum transfer learning.
This is an example of a continuous variable (CV) quantum network for state classification, developed according to the *quantum-to-quantum transfer learning* scheme presented in [1].
## Introduction
In this proof-of-principle demonstration we consider two distinct... | github_jupyter |
## Borehole lithology logs viewer
Interactive view of borehole data used for [exploratory lithology analysis](https://github.com/csiro-hydrogeology/pyela)
Powered by [Voila](https://github.com/QuantStack/voila), [ipysheet](https://github.com/QuantStack/ipysheet) and [ipyleaflet](https://github.com/jupyter-widgets/ipy... | github_jupyter |
```
## do_runcode
##%overwritefile
##%file:src/do_dot_runcode.py
##%noruncode
def do_runcode(self,return_code,fil_ename,magics,code, silent, store_history=True,
user_expressions=None, allow_stdin=True):
return_code=return_code
fil_ename=fil_ename
bcancel_exec=False
... | github_jupyter |
# Series Inelastic Cantilever
This notebook verifies the `elle.beam2dseries` element against an analysis run with the FEDEASLab `Inel2dFrm_wOneComp` element.
```
import anon
import anon as ana
import elle.beam2d
import elle.solvers
import elle.sections
import anon.ops as anp
```
### Model Definition
```
from elle.b... | github_jupyter |
```
import folium
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib
data = pd.read_csv('MDD_Dataset_PSD_and_SNR.csv')
coords = pd.read_excel('AudioMothPeru_Coordinates.xlsx', engine='openpyxl')
data
data = data.drop(columns=['SourceFile', 'Directory', 'FileSize', 'AudioMothID',
... | github_jupyter |
# Classification
This notebook aims at giving an overview of the classification metrics that
can be used to evaluate the predictive model generalization performance. We can
recall that in a classification setting, the vector `target` is categorical
rather than continuous.
We will load the blood transfusion dataset.
... | github_jupyter |
Para entrar no modo apresentação, execute a seguinte célula e pressione `-`
```
%reload_ext slide
```
<span class="notebook-slide-start"/>
# Proxy
Este notebook apresenta os seguintes tópicos:
- [Introdução](#Introdu%C3%A7%C3%A3o)
- [Servidor de proxy](#Servidor-de-proxy)
## Introdução
Existe muita informação di... | github_jupyter |
```
import pandas as pd
import numpy as np
import time
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn import preprocessing as pp
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score
from sklearn import preprocessing
import xgboost as xgb
from sklearn.ensembl... | github_jupyter |
<p></p>
<p style="text-align:center"><font size="20">BRAIN IMAGING</font></p>
<p style="text-align:center"><font size="20">DATA STRUCTURE</font></p>
The dataset for this tutorial is structured according to the [Brain Imaging Data Structure (BIDS)](http://bids.neuroimaging.io/). BIDS is a simple and intuitive way to or... | github_jupyter |
STAT 453: Deep Learning (Spring 2021)
Instructor: Sebastian Raschka (sraschka@wisc.edu)
Course website: http://pages.stat.wisc.edu/~sraschka/teaching/stat453-ss2021/
GitHub repository: https://github.com/rasbt/stat453-deep-learning-ss21
---
```
%load_ext watermark
%watermark -a 'Sebastian Raschka' -v -p torch
... | github_jupyter |
# Hidden Markov Model
## What is a Hidden Markov Model?
A Hidden Markov Model (HMM) is a statistical Markov model in with the system being modeled is assumed to be a Markov process with **hidden** states.
An HMM allows us to talk about both observed events (like words that we see in the input) and hidden events (like... | github_jupyter |
# Deep Reinforcement Learning in Action
### by Alex Zai and Brandon Brown
#### Chapter 3
##### Listing 3.1
```
from Gridworld import Gridworld
game = Gridworld(size=4, mode='static')
import sys
game.display()
game.makeMove('d')
game.makeMove('d')
game.makeMove('d')
game.display()
game.reward()
game.board.render_np()... | github_jupyter |
```
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
```
# 0. General note
* This notebook produces figures and calculations presented in [Ye et al. 2017, JGR](https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1002/2016JB013811).
* This notebook demonstrates how to correct pressure scales for the e... | github_jupyter |
# Generators
# 生成器
> Here we'll take a deeper dive into Python generators, including *generator expressions* and *generator functions*.
本章我们深入讨论Python的生成器,包括*生成器表达式*和*生成器函数*
## Generator Expressions
## 生成器表达式
> The difference between list comprehensions and generator expressions is sometimes confusing; here we'll... | github_jupyter |
<a href="https://colab.research.google.com/github/reallygooday/60daysofudacity/blob/master/Basic_Image_Classifier.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
hand-written digits dataset from UCI: http://archive.ics.uci.edu/ml/datasets/Optical+Re... | github_jupyter |
<h1>REGIONE LOMBARDIA</h1>
Confronto dei dati relativi ai decessi registrati dall'ISTAT e i decessi causa COVID-19 registrati dalla Protezione Civile Italiana con i decessi previsti dal modello predittivo SARIMA.
<h2>DECESSI MENSILI REGIONE LOMBARDIA ISTAT</h2>
Il DataFrame contiene i dati relativi ai decessi mensil... | github_jupyter |
# Self-Driving Car Engineer Nanodegree
## Project: **Finding Lane Lines on the Road**
***
In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j... | github_jupyter |
```
from imp import reload
import autoargs; reload(autoargs);
```
## argparse made easy!
```
# pass your function and args from your sys.argv, and you're off to the races!
def myprint(arg1, arg2):
print("arg1:", arg1)
print("arg2:", arg2)
autoargs.autocall(myprint, ["first", "second"])
# if you want your argu... | github_jupyter |
## Convolutional Layer
In this notebook, we visualize four filtered outputs (a.k.a. feature maps) of a convolutional layer.
### Import the image
```
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
# TODO: Feel free to try out your own images here by changing img_path
# to a file path to another image ... | github_jupyter |
# A Chaos Game with Triangles
John D. Cook [proposed](https://www.johndcook.com/blog/2017/07/08/the-chaos-game-and-the-sierpinski-triangle/) an interesting "game" from the book *[Chaos and Fractals](https://smile.amazon.com/Chaos-Fractals-New-Frontiers-Science/dp/0387202293)*: start at a vertex of an equilateral trian... | github_jupyter |
# Part 2: Intro to Private Training with Remote Execution
In the last section, we learned about PointerTensors, which create the underlying infrastructure we need for privacy preserving Deep Learning. In this section, we're going to see how to use these basic tools to train our first deep learning model using remote e... | github_jupyter |
<h1> Training on Cloud ML Engine </h1>
This notebook illustrates distributed training and hyperparameter tuning on Cloud ML Engine.
```
# change these to try this notebook out
BUCKET = 'cloud-training-demos-ml'
PROJECT = 'cloud-training-demos'
REGION = 'us-central1'
import os
os.environ['BUCKET'] = BUCKET
os.environ[... | github_jupyter |
<a href="https://colab.research.google.com/github/Mengxue12/tensorflow-1-public/blob/main/C4/W4/ungraded_labs/C4_W4_Lab_1_LSTM.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
```
#@title Licensed under the Apache License, Version 2.0 (the "License")... | github_jupyter |
# MIDAS Examples
If you're reading this you probably already know that MIDAS stands for Mixed Data Sampling, and it is a technique for creating time-series forecast models that allows you to mix series of different frequencies (ie, you can use monthly data as predictors for a quarterly series, or daily data as predict... | github_jupyter |
```
import sys, os
if 'google.colab' in sys.modules and not os.path.exists('.setup_complete'):
!wget -q https://raw.githubusercontent.com/yandexdataschool/Practical_RL/spring20/setup_colab.sh -O- | bash
!wget -q https://raw.githubusercontent.com/yandexdataschool/Practical_RL/coursera/grading.py -O ../grading.p... | github_jupyter |

[](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Healthcare/25.Date_Normalizer.ipynb)
## Colab Setup
... | github_jupyter |
# Code to download The Guardian UK data and clean data for text analysis
@Jorge de Leon
This script allows you to download news articles that match your parameters from the Guardian newspaper, https://www.theguardian.com/us.
## Set-up
```
import os
import re
import glob
import json
import requests
import pandas ... | github_jupyter |
```
import torch
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from pathlib import Path
sns.color_palette("tab10")
sns.set(rc={
"figure.dpi": 150,
"text.usetex": True,
"xtick.labelsize": "small",
"ytick.labelsize": "small",
"axes.labelsize": "small",
"axes.titlesize":... | github_jupyter |
Neuroon cross-validation
------------------------
Neuroon and PSG recordings were simultanously collected over the course of two nights. This analysis will show whether Neuroon is able to accurately classify sleep stages. The PSG classification will be a benchmark against which Neuroon performance will be tested. "Th... | github_jupyter |
# PI-ICR analysis
Created on 17 July 2019 for the ISOLTRAP experiment
- V1.1 (24 June 2020): Maximum likelihood estimation was simplified based on SciPy PDF's and the CERN-ROOT6 minimizer via the iminuit package (→ great performance)
- V1.2 (20 February 2021): Preparations for scientific publication and iminuit v2 upd... | github_jupyter |
# Introdution to Jupyter Notebooks and Text Processing in Python
This 'document' is a Jupyter notebook. It allows you to combine explanatory **text** and **code** that executes to produce results you can see on the same page.
## Notebook Basics
### Text cells
The box this text is written in is called a *cell*. It is... | github_jupyter |
<font size="+1">This notebook will illustrate how to access DeepLabCut(DLC) results for IBL sessions and how to create short videos with DLC labels printed onto, as well as wheel angle, starting by downloading data from the IBL flatiron server. It requires ibllib, a ONE account and the following script: https://github.... | github_jupyter |
# Week 3 - Functions
The real power in any programming language is the **Function**.
A function is:
* a little block of script (one line or many) that performs specific task or a series of tasks.
* reusable and helps us make our code DRY.
* triggered when something "invokes" or "calls" it.
* ideally modular – it per... | github_jupyter |
# piston example with explicit Euler scheme
```
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as anim
import numpy as np
import sys
sys.path.insert(0, './code')
import ideal_gas
```
### physical parameters
```
# length of cylinder
l = 0.1
# radius of cylinder
r... | github_jupyter |
설치하기
```
!pip install git+https://github.com/gbolmier/funk-svd
from funk_svd.dataset import fetch_ml_ratings
from funk_svd import SVD
from sklearn.metrics import mean_absolute_error
import pandas as pd
ds_ratings = pd.read_csv("../ml-latest-small/ratings.csv")
ds_movies = pd.read_csv("../ml-latest-small/movies.csv")
#... | github_jupyter |
```
# Import libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sqlite3
from sklearn.pipeline import Pipeline
# used for train/test splits
from sklearn.cross_validation import train_test_split
# used to impute mean for data
from sklearn.preprocessing import Imputer
# logistic reg... | github_jupyter |
```
#Using our synthetic data library for today's exercise
#pip install ydata
#Loading the census dataset from kaggle
import logging
import os
import requests
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
#import ydata.synt... | github_jupyter |
# LAB 5b: Deploy and predict with Keras model on Cloud AI Platform.
**Learning Objectives**
1. Setup up the environment
1. Deploy trained Keras model to Cloud AI Platform
1. Online predict from model on Cloud AI Platform
1. Batch predict from model on Cloud AI Platform
## Introduction
In this notebook, we'll depl... | github_jupyter |
```
#!/usr/bin/python3
import sys
sys.path.insert(0, '../src/')
from ntree import *
from tree_vis import *
import numpy as np
import matplotlib.pyplot as plt
```
### Summary
We are given :
* a positive integer $n$ which is the number of dimension of the space.
* a positive integer $k$ which is the total numbe... | github_jupyter |
## XYZ Pro Features
This notebook demonstrates some of the pro features for XYZ Hub API.
XYZ paid features can be found here: [xyz pro features](https://www.here.xyz/xyz_pro/).
XYZ plans can be found here: [xyz plans](https://developer.here.com/pricing).
### Virtual Space
A virtual space is described by definition w... | github_jupyter |
# Pyber Ride Sharing
3 observations from the data:
* Urban drivers typically drive more frequently yet charge on average (i.e., <30) less than rural drivers.
* Roughly two-thirds of all rides occur in Urban cities, however, roughly 80% of all drivers work in Urban areas.
* While less rides occur in rural cities, there... | github_jupyter |
# torchserve.ipynb
This notebook contains code for the portions of the benchmark in [the benchmark notebook](./benchmark.ipynb) that use [TorchServe](https://github.com/pytorch/serve).
```
# Imports go here
import json
import os
import requests
import scipy.special
import transformers
# Fix silly warning messages a... | github_jupyter |
# Lab 1: Markov Decision Processes - Problem 3
## Lab Instructions
All your answers should be written in this notebook. You shouldn't need to write or modify any other files.
**You should execute every block of code to not miss any dependency.**
*This project was developed by Peter Chen, Rocky Duan, Pieter Abbeel ... | github_jupyter |
# Exercise 6-3
## LSTM
The following two cells will create a LSTM cell with one neuron.
We scale the output of the LSTM linear and add a bias.
Then the output will be wrapped by a sigmoid activation.
The goal is to predict a time series where every $n^{th}$ ($5^{th}$ in the current example) element is 1 and all other... | github_jupyter |
# 2020L-WUM Praca domowa 2
Kod: **Bartłomiej Eljasiak**
## Załadowanie bibliotek
Z tych bibliotek będziemy korzystać w wielu miejscach, jednak w niektórych fragmentach kodu znajdą się dodatkowe importowania, lecz w takich sytuacjach użytek załadowanej biblioteki jest ograniczony do 'chunku', w którym została załadow... | github_jupyter |
```
import requests
import pandas as pd
from bs4 import BeautifulSoup
import string
import re
import nltk
import json
import matplotlib.pyplot as plt
import numpy as np
def get_text(url):
response = requests.get(url)
content = response.content
parser = BeautifulSoup(content,'html.parser')
return(parser.... | 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 |
<a href="https://colab.research.google.com/github/reihaneh-torkzadehmahani/MyDPGAN/blob/master/AdvancedDPCGAN.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
## differential_privacy.analysis.rdp_accountant
```
# Copyright 2018 The TensorFlow Author... | github_jupyter |
### **PINN eikonal solver for a portion of the Marmousi model**
```
from google.colab import drive
drive.mount('/content/gdrive')
cd "/content/gdrive/My Drive/Colab Notebooks/Codes/PINN_isotropic_eikonal_R1"
!pip install sciann==0.5.4.0
!pip install tensorflow==2.2.0
#!pip install keras==2.3.1
import numpy as np
impor... | github_jupyter |
# GRIP June'21 - The Sparks Foundation
## Data Science and Business Analytics
## Author: Smriti Gupta
### Task 1: **Prediction using Supervised ML**
* Predict the percentage of an student based on the no. of study hours.
* What will be predicted score if a student studies for 9.25 hrs/ day?
* _LANGUAGE:_ Python... | github_jupyter |
<a href="https://colab.research.google.com/github/yohanesnuwara/ccs-gundih/blob/master/main/gundih_historical_production_data.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
import pandas as pd
... | github_jupyter |
# 1A.1 - Deviner un nombre aléatoire (correction)
On reprend la fonction introduite dans l'énoncé et qui permet de saisir un nombre.
```
import random
nombre = input("Entrez un nombre")
nombre
```
**Q1 :** Ecrire une jeu dans lequel python choisi aléatoirement un nombre entre 0 et 100, et essayer de trouver ce nombr... | github_jupyter |
```
import sys
import os
import numpy as np
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path + "/src/simulations_v2")
from analysis_helpers import poisson_waiting_function, \
run_multiple_trajectories, \
... | github_jupyter |
# Artificial Intelligence Nanodegree
## Machine Translation Project
In this notebook, sections that end with **'(IMPLEMENTATION)'** in the header indicate that the following blocks of code will require additional functionality which you must provide. Please be sure to read the instructions carefully!
## Introduction
I... | github_jupyter |
# Unit 5 - Financial Planning
```
# Initial imports
import os
import requests
import pandas as pd
from dotenv import load_dotenv
import alpaca_trade_api as tradeapi
from MCForecastTools import MCSimulation
# date here
from datetime import date
%matplotlib inline
# Load .env enviroment variables
load_dotenv()
```
#... | github_jupyter |
### Abstract Factory Design Pattern
>An abstract factory is a generative design pattern that allows you to create families of related objects without getting attached to specific classes of created objects. The pattern is being implemented by creating an abstract class (for example - Factory), which is represented as ... | github_jupyter |
# Pytorch Basic
```
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from IPython.display import clear_output
torch.cuda.is_available()
```
## Device
```
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
```
## Hype... | github_jupyter |
### Importar librerías y series de datos
```
import time
start = time.time()
#importar datos y librerias
import numpy as np
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
from scipy import signal
from sklearn.linear_model import LinearRegression
from statsmodels.tsa.seasonal import ... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.