text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
``` import pandas as pd import numpy as np from sklearn.decomposition import PCA,TruncatedSVD,NMF from sklearn.preprocessing import Normalizer import argparse import time import pickle as pkl def year_binner(year,val=10): return year - year%val def dim_reduction(df,rows): df_svd = TruncatedSVD(n_components=300,...
github_jupyter
# Neural Networks for Regression with TensorFlow > Notebook demonstrates Neural Networks for Regression Problems with TensorFlow - toc: true - badges: true - comments: true - categories: [DeepLearning, NeuralNetworks, TensorFlow, Python, LinearRegression] - image: images/nntensorflow.png ## Neural Network Regression...
github_jupyter
# Análise de Dados com Python Neste notebook, utilizaremos dados de automóveis para analisar a influência das características de um carro em seu preço, tentando posteriormente prever qual será o preço de venda de um carro. Utilizaremos como fonte de dados um arquivo .csv com dados já tratados em outro notebook. Caso ...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/NAIP/ndwi.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="https://nbvi...
github_jupyter
## Release the Kraken! ``` # The next library we're going to look at is called Kraken, which was developed by Université # PSL in Paris. It's actually based on a slightly older code base, OCRopus. You can see how the # flexible open-source licenses allow new ideas to grow by building upon older ideas. And, in # this ...
github_jupyter
``` # @title Copyright & License (click to expand) # 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 r...
github_jupyter
RMinimum : Full - Test ``` import math import random import queue ``` Testfall : $X = [0, \cdots, n-1]$, $k$ ``` # User input n = 2**10 k = 2**5 # Automatic X = [i for i in range(n)] # Show Testcase print(' Testcase: ') print('=============================') print('X = [0, ..., ' + str(n - 1) + '...
github_jupyter
# Advanced topics The following material is a deep-dive into Yangson, and is not necessarily representative of how one would perform manipulations in a production environment. Please refer to the other tutorials for a better picture of Rosetta's intended use. Keep in mind that the key feature of Yangson is to be abl...
github_jupyter
# Planning Search Agent Notebook version of the project [Implement a Planning Search](https://github.com/udacity/AIND-Planning) from [Udacity's Artificial Intelligence Nanodegree](https://www.udacity.com/course/artificial-intelligence-nanodegree--nd889) <br> **Goal**: Solve deterministic logistics planning problems f...
github_jupyter
``` import pandas as pd df = pd.read_csv('queryset_CNN.csv') print(df.shape) print(df.dtypes) preds = [] pred = [] for index, row in df.iterrows(): doc_id = row.doc_id author_id = row.author_id import ast authorList = ast.literal_eval(row.authorList) candidate = len(authorList) algo ...
github_jupyter
``` # -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
github_jupyter
# Boltzmann Machine ## Downloading the dataset ### ML-100K ``` # !wget "http://files.grouplens.org/datasets/movielens/ml-100k.zip" # !unzip ml-100k.zip # !ls ``` ### ML-1M ``` # !wget "http://files.grouplens.org/datasets/movielens/ml-1m.zip" # !unzip ml-1m.zip # !ls ``` ## Importing the libraries ``` import ...
github_jupyter
<div style='background: #FF7B47; padding: 10px; border: thin solid darblue; border-radius: 5px; margin-bottom: 2vh'> # Session 01 - Notebook Like most session notebooks in this course, this notebook is divided into two parts. Part one is a 'manual' that will allow you to code along with the new code that we intro...
github_jupyter
# Autobatching log-densities example [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.sandbox.google.com/github/google/jax/blob/master/docs/notebooks/vmapped_log_probs.ipynb) This notebook demonstrates a simple Bayesian inference example where autobatching makes user code eas...
github_jupyter
<a href="https://colab.research.google.com/github/agungsantoso/deep-learning-v2-pytorch/blob/master/intro-to-pytorch/Part%201%20-%20Tensors%20in%20PyTorch%20(Exercises).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Introduction to Deep Learning ...
github_jupyter
## **University of Toronto - CSC413 - Neural Networks and Deep Learning** ## **Programming Assignment 4 - StyleGAN2-Ada** This is a self-contained notebook that allows you to play around with a pre-trained StyleGAN2-Ada generator Disclaimer: Some codes were borrowed from StyleGAN official documentation on Githu...
github_jupyter
``` #all_slow ``` # Tutorial - Migrating from Lightning > Incrementally adding fastai goodness to your Lightning training We're going to use the MNIST training code from Lightning's 'Quick Start' (as at August 2020), converted to a module. See `migrating_lightning.py` for the Lightning code we are importing here. `...
github_jupyter
``` # Import Required Libraries try: import tensorflow as tf import os import random import numpy as np from tqdm import tqdm from skimage.io import imread, imshow from skimage.transform import resize import matplotlib.pyplot as plt from tensorflow.keras.models import load_model ...
github_jupyter
# Autonomous driving - Car detection Welcome to your week 3 programming assignment. You will learn about object detection using the very powerful YOLO model. Many of the ideas in this notebook are described in the two YOLO papers: [Redmon et al., 2016](https://arxiv.org/abs/1506.02640) and [Redmon and Farhadi, 2016](h...
github_jupyter
# Retail Demo Store Messaging Workshop - Amazon Pinpoint In this workshop we will use [Amazon Pinpoint](https://aws.amazon.com/pinpoint/) to add the ability to dynamically send personalized messages to the customers of the Retail Demo Store. We'll build out the following use-cases. - Send new users a welcome email af...
github_jupyter
``` # !pip install graphviz ``` To produce the decision tree visualization you should install the graphviz package into your system: https://stackoverflow.com/questions/35064304/runtimeerror-make-sure-the-graphviz-executables-are-on-your-systems-path-aft ``` # Run one of these in case you have problems with graphviz...
github_jupyter
## Interpreting Ensemble Compressed Features **Gregory Way, 2019** The following notebook will assign biological knowledge to the compressed features using the network projection approach. I use the model previously identified that was used to predict TP53 inactivation. I observe the BioBombe gene set enrichment scor...
github_jupyter
# Algoritmos de Otimização No Deep Learning temos como propósito que nossas redes neurais aprendam a aproximar uma função de interesse, como o preço de casas numa regressão, ou a função que classifica objetos numa foto, no caso da classificação. No último notebook, nós programos nossa primeira rede neural. Além disso...
github_jupyter
# 07 - Serving predictions The purpose of the notebook is to show how to use the deployed model for online and batch prediction. The notebook covers the following tasks: 1. Test the `Endpoint` resource for online prediction. 2. Use the custom model uploaded as a `Model` resource for batch prediciton. 3. Run a the bat...
github_jupyter
``` # reload packages %load_ext autoreload %autoreload 2 ``` ### Choose GPU ``` %env CUDA_DEVICE_ORDER=PCI_BUS_ID %env CUDA_VISIBLE_DEVICES=0 import tensorflow as tf gpu_devices = tf.config.experimental.list_physical_devices('GPU') if len(gpu_devices)>0: tf.config.experimental.set_memory_growth(gpu_devices[0], Tr...
github_jupyter
# MNIST With SET This is an example of training an SET network on the MNIST dataset using synapses, pytorch, and torchvision. ``` #Import torch libraries and get SETLayer from synapses import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, trans...
github_jupyter
# Regression Errors Let's talk about errors in regression problems. Typically, in regression, we have a variable $y$ for which we want to learn a model to predict. The prediction from the model is usually denoted as $\hat{y}$. The error $e$ is thus defined as follows - $e = y - \hat{y}$ Since we have many pairs of t...
github_jupyter
# UCI Dodgers dataset ``` import pandas as pd import numpy as np import os from pathlib import Path from config import data_raw_folder, data_processed_folder from timeeval import Datasets import matplotlib.pyplot as plt %matplotlib inline plt.rcParams['figure.figsize'] = (20, 10) dataset_collection_name = "Dodgers" so...
github_jupyter
# Train a ready to use TensorFlow model with a simple pipeline ``` import os import sys import warnings warnings.filterwarnings("ignore") import numpy as np import matplotlib.pyplot as plt # the following line is not required if BatchFlow is installed as a python package. sys.path.append("../..") from batchflow impo...
github_jupyter
``` %pip install bs4 %pip install lxml %pip install nltk %pip install textblob import urllib.request as ur from bs4 import BeautifulSoup ``` ## STEP 1: Read data from HTML and parse it to clean string ``` #We would extract the abstract from this HTML page article articleURL = "https://www.washingtonpost.com/news/the-...
github_jupyter
# Just-in-time Compilation with [Numba](http://numba.pydata.org/) ## Numba is a JIT compiler which translates Python code in native machine language * Using special decorators on Python functions Numba compiles them on the fly to machine code using LLVM * Numba is compatible with Numpy arrays which are the basis of m...
github_jupyter
``` import sys sys.path.append('../input/shopee-competition-utils') sys.path.insert(0,'../input/pytorch-image-models') import numpy as np import pandas as pd import torch from torch import nn from torch.nn import Parameter from torch.nn import functional as F from torch.utils.data import Dataset, DataLoader import a...
github_jupyter
# 7. előadás *Tartalom:* Függvények, pár további hasznos library (import from ... import ... as szintaktika, time, random, math, regex (regular expressions), os, sys) ### Függvények Találkozhattunk már függvényekkel más programnyelvek kapcsán. De valójában mik is azok a függvények? A függvények: • újrahasználh...
github_jupyter
<a href="https://colab.research.google.com/github/google/neural-tangents/blob/master/notebooks/phase_diagram.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> Copyright 2020 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); y...
github_jupyter
### Genarating names with character-level RNN In this notebook we are going to follow the previous notebook wher we classified name's nationalities based on a character level RNN. This time around we are going to generate names using character level RNN. Example: _given a nationality and three starting characters we w...
github_jupyter
# Shashank V. Sonar ## Task 5: Exploratory Data Analysis - Sports ### Step -1: Importing the required Libraries ``` import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns %matplotlib inline from sklearn.cluster import KMeans from sklearn import datasets import warnings warnings...
github_jupyter
# Random Signals *This jupyter notebook is part of a [collection of notebooks](../index.ipynb) on various topics of Digital Signal Processing. Please direct questions and suggestions to [Sascha.Spors@uni-rostock.de](mailto:Sascha.Spors@uni-rostock.de).* ## Independent Processes The independence of random signals is ...
github_jupyter
# Model Development V1 - This is really more like scratchwork - Divide this into multiple notebooks for easier reading **Reference** - http://zacstewart.com/2014/08/05/pipelines-of-featureunions-of-pipelines.html ``` import json import pickle from pymongo import MongoClient import numpy as np import pandas as pd from...
github_jupyter
``` import numpy as np import pandas as pd from keras.models import * from keras.layers import Input, merge, Conv2D, MaxPooling2D, UpSampling2D, Dropout, Cropping2D from keras.optimizers import * from keras.callbacks import ModelCheckpoint, LearningRateScheduler, EarlyStopping, ReduceLROnPlateau from datetime import d...
github_jupyter
``` from neo4j import GraphDatabase import json with open('credentials.json') as json_file: credentials = json.load(json_file) username = credentials['username'] pwd = credentials['password'] ``` ### NOTE ❣️ * BEFORE running this, still need to run `bin\neo4j console` to enable bolt on 127.0.0.1:7687 * When the ...
github_jupyter
This notebook shows the MEP quickstart sample, which also exists as a non-notebook version at: https://bitbucket.org/vitotap/python-spark-quickstart It shows how to use Spark (http://spark.apache.org/) for distributed processing on the PROBA-V Mission Exploitation Platform. (https://proba-v-mep.esa.int/) The sample in...
github_jupyter
``` from statsmodels.stats.outliers_influence import variance_inflation_factor from sklearn.model_selection import KFold from sklearn.datasets import make_regression from sklearn.linear_model import LinearRegression from sklearn.metrics import r2_score from sklearn.model_selection import cross_val_score %matplotlib i...
github_jupyter
# Title **Exercise: B.1 - MLP by Hand** # Description In this exercise, we will **construct a neural network** to classify 3 species of iris. The classification is based on 4 measurement predictor variables: sepal length & width, and petal length & width in the given dataset. <img src="../img/image5.jpeg" style="wi...
github_jupyter
# Code for Chapter 1. In this case we will review some of the basic R functions and coding paradigms we will use throughout this book. This includes loading, viewing, and cleaning raw data; as well as some basic visualization. This specific case we will use data from reported UFO sightings to investigate what, if a...
github_jupyter
# Attempting to load higher order ASPECT elements An initial attempt at loading higher order element output from ASPECT. The VTU files have elements with a VTU type of `VTK_LAGRANGE_HEXAHEDRON` (VTK ID number 72, https://vtk.org/doc/nightly/html/classvtkLagrangeHexahedron.html#details), corresponding to 2nd order (q...
github_jupyter
# Индекс поиска ``` import numpy as np import pandas as pd import datetime import matplotlib from matplotlib import pyplot as plt import matplotlib.patches as mpatches matplotlib.style.use('ggplot') %matplotlib inline ``` ### Описание: Индекс строится на основе кризисных дескрипторов, взятых из [статьи Столбова.]...
github_jupyter
``` import torch import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import matplotlib.pyplot as plt import random import backwardcompatibilityml.loss as bcloss import backwardcompatibilityml.scores as scores # Initialize random seed random.seed(123) torch.manual_seed(...
github_jupyter
``` import numpy as np import os from astropy.table import Table from astropy.cosmology import FlatLambdaCDM from matplotlib import pyplot as plt from astropy.io import ascii from astropy.coordinates import SkyCoord import healpy import astropy.units as u import pandas as pd import matplotlib import pyccl from scipy i...
github_jupyter
``` from __future__ import print_function import sys import numpy as np from time import time import matplotlib.pyplot as plt from tqdm import tqdm import math import struct import binascii sys.path.append('/home/xilinx') from pynq import Overlay from pynq import allocate def float2bytes(fp): packNo = struct.pac...
github_jupyter
**NOTE: An version of this post is on the PyMC3 [examples](https://docs.pymc.io/notebooks/blackbox_external_likelihood.html) page.** <!-- PELICAN_BEGIN_SUMMARY --> [PyMC3](https://docs.pymc.io/index.html) is a great tool for doing Bayesian inference and parameter estimation. It has a load of [in-built probability dis...
github_jupyter
![Panel HighCharts Logo](https://raw.githubusercontent.com/MarcSkovMadsen/panel-highcharts/main/assets/images/panel-highcharts-logo.png) # 📈 Panel HighMap Reference Guide The [Panel](https://panel.holoviz.org) `HighMap` pane allows you to use the powerful [HighCharts](https://www.highcharts.com/) [Maps](https://www....
github_jupyter
# Classification metrics Author: Geraldine Klarenberg Based on the Google Machine Learning Crash Course ## Tresholds In previous lessons, we have talked about using regression models to predict values. But sometimes we are interested in **classifying** things: "spam" vs "not spam", "bark" vs "not barking", etc. Log...
github_jupyter
# Multi-panel detector The AGIPD detector, which is already in use at the SPB experiment, consists of 16 modules of 512×128 pixels each. Each module is further divided into 8 ASICs (application-specific integrated circuit). <img src="AGIPD.png" width="300" align="left"/> <img src="agipd_geometry_14_1.png" width="420"...
github_jupyter
tgb - 6/12/2021 - The goal is to see whether it would be possible to train a NN/MLR outputting results in quantile space while still penalizing them following the mean squared error in physical space. tgb - 4/15/2021 - Recycling this notebook but fitting in percentile space (no scale_dict, use output in percentile uni...
github_jupyter
``` import json import glob import re import malaya tokenizer = malaya.preprocessing._SocialTokenizer().tokenize def is_number_regex(s): if re.match("^\d+?\.\d+?$", s) is None: return s.isdigit() return True def detect_money(word): if word[:2] == 'rm' and is_number_regex(word[2:]): return ...
github_jupyter
``` image_shape = (56,64,1) train_path = "D:\\Projects\\EYE_GAME\\eye_img\\datav2\\train\\" test_path = "D:\\Projects\\EYE_GAME\\eye_img\\datav2\\test\\" import os import pandas as pd from glob import glob import numpy as np import matplotlib as plt from matplotlib.image import imread import seaborn as sns from te...
github_jupyter
# ism Import and Plotting This example shows how to measure an impedance spectrum and then plot it in Bode and Nyquist using the Python library [matplotlib](https://matplotlib.org/). ``` import sys from thales_remote.connection import ThalesRemoteConnection from thales_remote.script_wrapper import PotentiostatMode,Th...
github_jupyter
#### Omega and Xi To implement Graph SLAM, a matrix and a vector (omega and xi, respectively) are introduced. The matrix is square and labelled with all the robot poses (xi) and all the landmarks (Li). Every time you make an observation, for example, as you move between two poses by some distance `dx` and can relate t...
github_jupyter
<a href="https://colab.research.google.com/github/bitprj/Bitcamp-DataSci/blob/master/Week1-Introduction-to-Python-_-NumPy/Intro_to_Python_plus_NumPy.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> <img src="https://github.com/bitprj/Bitcamp-DataSci/...
github_jupyter
Move current working directory, in case for developing the machine learning program by remote machine or it is fine not to use below single line. ``` %cd /tmp/pycharm_project_881 import numpy as np import pandas as pd def sigmoid(x): return 1/(1+np.exp(-x)) def softmax(x): x = x - x.max(axis=1, keepdims=True...
github_jupyter
## Fashion Item Recognition with CNN > Antonopoulos Ilias (p3352004) <br /> > Ndoja Silva (p3352017) <br /> > MSc Data Science AUEB ## Table of Contents - [Data Loading](#Data-Loading) - [Hyperparameter Tuning](#Hyperparameter-Tuning) - [Model Selection](#Model-Selection) - [Evaluation](#Evaluation) ``` import gc i...
github_jupyter
``` %matplotlib inline # Packages import os, glob, scipy, sys import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # Project directory base_dir = os.path.realpath('..') print(base_dir) # Project-specific functions funDir = os.path.join(base_dir,'Code/Functions') print(funDir) ...
github_jupyter
``` import sys sys.path.append('../src') from mcmc_norm_learning.algorithm_1_v4 import to_tuple from mcmc_norm_learning.rules_4 import get_log_prob from pickle_wrapper import unpickle import pandas as pd import yaml import tqdm from numpy import log with open("../params_nc.yaml", 'r') as fd: params = yaml.safe_loa...
github_jupyter
# Data Management with OpenACC This version of the lab is intended for C/C++ programmers. The Fortran version of this lab is available [here](../../Fortran/jupyter_notebook/openacc_fortran_lab2.ipynb). You will receive a warning five minutes before the lab instance shuts down. Remember to save your work! If you are a...
github_jupyter
``` import sys sys.path.insert(1, '../functions') import importlib import numpy as np import nbformat import plotly.express import plotly.express as px import pandas as pd import scipy.optimize as optimization import food_bank_functions import food_bank_bayesian import matplotlib.pyplot as plt import seaborn as sns fro...
github_jupyter
``` import sys import keras import tensorflow as tf print('python version:', sys.version) print('keras version:', keras.__version__) print('tensorflow version:', tf.__version__) ``` # 6.3 Advanced use of recurrent neural networks --- ## A temperature-forecasting problem ### Inspecting the data of the Jena weather da...
github_jupyter
# Improving Data Quality **Learning Objectives** 1. Resolve missing values 2. Convert the Date feature column to a datetime format 3. Rename a feature column, remove a value from a feature column 4. Create one-hot encoding features 5. Understand temporal feature conversions ## Introduction Recall that machine l...
github_jupyter
# Books Recommender System ![](http://labs.criteo.com/wp-content/uploads/2017/08/CustomersWhoBought3.jpg) This is the second part of my project on Book Data Analysis and Recommendation Systems. In my first notebook ([The Story of Book](https://www.kaggle.com/omarzaghlol/goodreads-1-the-story-of-book/)), I attempted...
github_jupyter
``` %matplotlib inline import numpy as np import matplotlib.pyplot as plt import pandas as pd from scipy.stats import gaussian_kde, chi2, pearsonr SMALL_SIZE = 16 MEDIUM_SIZE = 18 BIGGER_SIZE = 20 plt.rc('font', size=SMALL_SIZE) # controls default text sizes plt.rc('axes', titlesize=SMALL_SIZE) # fontsiz...
github_jupyter
# WGAN 元論文 : Wasserstein GAN https://arxiv.org/abs/1701.07875 (2017) WGANはGANのLossを変えることで、数学的に画像生成の学習を良くしよう!っていうもの。 通常のGANはKLDivergenceを使って、Generatorによる確率分布を、生成したい画像の生起分布に近づけていく。だが、KLDでは連続性が保証されないので、代わりにWasserstain距離を用いて、近似していこうというのがWGAN。 Wasserstain距離によるLossを実現するために、WGANのDiscriminatorでは最後にSigmoid関数を適用しない。つまり、Lossも...
github_jupyter
``` #hide # default_exp script ``` # Script - command line interfaces > A fast way to turn your python function into a script. Part of [fast.ai](https://www.fast.ai)'s toolkit for delightful developer experiences. ## Overview Sometimes, you want to create a quick script, either for yourself, or for others. But in ...
github_jupyter
# Image Processing Dense Array, JPEG, PNG > In this post, we will cover the basics of working with images in Matplotlib, OpenCV and Keras. - toc: true - badges: true - comments: true - categories: [Image Processing, Computer Vision] - image: images/freedom.png Images are dense matrixes, and have a certain numbers of...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/contrib/fairness/fairlearn-azureml-mitigation.png) # Unfairness Mitigation with Fairlearn and Azure Machine Learning *...
github_jupyter
``` import cv2 import numpy as np import matplotlib.pyplot as plt ``` # Data Base Generation ### Basic Frame Capture ``` ## This is just an example to ilustrate how to display video from webcam## vid = cv2.VideoCapture(0) # define a video capture object status = True # Initalize status while(...
github_jupyter
# CTW dataset tutorial (Part 1: basics) Hello, welcome to the tutorial of _Chinese Text in the Wild_ (CTW) dataset. In this tutorial, we will show you: 1. [Basics](#CTW-dataset-tutorial-(Part-1:-Basics) - [The structure of this repository](#The-structure-of-this-repository) - [Dataset split](#Dataset-Split) - ...
github_jupyter
``` %load_ext autoreload %autoreload 2 import os import datetime import numpy as np import scipy import pandas as pd import torch from torch import nn import criscas from criscas.utilities import create_directory, get_device, report_available_cuda_devices from criscas.predict_model import * base_dir = os.path.abspath('...
github_jupyter
# Procedure for Word Correction Strategy as mentioned in Page 43 in the dissertation report ``` import numpy as np import pandas as pd import os import nltk import re import string from bs4 import BeautifulSoup from spellchecker import SpellChecker def read_file(df_new): print("Started extracting data from file",d...
github_jupyter
``` from extra import * import keras from keras.datasets import mnist from keras.models import Sequential, Model from keras import regularizers from keras.layers import Dense, Dropout, Conv2D, Input, GlobalAveragePooling2D, GlobalMaxPooling2D from keras.layers import Add, Concatenate, BatchNormalization import keras.b...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt %matplotlib inline # a) import sse Lx, Ly = 8, 8 n_updates_measure = 10000 # b) spins, op_string, bonds = sse.init_SSE_square(Lx, Ly) for beta in [0.1, 1., 64.]: op_string = sse.thermalize(spins, op_string, bonds, beta, n_updates_measure//10) ns = sse.mea...
github_jupyter
# Register Client and Create Access Token Notebook - Find detailed information about client registration and access tokens in this blog post: [Authentication to SAS Viya: a couple of approaches](https://blogs.sas.com/content/sgf/2021/09/24/authentication-to-sas-viya/) - Use the client_id to create an access token you c...
github_jupyter
# Sklearn # Визуализация данных ``` import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import scipy.stats as sts import seaborn as sns from contextlib import contextmanager sns.set() sns.set_style("whitegrid") color_palette = sns.color_palette('deep') + sns.color_palette...
github_jupyter
#Create the environment ``` from google.colab import drive drive.mount('/content/drive') %cd /content/drive/My Drive/ESoWC import pandas as pd import xarray as xr import numpy as np import pandas as pd from sklearn import preprocessing import seaborn as sns #Our class from create_dataset.make_dataset import CustomDa...
github_jupyter
## Amazon SageMaker Feature Store: Client-side Encryption using AWS Encryption SDK This notebook demonstrates how client-side encryption with SageMaker Feature Store is done using the [AWS Encryption SDK library](https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/introduction.html) to encrypt your data ...
github_jupyter
# Strings ### **Splitting strings** ``` 'a,b,c'.split(',') latitude = '37.24N' longitude = '-115.81W' 'Coordinates {0},{1}'.format(latitude,longitude) f'Coordinates {latitude},{longitude}' '{0},{1},{2}'.format(*('abc')) coord = {"latitude":latitude,"longitude":longitude} 'Coordinates {latitude},{longitude}'.format(**...
github_jupyter
# 9. Incorporating OD Veto Data ``` import sys import os import h5py from collections import Counter from progressbar import * import re import numpy as np import h5py from scipy import signal import matplotlib from repeating_classifier_training_utils import * from functools import reduce # Add the path to the parent...
github_jupyter
###### Name: Deepak Vadithala ###### Course: MSc Data Science ###### Project Name: MOOC Recommender System ##### Notes: This notebook contains the analysis of the **Google's Word2Vec** model. This model is trained on the news articles. two variable **(Role and Skill Scores)** is used to predict the course category. ...
github_jupyter
<a href="https://colab.research.google.com/github/sreyaschaithanya/football_analysis/blob/main/Football_1_Plotting_pass_and_shot.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` #! git clone https://github.com/statsbomb/open-data.git from google....
github_jupyter
``` %matplotlib inline ``` DCGAN Tutorial ============== **Author**: `Nathan Inkawhich <https://github.com/inkawhich>`__ Introduction ------------ This tutorial will give an introduction to DCGANs through an example. We will train a generative adversarial network (GAN) to generate new celebrities after showing it ...
github_jupyter
# Extension Input Data Validation When using extensions in Fugue, you may add input data validation logic inside your code. However, there is standard way to add your validation logic. Here is a simple example: ``` from typing import List, Dict, Any # partitionby_has: a # schema: a:int,ct:int def get_count(df:List[D...
github_jupyter
##### Copyright 2020 The TF-Agents 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 a...
github_jupyter
# Week 4 Yay! It's week 4. Today's we'll keep things light. I've noticed that many of you are struggling a bit to keep up and still working on exercises from the previous weeks. Thus, this week we only have two components with no lectures and very little reading. ## Overview * An exercise on visualizing geodata ...
github_jupyter
# Inference with your model This is the third and final tutorial of our [beginner tutorial series](https://github.com/awslabs/djl/tree/master/jupyter/tutorial) that will take you through creating, training, and running inference on a neural network. In this tutorial, you will learn how to execute your image classifica...
github_jupyter
# Autonomous driving - Car detection Welcome to your week 3 programming assignment. You will learn about object detection using the very powerful YOLO model. Many of the ideas in this notebook are described in the two YOLO papers: [Redmon et al., 2016](https://arxiv.org/abs/1506.02640) and [Redmon and Farhadi, 2016](h...
github_jupyter
``` # Copyright (c) 2020-2021 Adrian Georg Herrmann import os import matplotlib.pyplot as plt import pandas as pd import numpy as np from scipy import interpolate from sklearn.linear_model import LinearRegression from datetime import datetime data_root = "../../data" locations = { "berlin": ["52.4652025", "13.34...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt Pre_data = pd.read_csv("C:\\Users\\2019A00303\\Desktop\\Code\\Airbnb Project\\Data\\PreProcessingAustralia.csv") Pre_data Pre_data['Price'].plot(kind='hist', bins=100) Pre_data['group'] = pd.cut(x=Pre_data['Price'], bins=[0, 50, 100, 150, 200, ...
github_jupyter
# KNN(K Nearest Neighbours) for classification of glass types We will make use of KNN algorithms to classify the type of glass. ### What is covered? - About KNN algorithm - Exploring dataset using visualization - scatterplot,pairplot, heatmap (correlation matrix). - Feature scaling - using KNN to predict - Optimizati...
github_jupyter
<a href="https://colab.research.google.com/github/krakowiakpawel9/machine-learning-bootcamp/blob/master/unsupervised/04_anomaly_detection/01_local_outlier_factor.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ### scikit-learn Strona biblioteki: [ht...
github_jupyter
``` import numpy as np import pandas as pd import glob import emcee import corner import scipy.stats from scipy.ndimage import gaussian_filter1d import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator from sklearn.model_selection import GridSearchCV from sklearn.neighbors import KernelDensity f...
github_jupyter
# Initial data and problem exploration ``` import xarray as xr import pandas as pd import urllib.request import numpy as np from glob import glob import cartopy.crs as ccrs import matplotlib.pyplot as plt import os import cartopy.feature as cfeature states_provinces = cfeature.NaturalEarthFeature( category='cu...
github_jupyter
# Descriptive analysis for the manuscript Summarize geotagged tweets of the multiple regions used for the experiment and the application. ``` %load_ext autoreload %autoreload 2 import os import numpy as np import pandas as pd import yaml import scipy.stats as stats from tqdm import tqdm def load_region_tweets(regio...
github_jupyter