text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
# Time series forecasting using ARIMA
### Import necessary libraries
```
%matplotlib notebook
import numpy
import pandas
import datetime
import sys
import time
import matplotlib.pyplot as ma
import statsmodels.tsa.seasonal as st
import statsmodels.tsa.arima_model as arima
import statsmodels.tsa.stattools as tools
```... | github_jupyter |
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/FeatureCollection/simplify_polygons.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_... | github_jupyter |
[](https://colab.research.google.com/github/huggingface/education-toolkit/blob/main/02_ml-demos-with-gradio.ipynb)
💡 **Welcome!**
We’ve assembled a toolkit that university instructors and organizers can use to easily prepare labs, homework, ... | github_jupyter |
# Time Domain and Gating
## Intro
This notebooks demonstrates how to use [scikit-rf](www.scikit-rf.org) for time-domain analysis and gating. A quick example is given first, followed by a more detailed explanation.
S-parameters are measured in the frequency domain, but can be analyzed in time domain if you like. ... | github_jupyter |
# Getting object labels and positions
### Generating ZTF cutouts requires knowing object positions (RA and DEC), and image classification requires knowing truth labels ('star', 'galaxy'). ZTF catalogs do *not* include type labels, so we are unable to identify objects in the ZTF catalog as stars or galaxies.
### In t... | github_jupyter |
<a href="http://cocl.us/pytorch_link_top">
<img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DL0110EN/notebook_images%20/Pytochtop.png" width="750" alt="IBM Product " />
</a>
<img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DL0110EN... | github_jupyter |
# 第2章 最小二乗法:機械学習理論の第一歩
## 「02-square_error.py」の解説
ITエンジニアための機械学習理論入門「第2章 最小二乗法:機械学習理論の第一歩」で使用しているサンプルコード「02-square_error.py」の解説です。
※ 解説用にコードの内容は少し変更しています。
### データ数 N=10 の場合
はじめに必要なモジュールをインポートしておきます。
関数 normal は、正規分布に従う乱数を生成するために利用します。
```
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
fro... | github_jupyter |
##### Copyright 2018 The TensorFlow Authors.
```
#@title Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | github_jupyter |
```
import tensorflow as tf
import tensorflow.keras as keras
import matplotlib.pyplot as plt
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras.preprocessing.text import Tokenizer
sentences = ['I love my dog', 'I lov... | github_jupyter |
# Hierarchical Search
Hierarchical search is a a planning algorithm in high level of abstraction. <br>
Instead of actions as in classical planning (chapter 10) (primitive actions) we now use high level actions (HLAs) (see planning.ipynb) <br>
## Refinements
Each __HLA__ has one or more refinements into a sequence o... | github_jupyter |
# Get electricity data from the ENTSO-E API
To run this notebook, you must have the following environment variables set:
* BENTSO_DATA_DIR: Directory to cache data from ENTSO-E API
* ENTSOE_API_TOKEN: API token you get from signing up to ENTSO-E transparency platform
## Get data
```
from bentso import CachingDataCl... | github_jupyter |

# Image Classification with CNNs
#### Author: Alexander Fred Ojala
**Sources:**
* **Training + explanations**: https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html
**Copright:** Feel free to do whatever you want with this cod... | github_jupyter |
```
import numpy as np
import pandas as pd
import talib
def fix_data(path):
tmp = pd.read_csv(path, encoding="gbk", engine='python')
tmp.rename(columns={'Unnamed: 0':'trading_time'}, inplace=True)
tmp['trading_point'] = pd.to_datetime(tmp.trading_time)
del tmp['trading_time']
tmp.set_index(tmp.tra... | github_jupyter |
# 範例 : 計程車費率預測
https://www.kaggle.com/c/new-york-city-taxi-fare-prediction
***
- 使用並觀察特徵組合在計程車費率預測競賽的影響
```
# 做完特徵工程前的所有準備
import pandas as pd
import numpy as np
import datetime
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import cross_val_score
from sklearn.linear_model import LinearReg... | github_jupyter |
```
try:
# %tensorflow_version only exists in Colab.
%tensorflow_version 2.x
except Exception:
pass
import numpy as np
import tensorflow as tf
```
## Fetching the Data
This is a bit annoying. But to download from kaggle we need to upload the kaggle API key here. Then we need to move the file to the correct fol... | github_jupyter |
```
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
import os
import numpy as np
import csv
import re
import itertools
import copy
from sklearn import *
from collections import Counter
def iterate_rows():
filename = 'simbadresult.csv'
if not os.path.isfile(file... | github_jupyter |
# TensorFlow Fold Quick Start
TensorFlow Fold is a library for turning complicated Python data structures into TensorFlow Tensors.
```
# boilerplate
import random
import tensorflow as tf
sess = tf.InteractiveSession()
import tensorflow_fold as td
```
The basic elements of Fold are *blocks*. We'll start with some blo... | github_jupyter |
### This is a simple/fast tutorial for creating experiments
```
from scheduling_functions import *
from scheduling_algorithms import *
import numpy as np
import sys
import copy
from random import sample, randint, seed
from math import isclose, ceil, floor
from statistics import mean
from decimal import *
from fraction... | github_jupyter |
# About this Notebook
---
**Bayesian Gaussian CP decomposition** (or **BGCP** for short) is a type of Bayesian tensor decomposition that achieves state-of-the-art results on challenging the missing data imputation problem. In the following, we will discuss:
- What the Bayesian Gaussian CP decomposition is.
- How to ... | github_jupyter |
<img src="http://akhavanpour.ir/notebook/images/srttu.gif" alt="SRTTU" style="width: 150px;"/>
[](https://notebooks.azure.com/import/gh/Alireza-Akhavan/class.vision)
# <div style="direction:rtl;text-align:right;font-family:B Lotus, B Nazanin, Tahoma"> عملیات ر... | github_jupyter |
# Exercise 03 - Columnar Vs Row Storage
- The columnar storage extension used here:
- cstore_fdw by citus_data [https://github.com/citusdata/cstore_fdw](https://github.com/citusdata/cstore_fdw)
- The data tables are the ones used by citus_data to show the storage extension
```
%load_ext sql
```
## STEP 0 : Conn... | github_jupyter |
# Processing cellpy batch - Output and plots
### `{{cookiecutter.project_name}}::{{cookiecutter.session_id}}`
**Experimental-id:** `{{cookiecutter.notebook_name}}`
**Short-name:** `{{cookiecutter.session_id}}`
**Project:** `{{cookiecutter.project_name}}`
**By:** `{{cookiecutter.author_name}}`
**Date:** `{{co... | github_jupyter |
# Imports
```
%reload_ext autoreload
%autoreload 2
%matplotlib inline
from VAE1D import *
from IPython.core.debugger import set_trace
```
# Build model and loss function
Initially designed for 2D input images, modified for 1D time-series data.
Based on this paper: https://arxiv.org/abs/1807.01349
```
# The hydrauli... | github_jupyter |
```
import scipy.io as sio
import os
import numpy as np
import tensorflow as tf
datapath = r'..\data'
dataset = 'INSECT'
x = sio.loadmat(os.path.join(datapath, dataset, 'data.mat'))
x2 = sio.loadmat(os.path.join(datapath, dataset, 'splits.mat'))
barcodes=x['nucleotides']
species=x['labels']
train_loc=x2['trainval_loc'... | github_jupyter |
# 3 The RoboLab simulated on-screen robot (`nbev3devsim`)
Within the Jupyter notebook environment, you will be making use of a simple two-dimensional robot simulator, `nbev3devsim`. At times, we will refer to the Jupyter notebook + `nbev3devsim` simulator, or just the simulator itself, as *RoboLab* (it’s somewhat eas... | github_jupyter |
# WWLayerIterator
This Notebook explains how to use the internal WeightWatcher Layer Iterators
Includes the WWStackerLayerIterator
- Stacks all weight matrices into a single, large, rectangular matrix
- Probably should normalize each layer in some consistent way *(not done yet)
```
# Suppress the powerlaw package... | github_jupyter |
# Tutorial 01: Running Sumo Simulations
This tutorial walks through the process of running non-RL traffic simulations in Flow. Simulations of this form act as non-autonomous baselines and depict the behavior of human dynamics on a network. Similar simulations may also be used to evaluate the performance of hand-design... | github_jupyter |
# 基于U-Net卷积神经网络实现宠物图像分割
**作者:** [PaddlePaddle](https://github.com/PaddlePaddle)<br>
**日期:** 2021.10<br>
**摘要:** 本示例教程使用U-Net实现图像分割。
## 一、简要介绍
在计算机视觉领域,图像分割指的是将数字图像细分为多个图像子区域的过程。图像分割的目的是简化或改变图像的表示形式,使得图像更容易理解和分析。图像分割通常用于定位图像中的物体和边界(线,曲线等)。更精确的,图像分割是对图像中的每个像素加标签的一个过程,这一过程使得具有相同标签的像素具有某种共同视觉特性。图像分割的领域非常多,无人车、地块检测、表计识别等... | github_jupyter |
```
#Import required packages
from keras.models import Sequential
from keras.layers import Dense
import numpy as np
import ipdb # deb
# Getting the data ready
# Generate train dummy data for 1000 Students and dummy test
# for 500
#Columns :Age, Hours of Study &Avg Previous test scores
np.random.seed(2018) #Setting see... | github_jupyter |
### Setup
```
%reload_ext autoreload
%autoreload 2
%matplotlib inline
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in
import numpy as ... | github_jupyter |
```
%matplotlib inline
```
# Classifier Chain
Example of using classifier chain on a multilabel dataset.
For this example we will use the `yeast
<https://www.openml.org/d/40597>`_ dataset which contains
2417 datapoints each with 103 features and 14 possible labels. Each
data point has at least one label. As a basel... | github_jupyter |
```
import torch
import torchvision
from PIL import Image
import torchvision.transforms as transforms
%matplotlib inline
import matplotlib.pyplot as plt
import torchvision.transforms.functional as F
import numpy as np
import cv2
from cv2 import resize,merge,split
colors = torch.tensor([[0,0,128],[0,0,64],[0,0,32],[0,1... | github_jupyter |
<table>
<tr align=left><td><img align=left src="./images/CC-BY.png">
<td>Text provided under a Creative Commons Attribution license, CC-BY. All code is made available under the FSF-approved MIT license. (c) Marc Spiegelman</td>
</table>
```
%matplotlib inline
import numpy
import matplotlib.pyplot as plt
```
# Plott... | github_jupyter |
# Prediction de l'accélération et du freinage avec nuScenes
```
%matplotlib inline
from nuscenes.nuscenes import NuScenes
from nuscenes.can_bus.can_bus_api import NuScenesCanBus
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# data/sets/nuscenes
# D:\Utilisateurs\Alexandre\Repertoire_D\nuscen... | github_jupyter |
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content-dl/blob/main/tutorials/W2D1_ConvnetsAndRecurrentNeuralNetworks/student/W2D1_Tutorial2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <a href="https://kaggle.co... | github_jupyter |
```
import numpy as np
import pandas as pd
patients = pd.read_csv('internacoes_charlson_zero.csv.gz', compression='gzip', nrows=None, usecols=['target'])
target = np.asarray(patients['target'].values)
print(target.shape)
import nltk
nltk.download('rslp')
nltk.download('stopwords')
import gzip, pickle
from sklearn.feat... | github_jupyter |
```
import torch
import torch.nn as nn
from torch.nn import init
from torch.autograd import Variable
import argparse
import os
import numpy as np
import time
import random
from sklearn.metrics import f1_score
from collections import defaultdict
import networkx as nx
from encoders import Encoder
from aggregators impo... | github_jupyter |
<!--NAVIGATION-->
< [OPTIONAL - More about interact](02.01-OPTIONAL-More-About-Interact.ipynb) | [Contents](00.00-index.ipynb) | [Widgets in the core ipywidgets package](04.00-widget-list.ipynb) >
# Simple Widget Introduction
## O que são widgets?
Widgets são objetos python que têm uma representação no navegador, ge... | github_jupyter |
```
%pylab inline
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import patches
```
# Read spreadsheet
```
df = pd.read_excel("../tests/test_data.xlsx")
df.keys()
```
## Select data
```
ts = df.timestamp.unique()[0]
dfs = df[df.timestamp==ts]
```
# Tracking
```
sns.lineplot(data=df... | github_jupyter |
```
'''
基于菜鸟教程中的 [NumPy 教程](https://www.runoob.com/numpy/numpy-tutorial.html)
'''
import numpy as np
np.eye(4)
a = np.array([1,2,3])
print (a)
a = np.array([[1, 2], [3, 4]])
print (a)
a = np.array([1, 2, 3,4,5], ndmin = 2)
print (a)
a = np.array([1, 2, 3], dtype = complex)
print (a)
dt = np.dtype(np.i... | github_jupyter |
# Stereo Images
```
import matplotlib.pyplot as plt
imA = plt.imread("StereoLeft.jpg")
imB = plt.imread("StereoRight.jpg")
```
## Setting up
```
import cameratransform as ct
cam1 = ct.Camera(ct.RectilinearProjection(focallength_px=3863.64, image=[4608, 2592]))
cam2 = ct.Camera(cam1.projection)
cam_group = ct.Came... | github_jupyter |
<a href="https://colab.research.google.com/github/cxbxmxcx/EvolutionaryDeepLearning/blob/main/EDL_6_5_Keras_GA.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Original source https://github.com/zinsmatt/Neural-Network-Numpy/blob/master/neural-networ... | github_jupyter |
# Predicting prices with a single-asset regression model
## Preparing the independent and target variables
```
from alpha_vantage.timeseries import TimeSeries
# Update your Alpha Vantage API key here...
ALPHA_VANTAGE_API_KEY = 'PZ2ISG9CYY379KLI'
ts = TimeSeries(key=ALPHA_VANTAGE_API_KEY, output_format='pandas')
df_... | github_jupyter |
# Training Neural Networks
The network we built in the previous part isn't so smart, it doesn't know anything about our handwritten digits. Neural networks with non-linear activations work like universal function approximators. There is some function that maps your input to the output. For example, images of handwritt... | github_jupyter |
**6장 – 결정 트리**
_이 노트북은 6장에 있는 모든 샘플 코드와 연습문제 해답을 가지고 있습니다._
<table align="left">
<td>
<a target="_blank" href="https://colab.research.google.com/github/rickiepark/handson-ml2/blob/master/06_decision_trees.ipynb"><img src="https://www.tensorflow.org/images/colab_logo_32px.png" />구글 코랩에서 실행하기</a>
</td>
</table>... | github_jupyter |
```
import requests
import json
URL="http://localhost:1234/v1/swagger.json"
r = requests.get(url = URL)
r
res=json.loads(r.content)
res["paths"].keys()
res["paths"]['/cyndex2/v1/networks/current']
res["paths"]
res["paths"]['/diffusion']["get"]
paths=res["paths"]
url_path='/v1/networks/{networkId}/groups/{groupNodeId}/c... | github_jupyter |
# Analyzing the UncertaintyForest Class by Reproducing Posterior Estimates
This set of four tutorials (`uncertaintyforest_running_example.ipynb`, `uncertaintyforest_posteriorestimates.ipynb`, `uncertaintyforest_conditionalentropyestimates.ipynb`, and `uncertaintyforest_mutualinformationestimates.ipynb`) will explain t... | github_jupyter |
# Quantitative Exercise
The goal of this notebook is to practice quantitative data analysis using Numenta Anomaly Benchmark (NAB) dataset on Streaming Outlier Detection algorithm, in particular on SPOT (add reference). We will use three different datasets comprising of data retrieved from real world.
```
import panda... | github_jupyter |
```
from google.colab import drive
drive.mount('/content/gdrive')
import os
os.chdir('/content/gdrive/My Drive/finch/tensorflow2/text_matching/ant/main')
%tensorflow_version 2.x
!pip install tensorflow-addons
from sklearn.metrics import classification_report
import json
import tensorflow as tf
import tensorflow_addons... | github_jupyter |
```
%matplotlib inline
import tensorflow as tf
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn import metrics
from sklearn.model_selection import train_test_split
MAX_DOCUMENT_LENGTH = 100
VOCAB_SIZE = 20000
EMBEDDING_SIZE = 50
N_FILTERS = 10
N_CLASSES = 8
WINDOW_SIZE=20
FILTER_SHAP... | github_jupyter |
# Classification
*Supervised* machine learning techniques involve training a model to operate on a set of *features* and predict a *label* using a dataset that includes some already-known label values. You can think of this function like this, in which ***y*** represents the label we want to predict and ***X*** repres... | github_jupyter |
# Preprocessing
This notebook does the preprocessing for the dataset.
1. The bounding boxes and labels are extracted from the annotation files
2. The image, bounding box and label are grouped and accumulated in a list
3. For training, a train-validation split of 80/20 is done by shuffling the extracted training data ... | github_jupyter |
# Two modifications of mean-variance portfolio theory
#### Daniel Csaba, Thomas J. Sargent and Balint Szoke
#### December 2016
### Remarks about estimating means and variances
The famous **Black-Litterman** (1992) portfolio choice model that we describe in this notebook is motivated by the finding that with high o... | github_jupyter |
```
from __future__ import absolute_import, division, print_function, unicode_literals
try:
%tensorflow_version 2.x
except Exception:
pass
import tensorflow as tf
from tensorflow.keras.layers import Input, Dense
from tensorflow.keras.models import Model
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d im... | github_jupyter |
<a href='https://ai.meng.duke.edu'> = <img align="left" style="padding-top:10px;" src=https://storage.googleapis.com/aipi_datasets/Duke-AIPI-Logo.png>
# Boilerplate for running projects in Google Colab
```
# Run this cell only if working in Colab
# Connects to any needed files from GitHub and Google Drive
import os
i... | github_jupyter |
```
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation, rc
from IPython.display import HTML
%matplotlib inline
```
#Configurable parameters for pure pursuit
+ How fast do you want the robot to move? It is fixed at $v_{max}$ in this exercise
+ When can we declare the goal has been reac... | github_jupyter |
<div style="width: 100%; overflow: hidden;">
<div style="width: 150px; float: left;"> <img src="data/D4Sci_logo_ball.png" alt="Data For Science, Inc" align="left" border="0" width=160px> </div>
<div style="float: left; margin-left: 10px;"> <h1>Epidemiology 201</h1>
<h1>Social Networks</h1>
<p>Bruno Gonç... | github_jupyter |
# Setting Up Git
## Overview
- **Teaching:** 5 min
- **Exercises:** 0 min
**Questions**
- How do I get set up to use Git?
**Objectives**
- Configure git the first time it is used on a computer.
- Understand the meaning of the --global configuration flag.
First you will need to launch a terminal, e.g. see setup. Fo... | github_jupyter |
```
# %matplotlib
# !git reset master --hard && git pull
# !wget http://www.openslr.org/resources/12/dev-clean.tar.gz
# !tar -zxf dev-clean.tar.gz
# !wget https://raw.githubusercontent.com/pyannote/pyannote-audio/develop/tutorials/data_preparation/download_ami.sh
# !mkdir ami
# !bash download_ami.sh ami
# !wget https:/... | github_jupyter |
# Convert CIF to JCPDS
* This notebook shows how to calculate a theoretical diffraction pattern using `pymatgen`.
* This also aims to show how to read `CIF` files, convert them to `JCPDS`.
* Some `jcpds` files can be downloaded from: https://github.com/SHDShim/JCPDS
```
%matplotlib inline
```
## What is CIF fil... | github_jupyter |
# Continuous training with TFX and Google Cloud AI Platform
## Learning Objectives
1. Use the TFX CLI to build a TFX pipeline.
2. Deploy a TFX pipeline version with tuning enabled to a hosted AI Platform Pipelines instance.
3. Create and monitor a TFX pipeline run using the TFX CLI and KFP UI.
In this lab, you us... | github_jupyter |
# 量子编译简介
本文档介绍 *Qubiter* 所用的正余弦分解(CSD, Cosine-Sine decomposition)量子编译器及其性能。
量子编译器指以任意 $N=2^n$ 维的幺正矩阵 $U$ 作为输入,能够输出等价于矩阵 $U$ 的基本操作序列(比如 CNOT 受控反门和单量子比特旋转门)的计算机程序,可以有很多种。通常幺正矩阵 $U$ 的形式为 $U=e^{-itH}$,其中 $t$ 和 $H$ 分别代表时间和哈密顿算符。在物理学和量子化学领域中,$H$ 的具体形式往往可以先验已知,通常的做法是用 Trotter-Suzuki 近似对 $U$ 进行展开。而在人工智能等领域,哈密顿量 $H$ 的具体形式一般不能... | github_jupyter |
# 【課題】高エネルギー実験で生成された荷電粒子の飛跡を見つける
この課題では、変分量子固有値ソルバー法を物理実験に応用することを考えてみます。特に高エネルギー物理の実験に着目し、その必須技術である「**荷電粒子飛跡の再構成**」を変分量子固有値ソルバー法を使って実現することを目指します。
```{contents} 目次
---
local: true
---
```
## はじめに
**変分量子固有値ソルバー法**(*Variational Quantum Eigensolver*, VQE)を紹介した{doc}`ノートブック <vqe>`で、VQEの考え方と変分量子回路の基本的な実装の方法を学びました。ここでは、VQEの... | github_jupyter |
# How to Understand and Manipulate the Periodogram of an Oscillating Star
---
## Learning Goals
By the end of this tutorial you will:
- Understand the key features of periodograms of oscillating stars.
- Understand how these features change depending on the type of star being studied.
- Be able to manipulate the per... | github_jupyter |
# Iris classification in Keras
Author: Michał Słapek
Classification example for Iris dataset.
```
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import keras
from keras.models import Sequential
from keras.layers import Dense
from utils import get_iris_data
from pl... | github_jupyter |
# Table of Contents
* [Intro](#Intro)
* [Generative Adversarial Networks (GANs)](#Generative-Adversarial-Networks-%28GANs%29)
* [Gaussian Distribution Approximation (Keras)](#Gaussian-Distribution-Approximation-%28Keras%29)
* [MNIST GAN (Keras)](#MNIST-GAN-%28Keras%29)
* [Generator Model](#Generator-Model)
* [Discri... | github_jupyter |
# Unary Operators
## WHEN X AND +X ARE NOT EQUAL
```
import decimal
ctx = decimal.getcontext()
ctx.prec = 40
one_third = decimal.Decimal('1') / decimal.Decimal('3')
one_third
one_third == +one_third
ctx.prec = 28
one_third == +one_third
+one_third
from collections import Counter
ct = Counter('abracadabra')
ct
ct['r']... | github_jupyter |
> Texto fornecido sob a Creative Commons Attribution license, CC-BY. Todo o código está disponível sob a FSF-approved BSD-3 license.<br>
> (c) Original por Lorena A. Barba, Gilbert F. Forsyth em 2017, traduzido por Felipe N. Schuch em 2020.<br>
> [@LorenaABarba](https://twitter.com/LorenaABarba) - [@fschuch](https://tw... | github_jupyter |
### Deliverable 1: Preprocessing the Data for a Neural Network
```
# Import our dependencies
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler,OneHotEncoder
import pandas as pd
import tensorflow as tf
# Import and read the charity_data.csv.
import pandas as pd
app... | github_jupyter |
# Factor Risk Exposure
By Evgenia "Jenny" Nitishinskaya, Delaney Granizo-Mackenzie, and Maxwell Margenot.
Part of the Quantopian Lecture Series:
* [www.quantopian.com/lectures](https://www.quantopian.com/lectures)
* [github.com/quantopian/research_public](https://github.com/quantopian/research_public)
---
##DISCL... | github_jupyter |
## Dependencies
```
import json, glob
from tweet_utility_scripts import *
from tweet_utility_preprocess_roberta_scripts_aux import *
from transformers import TFRobertaModel, RobertaConfig
from tokenizers import ByteLevelBPETokenizer
from tensorflow.keras import layers
from tensorflow.keras.models import Model
```
# L... | github_jupyter |
# sell-short-in-may-and-go-away
see: https://en.wikipedia.org/wiki/Sell_in_May
The reason for this example is to demonstrate short selling (algo), and short selling using adjust_percent function (algo2).
algo - Sell short in May and go away, buy to cover in Nov
algo2 - first trading day of the month, adjust pos... | github_jupyter |
```
from awesome_panel_extensions.awesome_panel.notebook import Header
Header(folder="examples/reference/frameworks/fast", notebook="FastTextInput.ipynb")
```
# Fast TextInput - Reference Guide
The `FastTextInput` widget is based on the [fast-text-field](https://explore.fast.design/components/fast-text-field) web com... | github_jupyter |
```
# !pip install efficientnet-pytorch sklearn
import argparse
import os
import random
import time
from collections import OrderedDict
import numpy as np
import torch
import torchvision
from PIL import Image
from torch import nn
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.data.sam... | github_jupyter |
# Vehicle's Market Price - EDA
This is the **E**xploratory **D**ata **A**nalysis for the vehicle's market price dataset. In this analysis, we are going to analyze the different variables of the model in relation to the vehicle's prices for a better understanding of the dataset.
Here are the steps of the analysis:
##... | github_jupyter |
If we have smaller data it can be useful to benefit from k-fold cross-validation to maximize our ability to evaluate the neural network's performance. This is possible in Keras because we can "wrap" any neural network such that it can use the evaluation features available in scikit-learn, including k-fold cross-validat... | github_jupyter |
```
import astropy.units as u
import numpy as np
from matplotlib import pyplot as plt
from astroduet.bbmag import bb_abmag_fluence, bb_abmag
import astroduet.config as config
from astroduet.background import background_pixel_rate
from astroduet.utils import duet_abmag_to_fluence
%load_ext autoreload
%autoreload 2
f... | github_jupyter |
```
import sys; sys.path.append(_dh[0].split("knowknow")[0])
from knowknow import *
wos_base = "G:/My Drive/projects/qualitative analysis of literature/pre 5-12-2020/009 get everything from WOS"
basedir = Path(wos_base)
from csv import DictReader
# This cell ensures there are not overflow errors while importing large ... | github_jupyter |
```
def mySpindleStats(edf_path,stages_path):
# Programmed by Mohsen Naji, Aug 2018
# Email me if you need to know the detection method
# output is spindle-related stats such as numbers and densities
# This function detects the sleep spindles in the re-referenced high density EEG
# After callin... | 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 |
# NumPy
http://www.numpy.org/
* Vamos começar convertendo uma lista de Python em um Numpy Array.
```
lista = [1,2,3,4,5]
lista
import numpy as np
#Por convenção, importamos numpy como np.
np.array(lista)
arr = np.array(lista)
```
Agora possuímos um NumPy Array, que é mais sofisticado que uma lista comum.
```
arr
... | github_jupyter |
# Fluxing with PYPIT [v2]
```
%matplotlib inline
# import
from importlib import reload
import os
from matplotlib import pyplot as plt
import glob
import numpy as np
from astropy.table import Table
from pypeit import fluxspec
from pypeit.spectrographs.util import load_spectrograph
```
# For the standard User (Runnin... | github_jupyter |
## Simple neural network in plain Python
This notebook implements a simple neural network architecture that can map $2$ dimensional input vectors onto binary output values. Our network will have $2$ input neurons, one hidden layer with $6$ hidden neurons and an output layer with $1$ output neuron.
We will represent... | github_jupyter |
# Writing Functions
**Teaching**: 15min<br>
**Exercises**: 5min
## Break down programs into functions
* Readability: human beings can only keep a few items in working memory at a time. Encapsulate complexity so that we can treat it as a single “thing”.
* Reuse: write one time, use many times.
* Testing: components wit... | github_jupyter |
# Homework pandas
<table align="left">
<tr>
<td><a href="https://colab.research.google.com/github/airnandez/numpandas/blob/master/exam/2020-exam.ipynb">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
</a></td>
<td><a href="https://mybinder.org/v2/gh/airnandez/nu... | github_jupyter |
## First, let's install and import all required libraries
```
#!pip install -r requirements.txt
import collections #This library adds some extras to the standard python data structures
import folium #Great library for plotting data on maps
import json ... | github_jupyter |
### Web scrapping. Load table from website. NOTE: Clean data is loaded later in case website is no longer available.
### Team Name
```
team_name = 'Rams'
#https://www.coursera.org/learn/python-plotting/discussions/weeks/4/threads/yMT7zw2KEeeqzRJFs29uDA
import pandas as pd
from IPython.display import display, HTML
... | github_jupyter |
# multi-band constraints for HEB scenarios in TOI-837
```
import chronos as cr
import numpy as np
TEFF = 6047 #± 406
FEH = -0.065 #± 0.035
LOGG = 4.467 #± 0.01
RSTAR = 1.022 #±0.015
MSTAR = 1.118 #±0.011
LOG10AGE = np.log10(40e6)
DELTA_OBS_TESS = 0.004
import astropy.units as u
t.toi_params['Planet Radius (R_Earth)... | github_jupyter |
# Week 4: Multi-class Classification
Welcome to this assignment! In this exercise, you will get a chance to work on a multi-class classification problem. You will be using the [Sign Language MNIST](https://www.kaggle.com/datamunge/sign-language-mnist) dataset, which contains 28x28 images of hands depicting the 26 lett... | github_jupyter |
```
import numpy as np
import tensorflow as tf
import tensorflow.keras
import tensorflow.keras.backend as K
# import os
from tensorflow.keras.datasets import imdb
# import keras.backend as K
from tensorflow.keras.layers import Conv2D,Activation,BatchNormalization,UpSampling2D,Conv2DTranspose,MaxPooling1D, Embedding,Inp... | github_jupyter |
# Exp 110 analysis
See `./informercial/Makefile` for experimental
details.
```
import os
import numpy as np
from IPython.display import Image
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
import seaborn as sns
sns.set_style('ticks')
matplotlib.... | github_jupyter |
# Regression with Amazon SageMaker XGBoost algorithm
_**Single machine training for regression with Amazon SageMaker XGBoost algorithm**_
---
---
## Contents
1. [Introduction](#Introduction)
2. [Setup](#Setup)
1. [Fetching the dataset](#Fetching-the-dataset)
2. [Data Ingestion](#Data-ingestion)
3. [Training the X... | github_jupyter |
# Preprocessing and Feature Creation
In this notebook we import the data, preprocess the data and create features for supervised and unsupervised cross-lingual-information retrieval models.
## I. Import Data
In this section we import the English and German europarl datasets and combine them into a parallel sentence ... | github_jupyter |
```
%%configure -f
{
"executorMemory": "4g",
"driverMemory": "4g",
"executorCores": 4,
"driverCores": 2,
"numExecutors": 1
}
# For informational purposes,
# print the hostname of the container
# where the Spark driver is running
import subprocess
stdout = subprocess.check_output(
"... | github_jupyter |
```
%matplotlib inline
```
# Quantization Quickstart
Here is a four-minute video to get you started with model quantization.
.. youtube:: MSfV7AyfiA4
:align: center
Quantization reduces model size and speeds up inference time by reducing the number of bits required to represent weights or activations.
In NNI... | github_jupyter |
```
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
!pip install plotly
import plotly.express as px
r09 = pd.read_csv('https://raw.githubusercontent.com/PacktWorkshops/The-Data-Analysis-Workshop/master/Chapter08/Datasets/online_retail_II.csv')
r09.head()
r10 = pd.read_csv('h... | github_jupyter |
# Dano's CORVO & TPOT notebook
In this notebook, I will try and use TPOT to asses what traditional ML algorithms would be useful to predict cognitive performance from EEG data in Neurodoro
```
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import sklearn as sk
from os import walk
from os impo... | github_jupyter |
```
!git clone https://github.com/JoyPang123/RL-Explore-with-Own-made-Env.git
!mv RL-Explore-with-Own-made-Env/snake ./snake
!pip install -e snake
from collections import Counter
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as mp
from torch.distributions import Catego... | github_jupyter |
# ENV/ATM 415: Climate Laboratory
[Brian E. J. Rose](http://www.atmos.albany.edu/facstaff/brose/index.html), University at Albany
# Lecture 3: The Climate System and Climate Models
___________
## Contents
1. [The climate system and its interactions](#section1)
2. [Simulation versus Parameterization](#section2)
3. [... | github_jupyter |
```
# Some basic imports and setup
import numpy as np, numpy.random as nr, gym
import matplotlib.pyplot as plt
import time
np.set_printoptions(precision=3)
from robolearn.envs.frozen_lake import FrozenLakeEnv
class MDP(object):
"""
mdp.P is a two-level dict where the first key is the state and the second key is... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.