text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
```
from keras.callbacks import EarlyStopping, TensorBoard
from keras.layers import Input, Concatenate, Conv1D
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.models import Model
from sklearn.model_selection import StratifiedKFold, train_test_split
from tqdm import tqdm
import numpy as np
impo... | github_jupyter |
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
:
!wget https://github.co... | github_jupyter |
```
# !pip install category_encoders
# https://lambdaschool.github.io/ds/unit2/portfolio-project/ds14
# https://finance.yahoo.com/quote/GOLD/history?p=GOLD (Gold)
# GOLD (47B cap) has 15 more years of historical data than GLD, GDX, and GC=F
import pandas_datareader as web
import pandas as pd
import numpy as np
from ma... | github_jupyter |
# Собственные векторы, собственные значения. Разложение Шура и QR-алгоритм
## На прошлой лекции
- Матричное умножение
- Иерархия памяти
- BLAS
- Алгоритм Штрассена
- Вычисление QR разложения
## План на сегодня
- Собственные векторы и их приложения (PageRank)
- Круги Гершгорина
- Степенной метод вычисления собственн... | github_jupyter |
# Using multimetric experiments in SigOpt to identify multiple good solutions
If you have not yet done so, please make sure you are comfortable with the content in the [intro](multimetric_intro.ipynb) notebook.
Below we create the standard SigOpt [connection](https://sigopt.com/docs/overview/python) tool. If the `SI... | github_jupyter |
# Recurrent Neural Network to generate (predict) text data using Keras
* LSTM (Long Short-Term Memory) Network
* Code based on this article https://towardsdatascience.com/recurrent-neural-networks-by-example-in-python-ffd204f99470
* Data: full text of Alice in Wonderland taken from https://archive.org/stream/alicesadve... | github_jupyter |
```
import tensorflow as tf
import keras
import math
import numpy as np
import matplotlib.pyplot as plt
import time
import pickle as pkl
seed = 4
np.random.seed(seed)
cell_time = np.random.uniform(-2 * np.pi, 2 * np.pi, [1000, 1])
gene01_phase = np.random.uniform(0, 2 * np.pi, [1, 500])
gene01_time = np.random.normal... | github_jupyter |
# <center> Анализ данных на Python </center>
# Семинар 5. Словари да множества
Поговорим про словари, множества, хэш-таблицы и другие разные штуки!
# 1. Что такое Хэш-таблица?
Вы - продавец в магазине. Когда покупатель что-то у вас покупает, вы проверяете стоимость товара по книге.
```
book = [('яйца', 60), ('чай... | github_jupyter |
<h1>Using pre-trained embeddings with TensorFlow Hub</h1>
This notebook illustrates:
<ol>
<li>How to instantiate a TensorFlow Hub module</li>
<li>How to find pre-trained TensorFlow Hub modules for a variety of purposes</li>
<li>How to examine the embeddings of a Hub module</li>
<li>How one Hub module c... | github_jupyter |
```
%matplotlib notebook
from gamesopt.train import train, TrainConfig
from gamesopt.games import load_game, GameOptions, QuadraticGameConfig, GameType
from gamesopt.games.quadratic_games import make_random_matrix
from gamesopt.optimizer import load_optimizer, OptimizerOptions, OptimizerType
from gamesopt.optimizer.pr... | github_jupyter |
# <center><font color='MAROON'>Traffic Sign Recognition Classifier</font></center>
```
import pandas as pd
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from tqdm import tqdm
import seaborn as sns
import numpy as np
import os
import math
import keras
import wandb
```
## <font ... | github_jupyter |
# Expression of P(G_n) in terms of M_n and M_{n+2}
In this notebook we'll validate the expression for P(G_n) in terms of r,
b, and M_n and M_{n+2}
```
import numpy as np
from scipy.integrate import quad
import matplotlib.pyplot as pl
%matplotlib notebook
epsabs = 1e-12
epsrel = 1e-12
```
Here is the original express... | github_jupyter |
```
# Copyright (c) Facebook, Inc. and its affiliates.
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | github_jupyter |
# Assignment 2
##  Before you start working on this assignment please click File -> Save a Copy in Drive.
Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select ... | github_jupyter |
```
import tensorflow as tf
import numpy as np
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, Lambda, Conv2DTranspose, SeparableConv2D
from dataset import create_artifact_dataset
import matplotlib.pyplot as plt
%matplotlib inline
"""from tensorflow.keras.backend import set_... | github_jupyter |
```
#default_exp radar.config_v1
```
# radar.config_v1
The TI 1443/1843 radar firmware accepts a some commands over the serial port to configure the radar waveform.
This module parses these commands so that we can interperet and process the raw ADC readings correctly.
Futher details on this commands can be found in ... | github_jupyter |

Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
# Configuration
_**Setting up your Azure Machine Learning services workspace and configuring your n... | github_jupyter |
____
__Universidad Tecnológica Nacional, Buenos Aires__<br/>
__Ingeniería Industrial__<br/>
__Cátedra de Ciencia de Datos - Curso I5521 - Turno sabado mañana__<br/>
__Elaborado por: Nicolas Aguirre__
____
```
from google.colab import drive
drive.mount('/gdrive')
DRIVE_FOLDER = 'ClusterAI2020/'
CLASS_FOLDER = 'clase_02... | github_jupyter |
This script generates:
1) URIs for resources, i.e. entities found in Compact Memory by Tagme _that are also available in Judaicalink_.
2) URIs for references (mentions), each identifying a "spot" or a mention in Compact Memory.
See the documentation for more info.
```
import os, json, pickle
import urllib.parse
def ... | github_jupyter |
# Convolutional Variational Auto Encoder sample using tensorflow
tensorflow を利用して MNIST で CVAE を実行するサンプルです。
- [Convolutional Variational Autoencoder][tutorial]
[tutorial]: https://www.tensorflow.org/tutorials/generative/cvae
## 環境の確認
```
!cat /etc/issue
!free -h
!cat /proc/cpuinfo
!nvidia-smi
!python --version
fro... | github_jupyter |
# July 2021 CVE Data
This notebook will pull all [JSON Data](https://nvd.nist.gov/vuln/data-feeds#JSON_FEED) from the NVD and performs some basic data analysis of CVEd data.
## Getting Started
### Collecting Data
This cell pulls all JSON files from the NVD that we will be working with.
```
%%capture
!mkdir -p json... | github_jupyter |
# Missing Values Imputer
## Import Packages
```
import pandas as pd
from autoc.explorer import cserie,DataExploration
from autoc.utils.helpers import *
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline
matplotlib.style.use('ggplot')
import seaborn as sns
plt.rcParams['figu... | github_jupyter |
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# Challenge Notebook
## Problem: Determine whether there is a path between two nodes in a graph.
* [Constraints](#Constraints)
* [Test Ca... | github_jupyter |
```
import math
import numpy as np
import h5py
import matplotlib.pyplot as plt
import scipy
#from PIL import Image
from scipy import ndimage
import tensorflow as tf
from tensorflow.python.framework import ops
from cnn_utils import *
from sklearn.decomposition import PCA
from scipy.stats.mstats import zscore # This is t... | github_jupyter |
# OpenStreetMap: Historical Analysis
In this notebook, we analyze the evolution of OpenStreetMap availability through time from 2011 to 2018. More specifically, we are interested in the mapping trends related to the road network, the buildings footprints, and land use polygons.
## Imports & Parameters
```
import os
... | github_jupyter |
## Set up the dependencies
```
# for reading and validating data
import emeval.input.spec_details as eisd
import emeval.input.phone_view as eipv
import emeval.input.eval_view as eiev
# Visualization helpers
import emeval.viz.phone_view as ezpv
import emeval.viz.eval_view as ezev
# Analytics results
import emeval.metri... | github_jupyter |
<a href="https://colab.research.google.com/github/VHEX-LAB/VHEX-Tech/blob/main/client-iris.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Save/Load models
```
import joblib
from sklearn.linear_model import LogisticRegression
from sklearn import ... | github_jupyter |
```
import tensorflow as tf
import malaya_speech.augmentation.waveform as augmentation
import malaya_speech
from glob import glob
import random
import numpy as np
import IPython.display as ipd
np.seterr(all='raise')
files = glob('../youtube/clean-wav/*.wav')
random.shuffle(files)
len(files)
noises = glob('../noise-44... | github_jupyter |
```
"""This area sets up the Jupyter environment.
Please do not modify anything in this cell.
"""
import os
import sys
import time
# Add project to PYTHONPATH for future use
sys.path.insert(1, os.path.join(sys.path[0], '..'))
# Import miscellaneous modules
from IPython.core.display import display, HTML
# Set CSS sty... | github_jupyter |
```
###### Set Up #####
# verify our folder with the data and module assets is installed
# if it is installed make sure it is the latest
!test -e ds-assets && cd ds-assets && git pull && cd ..
# if it is not installed clone it
!test ! -e ds-assets && git clone https://github.com/lutzhamel/ds-assets.git
# point to the ... | github_jupyter |
# Mall Customers Clustering Analysis
> Learn about K-means clustering analysis
- toc: true
- badges: true
- comments: true
- categories: [clustering]
- image: images/mall-customer.jpg
**Installing the Libraries**
```
# for basic mathematics operation
import numpy as np
import pandas as pd
from pandas import plotti... | github_jupyter |
```
from __future__ import absolute_import, division, print_function
import pandas as pd
import os
import sys
import datetime
# import data analysis modules
import openbadge_analysis as ob
import openbadge_analysis.core
# Bokeh
from bokeh.io import output_notebook
from bokeh.charts import show
import openbadge_analy... | github_jupyter |
**Important: This notebook will only work with fastai-0.7.x. Do not try to run any fastai-1.x code from this path in the repository because it will load fastai-0.7.x**
# Intro to Random Forests
## About this course
### Teaching approach
This course is being taught by Jeremy Howard, and was developed by Jeremy along... | github_jupyter |
<a href="https://colab.research.google.com/github/b-whitman/DS-Unit-2-Linear-Models/blob/master/module3-ridge-regression/Ben_Whitman_213_assignment_regression_classification_3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Lambda School Data Scienc... | github_jupyter |
```
!nvidia-smi -L
import sys
sys.path.append('/content/drive/MyDrive/sign_language/lcrnet-v2-improved-ppi')
#from lcr_net_ppi_improved import LCRNet_PPI_improved
sys.path.append('/content/drive/MyDrive/sign_language/DOPE')
import gzip
import pickle
import sys, os
import argparse
import os.path as osp
from PIL import I... | github_jupyter |
# First steps with SYGMA
Prepared by Christian Ritter
A simple stellar population is a population of stars born out of the same gas cloud.
This notebook explains how the basic chemical evolution parameter lead to the ejecta of stellar matter.
We will use (artificial) yields out of pure h1 yields.
You can find the do... | github_jupyter |
```
import os
import sys
import gym
import eplus_env
import argparse
from numpy import genfromtxt
import numpy as np
import pickle
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
sys.path.append('../')
sys.path.append('../')
from diff_mpc import mp... | github_jupyter |
# EECS C106A HW 0: Python Intro
### EECS C106A: Introduction to Robotics, Fall 2019
# Introduction
We will be using the Python programming language for labs in EECS C106a. Some hw assignments will entail matrix calculations where Python will come in handy, but you are welcome to use something like Matlab instead. Thi... | github_jupyter |
# Read and write CSV files with pandas DataFrames
You can load data from a CSV file directly into a pandas DataFrame
```
import pandas as pd
```
## Reading a CSV file into a pandas DataFrame
**read_csv** allows you to read the contents of a csv file into a DataFrame
airports.csv contains the following:
Name,City... | github_jupyter |
## W3 - UNC Example:
Author: Chris Kennedy
```
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix, roc_curve, roc_auc_score, auc
from sklearn import tree
from sklearn.tree import export_graphviz
from graphviz import Source
```
### Data Preparation and... | github_jupyter |
# 1 - Введение в Pandas
**Pandas** это очень мощная библиотека с множеством полезных функций, ею можно пользаться много лет так и не использовав весь ее потенциал. Цель воркшопа ознакомить вас основами, это:
- Чтение и запись данных.
- Пониманимание разных типов данных в Pandas.
- Работа с текстовыми данными и tim... | github_jupyter |
```
%matplotlib inline
```
迁移学习教程
==========================
**作者**: `Sasank Chilamkurthy <https://chsasank.github.io>`_
这个教程将教你如何使用迁移学习训练你的网络.
你可以在 `cs231n 笔记 <http://cs231n.github.io/transfer-learning/>`__ 中
阅读更多有关迁移学习的信息.
引用自该笔记,
事实上, 很少有人从头(随机初始化)开始训练一个卷积网络, 因为拥有一个足够大的数据库是比较少见的.
替代的是, 通常会从一个大的数据集(例如 Im... | github_jupyter |
```
#import
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import seaborn as sns
#import lightgbm as lgb
from scipy import stats
import matplotlib.pyplot as plt
from numpy import mean
from numpy import std
import math
import scipy
from scipy.stats import stats... | github_jupyter |
# Week 8 worksheet: Numerical solution of hyperbolic PDEs
$$\newcommand{\vect}[1]{\bm #1}
\newcommand{\grad}{\nabla}
\newcommand{\pderiv}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\pdderiv}[2]{\frac{\partial^2 #1}{\partial #2^2}}
\newcommand{\deriv}[2]{\frac{\mathrm{d} #1}{\mathrm{d} #2}}
\newcommand{\Deriv}[3]{... | github_jupyter |
# MPC Tensor
### With Duet
In this tutorial we will show you how to perform secure multiparty computation with data you cannot see. There are three /notebooks:
* [POC-MPCTensor-Duet-Alice](POC-MPCTensor-Duet-Alice.ipynb). Alice will store data in his Duet server and will be available for the data-scientist.
* [POC-MPC... | github_jupyter |
### Set GPU clocks
```
!sudo nvidia-persistenced
!sudo nvidia-smi -ac 877,1530
from core import *
from torch_backend import *
```
### Network definition
```
def conv_bn(c_in, c_out, bn_weight_init=1.0, **kw):
return {
'conv': nn.Conv2d(c_in, c_out, kernel_size=3, stride=1, padding=1, bias=False),
... | github_jupyter |
```
# libraries
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Activation, Dropout, Flatten, Dense
from keras.preprocessing.image import ImageDataGenerator, img_to_array, load_img
import matplotlib.pyplot as plt
from glob import glob
train_path = r"******your training path ******"
t... | github_jupyter |
TSG090 - Yarn nodemanager logs
==============================
Steps
-----
### Parameters
```
import re
tail_lines = 2000
pod = None # All
container = "hadoop"
log_files = [ "/var/log/supervisor/log/nodemanager*.log" ]
expressions_to_analyze = [
re.compile(".{23} WARN "),
re.compile(".{23} ERROR ")
]
```
... | github_jupyter |
1. Import pandas; import TfidfVectorizer, split_train_test, confusion_matrix, classification_report, LogisticRegression from scikit-learn; and import yellowbrick
```
import warnings
from collections import Counter
import pandas as pd
import numpy as np
import sklearn
from sklearn.feature_extraction.text import Tfid... | github_jupyter |
# Machine Learning to Predict Earnings for Stocks: Neural Networks
**Hugh Donnelly, CFA**<br>
*AlphaWave Data*
**September 2021**
### Introduction
In this article, we are going to cover Neural Networks (NN). Let's begin by laying down the theoretical foundation of the algorithm.
Jupyter Notebooks are available on ... | github_jupyter |
# Some common 'tricks'
When modelling problems in ASP, it turns out that there are some 'tricks' that come in handy a lot of the time. Here we'll run through some of the most common of these tricks.
Let's start with setting up a function to print answer sets of a program:
```
import clingo
def print_answer_sets(pro... | github_jupyter |
```
# !pip3 install -r requirements.txt
# !pip install transformers
import pandas as pd
import numpy as np
import datetime
import time
import matplotlib.pyplot as plt
#import ipdb
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, classification_report
from sklearn.manifo... | github_jupyter |
```
import os
import numpy as np
from skimage.transform import resize, rescale
from skimage.io import imread, imsave, imread_collection
import matplotlib.pyplot as plt
%matplotlib inline
# imgs = imread_collection('../data/icons/*.png')
icons_dir = '/Users/universome/Downloads/chosen-icons'
imgs = [imread(f'{icons_dir... | github_jupyter |
```
import sys
sys.path.append('../scripts/')
from ideal_robot import *
from scipy.stats import expon, norm, uniform
class Robot(IdealRobot):
def __init__(self, pose, agent=None, sensor=None, color="black", \
noise_per_meter=5, noise_std=math.pi/60, bias_ra... | github_jupyter |
```
# If you run on colab uncomment the following line
#!pip install git+https://github.com/clementchadebec/benchmark_VAE.git
import torch
import torchvision.datasets as datasets
%load_ext autoreload
%autoreload 2
mnist_trainset = datasets.MNIST(root='../../data', train=True, download=True, transform=None)
train_data... | github_jupyter |
<a href="https://colab.research.google.com/github/aubricot/computer_vision_with_eol_images/blob/master/object_detection_for_image_cropping/multitaxa/multitaxa_split_train_test.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# Split EOL user crops da... | github_jupyter |
```
suppressWarnings(suppressPackageStartupMessages(library(ggplot2)))
suppressWarnings(suppressPackageStartupMessages(library(ggthemes)))
res.ips = read.csv("/nfs/leia/research/stegle/acuomo/mean/day0/all_expts/allresults.csv", row.names = 1)
res.mes = read.csv("/nfs/leia/research/stegle/acuomo/mean/mesendo_est_June20... | github_jupyter |
### Numba does something quite different
[Numba](http://numba.pydata.org/) is a library that enables just-in-time (JIT)
compiling of Python code. It uses the [LLVM](http://llvm.org/) tool chain to do
this. Briefly, what LLVM does takes an intermediate representation of your code
and compile that down to highly optimiz... | 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 torch
from torch import optim
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
from torch.autograd import Variable
from sklearn.preprocessing import OneHotEncoder
import os, math, glob, argparse
from utils.torch_utils import *
from utils.utils import *
from apa_predict... | github_jupyter |
# Data Manipulation in R using `dplyr`
## What is `dplyr`?
dplyr is a new package which provides a set of tools for efficiently manipulating datasets in R. dplyr is the next iteration of plyr , focussing on only data frames. With `dplyr` , anything you can do to a local data frame you can also do to a remote database ... | github_jupyter |
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\rightarrow$Run All).
Make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE", as we... | github_jupyter |
# Creating Vocubalary
```
import re
from collections import Counter
def createVocabulary(reviews):
vocabulary = []
for i in range(0,len(reviews)):
tweet2 = re.sub(r'^RT[\s]+', '', reviews[i])
# remove hyperlinks
tweet2 = re.sub(r'https?:\/\/.*[\r\n]*', '', tweet2)
# remove hashtags
# only rem... | github_jupyter |
```
import keras
from keras.models import Sequential, Model, load_model
from keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda
from keras.layers import Conv2D, MaxPooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, BatchNormalization, LocallyConnected2D, Permute
from keras.layers import Concat... | github_jupyter |
```
import csv
import json
import numpy as np
import colorspacious
ALL_NUM_COLORS = [6, 8, 10]
```
## Generate LaTeX markup for results table
```
with open("../aesthetic-models/top-cycles.json") as infile:
top_cycles = json.load(infile)
top_cycles = {int(i): top_cycles[i] for i in top_cycles}
npz = np.load("../co... | 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 |
```
import pickle
import os
import numpy as np
import pandas as pd
# pd.set_option('display.max_rows', None)
import matplotlib.pyplot as plt
import country_converter as coco
cc = coco.CountryConverter()
df_weights = pd.read_csv('../data/ref/parsed_intnt_pop.csv')
df_region = pd.read_csv('../data/ref/parsed_country_regi... | github_jupyter |
# 目标检测数据集
:label:`sec_object-detection-dataset`
目标检测领域没有像 MNIST 和 Fashion-MNIST 那样的小数据集。
为了快速测试目标检测模型,[**我们收集并标记了一个小型数据集**]。
首先,我们拍摄了一组香蕉的照片,并生成了 1000 张不同角度和大小的香蕉图像。
然后,我们在一些背景图片的随机位置上放一张香蕉的图像。
最后,我们在图片上为这些香蕉标记了边界框。
## [**下载数据集**]
包含所有图像和 csv 标签文件的香蕉检测数据集可以直接从互联网下载。
```
%matplotlib inline
import os
import pandas a... | github_jupyter |
# Entrainment-LF17
This notebook runs [GOTM](https://gotm.net/) simulating the entrainment of an initial mixed layer under various constant wind, waves, and destabilizing surface buoyancy flux forcing as described in [Li and Fox-Kemper, 2017](https://doi.org/10.1175/JPO-D-17-0085.1) (LF17). The idealized initial condi... | github_jupyter |
# Overview
This project is an implementation of the streaming, one-pass histograms described in Ben-Haim's [Streaming Parallel Decision Trees](http://jmlr.org/papers/volume11/ben-haim10a/ben-haim10a.pdf). The histograms act as an approximation of the underlying dataset. The histogram bins do not have a preset size, so... | github_jupyter |
```
# utilities
import pandas as pd
import numpy as np
from datetime import date
# figure plotting
from bokeh.io import show, curdoc
from bokeh.layouts import column, gridplot
from bokeh.models import ColumnDataSource, RangeTool, DatetimeTickFormatter, LabelSet
from bokeh.plotting import figure, show
# widgets
from ... | github_jupyter |
*Managerial Problem Solving*
# Tutorial 10 - Regression and Time Series Analysis
Toni Greif<br>
Lehrstuhl für Wirtschaftsinformatik und Informationsmanagement
SS 2019
```
library(tidyverse)
library(TTR)
library(forecast)
```
## Regression Analysis
Predict an economic quantity (=dependent variable) based on known ... | github_jupyter |
# What is Trend? #
The **trend** component of a time series represents a persistent, long-term change in the mean of the series. The trend is the slowest-moving part of a series, the part representing the largest time scale of importance. In a time series of product sales, an increasing trend might be the effect of a ... | github_jupyter |
# Chapter 10 - Turbo-charge your apps with advanced callback options
* Understanding State
* Creating components that control other components
* Allowing users to add dynamic components to the app
* Introducing pattern-matching callbacks
```
import plotly
import plotly.express as px
import plotly.graph_objects as ... | github_jupyter |
# QQQ vs DIA
### Entry Threshold: | Exit Threshold: 0.50 | Max Duration:
### MA Period: 30 | MA Type: SMA StdDev | Period: 30 | Total ROI: 128.91 % % | CAGR: 35.25 % % | Max. DD: 26.15 %
### Sharpe Ratio: 1.926
```
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
import mat... | github_jupyter |
```
# TODO add intro with objectives
# ## [markdown]
# Let's first load the data as we did in the previous notebook. TODO add link.
import pandas as pd
df = pd.read_csv("https://www.openml.org/data/get_csv/1595261/adult-census.csv")
# Or use the local copy:
# df = pd.read_csv('../datasets/adult-census.csv')
target_n... | github_jupyter |
# Using Python in HPC
Brian Skjerven
Marco DeLapierre
Maciej Cytowski

## Overview
* Python: The Good and the Bad
* Best Practices for Python in HPC
* Python Libraries
* Numerical (NumPy, SciPy)
* I/O (H5Py, PyTables)
* Machine Learning (PyTorch)
* Parallel Python
... | github_jupyter |
```
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from sparse_shift.plotting import plot_dag
import pickle
```
## DAGs in triangle MEC
```
with open("./dag_dict_all_triangles.pkl", "rb") as f:
dag_dict = pickle.load(f)
# Restrict to MEC
dag_dict = {
key: dag for... | github_jupyter |
```
import selenium
from time import sleep
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
driver=webdriver.Chrome('./chromedriver')
driver.get("https://tw.voicetube.com/")
```
https://www.itread01.com/content/1504789095.html
https://stackoverflow.com/questions/3560670... | github_jupyter |

# Chapter 5: Introduction to NumPy
<h2>Chapter Outline<span class="tocSkip"></span></h2>
<hr>
<div class="toc"><ul class="toc-item"><li><span><a href="#1.-Introduction-to-NumPy" data-toc-modified-id="1.-Introduction-to-NumPy-1">1. Introduction to NumPy</a></span></li><li><span><a href="#2.-Num... | 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 |
##### 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 |
# Finn's original architecture (with ReLU by default)
## DNA model
| Epoch | Loss |
|-------|------------|
| 0 | 0.00885869 |
| 1 | 0.00435413 |
| 2 | 0.00305164 |
| 3 | 0.00242613 |
| 4 | 0.0022955 |
| 5 | 0.00239393 |
| 6 | 0.00235859 |
| 7 | 0.00217946 |
| 8 | 0.00212445 ... | github_jupyter |
<a href="https://colab.research.google.com/github/tcardlab/optimus_bind_sample/blob/develop/notebooks/3_0_TJC_Cleaning_Code_While_No_Testing.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
**Open in Colab, gets cut off on github**
I'm reviewing and... | github_jupyter |
```
%matplotlib inline
import os
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import unicodedata
from os import path
matplotlib.style.use('ggplot')
pylab.rcParams['figure.figsize'] = 18, 10 # that's default image size for this interactive s... | github_jupyter |
## Image网 Submission `128x128`
This contains a submission for the Image网 leaderboard in the `128x128` category.
In this notebook we:
1. Train on 1 pretext task:
- Train a network to do image inpatining on Image网's `/train`, `/unsup` and `/val` images.
2. Train on 4 downstream tasks:
- We load the pretext weight... | github_jupyter |
# Environment: Python 3.5
```
from ast import literal_eval
from os import listdir
from os.path import isfile, join
from scipy.sparse import csr_matrix, load_npz, save_npz
from tqdm import tqdm
from sklearn.preprocessing import normalize
import seaborn as sns
import datetime
import json
import numpy as np
import panda... | github_jupyter |
```
% matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
import pandas
import torch, torch.utils.data, torchvision
import PIL
import os.path
import time
# import skimage, skimage.io
import time
import copy
from my_utils import *
MEAN = [0.485, 0.456, 0.406] # expected by pretrained resnet18
STD = [... | github_jupyter |
```
clean_up=True # removes gams-related files in work-folder if true
%run StdPackages.ipynb
os.chdir(py['main'])
import global_settings,ReadData,ShockFunction,Production,Household,GE,Invest,Trade,Government,diagnostics
from DataBase_wheels import small_updates
from gmspython import gmspython_i
os.chdir(curr)
data_fold... | github_jupyter |
# Operation on Qubits
## basic 1qubit operations
Here we start from the basic learing about quantum computing. If you haven't install blueqat SDK please install first.
```
!pip install blueqat
```
## Step1: Prepare basic circuit
To calculate on the quantum computer, we just make a circuit.
Let's import main component... | github_jupyter |
```
!pip install git+https://github.com/desi-bgs/bgs-cmxsv.git --upgrade --user
import numpy as np
import astropy.table as atable
import matplotlib.pyplot as plt
from bgs_sv import sv1
```
# read single exposures from Blanc reduction
Mike Wilson is currently running redrock outputs for single exposures
```
exps = s... | github_jupyter |
```
import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel
import pandas as pd
import random
import checklist
from checklist.editor import Editor
from checklist.expect import Expect
from checklist.pred_wrapper import PredictorWrapper
from checklist.test_types import MFT
from typing import List
import warn... | github_jupyter |
<a href="https://colab.research.google.com/github/unicamp-dl/IA025_2022S1/blob/main/ex01/Alexander_Valle/t1_IA025_1s22_Alexande_Valle.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
Esté um notebook Colab contendo exercícios de programação em python... | github_jupyter |
```
from attention import AttentionLayer
import numpy as np
import pandas as pd
import re
from bs4 import BeautifulSoup
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from nltk.corpus import stopwords
from tensorflow.keras.layers import Input, LSTM, Embedding, De... | github_jupyter |
# Double-checking FiveThirtyEight's 2016 Primary Predictions
Here I look at the [predictions that FiveThiryEight made](https://projects.fivethirtyeight.com/election-2016/primary-forecast/) about the 2016 Presidential Primaries.
## Loading the data
Load the data about their predictions and the actual outcomes into `p... | github_jupyter |
This example shows how to use a `SpectralMixtureKernel` module on an `ExactGP` model. This module is designed for
- When you want to use exact inference (e.g. for regression)
- When you want to use a more sophisticated kernel than RBF
Function to be modeled is $sin(2\pi x)$
The Spectral Mixture (SM) kernel was inven... | github_jupyter |
```
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from imblearn.over_sampling import SMOTE
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
from sklearn.model_selection import tra... | github_jupyter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.