text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` # default_exp models.ResCNN ``` # ResCNN > This is an unofficial PyTorch implementation by Ignacio Oguiza - oguiza@gmail.com based on: * Zou, X., Wang, Z., Li, Q., & Sheng, W. (2019). Integration of residual network and convolutional neural network along with various activation functions and global pooling for ti...
github_jupyter
``` # -*- coding: utf-8 -*- """ EVCのためのEV-GMMを構築します. そして, 適応学習する. 詳細 : https://pdfs.semanticscholar.org/cbfe/71798ded05fb8bf8674580aabf534c4dbb8bc.pdf This program make EV-GMM for EVC. Then, it make adaptation learning. Check detail : https://pdfs.semanticscholar.org/cbfe/71798ded05fb8bf8674580abf534c4dbb8bc.pdf """ ...
github_jupyter
``` import numpy as np # tensorflow2.0 import tensorflow as tf from tensorflow.keras import Input,Model from tensorflow.keras import layers from tensorflow.keras.layers import Flatten,Dense,Dropout,Conv2D from tensorflow.keras.datasets import mnist from tensorflow.keras import regularizers (x_train, _), (x_test, _) = ...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt import scipy.special import scipy.ndimage import scipy.optimize import sklearn.datasets from chmp.ds import mpl_set # helper for gradient checking def approximate_gradient(x, func, eps=1e-5): res = np.zeros(x.size) for i in range(x...
github_jupyter
``` import numpy as np import scipy import matplotlib.pyplot as plt from scipy.optimize import curve_fit from scipy.integrate import quad %matplotlib inline x = np.array([ 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10. ]) y = np.array([3.43, 4.94, 6.45, 9....
github_jupyter
# Multiple Kernel Learning #### By Saurabh Mahindre - <a href="https://github.com/Saurabh7">github.com/Saurabh7</a> This notebook is about multiple kernel learning in shogun. We will see how to construct a combined kernel, determine optimal kernel weights using MKL and use it for different types of [classification](h...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/relational_operators.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" h...
github_jupyter
## MNIST Training with MXNet and Gluon MNIST is a widely used dataset for handwritten digit classification. It consists of 70,000 labeled 28x28 pixel grayscale images of hand-written digits. The dataset is split into 60,000 training images and 10,000 test images. There are 10 classes (one for each of the 10 digits). T...
github_jupyter
<a href="https://colab.research.google.com/github/pascalhuszar/ner-benchmark/blob/master/Flair%20trained%20on%20multiple%20embeddings.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Walktrough Flair Framework using Conll_03, GermEval_14 as dataset...
github_jupyter
## Boosted regression trees Trying boosted regression trees in the gbm package, including lag and lead for all variables except depth. [This is me](https://www.linkedin.com/in/%C3%B8ystein-s%C3%B8rensen-4a877831/) ## Data load ``` trainingData <- read.csv("../training_data.csv") testData <- read.csv("../validation_d...
github_jupyter
``` import numpy as np import pandas as pd import torch import torch.nn as nn import matplotlib.pyplot as plt import seaborn as sns from torch.utils.data import TensorDataset, DataLoader from sklearn.model_selection import LeaveOneOut, StratifiedKFold from sklearn.metrics import mean_squared_error, r2_score from sklear...
github_jupyter
# Credit Risk Resampling Techniques ``` import warnings warnings.filterwarnings('ignore') import numpy as np import pandas as pd from pathlib import Path from collections import Counter ``` # Read the CSV and Perform Basic Data Cleaning ``` columns = [ "loan_amnt", "int_rate", "installment", "home_ownership", ...
github_jupyter
# Linking Plots Using Fast Interval Selector Details on how to use the fast interval selector can be found in [this](../Interactions/Selectors.ipynb#fastintervalselector) notebook. In this tutorial notebook, we will look at linking plots using the fast interval selector. Interval selectors are ideally suited for time ...
github_jupyter
``` import os from matplotlib import pylab as plt from os import path from numpy import array, maximum, minimum, median import numpy %matplotlib inline plt.style.use(['dark_background', 'bmh']) plt.rc('axes', facecolor='k') plt.rc('figure', facecolor='k') plt.rc('figure', figsize=(20,5)) N = 20 seeds = [i for i in rang...
github_jupyter
<img alt="Colaboratory logo" height="45px" src="https://colab.research.google.com/img/colab_favicon.ico" align="left" hspace="10px" vspace="0px"> <h1>Welcome to Colaboratory!</h1> Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. With Colaboratory you can writ...
github_jupyter
# NetworKit User Guide ## About NetworKit [NetworKit][networkit] is an open-source toolkit for high-performance network analysis. Its aim is to provide tools for the analysis of large networks in the size range from thousands to billions of edges. For this purpose, it implements efficient graph algorithms, many of th...
github_jupyter
<a href="https://colab.research.google.com/github/peterpaohuang/Facebook-College-Scraper/blob/master/357_FINAL.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` [Quiz 1](https://www.notion.so/Quiz-1-b6c1b4eb40314c3086fe65300976124f) https://colab....
github_jupyter
![Astrofisica Computacional](../logo.png) --- # 01. Introduction to `NumPy` Eduard Larrañaga (ealarranaga@unal.edu.co) --- ### About this notebook In this notebook we present an introduction to the `numpy` package. --- ``` import numpy as np import sys print(f"Python version: {sys.version}\n" f"NumPy ve...
github_jupyter
<a href="https://colab.research.google.com/github/anantshahi/GoogleColab/blob/main/GPT2_vs_XLnet_vs_BERT.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #What this is about? This colab noteboook will give you a POC for industrial standard Abstractiv...
github_jupyter
## PHYS 105A: Introduction to Scientific Computing # Integration of Differential Equations III Chi-kwan Chan ## Newton's Second Law is an ordinary differential equation (ODE) * Given this is an introduction to computational physics course, we are interested in solving, e.g., Newton's equation: $m \frac{d^2 x}{d...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.decomposition import PCA import os print('Start Parsing.\nParsing year 2020') data=pd.read_csv('../raw/players_20.csv') restr=data[0:4000] restr['player_url'].to_csv('../data/urlsTemp.csv',index=False) restr=restr[['sofifa_id','short_name','age','nationality','ove...
github_jupyter
# 【課題】量子相関を調べる 第一回の実習ではCHSH不等式の破れを調べるために、2つの量子ビットの相関関数$C^{i} \, (i=0,1,2,3)$という量を量子コンピュータを使って計算しました。この課題では、この量をもう少し細かく調べてみましょう。 ```{contents} 目次 --- local: true --- ``` $\newcommand{\ket}[1]{|#1\rangle}$ $\newcommand{\bra}[1]{\langle#1|}$ ## QCシミュレータの使い方 実習で見たように、QCで実現される量子状態は、量子力学の公理に基づいて理論的に計算・予測できます。そこで用いられる数学的...
github_jupyter
# Analysis of Oscar-nominated Films ``` import re import numpy as np import pandas as pd import scipy.stats as stats pd.set_option('display.float_format', lambda x: '%.3f' % x) %matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sb sb.set(color_codes=True) sb.set_palette("m...
github_jupyter
``` from z3 import * import numpy as np from itertools import combinations from typing import Sequence from tqdm.notebook import tqdm ``` Read instance file: ``` input_filename = '../../Instances/20x20.txt' w, h, n, DX, DY = None, None, None, None, None with open(input_filename, 'r') as f_in: lines = f_in.read(...
github_jupyter
``` import numpy as np from matplotlib import pyplot as plt %matplotlib inline #theano imports import lasagne import theano import theano.tensor as T import sys sys.setrecursionlimit(100000) floatX = theano.config.floatX %load_ext autoreload %autoreload 2 ``` # Stack-augmented RNN ![caption](https://usercontent1.hub...
github_jupyter
# Introduction to TensorFlow Welcome to this week's programming assignment! Up until now, you've always used Numpy to build neural networks, but this week you'll explore a deep learning framework that allows you to build neural networks more easily. Machine learning frameworks like TensorFlow, PaddlePaddle, Torch, Caf...
github_jupyter
``` import dask import dask.dataframe as dd import warnings import datetime import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import category_encoders as ce from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split, StratifiedKFol...
github_jupyter
Audio is taken as input and converted to a spectrogram with... * 80 frequency bins * Song data organized into 10 ms slices * So each matrix is has shape (80, song length / 10ms) * 70 ms of empty data appended and 70ms prepended * The algorithm will consider 70ms before and 70ms after each 10ms time step This ...
github_jupyter
# Read & clean the gaia (r = 3.5) sample ``` # For Sky Plots se: http://docs.astropy.org/en/stable/visualization/wcsaxes/ticks_labels_grid.html import numpy as np import matplotlib.pyplot as plt from astropy import constants as const from astropy import units as u from astropy.table import Table, join, vstack, hstack,...
github_jupyter
# Actively learned model for an ensemble of heteroscedastic regression with offline query comparison to baseline. ``` import sys sys.path.append("../../") %matplotlib inline from uq360.algorithms.actively_learned_model import ActivelyLearnedModel from uq360.algorithms.ensemble_heteroscedastic_regression import Ensem...
github_jupyter
In this notebook, we will explore learn about the WhyLogs Python library and the resulting profile summaries. # Getting Started with WhyLogs Profile Summaries We will first read in raw data into Pandas from file and explore that data briefly. To run WhyLogs, we will then import the WhyLogs library, initialize a logg...
github_jupyter
RQ4 - How prevalent are code smells in Dockerfiles? ============== # Dependencies and Configurations ## Import Dependencies ``` import numpy as np import pandas as pd from scipy import stats import itertools from datetime import datetime import time import matplotlib.pyplot as plt import matplotlib.dates as mdate im...
github_jupyter
# Tabular Time Series Related API Demo with NOAA Weather Data Copyright (c) Microsoft Corporation. All rights reserved. <br> Licensed under the MIT License. In this notebook, you will learn how to use the Tabular Time Series related API to filter the data by time windows for sample data uploaded to Azure blob storage...
github_jupyter
# Spark RDD Command Note **Outline** * [Intro](#intro) * [Spark RDD API](#rdd) --- # <a id='intro'>Intro</a> Spark has two different kinds of APIs * **APIs** * RDD API: lower level, we should use this when we deal with unstructured data * DataFrame API: can be related to pandas dataframe in python. ...
github_jupyter
# Gradient Checking Welcome to the final assignment for this week! In this assignment you will learn to implement and use gradient checking. You are part of a team working to make mobile payments available globally, and are asked to build a deep learning model to detect fraud--whenever someone makes a payment, you w...
github_jupyter
<style>div.container { width: 100% }</style> <img style="float:left; vertical-align:text-bottom;" height="65" width="172" src="../assets/holoviz-logo-unstacked.svg" /> <div style="float:right; vertical-align:text-bottom;"><h2>Tutorial 5. Composing Plots</h2></div> So far we have generated plots using [hvPlot](http://...
github_jupyter
# SLU1 - Pandas 101: Exercise notebook ``` import pandas as pd ``` In this notebook the following is tested: - Pandas Series - Pandas DataFrames - Adding columns to a dataframe - Printing the columns - Load a dataset - Preview a dataframe - Make use of info, describe and shape ## Useful information | Country ...
github_jupyter
# How a squashing function can effect feature importance The importance of a feature in a machine learning model can change significantly when you use a non-linear function to transform the model's output. The most common type of transformation where this matters is the use of a "squashing" function. Squashing functio...
github_jupyter
## Dependencies ``` from tweet_utility_scripts import * from transformers import TFBertModel, BertConfig from tokenizers import BertWordPieceTokenizer from tensorflow.keras.models import Model from tensorflow.keras.layers import Dense, Input, Dropout, GlobalAveragePooling1D, GlobalMaxPooling1D, Concatenate ``` # Load...
github_jupyter
``` import numpy as np from keras.models import Model from keras.layers import Input from keras.layers.convolutional import ZeroPadding1D from keras import backend as K import json from collections import OrderedDict def format_decimal(arr, places=6): return [round(x * 10**places) / 10**places for x in arr] DATA = ...
github_jupyter
# Direct Marketing with Amazon SageMaker Autopilot Kernel `Python 3 (Data Science)` works well with this notebook. ## Contents 1. [Introduction](#Introduction) 1. [Prerequisites](#Prerequisites) 1. [Downloading the dataset](#Downloading) 1. [Upload the dataset to Amazon S3](#Uploading) 1. [Setting up the SageMaker A...
github_jupyter
# Variational Inference in Stan Variational inference is a scalable technique for approximate Bayesian inference. Stan implements an automatic variational inference algorithm, called Automatic Differentiation Variational Inference (ADVI) which searches over a family of simple densities to find the best approximate po...
github_jupyter
# Introduction For each brain structure, we'll plot how similar its assigned mental functions are from cluster to cluster. # Load the data ``` import pandas as pd import numpy as np np.random.seed(42) import sys sys.path.append("..") from ontology import ontology from style import style framework = "data-driven" ...
github_jupyter
# Open data studio [Open data studio](https://open-datastudio.io) is a managed computing service on [Staroid](https://staroid.com). Run your machine learning and large scale data processing workloads without managing clusters and servers. [ods](https://github.com/open-datastudio/ods) library makes it easy to use in a...
github_jupyter
##### Copyright 2019 The TensorFlow Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@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.o...
github_jupyter
<h1> Challenge Solution: Getting started with TensorFlow </h1> ## Challenge Exercise Use TensorFlow to find the roots of a fourth-degree polynomial using [Halley's Method](https://en.wikipedia.org/wiki/Halley%27s_method). The five coefficients (i.e. $a_0$ to $a_4$) of <p> $f(x) = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + a...
github_jupyter
# Refactoring *A pattern for evolution of code* Scott Hendrickson<br> 2016 April 29 ## What is refactoring? Code refactoring is the process of restructuring existing computer code—changing the factoring—without changing its external behavior. - wikipedia ### Maybe an illustration about two work streams. ...
github_jupyter
``` # Necessary imports for the notebook import requests import pandas as pd import altair as alt import random as r import datetime as dt ``` #Premise of Notebook This exploratory notebook will explore increasingly granular levels of visualization, utilizing Altair for its high customizability and functionality, as w...
github_jupyter
# Collaborative filtering on the MovieLense Dataset ## Learning Objectives 1. Know how to build a BigQuery ML Matrix Factorization Model 2. Know how to use the model to make recommendations for a user 3. Know how to use the model to recommend an item to a group of users ###### This notebook is based on part of Chapte...
github_jupyter
<a href="https://colab.research.google.com/github/SimeonHristov99/ML_21-22/blob/main/ann_mnist.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # MNIST Digit Classification Challenge - Goal: Classify handwritten digits - Type: Multiclass classificati...
github_jupyter
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a> $ \newcommand{\bra}[1]{\langle #1|} $ $ \newcommand{\ket}[1]{|#1\rangle} $ $ \newcommand{\braket}[2]{\langle #1|#2\rangle} $ $ \newcommand{\dot}[2]{ #1 \cdot #2} $ $ \newcommand{\biginner}[2]{\left\langle...
github_jupyter
# TensorFlow In this notebook, we'll learn the basics of [TensorFlow + Keras](https://tensorflow.org), which is a machine learning library used to build dynamic neural networks. We'll learn about the basics, like creating and using Tensors. <div align="left"> <a href="https://github.com/madewithml/basics/blob/master/...
github_jupyter
``` # default_exp liquor ``` # VS Liquor Data Intake and Operations > This notebook uses data to generate a portion of BNIA's Vital Signs report. This colab and more can be found at https://github.com/BNIA/vitalsigns. ## Whats Inside?: ### __The Guided Walkthrough__ This notebook was made to create the following ...
github_jupyter
# 人脸区域及关键点检测 本案例使用`dlib`工具库进行人脸区域检测和人脸关键点(68个点)检测。 - 对图片中的人脸进行区域和关键点的检测 - 对视频中的人脸进行区域和关键点的检测 `dlib`官网: http://dlib.net/. `dlib`是一个机器学习工具库,类似OpenCV,里面预置了一些开发好的传统机器学习算法和深度学习算法。 ### 进入ModelArts 点击如下链接:https://www.huaweicloud.com/product/modelarts.html , 进入ModelArts主页。点击“立即使用”按钮,输入用户名和密码登录,进入ModelArts使用页面。 ### 创建Mode...
github_jupyter
# Plotting Pandapower Networks Without Geographical Information If a network does not have geographic coordinates, you can create generic coordinates for plotting with the create_generic_coordinates function. ###### You need to install the python-igraph package for this functionality: http://igraph.org/python/ ``` i...
github_jupyter
** Labs28 Notebook for creating merged dataset.** ``` # Install newspaper3k for article parser ! pip3 install newspaper3k import pandas as pd import numpy as np from bs4 import BeautifulSoup from collections import Counter from newspaper import Article import json import re import requests import spacy from spacy.tok...
github_jupyter
# Loading and Saving ## Loading ### mzML To accommodate disparate instrument types and manufacturers (e.g. Bruker, Waters, Thermo, Agilent), DEIMoS operates under the assumption that input data are in an open, standard format. As of this publication, the accepted file format for DEIMoS is mzML (or mzML.gz), which co...
github_jupyter
# Семинар 1 - Первичный анализ данных, визуализация, etc. __Источник данных:__ [https://opendata.socrata.com/](https://opendata.socrata.com/Government/Airplane-Crashes-and-Fatalities-Since-1908/q2te-8cvq) __Dataset:__ Airplane Crashes and Fatalities Since 1908 Содержит полную историю авиакатастроф по всему миру, с ...
github_jupyter
``` import pandas as pd import numpy as np import re import os URL_web = 'https://github.com/alik604/eminem_lyrics_generator/raw/master/data/preprocessed_data_eminem.csv' URL_local = './data/preprocessed_data_eminem.csv' lines = pd.read_csv(URL_web,index_col=0) def clean_text(sentence): sentence = sentence.lower() ...
github_jupyter
# Classification Test Here we're testing the possible models for data classification on this project. ``` import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit ``` ## 1. Water Required vs. Temperature data Manually sampled values: ``` t = np.array([15., 20., 25., 30., 35., 40.]...
github_jupyter
# MNIST: convolutional neural networks We define and train a convolutional neural network (CNN) model to recognize handwritten digits. Although CNNs can be used in many contexts, they are probably most often used in the context of image processing. ## Required imports ``` import keras from keras import backend as K...
github_jupyter
# First steps through pyiron This section gives a brief introduction about fundamental concepts of pyiron and how they can be used to setup, run and analyze atomic simulations. As a first step we import the libraries [numpy](http://www.numpy.org/) for data analysis and [matplotlib](https://matplotlib.org/) for visuali...
github_jupyter
# Fine-tune with Pre-trained Models Many of the exciting deep learning algorithms for computer vision require massive datasets for training. The most popular benchmark dataset, [ImageNet](http://www.image-net.org/), for example, contains one million images from one thousand categories. But for any practical problem,...
github_jupyter
# Goal * Select genomes for primer design # Var ``` work_dir = '/ebio/abt3_projects/software/dev/ll_pipelines/llprimer/experiments/christensenella/genbank' ``` # Init ``` library(dplyr) library(tidyr) library(ggplot2) library(LeyLabRMisc) df.dims() ``` # genome download ``` ncbi-genome-download -p 12 -s genbank ...
github_jupyter
<div> <img src="https://drive.google.com/uc?export=view&id=1vK33e_EqaHgBHcbRV_m38hx6IkG0blK_" width="350"/> </div> #**Artificial Intelligence - MSc** ET5003 - MACHINE LEARNING APPLICATIONS ###Instructor: Enrique Naredo ###ET5003_traffic_sign # Introduction [Classification](https://towardsdatascience.com/machine-l...
github_jupyter
``` import cv2 import matplotlib.pyplot as plt from time import sleep import numpy as np def show_img(img, size=(15, 15)): plt.figure(figsize=size) if len(img.shape) == 2: plt.gray() plt.imshow(img) else: plt.imshow(img[:, :, ::-1]) plt.show() def play_video(video_path...
github_jupyter
``` %matplotlib inline ``` # Image denoising using dictionary learning An example comparing the effect of reconstructing noisy fragments of a raccoon face image using firstly online `DictionaryLearning` and various transform methods. The dictionary is fitted on the distorted left half of the image, and subsequentl...
github_jupyter
## Classes for callback implementors ``` from fastai.gen_doc.nbdoc import * from fastai.callback import * from fastai.basics import * ``` fastai provides a powerful *callback* system, which is documented on the [`callbacks`](/callbacks.html#callbacks) page; look on that page if you're just looking for how to use exi...
github_jupyter
<font face="Calibri" size="2"> <i>Open SAR Toolkit - Tutorial 4a, version 1.2, June 2020. Andreas Vollrath, ESA/ESRIN phi-lab</i> </font> ![title](https://raw.githubusercontent.com/ESA-PhiLab/OpenSarToolkit/main/docs/source/_images/header_image.PNG) -------- # OST Tutorial IV-A ## How to create near-daily timeseries...
github_jupyter
# Refitting NumPyro models with ArviZ ArviZ is backend agnostic and therefore does not sample directly. In order to take advantage of algorithms that require refitting models several times, ArviZ uses `SamplingWrappers` to convert the API of the sampling backend to a common set of functions. Hence, functions like Leav...
github_jupyter
<a href="https://colab.research.google.com/github/bkkaggle/pytorch-CycleGAN-and-pix2pix/blob/master/pix2pix.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Install ``` # this mounts your Google Drive to the Colab VM. from google.colab import driv...
github_jupyter
``` # %load ../pipelines/esg_trending_topics/transform.py import pandas as pd import numpy as np from datetime import datetime # ~------------------ RESPONSE DATA ------------------~ def process_response(response, kw, ranking, geo): """ Utility function for create_response_df() """ try: df = response[...
github_jupyter
# AutoEncoder In the following we will show you how to create, train and use a simple autoencoder. We will then show you how to make an auto-encoder more robust against noise. ### Load Dataset ``` import tensorflow as tf from tensorflow.keras.datasets import fashion_mnist (x_train, y_train), (x_test, y_test) = fashi...
github_jupyter
## Deep Reinforcement Learning Project 1 : Navigation This report is a description of our environment and algorithms we use to train an agent that learns by himself (trials and errors) to navigate and collect a type of bananas in a large, square world. A reward of +1 is provided for collecting a yellow banana, and a ...
github_jupyter
# Lecture 11 - Classes ## Object (variable) Method (function) In this lecture we will learn classes and the basics of object oriented programming. It's important to know the main idea and be able to write simple classes that serve basic mathematical purposes. This also prepares us for the `scikit-learn` class object...
github_jupyter
<!DOCTYPE html> <html> <body> <div align="center"> <h3>Prepared by Asif Bhat</h3> <h1>Linear Algebra with Python</h1> <h3>Follow Me on - <a href="https://www.linkedin.com/in/asif-bhat/">LinkedIn</a>&nbsp; <a href="https://mobile.twitter.com/_asifbhat_">Twitter</a>&nbsp; <a href="https://www.instagram.com/datascie...
github_jupyter
<img src="../static/aeropython_name_mini.png" alt="AeroPython" style="width: 300px;"/> # Clase 2a: Introducción a NumPy _Hasta ahora hemos visto los tipos de datos más básicos que nos ofrece Python: integer, real, complex, boolean, list, tuple... Pero ¿no echas algo de menos? Efectivamente, los __arrays__. _ _Duran...
github_jupyter
``` import quantstats as qs from pycoingecko import CoinGeckoAPI import pandas as pd from datetime import datetime import statistics cg = CoinGeckoAPI() date = [] eth_price = [] eth_price_history = cg.get_coin_market_chart_by_id(id='defipulse-index', vs_currency='usd', days='30') eth_price_dict = eth_price_history['p...
github_jupyter
#### pivot_table A pivot table is a data summarization tool frequently found in spreadsheet programs and other data analysis software. It aggregates a table of data by one or more keys, arranging the data in a rectangle with some of the group keys along the rows and some along the columns. Pivot tables in Python with p...
github_jupyter
``` import torch import math from torch import optim from torch import Tensor from torch.autograd import Variable from torch import nn from torch.nn import functional as F import dlc_practical_prologue size=1000; train_input, train_target, train_classes, test_input, test_target, test_classes = \ dlc_practica...
github_jupyter
``` # bem: triangulation and fmm/bem electrostatics tools # # Copyright (C) 2011-2012 Robert Jordens <jordens@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versi...
github_jupyter
# Chapter 8: Winningest Methods in Time Series Forecasting Compiled by: Sebastian C. Ibañez In previous sections, we examined several models used in time series forecasting such as ARIMA, VAR, and Exponential Smoothing methods. While the main advantage of traditional statistical methods is their ability to perform mo...
github_jupyter
``` import matplotlib %matplotlib inline import numpy as np, matplotlib.pyplot as plt from matplotlib.cm import rainbow from Convenience import * model = 'Rodrigues18/smd' model_inter = 'Rodrigues18' N_z, N_bins = 60, 100 ## number of redshift bins and bins in likelihood functions zs = redshift_bins with h5.File( lik...
github_jupyter
# RadarCOVID-Report ## Data Extraction ``` import datetime import json import logging import os import shutil import tempfile import textwrap import uuid import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np import pandas as pd import pycountry import retry import seaborn as sns %matplotlib in...
github_jupyter
``` import pandas as pd from tqdm import tqdm from IPython.display import display pd.set_option('display.max_columns', 99) pd.set_option('display.max_rows', 50) train = pd.read_csv('../input/application_train.csv.zip') train['is_train'] = 1 test = pd.read_csv('../input/application_test.csv.zip') test['is_train'] = 0...
github_jupyter
# Inferential statistics II - Bootstrapping ## Introduction In the previous exercises you performed frequentist calculations to perform inference from a sample of data. Such inference relies on theory largely developed from the 19th Century onwards that is subject to certain assumptions or theoretical limits. These a...
github_jupyter
``` mar= """ 1 gacacacaaa aacaagagat gatgattttg tgtatcatat aaataaagaa gaatattaac 61 attgacattg agacttgtca gtctgttaat attcttgaaa agatggattt acatagcttg 121 ttagagttgg gtacaaaacc cactgcccct catgttcgta ataagaaggt gatattattt 181 gacacaaatc atcaggttag tatctgtaat cagataatag atgcaataaa ctcagggatt ...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # How NRPy+ Computes Finite Difference Coefficients ## Aut...
github_jupyter
``` import numpy as np import pandas as pd import sys import os import pickle from sklearn.model_selection import train_test_split from sklearn.metrics import roc_auc_score from sklearn.metrics import log_loss from sklearn.metrics import accuracy_score from sklearn.metrics import f1_score from sklearn.metrics import ...
github_jupyter
# Convex Optimization ## Stats 208: Lecture 4 ## Prof. Sharpnack - Lecture slides at [course github page](http://github.com/jsharpna/DavisSML) - Some content of these slides are from [STA 251 notes](https://github.com/jsharpna/AML) and [STA 141B lectures](https://github.com/jsharpna/141Blectures). - Some content is...
github_jupyter
# Comparing OpenVINO&trade; to TensorFlow Predictions In this notebook, we'll go through how to perform predictions on our 3D U-Net using both TensorFlow and OpenVINO&trade;. You should be able to see that OpenVINO&trade; inference gives a significant speedup to these predictions. We'll assume that you already ran `...
github_jupyter
# Smart Toll system using python and computer vision ``` import cv2 import numpy as np #numberPlateCascade = cv2.CascadeClassifier('haarcascade_russian_plate_number.xml') plat_detector = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_russian_plate_number.xml") video = cv2.VideoCapture('vid.mp4') if(vide...
github_jupyter
``` import arviz as az import matplotlib.pyplot as plt import numpy as np import pandas as pd import statsmodels.formula.api as smf from scipy import stats az.style.use("arviz-white") ``` # Gibbs sampling for simple linear regression For observation $i=1, \dots,n$ , let $Y_i$ be the response and $X_i$ be the covari...
github_jupyter
# Develop `velocity_section_and_surface` Figure Module Development of functions for `nowcast.figures.research.velocity_section_and_surface` web site figure module. This is an example of developing the functions for a web site figure module in a notebook. It follows the function organization patterns described in [Cre...
github_jupyter
# Unsupervised Anomaly Detection Anomaly detection detects data points in data that does not fit well with the rest of data. In this notebook we demonstrate how to do anomaly detection for 1-D data using Chronos's dbscan detector, autoencoder detector and threshold detector. For demonstration, we use the publicly ava...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Terrain/canada_dem.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" ...
github_jupyter
# Set up the environment ``` from azureml.core import Workspace ws = Workspace.get(name='demo-aml', subscription_id='YOUR-SUSCRIPTION-ID', resource_group='demo-aml') from azureml.core.environment import Environment from azureml.core.conda_dependencies import CondaDependencies # t...
github_jupyter
## Dependencies ``` import json, glob from tweet_utility_scripts import * from tweet_utility_preprocess_roberta_scripts import * from transformers import TFRobertaModel, RobertaConfig from tokenizers import ByteLevelBPETokenizer from tensorflow.keras import layers from tensorflow.keras.models import Model ``` # Load ...
github_jupyter
``` %matplotlib inline ``` 멀티-GPU 예제 ================== 데이터 병렬 처리(Data Parallelism)는 미니-배치를 여러 개의 더 작은 미니-배치로 자르고 각각의 작은 미니배치를 병렬적으로 연산하는 것입니다. 데이터 병렬 처리는 ``torch.nn.DataParallel`` 을 사용하여 구현합니다. ``DataParallel`` 로 감쌀 수 있는 모듈은 배치 차원(batch dimension)에서 여러 GPU로 병렬 처리할 수 있습니다. DataParallel ------------- ``` import t...
github_jupyter
# Keras tutorial - the Happy House Welcome to the first assignment of week 2. In this assignment, you will: 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including TensorFlow and CNTK. 2. See how you c...
github_jupyter