text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Using starry process as a prior Most of the tutorials here focus on doing inference on the statistical properties of star spots from large ensemble analyses. But what if we know (or think we know) the properties of the spots of a given star? Then we can use the GP to constrain the actual surface map of the body. Thi...
github_jupyter
``` %load_ext autoreload %autoreload 2 import sys sys.path.append('/Users/palmer/Documents/python_codebase/') from pyMS.centroid_detection import gradient from pyImagingMSpec.hdf5.inMemoryIMS_hdf5 import inMemoryIMS_hdf5 from pyImagingMSpec.image_measures import level_sets_measure import matplotlib.pyplot as plt import...
github_jupyter
<a href="https://colab.research.google.com/github/lionelsamrat10/machine-learning-a-to-z/blob/main/Classification/Naive%20Bayes%20Classification/naive_bayes_samrat.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Naive Bayes (Non Linear Classifier)...
github_jupyter
# Importing Libraries ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import plotly.express as px import plotly.offline as py import plotly.graph_objects as go %matplotlib inline import nltk import re import warnings train_df= pd.read_csv("https://raw.githubusercontent....
github_jupyter
<a href="https://colab.research.google.com/github/ahmedhisham73/deep_learningtuts/blob/master/DataAugmentation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !wget --no-check-certificate \ https://storage.googleapis.com/mledu-datasets/cats_...
github_jupyter
## Setup This section installs required packages, and initializes some imports and helper functions to keep the notebook code below neater. ``` #!pip uninstall tensorflow -yq #!pip install tensorflow-gpu>=2.0 gpustat -Uq # GPU selection import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBL...
github_jupyter
### 1.A Basic HTML ### 1.A.1 Tags The pieces of HTML documents that carry the commands for the browser are referred to as "tags". Tags are separated from the text through angle brackets ("<",">"). Also, most commands come in pairs consisting of an opening and an end tag. For example, when the browser encounters the o...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # ONNX Runtime: Tutorial for Nuphar execution provider **Accelerating model inference via compiler, using Docker Images for ONNX Runtime with Nuphar** This example shows how to accelerate model inference using Nuphar, an execu...
github_jupyter
# Graph Measures In this section we'll cover some common network analysis techniques. This doesn't cover everything NetworkX is capable of, but is a should get you started exploring the rest of the package. First we are going to need import some other packages. ``` import networkx as nx import numpy as np import ma...
github_jupyter
# 19. Gradient Boosting Regression [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rhennig/EMA6938/blob/main/Notebooks/19.GradientBoostingRegression.ipynb) In this notebook, we will use a gradient boosted trees model for regression of $({\bf X}, {\...
github_jupyter
# PyCaret 2 Regression Example This notebook is created using PyCaret 2.0. Last updated : 31-07-2020 ``` # check version from pycaret.utils import version version() ``` # 1. Loading Dataset ``` from pycaret.datasets import get_data data = get_data("insurance") ``` # 2. Initialize Setup ### 気になったsetup()の引数メモ ###...
github_jupyter
# Deploy and Distribute TensorFlow In this notebook you will learn how to deploy TensorFlow models to TensorFlow Serving (TFS), using the REST API or the gRPC API, and how to train a model across multiple devices. ## Imports ``` %matplotlib inline import matplotlib as mpl import matplotlib.pyplot as plt import numpy...
github_jupyter
# Fan-Tas-Tic test and debug * Read switch inputs * Make the LEDs blink, experiment with timing * Fire the solenoids, experiment with intensities * Try out quickfire rules Make sure to connect to the `DEVICE` port on the TM4C123 eval board. ``` import os, serial from time import sleep from numpy import * fr...
github_jupyter
``` # SELECT DISTINCT ?personVal ?relationVal ?toPVal WHERE { # ?s a tbio:Person . # ?s ?p ?o . # ?p rdfs:subPropertyOf ?familyOP . # FILTER ( ?familyOP = tbio:hasFamilyRelation || ?familyOP = tbio:isFamilyRelationOf ) . # BIND(STR(?s) AS ?personStr) . # BIND(REPLACE(?personStr, "http://tbio....
github_jupyter
---- <img src="../../../files/refinitiv.png" width="20%" style="vertical-align: top;"> # Data Library for Python ---- ## Content layer - Pricing snapshot This notebook demonstrates how to retrieve Pricing snapshot data. #### Learn more To learn more about the Refinitiv Data Library for Python please join the Refin...
github_jupyter
``` from local.torch_basics import * from local.test import * from local.core import * from local.layers import * from local.data.all import * from local.optimizer import * from local.learner import * from local.metrics import * from local.text.all import * from local.callback.rnn import * from local.callback.all impor...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import sklearn as sk from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score # Генерируем уникальный seed my_code = "Пушкарёва" seed_limit = 2 ** 32 my_seed = int.from_bytes(my_code.encode(), "little") % seed_limit n...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#TSS" data-toc-modified-id="TSS-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>TSS</a></span></li></ul></div> ``` from collections import defaultdict import warnings import logging import gffutils import...
github_jupyter
![title](http://www.sas.com/content/sascom/en_us/software/viya/_jcr_content/par/styledcontainer_95fa/par/image_e693.img.png/1473452935247.png) # A simple pipeline using hypergroup to perform community detection and network analysis A social network of a [karate club](https://en.wikipedia.org/wiki/Zachary%27s_karate_c...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import pandas as pd %matplotlib inline def calcR2(H,T,slope,igflag=0): """ % % [R2,S,setup, Sinc, SIG, ir] = calcR2(H,T,slope,igflag); % % Calculated 2% runup (R2), swash (S), setup (setup), incident swash (Sinc) % and infragravity swash (S...
github_jupyter
``` import azureml.core print(azureml.core.VERSION) from azureml.core.authentication import InteractiveLoginAuthentication from azureml.core import Workspace import os # ws = Workspace.from_config(auth=InteractiveLoginAuthentication(tenant_id=os.environ["AML_TENANT_ID"])) ws = Workspace.from_config() ws from azurem...
github_jupyter
``` # Required Libraries import numpy as np import pandas as pd import sklearn from sklearn.cluster import KMeans # K-Means Clustering from sklearn.neighbors import KNeighborsClassifier # KNN Classification from sklearn import metrics # Prediction Accuracy from sklearn.deco...
github_jupyter
``` %%time #print("1") import tensorflow as tf from numba import cuda from tensorflow.python.client import device_lib print(device_lib.list_local_devices()) from keras.preprocessing.sequence import pad_sequences # #print("2") from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.preprocessing import ...
github_jupyter
<a href="https://colab.research.google.com/github/Tessellate-Imaging/Monk_Object_Detection/blob/master/example_notebooks/1_gluoncv_finetune/TRAIN-gluon-ssd_300_vgg16_atrous_coco.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Installation - Run ...
github_jupyter
``` import QUANTAXIS as QA ``` # 在这里我们演示一下 下单/交易/结算的整个流程 我们首先会建立一个账户类和一个回测类 ``` # 初始化一个account user= QA.QA_User(username='admin',password='940809x') portfolio= user.new_portfolio('order_example') Account=portfolio.new_account() # 初始化一个回测类 B = QA.QA_BacktestBroker() ``` 在第一天的时候,全仓买入 000001 ``` # 全仓买入'000001' Ord...
github_jupyter
# pyplearnr demo Here I demonstrate pyplearnr, a wrapper for building/training/validating scikit learn pipelines using GridSearchCV or RandomizedSearchCV. Quick keyword arguments give access to optional feature selection (e.g. SelectKBest), scaling (e.g. standard scaling), use of feature interactions, and data transfo...
github_jupyter
# Advanced Feature Engineering in Keras ## Learning Objectives 1. Process temporal feature columns in Keras. 2. Use Lambda layers to perform feature engineering on geolocation features. 3. Create bucketized and crossed feature columns. ## Introduction In this notebook, we use Keras to build a taxifare price pre...
github_jupyter
``` import librosa import os import numpy as np import matplotlib.pyplot as plt from scipy.fftpack import dct from scipy.signal import spectrogram import operator import pickle import time import csv from random import shuffle import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as opti...
github_jupyter
# To run this, you need to run (or have run) the following in docker: ``` pip install textblob pip install nltk pip install twitterscraper pip install pandas_datareader pip install yahoo-finance ``` ``` from twitterscraper import query_tweets from twitterscraper.query import query_tweets_once as query_tweets_advanced ...
github_jupyter
# xarray use case: Neural network training **tl;dr** 1. This notebook is an example of reading from a climate model netCDF file to train a neural network. Neural networks (for use in parameterization research) require random columns of several stacked variables at a time. 2. Experiments in this notebook show: ...
github_jupyter
# Python Basics with Numpy (optional assignment) Welcome to your first assignment. This exercise gives you a brief introduction to Python. Even if you've used Python before, this will help familiarize you with functions we'll need. **Instructions:** - You will be using Python 3. - Avoid using for-loops and while-lo...
github_jupyter
Section 1 \ / ---> O ---> --> / \ Each neuron/node is a function with simple (but potentially nonlinear) behavior. Eg is F(x) { 0 : x<=0 ; x : x>0 } thresholding fxn Neural networks can track complicated functions with modular components ``` from __future__ import print_function import torch; print(...
github_jupyter
# Chapter 5 - Image Filtering In this chapter, we're introducing the concept of Image Filtering. Filters can be applied on 2D Image data either for various applications. We can broadly differenciate low-pass filters smooth images (retrain low-frequenciy components) and high-pass filters (retain contours / edges, e.g....
github_jupyter
``` from IPython.display import display, Markdown as md display(md(f"# Social Media Monitoring")) display(md(f"**Search for a Politician**")) display(md(f"***The following table contains data on the politicians and their associated social acounts***")) import os from smm_wrapper import SMM import qgrid from ipywidgets ...
github_jupyter
<a href="https://colab.research.google.com/github/SepideHematian/my_course_projects/blob/main/602/Project1/Final_version_project1_group1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Data602 - Project 1 **Group A/1** This project has been done ...
github_jupyter
# Multi Armed Bandit Problem Multi-armed bandit (MAB) problem is one of the classical problems in reinforcement learning. A multi-armed bandit is actually a slot machine, a gambling game played in a casino where you pull the arm(lever) and get a payout(reward) based on some randomly generated probability distribution....
github_jupyter
# Sensor invariance of signal bouts We assume that the bouts in the signal are caused by encounters of a plume filament with high gas concentration. The aim of this figure is to show that the sensor bouts are sensor invariant, that is, encountering them is (by and large) independent of the sensor used. As we will show,...
github_jupyter
``` # Importing required libraries import os import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline ad = pd.read_csv("Advertising.csv") ad.drop("Unnamed: 0", axis=1, inplace=True) ad.head() ``` ## The Bias **We will use Linear Regression to display bias or underfitting** ``` # F...
github_jupyter
``` import codecs import numpy as np import pandas as pd import tensorflow as tf import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split ``` Load data in Tensorflow. ``` root = "../" training_data_folder = '%straining_data/web-radio/output/rec' % root embDir = '%sembeddings' % root what ...
github_jupyter
``` from collections import namedtuple import json import matplotlib.pyplot as plt import pandas as pd import requests try: import geopandas as gpd except ModuleNotFoundError: !pip install geopandas import geopandas as gpd #get the Folium library for map generation try: import folium except ModuleNotFoundEr...
github_jupyter
# MAST Table Access Protocol PanSTARRS 1 DR2 Demo <br> This tutorial demonstrates how to use astroquery to access PanSTARRS 1 Data Release 2 via a Virtual Observatory standard Table Access Protocol (TAP) service at MAST, and work with the resultant data. It relies on Python 3 and astroquery, as well as some other comm...
github_jupyter
``` from sklearn import linear_model import numpy as np import matplotlib.pyplot as plt import scipy as sp from astropy.stats import LombScargle %matplotlib inline plt.style.use('seaborn') # in order to use custom modules in parent path import os import sys nb_dir = os.path.split(os.getcwd())[0] if nb_dir not in sys.pa...
github_jupyter
# Deps ``` %reload_ext autoreload %autoreload 2 %matplotlib inline from fastai import * from fastai.text import * from fastai.vision import * from fastai.callbacks import * def CountVocab(ds): return len(set([p for o in ds.items for p in o])) def VocabTransfered(path_dict,itos_new): old_itos = pickle.load(open...
github_jupyter
``` !pip install transformers !pip install sentence-transformers import numpy as np import pandas as pd import torch import csv from scipy import stats import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from sentence_transformers import SentenceTransformer device = 'cuda' SINGLE_TRAIN_DAT...
github_jupyter
# Oscillations Two practicals ## 1. Finding $g$ by using a pendulumn $\begin{aligned} T = 2\pi \sqrt{\frac{l}{g}} \end{aligned}$ - $T$: period in s - $l$: length in m - $g$ acceleration due to gravity: $m/s^2$ Linearisation of the sqrt function (as $T \propto \sqrt{l})$: $\begin{aligned} T^2 &= (2 \pi)^2 \frac{l}{g...
github_jupyter
## Mutable variables ``` var i:Int = 1 ``` We can reassign a value to `i` ``` i = 2 ``` ## Immutable values ``` val s:String = "a" ``` Declaring `s` as `val` prevents new assignement ``` s = "c" ``` ## Function We can declare inline function, the type will take a form of an application, as we can see below whe...
github_jupyter
# Class Project Reference # What analysis are you going to do? Please run your study idea by Jeremy or Jin before progressing. A few potentially interesting ones may include: Scary VS non-scary Loud VS quiet People VS no-people Anything your imagination comes up with! # Designing your GLM Before we can make our...
github_jupyter
(gravity)= # Gravity ## Newton's Law of Universal Gravitation The gravitational force \\(F\\) that body A exerts on body B has a magnitude that is directly proportional to the mass of body A \\(m_a\\) and the mass of body B \\(m_b\\), and inversely proportional to the square of the distance between their centres \\(...
github_jupyter
# Introduction to Biomechanics > Marcos Duarte > Laboratory of Biomechanics and Motor Control ([http://demotu.org/](http://demotu.org/)) > Federal University of ABC, Brazil ## Biomechanics @ UFABC ``` from IPython.display import IFrame IFrame('http://demotu.org', width='100%', height=500) ``` ## Biomechanics T...
github_jupyter
``` %load_ext autoreload %autoreload 2 from deluca.envs import PlanarQuadrotor from deluca.envs.classic._planar_quadrotor import dissipative from deluca.agents import ILQR from deluca.agents import ILC from deluca.agents import IGPC from deluca.agents._ilqr import rollout import numpy as np global_log = [] wind = 0.4 a...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns import tensorflow.keras print(tensorflow.__version__) # for GPU and not to overclock it which means that 50% of the GPU will be used and tensorflow, maybe won't be able to give proper results. from tensorflow.compat.v1 import ConfigProto from ...
github_jupyter
# This notebook is for SV3 results from QSO catalogs ``` import numpy as np import fitsio from matplotlib import pyplot as plt import os from astropy.table import Table,join,unique from desitarget.sv3 import sv3_targetmask ``` ## Look at z success based on Edmond's file ``` #read Edmond's file fq = Table.read('/glob...
github_jupyter
<h1>CS4618: Artificial Intelligence I</h1> <h1>Gradient Descent</h1> <h2> Derek Bridge<br> School of Computer Science and Information Technology<br> University College Cork </h2> <h1>Initialization</h1> $\newcommand{\Set}[1]{\{#1\}}$ $\newcommand{\Tuple}[1]{\langle#1\rangle}$ $\newcommand{\v}[1]{\pmb{#1}...
github_jupyter
# Set working directory ``` import os cwd = os.path.split(os.getcwd()) if cwd[-1] == 'tutorials': os.chdir('..') assert os.path.split(os.getcwd())[-1] == 'BRON' ``` # Import modules ``` import pandas as pd import csv import json import statistics import time from memory_profiler import memory_usage from typing ...
github_jupyter
# Photometric monitoring ## Setup ``` %load_ext autoreload %autoreload 2 import glob as glob import matplotlib as mpl import matplotlib.patheffects as PathEffects import matplotlib.pyplot as plt import matplotlib.transforms as transforms import numpy as np import pandas as pd import seaborn as sns import corner impo...
github_jupyter
# 09 - Ensemble Methods - Bagging by [Alejandro Correa Bahnsen](albahnsen.com/) version 0.2, May 2016 ## Part of the class [Machine Learning for Security Informatics](https://github.com/albahnsen/ML_SecurityInformatics) This notebook is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported Licens...
github_jupyter
``` # # This line imports the NumPy package import numpy as np ``` # Introduction **Pandas** is desgined to make data pre-processing and data analysis fast and easy in Python. Pandas adopts many coding idioms from NumPy, such as avoiding the `for` loops, but pandas is designed for working with heterogenous data repre...
github_jupyter
## How to forecast time series in BigQuery ML This notebook accompanies the article [How to do time series forecasting in BigQuery](https://towardsdatascience.com/how-to-do-time-series-forecasting-in-bigquery-af9eb6be8159) ## Install library and extensions if needed You don't need to do this if you use AI Platform N...
github_jupyter
This file is part of MADIP: Molecular Atlas Data Integration Pipeline This file provide some additional nomenclature refinements and concentrations calculation Copyright 2021 Blue Brain Project / EPFL Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complian...
github_jupyter
<img src="NYUDB-01.png"> # THE TRAGEDY OF THE PREQUELS ## Does bandwagoning in the Star Wars community <em> plague </em> Episodes I, II, and III? ### Feroz Khalidi, [*fk597@nyu.edu*](mailto:fk597@nyu.edu) ## A long time ago, in a galaxy not so far away... ...George Lucas created the epic space movie series called *...
github_jupyter
# Huggingface SageMaker-SDK - GPT2 Fine-tuning example 1. [Introduction](#Introduction) 2. [Development Environment and Permissions](#Development-Environment-and-Permissions) 1. [Installation](#Installation) 2. [Permissions](#Permissions) 3. [Uploading data to sagemaker_session_bucket](#Uploading-data-...
github_jupyter
# Maze tutorial In this tutorial, we tackle the maze problem. We use this classical game to demonstrate how - a new scikit-decide domain can be easily created - to find solvers from scikit-decide hub matching its characteristics - to apply a scikit-decide solver to a domain - to create its own rollout function to pl...
github_jupyter
``` # https://stackoverflow.com/questions/63714679/plotting-gannt-chart-using-timestamps # https://plotly.com/python-api-reference/generated/plotly.express.timeline.html # https://towardsdatascience.com/working-with-datetime-in-pandas-dataframe-663f7af6c587 import datetime as dt import numpy as np import matplotlib.py...
github_jupyter
# Analyze Facebook Data Using IBM Watson and IBM Watson Studio This is a three-part notebook meant to show how anyone can enrich and analyze a combined dataset of unstructured and structured information with IBM Watson and IBM Watson Studio. For this example we are using a standard Facebook Analytics export which feat...
github_jupyter
``` import sys, os import tensorflow as tf import numpy as np import json from PIL import Image import glob import matplotlib.pyplot as plt # colab에서 사용한다면 colab = False if colab: !git clone --depth 1 --branch ver1.1 https://github.com/malheading/Surface_Crack_Segmentation.git # filepath = '/content/Surface_Crac...
github_jupyter
<a href="https://colab.research.google.com/github/Dakini/AnimeColorDeOldify/blob/master/ImageColorizerColabSketch2Gray.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### **<font color='blue'> Artistic Colorizer </font>** #◢ DeOldify - Colorize you...
github_jupyter
``` import matplotlib.pyplot as plt %matplotlib inline plt.style.use('ggplot') import os import sys CURRENT_DIR = os.path.abspath(os.path.dirname(__name__)) LIBRARY_DIR = os.path.join(CURRENT_DIR, '..', '..') sys.path.append(LIBRARY_DIR) import os CURRENT_DIR = os.path.abspath(os.path.dirname(__name__)) def saveas(...
github_jupyter
# Passive Aggressive Regressor with Scale This Code template is for the regression analysis using a simple PassiveAggresiveRegressor based on the passive-aggressive algorithms and the feature rescaling technique used is Scale. Passive-aggressive algorithms are a group of algorithms for large-scale learning. ### Requi...
github_jupyter
``` # Cargar funciones de la librería de python data analysis import pandas as pd # Leer csv con datos y cargar en el dataframe data data = pd.read_csv("data/stockprices.csv") # Preview de las 5 primeras filas de data data.head() # Calcular variables con correlacion positiva o negativa superior a un umbral corMatr...
github_jupyter
# Analysis of trained models and training logs This notebook shows how to load, process, and analyze logs that are automatically generated during training. It also demonstrates how to make plots to examine performance of a single model or compare performance of multiple models. Prerequisites: - To run this example liv...
github_jupyter
``` %pylab inline ``` # FaceDetection - with high-level API (WebcamFaceDetector) ``` from facelib import WebcamFaceDetector detector = WebcamFaceDetector() # please wait: it shows a window detector.run() ``` - with low-level API(FaceDetector) ``` import matplotlib.pyplot as plt from facelib import FaceDetector ...
github_jupyter
This Notebook illustrates the usage of OpenMC's multi-group calculational mode with the Python API. This example notebook creates and executes the 2-D [C5G7](https://www.oecd-nea.org/science/docs/2003/nsc-doc2003-16.pdf) benchmark model using the `openmc.MGXSLibrary` class to create the supporting data library on the f...
github_jupyter
``` import numpy as np import tensorflow as tf from sklearn.utils import shuffle import re import time import collections import os def build_dataset(words, n_words, atleast=1): count = [['PAD', 0], ['GO', 1], ['EOS', 2], ['UNK', 3]] counter = collections.Counter(words).most_common(n_words) counter = [i for...
github_jupyter
``` import numpy as np import pandas as pd #import matplotlib.pylab as plt import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import silhouette_score from sklearn import cluster from sklearn.cluster import KMeans from sklearn.datasets import make_blobs import seaborn as ...
github_jupyter
## Inter-Subject Correlation and Inter-Subject Functional Correlation [Contributions](#contributions) The functional connectivity methods that we used in previous notebooks compared time series of BOLD activity between voxels within participant to infer how different regions of the brain were interacting. However, B...
github_jupyter
# Abnormality Detection in Musculoskeletal Radiographs The objective is to build a machine learning model that can detect an abnormality in the X-Ray radiographs. These models can help towards providing healthcare access to the parts of the world where access to skilled radiologists is limited. According to a study on...
github_jupyter
# D-optimal experiment design: comparing ABPG and Frank-Wolfe Solve the D-Optimal experiment design problem $$ \begin{array}{ll} \textrm{minimize} & F(x):=\log\left(\det\left(\sum_{i=1}^n x_i V_i V_i^T\right)\right) \\ \textrm{subject to} & \sum_{i=1}^n x_i = 1, \\ & x_i\geq 0, \quad i=1,\ldots,n...
github_jupyter
# Dictionaries The third and final new type of variable we'll introduce here is the **dictionary**. Like dictionaries where you look up words and are provided with a definition of that word, Python dictionaries store two pieces of information. These two pieces are referred to as the **key** and its **value**. Dictiona...
github_jupyter
# <center> Практические задания по цифровой обработке сигналов </center> # <center> Четвёртая лабораторная работа </center> # <center> Акустические признаки </center> ``` from glob import glob import hashlib import IPython.display as ipd import os import librosa import librosa.display import librosa.filters import ma...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Support-Vector-Machines" data-toc-modified-id="Support-Vector-Machines-1">Support Vector Machines</a></span></li><li><span><a href="#Prepare-data" data-toc-modified-id="Prepare-data-2">Prepare data</a></spa...
github_jupyter
# Federated PyTorch TinyImageNet Tutorial ## Using low-level Python API # Long-Living entities update * We now may have director running on another machine. * We use Federation API to communicate with Director. * Federation object should hold a Director's client (for user service) * Keeping in mind that several API i...
github_jupyter
# Acquire Sentinel-2 MSI Data for California This notebook is used for gathering data from California from the Sentinel-2 satellites. Specifically, we are looking to acquire the surface reflectance data (atmosphere corrected - level 2a) as that is what we did our baseline model testing and evaluation with using the Bi...
github_jupyter
``` import numpy as np parameters = {'W1': np.array([[-0.00416758, -0.00056267], [-0.02136196, 0.01640271], [-0.01793436, -0.00841747], [ 0.00502881, -0.01245288]]), 'W2': np.array([[-0.01057952, -0.00909008, 0.00551454, 0.02292208]]), 'b1': np.array([[ 0.], [ 0.], [ 0.], ...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns import os data_dir = os.path.join(os.pardir, "data") raw_dir = os.path.join(data_dir, "raw") ``` ## Training Data ``` train = pd.read_csv(os.path.join(raw_dir, "train", "train.csv"), nrows=10000000, ...
github_jupyter
# This notebook is to test a single batch run in ADAM ``` from adam import Batch from adam import Batches from adam import BatchRunManager from adam import PropagationParams from adam import OpmParams from adam import ConfigManager from adam import ProjectsClient from adam import RestRequests from adam import Authenti...
github_jupyter
#Price Momentum Factor Algorithm By Gil Wassermann Strategy taken from "130/30: The New Long-Only" by Andrew Lo and Pankaj Patel Part of the Quantopian Lecture Series: * www.quantopian.com/lectures * github.com/quantopian/research_public Notebook released under the Creative Commons Attribution 4.0 License. Please d...
github_jupyter
``` import os import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns from PIL import Image from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer from textblob import TextBlob import plotly.graph_objs as go from plotly.offline import download_plotl...
github_jupyter
# Showcasing Dataset and PipelineParameter This notebook demonstrates how a **FileDataset** or **TabularDataset** can be parametrized with **PipelineParameters** in an AML Pipeline. By parametrizing datasets, you can dynamically run pipeline experiments with different datasets without any code change. A common use ca...
github_jupyter
<img alt="QuantRocket logo" src="https://www.quantrocket.com/assets/img/notebook-header-logo.png"> © Copyright Quantopian Inc.<br> © Modifications Copyright QuantRocket LLC<br> Licensed under the [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/legalcode). <a href="https://www.quantrocke...
github_jupyter
# Job Sequencing with Integer Lengths # Hamiltonian We get a Hamiltonian from the paper below. https://arxiv.org/abs/1302.5843 $\displaystyle H = H_A + H_B$ $\displaystyle H_A = A \sum_{i=1}^N \left( 1 - \sum_\alpha x_{i,\alpha} \right)^2 + A\sum_{\alpha=1}^m \left( \sum_{n=1}^M ny_{n,\alpha} + \sum_i L_i \left( x...
github_jupyter
``` ## import modules import pandas as pd import re import numpy as np ## tell python to display output and print multiple objects from IPython.display import display, HTML from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = "all" ## create range b/t start and end date...
github_jupyter
# Week 10 Discussion ## Infographic * [Racial Discrimination in Auto Insurance Prices][propublica] [propublica]: https://www.propublica.org/article/minority-neighborhoods-higher-car-insurance-premiums-methodology ## Links * [Learn X in Y Minutes, X = JavaScript][js-intro] -- a brief intro to JavaScript * [MDN Java...
github_jupyter
# Self-Driving Car Engineer Nanodegree ## Project: **Finding Lane Lines on the Road** *** In this project, you will use the tools you learned about in the lesson to identify lane lines on the road. You can develop your pipeline on a series of individual images, and later apply the result to a video stream (really j...
github_jupyter
``` %load_ext autoreload %autoreload 2 import qcodes as qc ``` # QCoDeS config The QCoDeS config module uses JSON files to store QCoDeS configuration. The config file controls various options to QCoDeS such as the default path and name of the database in which your data is stored and logging level of the debug outpu...
github_jupyter
![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fcallysto%2Fcurriculum-notebooks&branch=master&subPath=Health/CALM/CALM-moving-out-3.ipynb&dep...
github_jupyter
# Assignment 1 - Python Basics Practice *This assignment is a part of the course ["Data Analysis with Python: Zero to Pandas"](https://jovian.ml/learn/data-analysis-with-python-zero-to-pandas)* In this assignment, you'll get to practice some of the concepts and skills covered in the following notebooks: 1. [First St...
github_jupyter
# Particle Swarm Optimization >Investigación y entendimiento del algoritmo. La idea de este notebook es revisar la implementación del algoritmo particle swarm optimization de manera general para tener una idea de la lógica, intuición y los parámetros que éste contempla. ``` import random import math import matplotli...
github_jupyter
``` #export from fastai2.data.all import * from fastai2.text.core import * from nbdev.showdoc import * #default_exp text.models.awdlstm #default_cls_lvl 3 ``` # AWD-LSTM > AWD LSTM from [Smerity et al.](https://arxiv.org/pdf/1708.02182.pdf) ## Basic NLP modules On top of the pytorch or the fastai [`layers`](/layers...
github_jupyter
### Simulating From the Null Hypothesis Load in the data below, and use the exercises to assist with answering the quiz questions below. ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline np.random.seed(42) full_data = pd.read_csv('coffee_dataset.csv') sample_data = full_d...
github_jupyter
# Schnellere Zufallsspiele Beschleunige die zufälligen Spiele indem nicht erst Züge generiert werden die dann an dem RandomPlayer gegeben werden um einen zufälligen zu erhalten. Stattdessen wird einfach ein zufälliger Stein zweimal um 1-6 Schritte bewegt (falls möglich). Diese Methode ist für MCTS sehr wichtig, insbes...
github_jupyter