text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Introduction to Classification. Notebook version: 2.1 (Oct 19, 2018) Author: Jesús Cid Sueiro (jcid@tsc.uc3m.es) Jerónimo Arenas García (jarenas@tsc.uc3m.es) Changes: v.1.0 - First version. Extracted from a former notebook on K-NN v.2.0 - Adapted to Python 3.0 (bac...
github_jupyter
1. read .las pointcloud file 2. convert the pointcloud to the reference local coordinates 3. read bounding boxes 5. enlarge bounding boxes 6. crop points within enlarged bounding boxes 7. write cropped pointcloud objects ``` """# google colab installation !pip install open3d !pip install laspy !pip install pptk """ ""...
github_jupyter
Per a recent request somebody posted on Twitter, I thought it'd be fun to write a quick scraper for the [biorxiv](http://biorxiv.org/), an excellent new tool for posting pre-prints of articles before they're locked down with a publisher embargo. A big benefit of open science is the ability to use modern technologies (...
github_jupyter
# Chebychev polynomial and spline approximantion of various functions **Randall Romero Aguilar, PhD** This demo is based on the original Matlab demo accompanying the <a href="https://mitpress.mit.edu/books/applied-computational-economics-and-finance">Computational Economics and Finance</a> 2001 textbook by Mario Mir...
github_jupyter
``` from utils import * import tensorflow as tf from sklearn.cross_validation import train_test_split import time trainset = sklearn.datasets.load_files(container_path = 'data', encoding = 'UTF-8') trainset.data, trainset.target = separate_dataset(trainset,1.0) print (trainset.target_names) print (len(trainset.data)) p...
github_jupyter
``` import sys from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn.model_selection import GridSearchCV from sklearn.datasets import load_files from sklearn.model_selection import train_test_split from sklearn import metrics imp...
github_jupyter
``` Copyright 2021 IBM Corporation 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 agreed to in writing, softwa...
github_jupyter
# SageMaker で Neural Network Libraries のコンテナを作成して学習する #### ノートブックに含まれる内容 - [Newral Network Libraries](https://github.com/sony/nnabla) を使った学習用コンテナの作成 - SageMaker で BYOA(Bring Your Own Container) により,作成したコンテナを使って学習 #### ノートブックで使われている手法の詳細 - Docker - MNIST ([nnabla-example](https://github.com/sony/nnabla-examples/blob...
github_jupyter
## <i>Import libraries</i> ``` import pandas as pd import mysql.connector as mysql ``` ## Sambungkan ke MySQL ``` koneksi = mysql.connect(host = "localhost", database = "kampus", user = "root", password = "Rakhid@16") ``` ## Ambil tabel jurusan...
github_jupyter
## Example 1 - Common Driver Here we investigate the statistical association between summer precipitation (JJA mean) in Denmark (DK) and the Mediterranean (MED). A standard correlation test shows them to be negatively correlated (r = -0.24). However, this association is not causal but is due to both regions being affe...
github_jupyter
# Trabajo en grupo 2018 - Filtros de imágenes ## Versión: SIMD ### Autores: - Alejandro - Álvaro Baños Gomez - Iñaki - Guillermo Facundo Colunga ### Enunciado Realizar una versión monohilo con extensiones multimedia y una versión multihilo del programa anterior para aprovechar las capacidades de paralelismo y c...
github_jupyter
# Extinction Efficiency Factor Figure 6.5 from Chapter 6 of *Interstellar and Intergalactic Medium* by Ryden & Pogge, 2021, Cambridge University Press. Plot the efficiency factor Q$_{ext}$ for two values of the real index of refraction, $n_r=1.5$ (glass) and $n_r=1.33$ (water ice). Uses van de Hulst's method to co...
github_jupyter
``` import pandas as pd import pickle import os import numpy as np import sys from sklearn.metrics import roc_auc_score, make_scorer,brier_score_loss,log_loss,average_precision_score import shutil import os def convert_hba1c_mmol_mol_2_percentage(row): try: row = 0.0915 * row + 2.15 except: row ...
github_jupyter
``` ## https://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html - original tutorial ``` ## Packages ``` import gym import math import random import numpy as np import matplotlib import matplotlib.pyplot as plt from collections import namedtuple from itertools import count from PIL import Image import...
github_jupyter
# Probabilidad y Estadística # Axiomas de probabilidad Son reglas mínimas que definen la lógica y el sistema de deductivo en torno al estudio de las probabilidades. + **No negatividad:** suceso imposible tiene probabilidad 0. + **Certidumbre:** suceso seguro tiene probabilidad 1. Esto no tiene que ver con el resulta...
github_jupyter
``` import os import sys import math import numpy as np import pandas as pd import librosa import seaborn as sns import matplotlib.pyplot as plt from scipy import stats from sklearn import linear_model from collections import Counter # load other modules --> repo root path sys.path.insert(0, "../") from utils import...
github_jupyter
# Composite Executors Executors that execute more than one flow. # Preliminaries ``` # Black Codeformatter %load_ext lab_black ``` ## Imports ``` import numpy as np import pandas as pd import os from affe.execs import CompositeExecutor ``` # Implementation This is where functions and classes are implemented. ##...
github_jupyter
# TF object detection API in Azure Machine Learning This notebook demonstrates how to train an object detection model using Tensorflow Object detection API in Azure Machine Learning service ``` %load_ext autoreload %autoreload 2 import wget import os from azureml.core import Workspace, Experiment, VERSION from azu...
github_jupyter
# StreamingPhish ------ **Author**: Wes Connell <a href="https://twitter.com/wesleyraptor">@wesleyraptor</a> This notebook is a subset of the streamingphish command-line tool and is focused exclusively on describing the process of going from raw data to a trained predictive model. If you've never trained a predictive...
github_jupyter
<a href="https://colab.research.google.com/github/facebookresearch/habitat-sim/blob/master/examples/tutorials/colabs/ECCV_2020_Interactivity.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Habitat-sim Interactivity This use-case driven tutorial co...
github_jupyter
### Step 4 - Generate Results This script has gone through a lot of development, and is now in two version - with the 'operational' one being the automated version also labelled as Step 4 in this folder. This is really where most of the complexity lies in the Yemen analysis, as we have been asked to do cuts and anal...
github_jupyter
``` import re import os import sys sys.path.insert(0, '../') import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats import astropy.units as u import pandas as pd from src.utils import * from src.GMM import * %load_ext autoreload %autoreload 2 drct = "../scripts/get_globular_clusters/result.tx...
github_jupyter
``` # 定义一组字典列表,用来表示多个数据样本(每个字典代表一个数据样本)。 measurements = [{'city': 'Dubai', 'temperature': 33.}, {'city': 'London', 'temperature': 12.}, {'city': 'San Fransisco', 'temperature': 18.}] # 从sklearn.feature_extraction 导入 DictVectorizer from sklearn.feature_extraction import DictVectorizer # 初始化DictVectorizer特征抽取器 vec = Dict...
github_jupyter
# **Preprocessing** The purpose of this notebook is to execute preprocessing by combining posts and comments. The raw data are in the `JSON` format and we need to transform them into data frames for the further analysis. ``` import pandas as pd import numpy as np import json from ast import literal_eval import multipr...
github_jupyter
## Multi-label prediction with Planet Amazon dataset ``` !curl https://course.fast.ai/setup/colab | bash from fastai.vision import * ``` ## Getting the data The planet dataset isn't available on the [fastai dataset page](https://course.fast.ai/datasets) due to copyright restrictions. You can download it from Kaggle ...
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> # Tutorial 2: Training loop of C...
github_jupyter
``` #collapse # Kelloggs > notebook that creates the kerry datasets. - toc: true - badges: true - comments: true - categories: [jupyter] - image: images/chart-preview.png #collapse #IMPORT LIBRARIES FROM PYTHON import pandas as pd #IMPORT DATA SETS FROM TRUSTED SOURCES #US CENSUS DATA FROM - censusData = pd.read_csv...
github_jupyter
# Performance plots for Gaia FGK benchmark stars ## Author(s): Sven Buder (SB, WG4) ### History: 180926 SB Created 200313 SB Switched the analysis to the final DR3 values. Seperated the initial FREE runs ``` # Preamble for notebook # Compatibility with Python 3 from __future__ import (absolute_import, division, ...
github_jupyter
## Basic Relative Permeability Example in 2D This example is about finding relative permeability of two phases in the medium. We use invasion percolation to invade air (non-wetting) into a water-filled (wetting) network. Here we use a 2D network so that we can visualize the results easily. ``` import warnings import p...
github_jupyter
``` # creating R environment in Google Colab %load_ext rpy2.ipython %%R # installing necessary libraries install.packages('tidyverse') library(tidyverse) install.packages('caret') library(caret) install.packages('corrplot') library(corrplot) install.packages('xgboost') library(xgboost) %%R # reading the file data = re...
github_jupyter
# Project 2: Breakout Strategy ## Instructions Each problem consists of a function to implement and instructions on how to implement the function. The parts of the function that need to be implemented are marked with a `# TODO` comment. After implementing the function, run the cell to test it against the unit tests we...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D1_BayesianDecisions/student/W3D1_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 1: Bayes with a binary hidden state **W...
github_jupyter
# Compare trained NPEs accuracy as a function of $N_{\rm train}$ ``` import numpy as np from scipy import stats from sedflow import obs as Obs from sedflow import train as Train from IPython.display import IFrame # --- plotting --- import corner as DFM import matplotlib as mpl import matplotlib.pyplot as plt #mpl.us...
github_jupyter
``` import databehandling #databehandling? """ InfoSec, Python Programming beginner (version, 3.9+) Data processing. [*]This code might now tbe the most user friendly, but it sure is quite effiencent and scalable. [*]The code is not developed for eternal use only internal. [*]Any function only works with class object ...
github_jupyter
# Memory Information # GPU Information ``` !ls -lha kaggle.json !pip install -q kaggle !mkdir -p ~/.kaggle !cp kaggle.json ~/.kaggle/ !chmod 600 ~/.kaggle/kaggle.json import kaggle import os dataset_dir = '/content/home/' def download_drive(dataset_dir): """ Downloads dataset from Kaggle and loads it in dat...
github_jupyter
# Lista 6 ``` import matplotlib.pyplot as plt import numpy as np from IPython.display import Image from scipy import signal import matplotlib.style as style plt.rcParams['font.size'] = 20 plt.rcParams['axes.labelsize'] = 20 plt.rcParams['axes.labelweight'] = 'bold' plt.rcParams['xtick.labelsize'] = 15 plt.rcParams...
github_jupyter
![title](yesbank_feature_banner.png) # YES BANK DATATHON ## Machine Learning Challenge Round 3 - Classification ## EDA ``` import numpy as np import pandas as pd train=pd.read_csv('Yes_Bank_Train.csv') test=pd.read_csv('Yes_Bank_Test_int.csv') train.info() sub=pd.read_csv('sample_clusters.csv') ``` No Null ``` t...
github_jupyter
# High-Order Example [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/teseoch/fem-intro/master?filepath=fem-intro-high-order.ipynb) ![](QR-ho.png) Run it with binder! ``` import numpy as np import scipy.sparse as spr from scipy.sparse.linalg import spsolve import plotly.graph_objects as go...
github_jupyter
``` import collections import math import torch from torch import nn from d2l import torch as d2l class Seq2SeqEncoder(d2l.Encoder): def __init__(self, vocab_size, embed_size, num_hiddens, num_layers, dropout=0, **kwargs): super(Seq2SeqEncoder, self).__init__(**kwargs) self.embedding = nn.Embedding(vocab_size...
github_jupyter
# **Amazon Lookout for Equipment** - SDK Tutorial #### Temporary cell to be executed until module is published on PyPI: ``` !pip install --quiet --use-feature=in-tree-build .. ``` ## Initialization --- ### Imports ``` import boto3 import matplotlib.pyplot as plt import matplotlib.ticker as mtick import numpy as np...
github_jupyter
# *Density Matrices and Path Integrals* `Doruk Efe Gökmen -- 14/08/2018 -- Ankara` ## Stationary states of the quantum harmonic oscillator The 1-dimensional (1D) quantum mechanical harmonic oscillator with characteristic frequency $\omega$ is described by the same potential energy as its classical counterpart acting...
github_jupyter
<center> <img src="http://sct.inf.utfsm.cl/wp-content/uploads/2020/04/logo_di.png" style="width:60%"> <h1> INF285 - Computación Científica </h1> <h2> Finding 2 Chebyshev points graphically </h2> <h2> <a href="#acknowledgements"> [S]cientific [C]omputing [T]eam </a> </h2> <h2> Version: 1.04</h2> </ce...
github_jupyter
## Polynomial Regression ## What is polynomial regression? > This is simply regression at a higher order. Why? > Sometimes a line just does not cut it, and you need a curve Basic terms which should be pretty self explanatory. * Linear - $y = \beta_0 + \beta_1 x$ * Quadratic - $y = \beta_0 + \beta_1 x + \beta_2 x^2$...
github_jupyter
##### Copyright 2020 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
``` from __future__ import absolute_import from __future__ import print_function from __future__ import division import random import collections import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline plt.rcParams['figure.figsize'] = (10.0, 8.0) # set default size of plots plt.rcPa...
github_jupyter
``` # Write a dynamic programming based program to find minimum number insertions (addition) needed to make a palindrome # Examples: # ab: Number of insertions required is 1 i.e. bab aa: Number of insertions required is 0 i.e. aa # abcd: Number of insertions required is 3 i.e. dcb + abcd # Algorithm: # The table ...
github_jupyter
# Validação cruzada ### Objetivo da apresentação Identificar maneiras de evitar com que um modelo preditivo deixe de ser genérico o suficiente para previsões ainda não vistas, caso exista uma influência na forma de validação. O dataset e o dicionário de variáveis podem ser baixados pelo link https://www.kaggle.com/he...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import os plt.rcParams['figure.figsize'] = (10, 10) plt.rcParams['axes.labelsize'] = 16 plt.rcParams['xtick.labelsize'] = 16 plt.rcParams['ytick.labelsize'] = 16 from pathlib import Path def mkdir_secure(path): if not ...
github_jupyter
``` import pandas as pd import numpy as np import random as rnd from sklearn.cross_validation import KFold, cross_val_score # machine learning from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC, LinearSVC from sklearn.ensemble import RandomForestClassifier from sklearn.neighbors import...
github_jupyter
``` # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. ``` # Absolute camera orientation given set of relative camera pairs This tutorial showcases the `cameras`, `transforms` and `so3` API. The problem we deal with is defined as follows: Given an optical system of $N$ cameras with extrinsics $...
github_jupyter
# Model Template - STEP Data This notebook outlines the data prep process for inputting the STEP data into a neural network. This code is essentially replicated in our full walkthrough notebooks for an end-to-end deep learning model. ### Import libraries and data ``` import pandas as pd import numpy as np import more...
github_jupyter
<a href="https://colab.research.google.com/github/kentokura/ox_2x2_retrograde_analysis/blob/main/retrograde_analysis/retrograde_analysis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ## ox_input | | PREVIOUS_STATES | STATE | NEXT_STATES ...
github_jupyter
# Tutorial 8 : Comparison of various DMD algorithms In this tutorial, we perform a thorough comparison of various DMD algorithms available in PyDMD, namely: - the original DMD algorithm proposed by [Schmid (*J. Fluid Mech.*, 2010)](https://www.cambridge.org/core/journals/journal-of-fluid-mechanics/article/dynamic-mode...
github_jupyter
``` !apt-get install -y -qq software-properties-common python-software-properties module-init-tools !add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null !apt-get update -qq 2>&1 > /dev/null !apt-get -y install -qq google-drive-ocamlfuse fuse from google.colab import auth auth.authenticate_user() from oauth...
github_jupyter
# Warsztaty Python w Data Science *** # Blok 1 - Wprowadzenie ## Python (1 z 2) *** # https://github.com/MichalKorzycki/PythonDataScience ![github](img/githubzip.png) *** # Python Język Python jest: - dynamicznym, silnie typowanym językiem skryptowym - napędza takie sajty jak Youtube, Dropbox, Netflix czy Instag...
github_jupyter
``` %autosave 60 %load_ext autoreload %autoreload 2 %matplotlib inline import json import os import pickle from collections import Counter, OrderedDict, defaultdict from copy import deepcopy from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union, cast import cv2 import matplotlib.pyplot as...
github_jupyter
<img align="left" src = https://www.linea.gov.br/wp-content/themes/LIneA/imagens/logo-header.png width=180 style="padding: 20px"> <br> ## Curso básico de ferramentas computacionais para astronomia Contato: Julia Gschwend ([julia@linea.gov.br](mailto:julia@linea.gov.br)) <br> Github: https://github.com/linea-it/minicur...
github_jupyter
# Introduction ## Motivation This notebook follows up `model_options.ipynb`. The key difference is that we filter using the category distance metric (see `bin/wp-get-links` for details), rather than relying solely on the regression to pick relevant articles. Thus, we want to decide what an appropriate category dista...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt from IPython.core.display import HTML import pydae.svg_tools as svgt #%config InlineBackend.figure_format = 'svg' import pydae.grid_tools as gt import scipy.optimize as sopt from scipy.optimize import NonlinearConstraint import time %matplotlib widget from pydae im...
github_jupyter
# Linear Elasticity in 2D for 3 Phases ## Introduction This example provides a demonstration of using PyMKS to compute the linear strain field for a three-phase composite material. It demonstrates how to generate data for delta microstructures and then use this data to calibrate the first order MKS influence coeffici...
github_jupyter
# Short-Circuit Calculation according to IEC 60909 pandapower supports short-circuit calculations with the method of equivalent voltage source at the fault location according to IEC 60909. The pandapower short-circuit calculation supports the following elements: - sgen (as motor or as full converter generator) - gen ...
github_jupyter
# Matplotlib example (https://matplotlib.org/gallery/index.html) ``` %matplotlib inline import matplotlib.pyplot as plt plt.plot([1,2,3,4]) plt.show() # to save # plt.savefig('test_nb.png') ``` # Pandas examples (https://pandas.pydata.org/pandas-docs/stable/visualization.html) ``` import pandas as pd import numpy as...
github_jupyter
# Independence Tests Power over Increasing Dimension ``` import sys, os import multiprocessing as mp from joblib import Parallel, delayed import numpy as np import matplotlib.pyplot as plt import seaborn as sns from power import power from hyppo.independence import CCA, MGC, RV, Dcorr, Hsic, HHG from hyppo.tools imp...
github_jupyter
# ETL Project by Johneson Giang ## SCOPE: ### - Extracted, transformed, and loaded up YouTube's Top Trending Videos from December 2017 thru May 2018 for their videos categorized as music only, and created an "Artist" column to enable joining with Spotify's Top 100 Songs of 2018. Both dataframes were loaded into MySQL....
github_jupyter
``` import math import numpy as np import sys import pandas as pd def add(x,y,filter=False): if filter==True: x[np.isnan(x)] = 0 y[np.isnan(y)] = 0 else: a=0 return x+y def ceil(x): a=x.shape[0] b=x.shape[1] for i in range(a): for j in range(b): x[i][j...
github_jupyter
<a href="https://colab.research.google.com/github/jejjohnson/gp_model_zoo/blob/master/code/numpyro/numpyro_gpr_laplace.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Numpyro Jax PlayGround My starting notebook where I install all of the necessar...
github_jupyter
# Averaging Example Example system of $$ \begin{gather*} \ddot{x} + \epsilon \left( x^2 + \dot{x}^2 - 4 \right) \dot{x} + x = 0. \end{gather*} $$ For this problem, $h(x,\dot{x}) = x^2 + \dot{x}^2 - 4$ where $\epsilon \ll 1$. The if we assume the solution for x to be $$ \begin{gather*} x(t) = a\cos(t + \phi...
github_jupyter
``` # Standard imports import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt # Needed for advanced plotting import matplotlib.patches as patches # For plotting inline %matplotlib inline plt.ion() # Import suftware (use development copy) import sys sys.path.append('../../suftw...
github_jupyter
``` %pylab inline import sys sys.path.append("/Users/hantke/flash_mnt/home/tekeberg/Source/pah/") import numpy import matplotlib import matplotlib.pyplot from camp.pah.beamtimedaqaccess import BeamtimeDaqAccess # MOUNT YOUR DATA # ssh -f mhantke@bastion -L 2222:max-cfel002:22 -N # sshfs -p 2222 mhantke@localhost:/ /Use...
github_jupyter
# Build a Custom Training Container and Debug Training Jobs with Amazon SageMaker Debugger Amazon SageMaker Debugger enables you to debug your model through its built-in rules and tools (`smdebug` hook and core features) to store and retrieve output tensors in Amazon Simple Storage Service (S3). To run your customize...
github_jupyter
## 2.3 Combination Matrix over undirected network ### 2.3.1 Weight We now associate each edge with a positive weight. This weight is used to scale information following over the associated edge. For a given topology, we define $w_{ij}$, the weight to scale information flowing from agent $j$ to agent $i$, as follows:...
github_jupyter
# Lecture 11 - Gaussian Process Regression ## Objectives + to do regression using a GP + to find the hyperparameters of the GP by maximizing the (marginal) likelihood + to use GP regression for uncertainty propagation ## Readings + Please read [this](http://www.kyb.mpg.de/fileadmin/user_upload/files/publications/pd...
github_jupyter
# 传统数据库 上篇文章:聊聊数据库~开篇 <https://www.cnblogs.com/dotnetcrazy/p/9690466.html> 本来准备直接开讲NoSQL的(当时开篇就是说的NoSQL)考虑到有些同志可能连MySQL系都没接触过,所以我们2019说数据系的时候预计从`MySQL`(穿插`MSSQL`)开始,这篇文章就当试水篇,效果好就继续往下写~(这篇偏理论和运维) ## 1.1.MariaDB and MySQL 官方文档:`https://mariadb.com/kb/zh-cn/mariadb` 目前主流:`MySQL 5.7.x` or **`MariaDB 5.5.60`**(推荐) 多一...
github_jupyter
# SEIR-Campus Examples This file illustrates some of the examples from the corresponding paper on the SEIR-Courses package. Many of the function here call on classes inside the SEIR-Courses package. We encourage you to look inside the package and explore! The data file that comes in the examples, publicdata.data, i...
github_jupyter
``` from pdc_project.settings import * from pdc_project.encoder import * from pdc_project.helper import * from pdc_project.transmitter import * from pdc_project.modulation import * import numpy as np import pylab as pl import scipy.signal.signaltools as sigtool import scipy.signal as signal from numpy.random import sa...
github_jupyter
STAT 453: Deep Learning (Spring 2021) Instructor: Sebastian Raschka (sraschka@wisc.edu) Course website: http://pages.stat.wisc.edu/~sraschka/teaching/stat453-ss2021/ GitHub repository: https://github.com/rasbt/stat453-deep-learning-ss21 --- ``` %load_ext watermark %watermark -a 'Sebastian Raschka' -v -p torch ...
github_jupyter
``` import cv2 import dlib import numpy as np import imutils import random from imutils import face_utils import matplotlib.pyplot as plt print(cv2.__version__) %matplotlib inline def features(img): #initialize facial detector gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # gray = cv2.resize(gray,(300,300))...
github_jupyter
### Telecom Customer Churn Prediction ``` import numpy as np import pandas as pd import seaborn as sns import matplotlib.ticker as mtick import matplotlib.pyplot as plt ``` ### Reading the data The dataset contains the following information: 1- Customers who left within the last month – the column is called Churn...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import warnings warnings.filterwarnings('ignore') ``` # Implementing activation functions with numpy ## Sigmoid ``` x = np.arange(-10,10,0.1) z = 1/(1 + np.exp(-x)) plt.figure(figsize=(20, 10)) plt.plot(x, z, label = 'sigmoid function', lw=5) plt.axvline(lw=0.5...
github_jupyter
<img src="https://raw.githubusercontent.com/google/jax/main/images/jax_logo_250px.png" width="300" height="300" align="center"/><br> I hope you all enjoyed the first JAX tutorial where we discussed **DeviceArray** and some other fundamental concepts in detail. This is the fifth tutorial in this series, and today we wi...
github_jupyter
# System and Python setup ## Google Colab prerequisites Make sure to activate CPU acceleration in Google Colab under `Runtime/Runtime type/CPU`. This Notebook follows the [tf2-object-detection-api-tutorial](https://github.com/abdelrahman-gaber/tf2-object-detection-api-tutorial) from [Abdelrahman G. Abubakr](https:...
github_jupyter
``` # necessary libraries import os import pandas as pd # visualizations libraries import matplotlib.pyplot as plt import matplotlib.image as mpimg from matplotlib.image import imread %matplotlib inline # tensorflow libraries import tensorflow as tf from tensorflow import keras from keras.preprocessing.image import I...
github_jupyter
# Project: Part of Speech Tagging with Hidden Markov Models --- ### Introduction Part of speech tagging is the process of determining the syntactic category of a word from the words in its surrounding context. It is often used to help disambiguate natural language phrases because it can be done quickly with high accu...
github_jupyter
## Visualization ``` import torch import torch.nn as nn import numpy as np import pytorch_lightning as pl import sys import os import matplotlib.pylab as plt %matplotlib inline from lifelines.utils import concordance_index from sklearn.metrics import r2_score from torch.utils.data import DataLoader, TensorDataset fro...
github_jupyter
# Analyzing the model comparison benchmark with ROC analysis We want to analyze our model comparison benchmark with respect to the receiver operating characteristic and precision-recall curves. For most models, we use thresholding on the p-values to create the curves. Exceptions: - scCODA: Use inclusion probability i...
github_jupyter
# RadiusNeighborsClassifier with Scale & Quantile Transformer This Code template is for the Classification task using a simple Radius Neighbor Classifier with separate feature scaling using Scale pipelining Quantile Transformer which is a feature transformation technique. It implements learning based on the number of...
github_jupyter
``` # Load packages import tensorflow as tf from tensorflow import keras import numpy as np import pandas as pd import os import pickle import time import scipy as scp import scipy.stats as scps from scipy.optimize import differential_evolution from scipy.optimize import minimize from datetime import datetime import ma...
github_jupyter
<a href="https://colab.research.google.com/github/florentPoux/point-cloud-processing/blob/main/Point_cloud_data_sub_sampling_with_Python.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Created by Florent Poux. Licence MIT * To reuse in your proje...
github_jupyter
Copyright 2018 The Dopamine Authors. 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 agreed to in writing, software...
github_jupyter
# Time-series prediction (temperature from weather stations) Companion to [(Time series prediction, end-to-end)](./sinewaves.ipynb), except on a real dataset. ``` # change these to try this notebook out BUCKET = 'cloud-training-demos-ml' PROJECT = 'cloud-training-demos' REGION = 'us-central1' import os os.environ['BU...
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
[![imagenes/pythonista.png](imagenes/pythonista.png)](https://pythonista.io) ## La biblioteca *SQLAlchemy*. [*SQLAlchemy*](http://www.sqlalchemy.org/) comprende diversas herramientas enfocadas a interactuar con bases de datos relacionales de forma "pythonica". Consta de: * **SQLAlchemy Core**, la cual permite crear ...
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
# Volumetrics: HCIP calculation We'll implement the volumetric equation: $$ V = A \times T \times G \times \phi \times N\!\!:\!\!G \times S_\mathrm{O} \times \frac{1}{B_\mathrm{O}} $$ ## Gross rock volume $$ \mathrm{GRV} = A \times T $$ ## Geometric factor Now we need to compensate for the prospect not being a f...
github_jupyter
# DL20191921: Initial analysis of hemichordate 10x pilot experiment ## Modules and functions ``` %matplotlib inline import collections import matplotlib import matplotlib.pyplot as plt import numpy as np import pandas as pd from pandas import CategoricalDtype from pandas.api.types import CategoricalDtype, is_categori...
github_jupyter
``` import gym from gym import spaces from gym.utils import seeding import numpy as np from os import path from IPython.display import clear_output import matplotlib.pyplot as plt np_random, seed = seeding.np_random(42) a = np.arange(4).reshape((2,2)) print(a) [0, 1, 2, 3][:1] print([row for row in a]) class g2048(gym....
github_jupyter
# [ATM 623: Climate Modeling](../index.ipynb) [Brian E. J. Rose](http://www.atmos.albany.edu/facstaff/brose/index.html), University at Albany # Lecture 3: Climate sensitivity and feedback Tuesday February 3 and Thursday February 5, 2015 ### About these notes: This document uses the interactive [`IPython notebook`](h...
github_jupyter
``` import pandas as pd import matplotlib.pyplot as plt import numpy as np import statsmodels.api as sm import seaborn as sns from scipy.stats import skew from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, r2_score from sklearn.model_selection import train_test_split fro...
github_jupyter
``` %matplotlib inline %load_ext autoreload %autoreload 2 import seaborn as sns import pandas as pd import matplotlib.pyplot as plt import numpy as n import sys import os sys.path.insert(0, 'python') #base='kinase_sarfari' base="gpcr_pdsp" regression_file="{}_regressors.csv".format(base) classification_file="{}_class...
github_jupyter
# Completely optional ... but fun! #### Geek-out about Pandas Expanding Rolling Windows follows (a.k.a. `"Let's measure the Earth!!"`) Rolling windows are cool, especially because they forget the far past, and keep only the recent data "in mind" when performing operations. There are [many types of rolling window](htt...
github_jupyter