code
stringlengths
2.5k
150k
kind
stringclasses
1 value
# 09 Strain Gage This is one of the most commonly used sensor. It is used in many transducers. Its fundamental operating principle is fairly easy to understand and it will be the purpose of this lecture. A strain gage is essentially a thin wire that is wrapped on film of plastic. <img src="img/StrainGage.png" wi...
github_jupyter
``` #export from fastai.basics import * from fastai.tabular.core import * from fastai.tabular.model import * from fastai.tabular.data import * #hide from nbdev.showdoc import * #default_exp tabular.learner ``` # Tabular learner > The function to immediately get a `Learner` ready to train for tabular data The main fu...
github_jupyter
# Aerospike Connect for Spark - SparkML Prediction Model Tutorial ## Tested with Java 8, Spark 3.0.0, Python 3.7, and Aerospike Spark Connector 3.0.0 ## Summary Build a linear regression model to predict birth weight using Aerospike Database and Spark. Here are the features used: - gestation weeks - mother’s age - fat...
github_jupyter
## Concurrency with asyncio ### Thread vs. coroutine ``` # spinner_thread.py import threading import itertools import time import sys class Signal: go = True def spin(msg, signal): write, flush = sys.stdout.write, sys.stdout.flush for char in itertools.cycle('|/-\\'): status = char + ' ' + msg ...
github_jupyter
## Problem 1 --- #### The solution should try to use all the python constructs - Conditionals and Loops - Functions - Classes #### and datastructures as possible - List - Tuple - Dictionary - Set ### Problem --- Moist has a hobby -- collecting figure skating trading cards. His card collection has been growing, an...
github_jupyter
<a href="http://cocl.us/pytorch_link_top"> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DL0110EN/notebook_images%20/Pytochtop.png" width="750" alt="IBM Product " /> </a> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DL0110EN...
github_jupyter
``` import nltk from nltk.stem import PorterStemmer from nltk.corpus import stopwords import re paragraph = """I have three visions for India. In 3000 years of our history, people from all over the world have come and invaded us, captured our lands, conquered our minds. From Alexander on...
github_jupyter
# Classification on Iris dataset with sklearn and DJL In this notebook, you will try to use a pre-trained sklearn model to run on DJL for a general classification task. The model was trained with [Iris flower dataset](https://en.wikipedia.org/wiki/Iris_flower_data_set). ## Background ### Iris Dataset The dataset c...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Algorithms/landsat_radiance.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
# Import Libraries ``` from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision from torchvision import datasets, transforms %matplotlib inline import matplotlib.pyplot as plt ``` ## Data Transformations We first start wi...
github_jupyter
``` %cd /Users/Kunal/Projects/TCH_CardiacSignals_F20/ from numpy.random import seed seed(1) import numpy as np import os import matplotlib.pyplot as plt import tensorflow tensorflow.random.set_seed(2) from tensorflow import keras from tensorflow.keras.callbacks import EarlyStopping from tensorflow.keras.regularizers im...
github_jupyter
# basic operation on image ``` import cv2 import numpy as np impath = r"D:/Study/example_ml/computer_vision_example/cv_exercise/opencv-master/samples/data/messi5.jpg" img = cv2.imread(impath) print(img.shape) print(img.size) print(img.dtype) b,g,r = cv2.split(img) img = cv2.merge((b,g,r)) cv2.imshow("image",img) cv2....
github_jupyter
Create a list of valid Hindi literals ``` a = list(set(list("ऀँंःऄअआइईउऊऋऌऍऎएऐऑऒओऔकखगघङचछजझञटठडढणतथदधनऩपफबभमयरऱलळऴवशषसहऺऻ़ऽािीुूृॄॅॆेैॉॊोौ्ॎॏॐ॒॑॓॔ॕॖॗक़ख़ग़ज़ड़ढ़फ़य़ॠॡॢॣ।॥॰ॱॲॳॴॵॶॷॸॹॺॻॼॽॾॿ-"))) len(genderListCleared),len(set(genderListCleared)) genderListCleared = list(set(genderListCleared)) mCount = 0 fCount = 0 nCount = 0 f...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib import seaborn as sns import matplotlib.pyplot as plt pd.set_option('display.max_colwidth', -1) default = pd.read_csv('./results/results_default.csv') new = pd.read_csv('./results/results_new.csv') selected_cols = ['model','hyper','metric','value'] default = ...
github_jupyter
``` import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import style import matplotlib.ticker as ticker import seaborn as sns from sklearn.datasets import load_boston from sklearn.ensemble import RandomForestClassifier, VotingClassifier, GradientBoostingClassifier from sklearn.metrics...
github_jupyter
# Delfin ### Installation Run the following cell to install osiris-sdk. ``` !pip install osiris-sdk --upgrade ``` ### Access to dataset There are two ways to get access to a dataset 1. Service Principle 2. Access Token #### Config file with Service Principle If done with **Service Principle** it is adviced to add ...
github_jupyter
<a href="https://colab.research.google.com/github/PradyumnaKrishna/Colab-Hacks/blob/RDP-v2/Colab%20RDP/Colab%20RDP.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # **Colab RDP** : Remote Desktop to Colab Instance Used Google Remote Desktop & Ngrok...
github_jupyter
``` from xml.dom import expatbuilder import numpy as np import matplotlib.pyplot as plt import struct import os # should be in the same directory as corresponding xml and csv eis_filename = '/example/path/to/eis_image_file.dat' image_fn, image_ext = os.path.splitext(eis_filename) eis_xml_filename = image_fn + ".xml" ``...
github_jupyter
# Cryptocurrency Clusters ``` %matplotlib inline #import dependencies from pathlib import Path import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler from sklearn.manifold import TSNE from sklearn.decomposition import PCA from sklearn.cluster import KMea...
github_jupyter
Our best model - Catboost with learning rate of 0.7 and 180 iterations. Was trained on 10 files of the data with similar distribution of the feature user_target_recs (among the number of rows of each feature value). We received an auc of 0.845 on the kaggle leaderboard #Mount Drive ``` from google.colab import drive ...
github_jupyter
# Random Search Algorithms ### Importing Necessary Libraries ``` import six import sys sys.modules['sklearn.externals.six'] = six import mlrose import numpy as np import pandas as pd import seaborn as sns import mlrose_hiive import matplotlib.pyplot as plt np.random.seed(44) sns.set_style("darkgrid") ``` ### Definin...
github_jupyter
``` %matplotlib inline ``` Performance Tuning Guide ************************* **Author**: `Szymon Migacz <https://github.com/szmigacz>`_ Performance Tuning Guide is a set of optimizations and best practices which can accelerate training and inference of deep learning models in PyTorch. Presented techniques often can...
github_jupyter
# 78. Subsets __Difficulty__: Medium [Link](https://leetcode.com/problems/subsets/) Given an integer array `nums` of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. __Example 1__: Input: `nums = [1,2,3]` Output: `[...
github_jupyter
``` #r "nuget:Microsoft.ML,1.4.0" #r "nuget:Microsoft.ML.AutoML,0.16.0" #r "nuget:Microsoft.Data.Analysis,0.1.0" using Microsoft.Data.Analysis; using XPlot.Plotly; using Microsoft.AspNetCore.Html; Formatter<DataFrame>.Register((df, writer) => { var headers = new List<IHtmlContent>(); headers.Add(th(i("index")))...
github_jupyter
# Chapter 8 - Applying Machine Learning To Sentiment Analysis ### Overview - [Obtaining the IMDb movie review dataset](#Obtaining-the-IMDb-movie-review-dataset) - [Introducing the bag-of-words model](#Introducing-the-bag-of-words-model) - [Transforming words into feature vectors](#Transforming-words-into-feature-ve...
github_jupyter
<a href="https://colab.research.google.com/github/satyajitghana/TSAI-DeepNLP-END2.0/blob/main/09_NLP_Evaluation/ClassificationEvaluation.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` ! pip3 install git+https://github.com/extensive-nlp/ttc_nlp ...
github_jupyter
# MultiGroupDirectLiNGAM ## Import and settings In this example, we need to import `numpy`, `pandas`, and `graphviz` in addition to `lingam`. ``` import numpy as np import pandas as pd import graphviz import lingam from lingam.utils import print_causal_directions, print_dagc, make_dot print([np.__version__, pd.__ver...
github_jupyter
![image](./images/pandas.png) Pandas est le package de prédilection pour traiter des données structurées. Pandas est basé sur 2 structures extrêmement liées les Series et le DataFrame. Ces deux structures permettent de traiter des données sous forme de tableaux indexés. Les classes de Pandas utilisent des classes d...
github_jupyter
``` #@title Copyright 2020 Google LLC. Double-click here for license information. # 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 requ...
github_jupyter
## Analisis de O3 y SO2 arduair vs estacion universidad pontificia bolivariana Se compararon los resultados generados por el equipo arduair y la estacion de calidad de aire propiedad de la universidad pontificia bolivariana seccional bucaramanga Cabe resaltar que durante la ejecucion de las pruebas, el se sospechaba e...
github_jupyter
## Accessing TerraClimate data with the Planetary Computer STAC API [TerraClimate](http://www.climatologylab.org/terraclimate.html) is a dataset of monthly climate and climatic water balance for global terrestrial surfaces from 1958-2019. These data provide important inputs for ecological and hydrological studies at g...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Automated Machine Learning _**ディープラーンニングを利用したテキスト分類**_ ## Contents 1. [事前準備](#1.-事前準備) 1. [自動機械学習 Automated Machine Learning](2.-自動機械学習-Automated-Machine-Learning) 1. [結果の確認](#3.-結果の確認) ## 1. 事前準備 本デモンストレーションでは、AutoML の深層学習...
github_jupyter
<a href="https://colab.research.google.com/github/pszemraj/ml4hc-s22-project01/blob/autogluon-results/notebooks/colab/automl-baseline/process_autogluon_results.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #process_autogluon_results - cleans up t...
github_jupyter
<h1> Repeatable splitting </h1> In this notebook, we will explore the impact of different ways of creating machine learning datasets. <p> Repeatability is important in machine learning. If you do the same thing now and 5 minutes from now and get different answers, then it makes experimentation is difficult. In other...
github_jupyter
Import the necessary imports ``` from __future__ import print_function, division, absolute_import import tensorflow as tf from tensorflow.contrib import keras import numpy as np import os from sklearn import preprocessing from sklearn.metrics import confusion_matrix import itertools import cPickle #python 2.x #impor...
github_jupyter
# IDS Instruction: Regression (Lisa Mannel) ## Simple linear regression First we import the packages necessary fo this instruction: ``` import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error, mean_absolut...
github_jupyter
``` import numpy as np import pandas as pd from datetime import date from random import seed from random import random import time import scipy, scipy.signal import os, os.path import shutil import matplotlib import matplotlib.pyplot as plt from pylab import imshow # vgg16 model used for transfer learning on the dog...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.cross_validation import train_test_split from sklearn.metrics import accuracy_score from sklearn.preprocessing import StandardScaler data = pd.read_csv('Social_Network_Ads.csv') data.head() data.isnull().sum() from sklearn import ...
github_jupyter
# Spark SQL Spark SQL is arguably one of the most important and powerful features in Spark. In a nutshell, with Spark SQL you can run SQL queries against views or tables organized into databases. You also can use system functions or define user functions and analyze query plans in order to optimize their workloads. Th...
github_jupyter
``` import numpy as np import cv2 import matplotlib import matplotlib.pyplot as plt import matplotlib as mpimg import numpy as np from IPython.display import HTML import os, sys import glob import moviepy from moviepy.editor import VideoFileClip from moviepy.editor import * from IPython import display from IPython.cor...
github_jupyter
## Как выложить бота на HEROKU *Подготовил Ян Пиле* Сразу оговоримся, что мы на heroku выкладываем **echo-Бота в телеграме, написанного с помощью библиотеки [pyTelegramBotAPI](https://github.com/eternnoir/pyTelegramBotAPI)**. А взаимодействие его с сервером мы сделаем с использованием [flask](http://flask.pocoo.org...
github_jupyter
<a href="https://colab.research.google.com/github/JimKing100/DS-Unit-2-Kaggle-Challenge/blob/master/Kaggle_Challenge_Assignment_Submission5.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # Installs %%capture !pip install --upgrade category_enco...
github_jupyter
``` import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import pickle # Read in an image image = mpimg.imread('signs_vehicles_xygrad.png') def abs_sobel_thresh(img, orient='x', sobel_kernel=3, thresh=(0, 255)): # Apply the following steps to img # 1) Convert to grays...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import numba from tqdm import tqdm import eitest ``` # Data generators ``` @numba.njit def event_series_bernoulli(series_length, event_count): '''Generate an iid Bernoulli distributed event series. series_length: length of the event series event_cou...
github_jupyter
## The Analysis of The Evolution of The Russian Comedy. Part 3. In this analysis,we will explore evolution of the French five-act comedy in verse based on the following features: - The coefficient of dialogue vivacity; - The percentage of scenes with split verse lines; - The percentage of scenes with split rhymes; - ...
github_jupyter
# Lalonde Pandas API Example by Adam Kelleher We'll run through a quick example using the high-level Python API for the DoSampler. The DoSampler is different from most classic causal effect estimators. Instead of estimating statistics under interventions, it aims to provide the generality of Pearlian causal inference....
github_jupyter
# Welcome to the Datenguide Python Package Within this notebook the functionality of the package will be explained and demonstrated with examples. ### Topics - Import - get region IDs - get statstic IDs - get the data - for single regions - for multiple regions ## 1. Import **Import the helper functions 'g...
github_jupyter
``` pip install pandera pip install gcsfs import os import pandas as pd from google.cloud import storage serviceAccount = '/content/Chave Ingestao Apache.json' os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = serviceAccount #leitura do arquivo em JSON df = pd.read_json(r'gs://projeto-final-grupo09/entrada_dados/Projeto F...
github_jupyter
# Chapter 4 `Original content created by Cam Davidson-Pilon` `Ported to Python 3 and PyMC3 by Max Margenot (@clean_utensils) and Thomas Wiecki (@twiecki) at Quantopian (@quantopian)` ______ ## The greatest theorem never told This chapter focuses on an idea that is always bouncing around our minds, but is rarely ma...
github_jupyter
# PTN Template This notebook serves as a template for single dataset PTN experiments It can be run on its own by setting STANDALONE to True (do a find for "STANDALONE" to see where) But it is intended to be executed as part of a *papermill.py script. See any of the experimentes with a papermill script to get sta...
github_jupyter
``` %matplotlib inline ``` Neural Networks =============== Neural networks can be constructed using the ``torch.nn`` package. Now that you had a glimpse of ``autograd``, ``nn`` depends on ``autograd`` to define models and differentiate them. An ``nn.Module`` contains layers, and a method ``forward(input)`` that ret...
github_jupyter
# Classifying Fashion-MNIST Now it's your turn to build and train a neural network. You'll be using the [Fashion-MNIST dataset](https://github.com/zalandoresearch/fashion-mnist), a drop-in replacement for the MNIST dataset. MNIST is actually quite trivial with neural networks where you can easily achieve better than 9...
github_jupyter
``` # Copyright 2020 Erik Härkönen. All rights reserved. # This file is licensed to you 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 app...
github_jupyter
# Importing Dependencies ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import pandas_datareader import pandas_datareader.data as web import datetime from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from keras.layers import Dense,LS...
github_jupyter
# Hyperparameter tuning with Cloud AI Platform **Learning Objectives:** * Improve the accuracy of a model by hyperparameter tuning ``` import os PROJECT = 'qwiklabs-gcp-faf328caac1ef9a0' # REPLACE WITH YOUR PROJECT ID BUCKET = 'qwiklabs-gcp-faf328caac1ef9a0' # REPLACE WITH YOUR BUCKET NAME REGION = 'us-east1' # REP...
github_jupyter
# Köhn In this notebook I replicate Koehn (2015): _What's in an embedding? Analyzing word embeddings through multilingual evaluation_. This paper proposes to i) evaluate an embedding method on more than one language, and ii) evaluate an embedding model by how well its embeddings capture syntactic features. He uses an ...
github_jupyter
``` # In this exercise you will train a CNN on the FULL Cats-v-dogs dataset # This will require you doing a lot of data preprocessing because # the dataset isn't split into training and validation for you # This code block has all the required inputs import os import zipfile import random import tensorflow as tf from t...
github_jupyter
``` # Confidence interval and bias comparison in the multi-armed bandit # setting of https://arxiv.org/pdf/1507.08025.pdf import numpy as np import pandas as pd import scipy.stats as stats import time import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set(style='white', palette='colorblind', c...
github_jupyter
# Transfer Learning Template ``` %load_ext autoreload %autoreload 2 %matplotlib inline import os, json, sys, time, random import numpy as np import torch from torch.optim import Adam from easydict import EasyDict import matplotlib.pyplot as plt from steves_models.steves_ptn import Steves_Prototypical_Network ...
github_jupyter
<a href="https://colab.research.google.com/github/s-mostafa-a/pytorch_learning/blob/master/simple_generative_adversarial_net/MNIST_GANs.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` import torch from torchvision.transforms import ToTensor, Nor...
github_jupyter
``` import pandas as pd import numpy as np import os import matplotlib.mlab as mlab import matplotlib.pyplot as plt import seaborn def filterOutlier(data_list,z_score_threshold=3.5): """ Filters out outliers using the modified Z-Score method. """ # n = len(data_list) # z_score_threshold = (n-1)/np.sqrt(n) data ...
github_jupyter
# Matrix > Marcos Duarte > Laboratory of Biomechanics and Motor Control ([http://demotu.org/](http://demotu.org/)) > Federal University of ABC, Brazil A matrix is a square or rectangular array of numbers or symbols (termed elements), arranged in rows and columns. For instance: $$ \mathbf{A} = \begin{bmatrix} ...
github_jupyter
<a href="https://colab.research.google.com/github/mzkhan2000/KG-Embeddings/blob/main/embedding_word_clusters2.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` # Python program to generate embedding (word vectors) using Word2Vec # importing neces...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt dataset1=pd.read_csv('general_data.csv') dataset1.head() dataset1.columns dataset1 dataset1.isnull() dataset1.duplicated() dataset1.drop_duplicates() dataset3=dataset1[['Age','DistanceFromHome','Education','MonthlyIncome', 'NumCompaniesWorked', ...
github_jupyter
# Convolutional Networks So far we have worked with deep fully-connected networks, using them to explore different optimization strategies and network architectures. Fully-connected networks are a good testbed for experimentation because they are very computationally efficient, but in practice all state-of-the-art res...
github_jupyter
# Pre-processing and analysis for one-source with distance 25 ## Load or create R scripts ``` get.data <- dget("get_data.r") #script to read data files get.pars <- dget("get_pars.r") #script to extract relevant parameters from raw data get.mv.bound <- dget("get_mvbound.r") #script to look at movement of boundary acro...
github_jupyter
# About 此笔记包含了以下内容: * keras 的基本使用 * 组合特征 * 制作dataset * 模型的存取(2种方式) * 添加检查点 ``` import tensorflow as tf from tensorflow.keras import layers import numpy as np import matplotlib.pyplot as plt import math from tensorflow.keras.utils import plot_model import os # fea_x = [i for i in np.arange(0, math.pi * 2.0, 0.01)] # ...
github_jupyter
# Advent of Code 2016 ``` data = open('data/day_1-1.txt', 'r').readline().strip().split(', ') class TaxiCab: def __init__(self, data): self.data = data self.double_visit = [] self.position = {'x': 0, 'y': 0} self.direction = {'x': 0, 'y': 1} self.grid = {i: {j: 0 for j ...
github_jupyter
# [Strings](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str) ``` my_string = 'Python is my favorite programming language!' my_string type(my_string) len(my_string) ``` ## Respecting [PEP8](https://www.python.org/dev/peps/pep-0008/#maximum-line-length) with long strings ``` long_story = ('Lorem...
github_jupyter
# FAQ ## I have heard of autoML and automated feature engineering, how is this different? AutoML targets solving the problem once the labels or targets one wants to predict are well defined and available. Feature engineering focuses on generating features, given a dataset, labels, and targets. Both assume that the t...
github_jupyter
# ADVANCED TEXT MINING - 본 자료는 텍스트 마이닝을 활용한 연구 및 강의를 위한 목적으로 제작되었습니다. - 본 자료를 강의 목적으로 활용하고자 하시는 경우 꼭 아래 메일주소로 연락주세요. - 본 자료에 대한 허가되지 않은 배포를 금지합니다. - 강의, 저작권, 출판, 특허, 공동저자에 관련해서는 문의 바랍니다. - **Contact : ADMIN(admin@teanaps.com)** --- ## WEEK 02-2. Python 자료구조 이해하기 - 텍스트 데이터를 다루기 위한 Python 자료구조에 대해 다룹니다. --- ### 1. 리...
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
# Code along 4 ## Scale, Standardize, or Normalize with scikit-learn ### När ska man använda MinMaxScaler, RobustScaler, StandardScaler, och Normalizer ### Attribution: Jeff Hale ### Varför är det ofta nödvändigt att genomföra så kallad variable transformation/feature scaling det vill säga, standardisera, normalisera...
github_jupyter
# Tutorial 2. Solving a 1D diffusion equation ``` # Document Author: Dr. Vishal Sharma # Author email: sharma_vishal14@hotmail.com # License: MIT # This tutorial is applicable for NAnPack version 1.0.0-alpha4 ``` ### I. Background The objective of this tutorial is to present the step-by-step solution of a 1D diffus...
github_jupyter
# lesson goals * Intro to markdown, plain text-based syntax for formatting docs * markdown is integrated into the jupyter notebook ## What is markdown? * developed in 2004 by John Gruber - a way of formatting text - a perl utility for converting markdown into html **plain text files** have many advantages of...
github_jupyter
``` import tensorflow as tf from tensorflow.keras.callbacks import TensorBoard import os import matplotlib.pyplot as plt import numpy as np import random import cv2 import time training_path = "fruits-360_dataset/Training" test_path = "fruits-360_dataset/Test" try: STATS = np.load("stats.npy", allow_pickle=True...
github_jupyter
# <span style="color:Maroon">Trade Strategy __Summary:__ <span style="color:Blue">In this code we shall test the results of given model ``` # Import required libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import os np.random.seed(0) import warnings warnings.filterwarnings('ignore') #...
github_jupyter
``` import numpy as np import math import matplotlib.pyplot as plt input_data = np.array([math.cos(x) for x in np.arange(200)]) plt.plot(input_data[:50]) plt.show X = [] Y = [] size = 50 number_of_records = len(input_data) - size for i in range(number_of_records - 50): X.append(input_data[i:i+size]) Y.append(input...
github_jupyter
# Monte Carlo Integration with Python ## Dr. Tirthajyoti Sarkar ([LinkedIn](https://www.linkedin.com/in/tirthajyoti-sarkar-2127aa7/), [Github](https://github.com/tirthajyoti)), Fremont, CA, July 2020 --- ### Disclaimer The inspiration for this demo/notebook stemmed from [Georgia Tech's Online Masters in Analytics (...
github_jupyter
This illustrates the datasets.make_multilabel_classification dataset generator. Each sample consists of counts of two features (up to 50 in total), which are differently distributed in each of two classes. Points are labeled as follows, where Y means the class is present: | 1 | 2 | 3 | Color | |--- |--- |--- |--...
github_jupyter
Log the concentrations to and learn the models for CaCO3 again to avoid 0 happen in the prediction. ``` import numpy as np import pandas as pd import dask.dataframe as dd import matplotlib.pyplot as plt import seaborn as sns plt.style.use('ggplot') #plt.style.use('seaborn-whitegrid') plt.style.use('seaborn-colorblin...
github_jupyter
[Table of Contents](http://nbviewer.ipython.org/github/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/table_of_contents.ipynb) # Kalman Filter Math ``` #format the book %matplotlib inline from __future__ import division, print_function from book_format import load_style load_style() ``` If you've gotten th...
github_jupyter
# Multiple linear regression In many data sets there may be several predictor variables that have an effect on a response variable. In fact, the *interaction* between variables may also be used to predict response. When we incorporate these additional predictor variables into the analysis the model is called *mult...
github_jupyter
# Generative Adversarial Network In this notebook, we'll be building a generative adversarial network (GAN) trained on the MNIST dataset. From this, we'll be able to generate new handwritten digits! GANs were [first reported on](https://arxiv.org/abs/1406.2661) in 2014 from Ian Goodfellow and others in Yoshua Bengio'...
github_jupyter
# Intro to Machine Learning with Classification ## Contents 1. **Loading** iris dataset 2. Splitting into **train**- and **test**-set 3. Creating a **model** and training it 4. **Predicting** test set 5. **Evaluating** the result 6. Selecting **features** This notebook will introduce you to Machine Learning and class...
github_jupyter
420-A52-SF - Algorithmes d'apprentissage supervisé - Hiver 2020 - Spécialisation technique en Intelligence Artificielle - Mikaël Swawola, M.Sc. <br/> ![Travaux Pratiques - Moneyball NBA](static/06-tp-banner.png) <br/> **Objectif:** cette séance de travaux pratique est consacrée à la mise en oeuvre de l'ensemble des con...
github_jupyter
<a href="https://colab.research.google.com/github/keirwilliamsxyz/keirxyz/blob/main/Multi_Perceptor_VQGAN_%2B_CLIP_%5BPublic%5D.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Multi-Perceptor VQGAN + CLIP (v.3.2021.11.29) by [@remi_durant](https:/...
github_jupyter
``` # Copyright 2021 Google LLC # # 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 writi...
github_jupyter
# WikiPathways and py4cytoscape ## Yihang Xin and Alex Pico ## 2020-11-10 WikiPathways is a well-known repository for biological pathways that provides unique tools to the research community for content creation, editing and utilization [@Pico2008]. Python is an interpreted, high-level and general-purpose programming...
github_jupyter
# Plotting with Matplotlib ## What is `matplotlib`? * `matplotlib` is a 2D plotting library for Python * It provides quick way to visualize data from Python * It comes with a set plots * We can import its functions through the command ```Python import matplotlib.pyplot as plt ``` ``` import numpy as np import matpl...
github_jupyter
# Classes For more information on the magic methods of pytho classes, consult the docs: https://docs.python.org/3/reference/datamodel.html ``` class DumbClass: """ This class is just meant to demonstrate the magic __repr__ method """ def __repr__(self): """ I'm giving this method a docstring ...
github_jupyter
# Estimation on real data using MSM ``` from consav import runtools runtools.write_numba_config(disable=0,threads=4) %matplotlib inline %load_ext autoreload %autoreload 2 # Local modules from Model import RetirementClass import figs import SimulatedMinimumDistance as SMD # Global modules import numpy as np import p...
github_jupyter
<a href="https://colab.research.google.com/github/clemencia/ML4PPGF_UERJ/blob/master/Exemplos_DR/Exercicios_DimensionalReduction.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> #Mais Exercícios de Redução de Dimensionalidade Baseado no livro "Pytho...
github_jupyter
## Ejemplos aplicaciones de las distribuciones de probabilidad ## Ejemplo Binomial Un modelo de precio de opciones, el cual intente modelar el precio de un activo $S(t)$ en forma simplificada, en vez de usar ecuaciones diferenciales estocásticas. De acuerdo a este modelo simplificado, dado el precio del activo actual...
github_jupyter
<a href="https://colab.research.google.com/github/sanjaykmenon/DS-Unit-1-Sprint-1-Dealing-With-Data/blob/master/module3-databackedassertions/Sanjay_Krishna_LS_DS_113_Making_Data_backed_Assertions_Assignment.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>...
github_jupyter
# Working with Pytrees [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/google/jax/blob/main/docs/jax-101/05.1-pytrees.ipynb) *Author: Vladimir Mikulik* Often, we want to operate on objects that look like dicts of arrays, or lists of lists of dicts...
github_jupyter
<a href="https://colab.research.google.com/github/JohnParken/iigroup/blob/master/pycorrector_threshold_1.1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### 准备工作 ``` from google.colab import drive drive.mount('/content/drive') import os os.chdi...
github_jupyter
``` import matplotlib.pyplot as plt import pandas as pd import numpy as np import requests import time from scipy.stats import linregress import psycopg2 from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String, Float from api_keys import client_id from twitch import TwitchClient from pprint impor...
github_jupyter
``` import CNN2Head_input import tensorflow as tf import numpy as np SAVE_FOLDER = '/home/ubuntu/coding/cnn/multi-task-learning/save/current' _, smile_test_data = CNN2Head_input.getSmileImage() _, gender_test_data = CNN2Head_input.getGenderImage() _, age_test_data = CNN2Head_input.getAgeImage() def eval_smile_gend...
github_jupyter
``` #import libraries import numpy as np import pandas as pd print('The pandas version is {}.'.format(pd.__version__)) from pandas import read_csv from random import random import sklearn print('The scikit-learn version is {}.'.format(sklearn.__version__)) from sklearn.model_selection import train_test_split, cross_v...
github_jupyter