text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
<div class="alert alert-block alert-info" style="margin-top: 20px"> <a href="https://cocl.us/topNotebooksPython101Coursera"> <img src="https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/PY0101EN/Ad/TopAd.png" width="750" align="center"> </a> </div> <a href="https://cognit...
github_jupyter
# Modeling and Simulation in Python Chapter 6 Copyright 2017 Allen Downey License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0) ``` # Configure Jupyter so figures appear in the notebook %matplotlib inline # Configure Jupyter to display the assigned value after an as...
github_jupyter
# Hierarchical Live sellers ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.style as style from datetime import datetime as dt style.use('ggplot') #importando dataset e dropando colunas vazias e sem informação útil dataset = pd.read_csv("Live.csv").drop(columns = {'status_i...
github_jupyter
### 참고 사이트 glove model : https://jxnjxn.tistory.com/49 mecab : https://github.com/SOMJANG/Mecab-ko-for-Google-Colab mecab : https://velog.io/@kjyggg/ %ED%98%95%ED%83%9C%EC%86%8C-%EB%B6%84%EC%84%9D%EA%B8%B0-Mecab-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0-A-to-Z%EC%84%A4%EC%B9%98%EB%B6%80%ED%84%B0-%EB%8B%A8%EC%96%B4-%EC%...
github_jupyter
# A TRIGA geometry This notebook can be used as a template for modeling TRIGA reactors. ``` %matplotlib inline import numpy as np import openmc # Materials definitions # Borated water water = openmc.Material(name='Borated Water') water.set_density('g/cm3', 0.740582) water.add_nuclide('H1', 4.9457e-2) water.add_nucli...
github_jupyter
``` import config ''' Lets print all the variable for the pinouts on board ''' def get_variable_module_name(module_name): module = globals().get(module_name, None) variable = {} if module: variable = {key: value for key, value in module.__dict__.iteritems() if not (key.startswith('__') or key.starts...
github_jupyter
This notebook is an analysis of predictive accuracy in relative free energy calculations from the Schrödinger JACS dataset: > Wang, L., Wu, Y., Deng, Y., Kim, B., Pierce, L., Krilov, G., ... & Romero, D. L. (2015). Accurate and reliable prediction of relative ligand binding potency in prospective drug discovery by way ...
github_jupyter
# Inference and Validation ``` import torch from torchvision import datasets, transforms # Define a transform to normalize the data transform = transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,)) ]) # Download and load the training data trainset = datasets...
github_jupyter
# Assessing Corpus Quality ### In this notebook, we'll learn about assessing corpus quality and potentially correcting problems. ## Potential Problem areas 1. Unexpected characters 1. Improperly joined words 1. Loanwords ### We will consider each of these in turn. ### Datasets: We'll be using the freely available CLTK...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Reducer/stats_by_group.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_blank" href=...
github_jupyter
# Reinforcement Learning В этом задании постараемся разобраться в проблеме обучения с подкреплением, реализуем алгоритм REINFORCE и научим агента с помощью этого алгоритма играть в игру Cartpole. Установим и импортируем необходимые библиотеки, а также вспомогательные функции для визуализации игры агента. ``` !pip in...
github_jupyter
``` # import necessary modules # uncomment to get plots displayed in notebook %matplotlib inline import matplotlib import matplotlib.pyplot as plt import numpy as np from classy import Class from scipy.optimize import fsolve from scipy.interpolate import interp1d import math # esthetic definitions for the plots font = ...
github_jupyter
# Agregando funciones no lineales a las capas > Transformaciones no lineales para mejorar las predicciones de nuestras redes Algunas de las transformaciones no lineales más comunes en una red neuronal son la funcion ```sigmoide```, ```tanh``` y ```ReLU``` Para agregar estas funciones debemos agregar los siguientes met...
github_jupyter
# Convolutional Neural Networks CNNs are a twist on the neural network concept designed specifically to process data with spatial relationships. In the deep neural networks we've seen so far every node is always connected to every other node in the subsequent layer. While spatial relationships CAN be captured, as we'v...
github_jupyter
# Lasso and Ridge Regression **Lasso regression:** It is a type of linear regression that uses shrinkage. Shrinkage is where data values are shrunk towards a central point, like the mean. <hr> **Ridge Regression:** It is a way to create a predictive and explonatory model when the number of predictor variables in a s...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import seaborn as sns # Plot parameters sns.set() %pylab inline pylab.rcParams['figure.figsize'] = (4, 4) plt.rcParams['xtick.major.size'] = 0 plt.rcParams['ytick.major.size'] = 0 # Avoid inaccurate floating values (for inverse matrices in dot product for instance)...
github_jupyter
## Text Similarity using Word Embeddings In this notebook we're going to play around with pre build word embeddings and do some fun calcultations: ``` %matplotlib inline import os from keras.utils import get_file import gensim import subprocess import numpy as np import matplotlib.pyplot as plt from IPython.core.pyl...
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 sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split import pandas as pd import numpy as np import pandas_profiling %matplotlib inline !dir %cd .\decision_tree !dir df = pd.read_csv(".\\credit_cards_dataset.csv") df['EDUCATION'].plot.hist() #df.describe() #df['PAY...
github_jupyter
``` # Copyright 2021 The Earth Engine Community Authors { display-mode: "form" } # # 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 req...
github_jupyter
# NoSQL (Neo4j) (sesión 7) ![imagen.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOIAAABkCAYAAACb+ewSAAAABHNCSVQICAgIfAhkiAAAIABJREFUeF7tvXmAXUWdL1739pKk0+kknT0kIUCABEIIkUEEhOCCyvBwR1EcBxccZIenzozPQX78HMeHoICMOy64sAiDCMgoakBAZCAChsgSQ8iekLXJ2um+930+VfU993u+Xefe2wGd98c7yelz6rvXt+p7qk5VnbrODTzKA0EeQvhfAlegrlBXkS1i...
github_jupyter
Let's say we have a pandas DataFrame with several columns. ``` import pandas as pd import numpy as np df = pd.DataFrame(np.random.rand(5,5), columns=['A', 'B', 'C', 'D', 'E']) df ``` What if we want to rename the columns? There is more than one way to do this, and I'll start with an indirect answer that's not reall...
github_jupyter
<table width="100%"> <tr> <td style="background-color:#ffffff;"> <a href="http://qworld.lu.lv" target="_blank"><img src="..\images\qworld.jpg" width="35%" align="left"> </a></td> <td style="background-color:#ffffff;vertical-align:bottom;text-align:right;"> prepared by Abuzer Yak...
github_jupyter
## Create a Self-Aggregating Map Layer using GeoAnalytics This notebook will complete the following: - Connect to your Enterprise portal - Search through your big data file shares for your dataset of interest - Run the GeoAnalytics Tool Copy to Data Store - Publish the results of the tool as a Map Image Layer ``` # ...
github_jupyter
``` import os import numpy as np from matplotlib import pyplot as plt, colors, lines ``` ## Generate plots for Adaptive *k*-NN on Random Subspaces and Tiny ImageNet This code expects the output from the `Adaptive k-NN Subspaces Tiny ImageNet` notebook, so be sure to run that first. ``` plt.rc('text', usetex=True) p...
github_jupyter
# Introduction to Deep Learning with PyTorch In this notebook, you'll get introduced to [PyTorch](http://pytorch.org/), a framework for building and training neural networks. PyTorch in a lot of ways behaves like the arrays you love from Numpy. These Numpy arrays, after all, are just tensors. PyTorch takes these tenso...
github_jupyter
``` #r "./../../../../../../public/src/L4-application/BoSSSpad/bin/Release/net5.0/BoSSSpad.dll" using System; using ilPSP; using ilPSP.Utils; using BoSSS.Platform; using BoSSS.Foundation; using BoSSS.Foundation.XDG; using BoSSS.Foundation.Grid; using BoSSS.Solution; using BoSSS.Application.XNSE_Solver; using BoSSS.Appl...
github_jupyter
<img src="images/dask_horizontal.svg" width="45%" alt="Dask logo\"> # Dask Delayed This notebook covers Dask's `delayed` interface and how it can be used to parallelize existing Python code and custom algorithms. Let's start by looking at a basic, non-parallelized example and then see how `dask.delayed...
github_jupyter
# 1. Introduction ``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline from prml.preprocess import PolynomialFeature from prml.linear import ( LinearRegression, RidgeRegression, BayesianRegression ) np.random.seed(1234) ``` ## 1.1. Example: Polynomial Curve Fitting ``` def create_t...
github_jupyter
``` %matplotlib inline ``` Compute the scattering transform of a speech recording ====================================================== This script loads a speech signal from the free spoken digit dataset (FSDD) of a man pronouncing the word "zero," computes its scattering transform, and displays the zeroth-, first-...
github_jupyter
# ***Good morning*** Aakansh//Asritha//Jayakrishna//Dinesh//Harsha Vardhan **8. Even Digits Problem** Supervin has a unique calculator. This calculator only has a display, a plus button, and a minus button. Currently, the integerNis displayed on the calculator display.Pressing the plus button incre...
github_jupyter
``` import numpy as np from keras.datasets import mnist from keras.models import Sequential, Model from keras.layers import Dense, Dropout, Activation, Flatten, Input, UpSampling2D from keras.layers import Convolution2D, MaxPooling2D from keras.utils import np_utils from joblib import Parallel, delayed import matplotli...
github_jupyter
``` import numpy as np import tensorflow as tf from tensorflow.keras.datasets import fashion_mnist from tensorflow.keras.callbacks import ModelCheckpoint # important constants batch_size = 128 epochs = 20 n_classes = 10 learning_rate = 0.1 width = 28 height = 28 fashion_labels = ["T-shirt/top","Trousers","Pullover","Dr...
github_jupyter
``` import numpy as np import pandas as pd ``` <img src="logo.png" alt="Girl in a jacket" width="500" height="600"> ## What is object oriented programming ? there are two concepts - procedural programming - code as sequence of objects. - great for data analysis and scripts. - Object oriented Programming ...
github_jupyter
# Prediction models for Project1 This notebook explores the following models: * MeanModel - Predicts mean value for all future values * LastDayModel - Predicts the same values like last day (given as futures) Table of contents: * Load model and create training and test datasets * Evaluate Mean model * E...
github_jupyter
Deep Learning Models -- A collection of various deep learning architectures, models, and tips for TensorFlow and PyTorch in Jupyter Notebooks. - Author: Sebastian Raschka - GitHub Repository: https://github.com/rasbt/deeplearning-models ``` %load_ext watermark %watermark -a 'Sebastian Raschka' -v -p torch ``` # Gradi...
github_jupyter
# "A Basic Neural Network: Differentiate Hand-Written Digits" - badges: true - author: Akshith Sriram ### Key Objectives: - Building a neural network that differentiates two hand-written digits 3 and 8. - Comparing the results of this Neural Network (NN) to that of a Logistic Regression (LR) model. ### Requirements:...
github_jupyter
<h1>Table of Contents<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#Raw-data-stats" data-toc-modified-id="Raw-data-stats-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Raw data stats</a></span></li><li><span><a href="#Read-in-data" data-toc-modified-id="Read-in-data-2"><...
github_jupyter
# Tutorial We will solve the following problem using a computer to estimate the expected probabilities: ```{admonition} Problem An experiment consists of selecting a token from a bag and spinning a coin. The bag contains 5 red tokens and 7 blue tokens. A token is selected at random from the bag, its colour is noted ...
github_jupyter
# Thinking in tensors, writing in PyTorch A hands-on course by [Piotr Migdał](https://p.migdal.pl) (2019). <a href="https://colab.research.google.com/github/stared/thinking-in-tensors-writing-in-pytorch/blob/master/5%20Nonlinear%20regression.ipynb" target="_parent"> <img src="https://colab.research.google.com/ass...
github_jupyter
<a id='python-by-example'></a> <div id="qe-notebook-header" align="right" style="text-align:right;"> <a href="https://quantecon.org/" title="quantecon.org"> <img style="width:250px;display:inline;" width="250px" src="https://assets.quantecon.org/img/qe-menubar-logo.svg" alt="QuantEcon"> ...
github_jupyter
## Introduction of Fairness Workflow Tutorial ## (Dataset/Model Bias Check and Mitigation by Reweighing) ### Table of contents : * [1 Introduction](#1.-Introduction) * [2. Data preparation](#2.-Data-preparation) * [3. Data fairness](#3.-Data-fairness) * [Data bias checking](#3.1-Bias-Detection) * [Data mitigatio...
github_jupyter
from PIL import Image from matplotlib import image from os import listdir from torchvision import transforms, datasets as ds from torchvision import models import torchvision as tv from torch.utils.data import DataLoader import matplotlib.pyplot as plt import numpy as np import torch import torch.optim as optim import...
github_jupyter
# Improving a model with Grid Search In this mini-lab, we'll fit a decision tree model to some sample data. This initial model will overfit heavily. Then we'll use Grid Search to find better parameters for this model, to reduce the overfitting. First, some imports. ``` %matplotlib inline import pandas as pd import n...
github_jupyter
<img src="img/saturn_logo.png" width="300" /> # Introduction to Dask Before we get into too much complexity, let's talk about the essentials of Dask. ## What is Dask? Dask is an open-source framework that enables parallelization of Python code. This can be applied to all kinds of Python use cases, not just machine ...
github_jupyter
``` import matplotlib.pyplot as plt import numpy as np import pickle from skimage.segmentation import slic import scipy.ndimage import scipy.spatial import torch from torchvision import datasets import sys sys.path.append("../") from chebygin import ChebyGIN from extract_superpixels import process_image from graphdata ...
github_jupyter
# View main analysis This notebook provides a view into a snapshot of the SpikeForest analysis. A snapshot URL may be obtained from the "Archive" section of the website or it may be created offline using the spikeforest Python package. Because this notebook is checked into the git repo, it is a good idea to make a wo...
github_jupyter
``` import cv2 from pathlib import Path from random import * import tensorflow as tf from tensorflow import keras import numpy as np import matplotlib.pyplot as plt np.random.seed(1000) physical_devices = tf.config.experimental.list_physical_devices('GPU') if len(physical_devices) > 0: tf.config.experimental.set_mem...
github_jupyter
# Stock market fluctuations The fluctuations of stock prices represent an intriguing example of a complex random walk. Stock prices are influenced by transactions that are carried out over a broad range of time scales, from micro- to milliseconds for high-frequency hedge funds over several hours or days for day-trader...
github_jupyter
``` #https://kieranrcampbell.github.io/blog/2016/05/15/gibbs-sampling-bayesian-linear-regression.html %load_ext autoreload %autoreload 2 import sys,os import numpy as np import readline #from rpy2.rinterface import R_VERSION_BUILD #print(R_VERSION_BUILD) #import rpy2.robjects as robjects #import rpy2.robjects.numpy2r...
github_jupyter
``` #Replace all ______ with rjust, ljust or center. thickness = int(input()) #This must be an odd number c = 'H' #Top Cone for i in range(thickness): print((c*i).rjust(thickness-1)+c+(c*i).ljust(thickness-1)) #Top Pillars for i in range(thickness+1): print((c*thickness).center(thickness*2)+(c*thickness).ce...
github_jupyter
For network data visualization we can use a number of libraries. Here we'll use [networkX](https://networkx.github.io/documentation/networkx-2.4/install.html). ``` ! pip3 install networkx ! pip3 install pytest import networkx as nx ! ls ../facebook_large/ import pandas as pd target = pd.read_csv('../facebook_large/mus...
github_jupyter
# 공시지가 K-NN ``` import numpy as np import pandas as pd from sklearn.metrics import accuracy_score, classification_report import sklearn.neighbors as neg import matplotlib.pyplot as plt import folium import json import sklearn.preprocessing as pp import warnings warnings.filterwarnings('ignore') ``` **데이터 전처리** ``` #...
github_jupyter
# NEST by Example - An Introduction to the Neural Simulation Tool NEST Version 2.12.0 # Introduction NEST is a simulator for networks of point neurons, that is, neuron models that collapse the morphology (geometry) of dendrites, axons, and somata into either a single compartment or a small number of compartments <cit...
github_jupyter
To Queue or Not to Queue ===================== In this notebook we look at the relative performance of a single queue vs multiple queues using the [Simpy](https://simpy.readthedocs.io/en/latest/) framework as well as exploring various common load balancing algorithms and their performance in M/G/k systems. First we e...
github_jupyter
# Machine Learning and Statistics for Physicists Material for a [UC Irvine](https://uci.edu/) course offered by the [Department of Physics and Astronomy](https://www.physics.uci.edu/). Content is maintained on [github](github.com/dkirkby/MachineLearningStatistics) and distributed under a [BSD3 license](https://openso...
github_jupyter
``` import cv2 import numpy as np import pandas as pd import pickle as cPickle from matplotlib import pyplot as plt from sklearn.cluster import MiniBatchKMeans from sklearn.neighbors import KNeighborsClassifier from sklearn.decomposition import PCA from sklearn.discriminant_analysis import LinearDiscriminantAnalysis fr...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W1D2_ModelingPractice/W1D2_Tutorial1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Neuromatch Academy: Week 1, Day 2, Tutorial 1 # Modeling ...
github_jupyter
# Custom widgets in a notebook The notebook explore a couple of ways to interact with the user and modifies the output based on these interactions. This is inspired from the examples from [ipwidgets](http://ipywidgets.readthedocs.io/). ``` from jyquickhelper import add_notebook_menu add_notebook_menu() ``` ## List o...
github_jupyter
# Working With STAC [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/developmentseed/titiler/master?filepath=docs%2Fexamples%2F%2Fnotebooks%2FWorking_with_STAC_simple.ipynb) ### STAC: SpatioTemporal Asset Catalog > The SpatioTemporal Asset Catalog (STAC) specification aims to standardize t...
github_jupyter
``` import matplotlib.pyplot as plt import seaborn as sns sns.set(context='talk', style='ticks', color_codes=True, font_scale=0.8) import numpy as np import pandas as pd import scipy from tqdm import tqdm %matplotlib inline ``` This notebook generates some of the precursor files for the fragment decomposition figure...
github_jupyter
# Basic Usage of the Uncertainty Characteristics Curve (UCC) Needs `uncertainty_characteristics_curve.py` and `sample_predict.pkl` files to be in the same directory. ``` import numpy as np import matplotlib.pyplot as plt from uq360.metrics.uncertainty_characteristics_curve import UncertaintyCharacteristicsCurve as ucc...
github_jupyter
``` import pathlib import tensorflow as tf import tensorflow.keras.backend as K import skimage import imageio import numpy as np import matplotlib.pyplot as plt # Makes it so any changes in pymedphys is automatically # propagated into the notebook without needing a kernel reset. from IPython.lib.deepreload import rel...
github_jupyter
``` import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import log_loss, roc_auc_score, accuracy_score from xgboost import XGBClassifier from cinnamon.drift import ModelDriftExplainer, AdversarialDriftExplainer # pandas config pd.set_option('display.max_col...
github_jupyter
<a href="https://qworld.net" target="_blank" align="left"><img src="../qworld/images/header.jpg" align="left"></a> $$ \newcommand{\set}[1]{\left\{#1\right\}} \newcommand{\abs}[1]{\left\lvert#1\right\rvert} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \newcommand{\inner}[2]{\left\langle#1,#2\right\rangle} \newcomma...
github_jupyter
# Load forecasting benchmark Example created by Wilson Rocha Lacerda Junior ## Note The following example is **not** intended to say that one library is better than another. The main focus of these examples is to show that SysIdentPy can be a good alternative for people looking to model time series. We will compare...
github_jupyter
# Huggingface SageMaker-SDK - BERT Japanese NER 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
``` # Select the TensorFlow 2.0 runtime %tensorflow_version 2.x # Install Weights and Biases (WnB) #!pip install wandb # Primary imports import tensorflow as tf import numpy as np import wandb # Load the FashionMNIST dataset, scale the pixel values (X_train, y_train), (X_test, y_test) = tf.keras.datasets.fashion_mnist....
github_jupyter
# QCoDeS Example with Yokogawa GS200 and Keithley 7510 Multimeter In this example, we will show how to use the Yokogawa GS200 smu and keithley 7510 dmm to perform a sweep measurement. The GS200 smu will source current through a 10 Ohm resistor using the **program** feature, and **trigger** the the 7510 dmm, which will...
github_jupyter
![](https://images.unsplash.com/photo-1602084551218-a28205125639?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2070&q=80) <div class = 'alert alert-block alert-info' style = 'background-color:#4c1c84; color:#eeebf1; border-width:5px; ...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '' # !git pull import malaya_speech import malaya_speech.train.model.vggvox_v2 as vggvox_v2 import tensorflow as tf class Model: def __init__(self): self.X = tf.placeholder(tf.float32, [None, 257, None, 1]) self.logits = vggvox_v2.Model(self.X, num...
github_jupyter
# Word Embeddings using CBOW [without python DL libraries] This project presents how to compute word embeddings and use them for sentiment analysis. - To implement sentiment analysis, you can go beyond counting the number of positive words and negative words. - You can find a way to represent each word numerically, ...
github_jupyter
# MNIST Image Classification with TensorFlow on Cloud AI Platform This notebook demonstrates how to implement different image models on MNIST using the [tf.keras API](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/keras). ## Learning Objectives 1. Understand how to build a Dense Neural Network (DNN) for ...
github_jupyter
``` import boto3 import sagemaker print(boto3.__version__) print(sagemaker.__version__) session = sagemaker.Session() bucket = session.default_bucket() print("Default bucket is {}".format(bucket)) ### REPLACE INPUT FROM PREVIOUS SAGEMAKER PROCESSING CONFIG OUTPUT ##### prefix="customer_support_classification" s3_traini...
github_jupyter
``` import networkx as nx import pandas as pd import matplotlib.pyplot as plt from networkx.drawing.nx_agraph import graphviz_layout from abc import ABC, abstractmethod import numpy as np def V(num): return 4*num+1 def S(num): return 2*num+1 def fG(num): return 2*num-1 def getType(num): if (num+1) %3...
github_jupyter
# 2017 August Duplicate Bug Detection [**Find more on wiki**](https://wiki.nvidia.com/itappdev/index.php/Duplicate_Detection) [**Demo Link**](http://qlan-vm-1.client.nvidia.com:8080/) ## Walk through of the Algorithm <img src="imgsrc/Diagram.png"> ## 1. Data Cleaning - SenteceParser Python 3 Available on Perforce...
github_jupyter
[![colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/davemlz/eemont/blob/master/docs/tutorials/018-Complete-Preprocessing-One-Method.ipynb) # Complete Preprocessing (Clouds Masking, Shadows Masking, Scaling and Offsetting) With Just One Method _Tutorial created...
github_jupyter
# Problem 1 **Least Recently Used Cache** We have briefly discussed caching as part of a practice problem while studying hash maps. The lookup operation (i.e., `get()`) and `put()` / `set()` is supposed to be fast for a cache memory. While doing the `get()` operation, if the entry is found in the cache, it is known...
github_jupyter
# Stellargraph example: GraphSAGE on the CORA citation network Import NetworkX and stellar: ``` import networkx as nx import pandas as pd import os import stellargraph as sg from stellargraph.mapper import GraphSAGENodeGenerator from stellargraph.layer import GraphSAGE from tensorflow.keras import layers, optimizer...
github_jupyter
``` try: from openmdao.utils.notebook_utils import notebook_mode except ImportError: !python -m pip install openmdao[notebooks] from openmdao.utils.assert_utils import assert_near_equal import os if os.path.exists('cases.sql'): os.remove('cases.sql') ``` # Driver Recording A CaseRecorder is commonly atta...
github_jupyter
# Theano, Lasagne и с чем их едят # разминка * напиши на numpy функцию, которая считает сумму квадратов чисел от 0 до N, где N - аргумент * массив чисел от 0 до N - numpy.arange(N) ``` !pip install Theano !pip install lasagne import numpy as np def sum_squares(N): return сумма квадратов чисел от 0 до N %%time sum...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline import my_utils as my_utils 635 - 243 1027 - 635 ``` ## prepare test data ``` row_test = pd.read_csv('./1962_to_1963.csv') # row_test = pd.read_excel('./normalized_bs.xlsx') row_test[row_data.day > 635].head() test_data = ro...
github_jupyter
# [LEGALST-190] Lab 3/20: TF-IDF and Classification This lab will cover the term frequency-inverse document frequency method, and classification algorithms in machine learning. Estimated Lab time: 30 minutes ``` # Dependencies from datascience import * import numpy as np import pandas as pd from sklearn.feature_extr...
github_jupyter
``` import os from subprocess import Popen, PIPE, STDOUT es_server = Popen(['/home/dr_lunars/elasticsearch-7.0.0/bin/elasticsearch'],stdout=PIPE, stderr=STDOUT) !sleep 30 !/home/dr_lunars/elasticsearch-7.0.0/bin/elasticsearch-plugin install analysis-nori !/home/dr_lunars/elasticsearch-7.0.0/bin/elasticsearch-plugin ins...
github_jupyter
``` from env_1_nonstochastic_kings import Environment1,StartandGoal from SophAgent import SophAgentActions from QlearningAgent import QAgent import numpy as np import random as random [startstate,goalstate]=StartandGoal() trials=100000 Time_horizon=15 T_min=2 #RandomAgent #Experimenting success rate of RandomAgent fro...
github_jupyter
<center><img src='../../img/ai4eo_logos.jpg' alt='Logos AI4EO MOOC' width='80%'></img></center> <hr> <br> <a href='https://www.futurelearn.com/courses/artificial-intelligence-for-earth-monitoring/1/steps/1280514' target='_blank'><< Back to FutureLearn</a><br> # 3B - Tile-based classification using Sentinel-2 L1C an...
github_jupyter
# Задание 1.2 - Линейный классификатор (Linear classifier) В этом задании мы реализуем другую модель машинного обучения - линейный классификатор. Линейный классификатор подбирает для каждого класса веса, на которые нужно умножить значение каждого признака и потом сложить вместе. Тот класс, у которого эта сумма больше,...
github_jupyter
``` import os import pickle import numpy as np import matplotlib import matplotlib.pyplot as plt import seaborn as sns matplotlib.style.use('seaborn') sns.set(style='whitegrid', color_codes=True) save_path = './figures' if not os.path.exists(save_path): os.makedirs(save_path) save_type = 'png' def remove_pts(x,y...
github_jupyter
``` import tensorflow as tf import torch import numpy as np Hc = 3 Wc = 4 coord_cells = tf.stack(tf.meshgrid(tf.range(Hc), tf.range(Wc), indexing='ij'), axis=-1) a = tf.Session().run(coord_cells) print(a) import torch coor_cells = torch.stack(torch.meshgrid(torch.arange(Hc), torch.arange(Wc)), dim=2) # [Hc, Wc, 2] b ...
github_jupyter
# Introduction Although math is the fundamental basis of physics and astrophysics, we cannot always easily convert numbers and equations into a coherent picture. Plotting is therefore a vital tool in bridging the gap between raw data and a deeper scientific understanding. *Disclaimer:* There are many ways to make t...
github_jupyter
# MNIST distributed training The **SageMaker Python SDK** helps you deploy your models for training and hosting in optimized, productions ready containers in SageMaker. The SageMaker Python SDK is easy to use, modular, extensible and compatible with TensorFlow and MXNet. This tutorial focuses on how to create a conv...
github_jupyter
``` import pandas as pd import numpy as np import json import time import hmac import hashlib import random random.seed(42) HMAC_KEY = "Insert your HMAC key from Edge Impulse project" classes = { "grazing": 0, "lying": 0, "running": 0, "standing": 0, "walking":0, "trotting":0 } ident_col...
github_jupyter
# Configuring analyzers for the MSMARCO Document dataset Before we start tuning queries and other index parameters, we wanted to first show a very simple iteration on the standard analyzers. In the MS MARCO Document dataset we have three fields: `url`, `title` and `body`. We tried just couple very small improvements, ...
github_jupyter
``` import pandas as pd import numpy as np import os, sys sys.path.append(os.environ['HOME'] + '/src/models/') from deeplearning_models import DLTextClassifier from feature_based_models import FBConstructivenessClassifier from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt %matplotlib ...
github_jupyter
# Objective In this notebook we will: + load and merge data from different sources (in this case, data source is filesystem.) + preprocess data + create features + visualize feature distributions across the classes + write down our observations about the data ``` import pandas as pd import matplot...
github_jupyter
``` import numpy as np,scipy.stats as ss,pandas as pd,datetime as dt from random import gauss from itertools import product #---------------------------------------------------------------------------------------- def getRefDates_MonthBusinessDate(dates): refDates,pDay={},[] first=dt.date(year=dates[0].year,mo...
github_jupyter
# eICU Collaborative Research Database # Notebook 4: Summary statistics This notebook shows how summary statistics can be computed for a patient cohort using the `tableone` package. Usage instructions for tableone are at: https://pypi.org/project/tableone/ ## Load libraries and connect to the database ``` # Import ...
github_jupyter
# Ler a informação de um catálogo a partir de um arquivo texto e fazer gráficos de alguns parâmetros ## Autores Adrian Price-Whelan, Kelle Cruz, Stephanie T. Douglas ## Tradução Ricardo Ogando, Micaele Vitória ## Objetivos do aprendizado * Ler um arquivo ASCII usando o `astropy.io` * Converter entre representações d...
github_jupyter
# PyTorch 및 SMDataParallel을 사용한 분산 데이터 병렬 MNIST 훈련 ## 배경 SMDataParallel은 Amazon SageMaker의 새로운 기능으로 딥러닝 모델을 더 빠르고 저렴하게 훈련할 수 있습니다. SMDataParallel은 TensorFlow2, PyTorch, MXNet을 위한 분산 데이터 병렬 훈련 프레임워크입니다. 이 노트북 예제는 MNIST 데이터셋을 사용하여 SageMaker에서 PyTorch와 함께 SMDataParallel을 사용하는 방법을 보여줍니다. 자세한 내용은 아래 자료들을 참조해 주세요. 1. [PyT...
github_jupyter
Based on: https://medium.com/swlh/transformer-fine-tuning-for-sentiment-analysis-c000da034bb5 ``` !pip install pytorch-transformers !pip install pytorch-ignite from google.colab import drive drive.mount('/content/drive') # !cp drive/'My Drive'/cs231n-project/train_captions_v2.pkl . # !cp drive/'My Drive'/cs231n-proje...
github_jupyter