text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
# Edafa on ImageNet dataset This notebook shows an example on how to use Edafa to obtain better results on **classification task**. We use [ImageNet](http://www.image-net.org/) dataset which has **1000 classes**. We use *pytorch* and pretrained weights of AlexNet. At the end we compare results of the same model with a...
github_jupyter
# Extract authors from PMC-OAI frontmatter `<article>` records ``` import pathlib import pandas from pubmedpy.xml import yield_etrees_from_zip from pubmedpy.pmc_oai import extract_authors_from_article zip_paths = sorted(pathlib.Path('data/pmc/oai/pmc_fm').glob('*.zip')) zip_paths authors = list() for zip_path in zip...
github_jupyter
<!--NOTEBOOK_HEADER--> *This notebook contains material from [PyRosetta](https://RosettaCommons.github.io/PyRosetta.notebooks); content is available [on Github](https://github.com/RosettaCommons/PyRosetta.notebooks.git).* <!--NAVIGATION--> | [Contents](toc.ipynb) | [Index](index.ipynb) | [PyRosetta Google Drive Setup]...
github_jupyter
``` import bar_chart_race as bcr import pandas as pd import numpy as np import yfinance as yf import warnings warnings.filterwarnings('ignore') import os import pickle COLUMNS=['zip', 'sector', 'fullTimeEmployees', 'longBusinessSummary', 'city', 'phone', 'state', 'country', 'companyOfficers', 'website', 'ma...
github_jupyter
## Processamento de consulta ``` import math import json import operator from collections import Counter class QueryProcessing(): def load(self, path): # carregar o indice invertido no formato json f = open(path) return json.load(f) def init_vectors(self, spl): # inicia as tres estruturas...
github_jupyter
``` import os import numpy as np import pandas as pd import tensorflow as tf import FinanceDataReader as fdr import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler from sklearn.model_selection import train_test_split from tensorflow.keras.models import Sequential from tensorflow.keras.layers imp...
github_jupyter
``` #importing libraries import PIL import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LogisticRegression from sklearn import preprocessing from sklearn.model_selection import train_test_split import keras from keras.models import Sequential from keras.layers import...
github_jupyter
# Image Cropping This script will load the sample image files found in the `photo_files` sub-directory and crop them to a more uniform size centered on the sample. These values were chosen to maximize the 'fill' of the photo by the sample color. ``` import numpy as np import pandas as pd import matplotlib.pyplot as p...
github_jupyter
# Beautiful Charts **Inhalt:** Etwas Chart-Formatierung **Nötige Skills:** Erste Schritte mit Pandas **Lernziele:** - Basic Parameter in der Plot-Funktion kennenlernen - Charts formatieren mit weiteren Befehlen - Intro für Ready-Made Styles und Custom Styles - Charts exportieren **Weitere Ressourcen:** - Alle Ress...
github_jupyter
# Elastic Tensor Dataset This notebook demostrates how to pull all computed elastic tensors and associated data from the Materials Project (well the ones with no warnings more exist). A few minimal modifications are made to the data in data_clean, but largely intended to write a JSON file with all the data so the MP's...
github_jupyter
``` # default_exp networks # hide from nbdev.showdoc import * # export import torch import torch.nn as nn from torch import tensor ``` # Networks > Common neural network architectures for *Collaborative Filtering*. # Overview This package implements several neural network architectures that can be used to build re...
github_jupyter
# Videos Pipeline ``` # Import everything needed to edit/save/watch video clips from moviepy.editor import VideoFileClip from IPython.display import HTML # load helper functions %run -i "0. Functions_Clases Pipeline.py" %run -i "Line.py" # Load Camera calibration params [ret, mtx, dist, rvecs, tvecs] = pickle.load(o...
github_jupyter
## Image网 Submission `128x128` This contains a submission for the Image网 leaderboard in the `128x128` category. In this notebook we: 1. Train on 1 pretext task: - Train a network to do image inpatining on Image网's `/train`, `/unsup` and `/val` images. 2. Train on 4 downstream tasks: - We load the pretext weight...
github_jupyter
## Tests of code for plotting probability distributions and density matrices ``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import itertools ``` Define pandas dataframe for a probability distribution ``` states = ['Apple', 'Strawberry','Coconut'] pd_df = pd.DataFrame(np.array([.1, .3, .6]...
github_jupyter
``` %matplotlib inline %time from hikyuu.interactive.interactive import * iodog.open() #use_draw_engine('echarts') ``` # 一、策略分析 ## 原始描述 买入条件:周线MACD零轴下方底部金叉买入30% 卖出条件:日线级别 跌破 20日线 卖出50%持仓 ## 策略分析 市场环境:无 系统有效性:无 信号指示器: - 买入信号:周线MACD零轴下方底部金叉,即周线的DIF>DEA金叉时买入(快线:DIF,慢线DEA) - 卖出信号:日线级别 跌破 20日均线 止损/止盈:无 资金管理: - 买入...
github_jupyter
## Importing the required libraries ``` import librosa import librosa.display import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from matplotlib.pyplot import specgram import keras from keras.preprocessing import sequence from keras.models import Sequential from keras.layers import Dense, Embed...
github_jupyter
# Main This script demonstrates how the whole pipeline should work. ``` # Imports import sys sys.path.append('../..') import datetime import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from help_project.src.disease_model import data from help_project.src.disease_model import ensemble_model fro...
github_jupyter
# K-means Clustering ## Import resources and display image ``` import numpy as np np.set_printoptions(threshold=np.nan) import matplotlib.pyplot as plt import cv2 %matplotlib inline # Read in the image ## TODO: Check out the images directory to see other images you can work with # And select one! image = cv2.imread...
github_jupyter
``` from mpl_toolkits import mplot3d import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import matplotlib.pylab as pylab params = {'axes.labelsize': '20', 'font.weight' : 10} plt.rcParams.update(params) plt.rcParams["font.family"] = "normal" #Times New Roman" fig = plt.figure() ax1 = plt.axes(...
github_jupyter
# Wrapping a fine-tuned Transformer --- This tutorial will briefly take you through how to wrap an already trained transformer for text classification in a SpaCy pipeline. For this example we will use DaNLP's BertTone as an example. However, do note that this approach also works using models directly from Huggingface'...
github_jupyter
# Spectral Vertex Nomination This demo shows how to use the Spectral Vertex Nomination (SVN) class. We will use SVN to nominate vertices in a Stochastic Block Model (SBM) ``` # imports import numpy as np from graspologic.nominate import SpectralVertexNomination from graspologic.simulations import sbm from graspologic...
github_jupyter
***The content below is a TensorFlow port of the tutorial [Deep Learning for NLP with PyTorch](https://pytorch.org/tutorials/beginner/deep_learning_nlp_tutorial.html).*** <h1>Word Embedding - Encoding Lexical Semantics<span class="tocSkip"></span></h1> <div class="toc"><ul class="toc-item"><li><span><a href="#N-gram-L...
github_jupyter
``` import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import tqdm %matplotlib inline from torch.utils.data import Dataset, DataLoader import torch import torchvision import torch.nn as nn import torch.optim as optim from torch.nn import functional as F device = torch.device("cuda" i...
github_jupyter
# Kepler Data ## The Data SIMBAD info: http://simbad.u-strasbg.fr/simbad/sim-id?Ident=KIC7198959 Lightcurve data from: https://archive.stsci.edu/kepler/publiclightcurves.html ``` # !curl -O https://archive.stsci.edu/pub/kepler/lightcurves/0071/007198959/kplr007198959-2009259160929_llc.fits from astropy.io import fi...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import seaborn as sns import umap %matplotlib inline #sns.set(style='white', rc={'figure.figsize':(12,8)}) import requests import zipfile import imageio import os import umap import MulticoreTSNE import ...
github_jupyter
# Table of Contents <p><div class="lev1 toc-item"><a href="#Creating-XML-for-NETCONF-via-LXML" data-toc-modified-id="Creating-XML-for-NETCONF-via-LXML-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Creating XML for NETCONF via LXML</a></div><div class="lev1 toc-item"><a href="#Alternative-One:-Namespaces" data-toc-...
github_jupyter
``` import torch import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from tqdm import tqdm import os import seaborn as sns import sys sys.path.insert(0,'/home/gsoc0/Adversarial_CapsNet_Pytorch/') from model.net import * from model.cnn_net import * from utils.training import * from dat...
github_jupyter
# <center>Multiscale Geographically Weighted Regression - Poisson dependent variable</center> The model has been explored and tested for multiple parameters on real and simulated datasets. The research includes the following outline with separate notebooks for each part. **Notebook Outline:** **Introduction (c...
github_jupyter
### 라이브러리 불러오기 ``` import sklearn print(sklearn.__version__) !pip install sklearn import sklearn print(sklearn.__version__) import numpy as np import pandas as pd # ----------------------------------- # 학습 데이터, 테스트 데이터 읽기 # ----------------------------------- # 학습 데이터, 테스트 데이터 읽기 train = pd.read_csv('../input/ch01-tit...
github_jupyter
# Churn Project -------------------------------------------------------------------- _note_: This notebook was adapted from a number external sources: * **[Churn Prediction and Prevention in Python](https://towardsdatascience.com/churn-prediction-and-prevention-in-python-2d454e5fd9a5)** * **[Telecom Customer Churn P...
github_jupyter
``` #default_exp cifar_loader ``` # CIFAR Loader STATUS: SUPER EARLY ALPHA This package is NOT yet ready for PUBLIC CONSUMPTION. Use at your own RISK!!!! Everything, including the API (and even the existence of this module) are subject to breaking change... These are utilities ``` #colab !pip install -Uqq git+htt...
github_jupyter
# A: Studying Higgs Boson Analysis. Signal and Background Sloping background as in real experiment ## Part 1 The Background This file contains the code for the unit "The Elusive Mr. Higgs". It explains the experiment with the Higgs signal and background signal under different settings In this part we look at the Ba...
github_jupyter
``` from IPython.core.display import display, HTML import pygments display(HTML("<style>.container { width:290mm !important; }</style>")) # to set cell widths #to get this into the dissertation, #1. widht (above) was changed from 290 to 266 mm #2. exported with jupyter notebook as html (space gets wider), #3. convert...
github_jupyter
I want to create a data-driven model to better predict the winners of the current year. The model i want to create uses a region-based Elo rating. <br/> We use a genetic algorithm to learn an elo model where the variable are: - one K constant (positive) for the maximum points gainable/losable per win/lose - a number o...
github_jupyter
### VGG16 Image Captioning. ### Imports ``` from matplotlib import pyplot as plt import tensorflow as tf import numpy as np import os, time, sys from PIL import Image from tensorflow.keras import backend as K from tensorflow import keras from tensorflow.keras.applications import VGG16 from tensorflow.keras.preproc...
github_jupyter
# Sequence to sequence learning for performing number addition **Author:** [Smerity](https://twitter.com/Smerity) and others<br> **Date created:** 2015/08/17<br> **Last modified:** 2020/04/17<br> **Description:** A model that learns to add strings of numbers, e.g. "535+61" -> "596". ## Introduction In this example, ...
github_jupyter
<h1>**Data Bootcamp Final Project**</h1> <h2>**Success rate of movies: released date and production cost**</h2> **Name: Jaehurn Nam** **Net ID: jn1402** **N#: N10448338** ***Description of the project: This project is figuring out the correlation between the amount of revenue a movie creates and the month it ...
github_jupyter
# Hypothesis testing with BayesDB ##### Prepared by Ulrich Schaechtle, PhD. ## Preamble This notebook is demonstrating hypothesis testing with BayesDB. **The demo is using early stage alpha version research software.** The demo is not intended to be used as is -- it won't scale to larger datasets and the interface...
github_jupyter
``` %pylab inline %load_ext autoreload %autoreload 2 import warnings warnings.filterwarnings('ignore') warnings.simplefilter('ignore') import os import glob from tqdm import tqdm, tqdm_notebook import pandas as pd import fitsne from sklearn.model_selection import cross_val_score from sklearn.metrics import confusion_ma...
github_jupyter
``` import json import os import glob import pprint from tqdm import tqdm from collections import Counter import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv("datasets/verified.dat") # df = df[df['friends_count'] <= 1000] df.info() df.head() # df[df['FriendsCount'] < 5000].info() ``` ### Dic...
github_jupyter
##### Copyright 2018 The TensorFlow Probability Authors. Licensed under the Apache License, Version 2.0 (the "License"); ``` #@title Licensed under the Apache License, Version 2.0 (the "License"); { display-mode: "form" } # you may not use this file except in compliance with the License. # You may obtain a copy of th...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/automated-machine-learning/forecasting-energy-demand/auto-ml-forecasting-energy-demand.png) # Automa...
github_jupyter
# Registration Framework Components ### Learning Objectives * Get exposure to the different components in a registration optimization framework and how they are connected * Set up and run a complete registration pipeline ## Registration Optimization Framework Overview ![Optimization framework](figures/ITKv4Registra...
github_jupyter
``` import torch import torch.nn as nn import torchvision.models as models from torch.nn.utils.rnn import pack_padded_sequence class EncoderCNN(nn.Module): def __init__(self, embed_size): """Load the pretrained ResNet-152 and replace top fc layer.""" super(EncoderCNN, self).__init__() resnet...
github_jupyter
# Práctico 2 - Redes en escalera avanzadas Este práctico es similar al práctico 1, pero agregará un paso extra que es el uso de redes en escalera avanzadas, ya sean Redes Convolucionales o Redes Recurrentes. Se les dará, como base, el mismo conjunto de datos de la competencia "PetFinder" que se trabajó para el prácti...
github_jupyter
# 01 - Introduction to Machine Learning by [Alejandro Correa Bahnsen](albahnsen.com/) version 0.2, May 2016 ## Part of the class [Machine Learning for Security Informatics](https://github.com/albahnsen/ML_SecurityInformatics) This notebook is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported ...
github_jupyter
# Rollout Starting Demo This notebook demonstrates our code's basic features by computing the rollout of expected improvement (EI) for horizon two. Let $y^*$ represent the current observed minimum and $(\cdot)^+ = \text{max}(\cdot, 0)$. Recall that EI is defined as $\text{EI}(\mathbf{x}) = \mathbb{E}[\big(y^* - y(\ma...
github_jupyter
# Neural networks with PyTorch Deep learning networks tend to be massive with dozens or hundreds of layers, that's where the term "deep" comes from. You can build one of these deep networks using weight matrices manually, but in general it's very cumbersome and difficult to implement. PyTorch has a nice module `nn` th...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. ![Impressions](https://PixelServer20190423114238.azurewebsites.net/api/impressions/MachineLearningNotebooks/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.png) # How to u...
github_jupyter
``` from keras.models import Sequential from keras.layers import Convolution2D, MaxPooling2D, Flatten, Dense model = Sequential() # keras modeli model.add(Convolution2D(32, 3, 3, input_shape = (64, 64, 3), activation = 'relu')) # evrisim katmani (64, 64, 3...
github_jupyter
## Dependencies ``` from tweet_utility_scripts import * from transformers import TFDistilBertModel, DistilBertConfig from tokenizers import BertWordPieceTokenizer from tensorflow.keras.models import Model from tensorflow.keras import optimizers, metrics, losses from tensorflow.keras.callbacks import EarlyStopping, Ten...
github_jupyter
``` import os import pandas as pd from oemof import solph from oemof.solph.plumbing import sequence import datetime as dt import matplotlib.pyplot as plt # function for summarize information about flows def calc_total_flows(storage_flow, boiler_flow, total_flow, demand, schedule=None): total_flows = pd.DataFrame...
github_jupyter
Lambda School Data Science *Unit 2, Sprint 2, Module 4* --- # Classification Metrics ## Assignment - [ ] If you haven't yet, [review requirements for your portfolio project](https://lambdaschool.github.io/ds/unit2), then submit your dataset. - [ ] Plot a confusion matrix for your Tanzania Waterpumps model. - [ ] Co...
github_jupyter
``` # style the notebook from IPython.core.display import HTML import urllib.request response = urllib.request.urlopen('http://bit.ly/1LC7EI7') HTML(response.read().decode("utf-8")) ``` # Perceptron Learning Algorithm ** Not 'written' yet, just notes to an article**. Based on development in chapter 1 of "Learning fro...
github_jupyter
``` !nvidia-smi ``` # Imports ``` from google.colab import drive drive.mount('/content/drive') !cp '/content/drive/My Drive/GIZ Zindi/Train.csv' . !cp '/content/drive/My Drive/GIZ Zindi/SampleSubmission.csv' . !cp '/content/drive/My Drive/GIZ Zindi/AdditionalUtterances.zip' AdditionalUtterances.zip !unzip -q Addition...
github_jupyter
# PMOD Grove OLED ---- ## Aim/s * Write a Python Driver for the Grove OLED. ## References * [PYNQ Docs](https://pynq.readthedocs.io/en/latest/index.html) * [Grove OLED Display](https://www.seeedstudio.com/Grove-OLED-Display-0-96.html) * [Adafruit Python](https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Ad...
github_jupyter
# SCOPRIRE GLI OPENDATA DELLA SCUOLA ITALIANA ![open data miur](http://dati.istruzione.it/opendata/img/pagine-interne/copertina-open-data.jpg) ![](http://dati.istruzione.it/opendata/img/home/home_icon_01_opendata.png) # [I DATI DISPONIBILI](#opendatalist) http://dati.istruzione.it/opendata/opendata/ --- # SCUOLE <im...
github_jupyter
``` %%init_spark launcher.jars = ["file:///opt/benchmark-tools/spark-sql-perf/target/scala-2.12/spark-sql-perf_2.12-0.5.1-SNAPSHOT.jar", "/opt/benchmark-tools/oap/oap_jars/spark-columnar-core-1.2.0-jar-with-dependencies.jar","/opt/benchmark-tools/oap/oap_jars/spark-arrow-datasource-standard-1.2.0-jar-with-dependencies....
github_jupyter
As usual we start loading the packages that we will use in our notebook ``` import tensorflow as tf import numpy as np import pandas as pd from sklearn import model_selection from sklearn.preprocessing import LabelEncoder #PRINT VERSION!! tf.__version__ train_df = pd.read_csv("train_languages.csv")#here we have the d...
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
``` import numpy as np import tensorflow as tf from sklearn.utils import shuffle import re import time import collections import os def build_dataset(words, n_words, atleast=1): count = [['GO', 0], ['PAD', 1], ['EOS', 2], ['UNK', 3]] counter = collections.Counter(words).most_common(n_words) counter = [i for...
github_jupyter
<a href="https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W3D4_ReinforcementLearning/student/W3D4_Tutorial3.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Tutorial 3: Learning to Act: Q-Learning **We...
github_jupyter
### Introduction Text classification algorithms are at the heart of a variety of software systems that process text data at scale. Email software uses text classification to determine whether incoming mail is sent to the inbox or filtered into the spam folder. Discussion forums use text classification to determine w...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt ``` Remember that in week 1 we had generated open-loop commands for a set of manoeuvres such as $[("straight", 5), ("right", 90), ("straight", 6), ("left", 90)]$ Let us do repeat, but with a change. Instead of left/ right, simply use turn and a signed angle. $[("...
github_jupyter
# Lasso Scenario Creation Quickstart In this notebook we will run through: 1. Using a configuration file to run lasso 2. Setting up a base scenario and applying projects 3. Transforming the standard network format to the MetCouncil expected format 4. Exporting the network to a shapefile and csvs ``` import o...
github_jupyter
## A stateless oracle: introduction #### 09.0 Winter School on Smart Contracts ##### Peter Gruber (peter.gruber@usi.ch) 2022-03-24 * Part 0: Theoretical introduction * Parts 1-4 are only relevant if you want to **create** an Oracle * Parts 5-6 are needed to **use** the oracle. ## Introduction The distincion between "...
github_jupyter
# Managing assignment files manually Distributing assignments to students and collecting them can be a logistical nightmare. If you are relying on distributing the release version of the assignment to the students using your institution's existing learning management system the process of downloading the students subm...
github_jupyter
# step 1:write a fn that can print out a board .set up your board as a list,where each index 1-9 corresponds with a number on a number pad,so you get a 3 by 3 board representation ``` lis = {7 :" ",8:" ",9:" ",4:" ",5:" ",6:" ",1:" ",2:" ",3:" "} def print_board(): # fun to...
github_jupyter
``` #%config Completer.use_jedi = False import pandas as pd import numpy as np ``` ###### Loading and exploring data, spanish is the original language of dataset ``` properties = pd.read_excel('outputs/propiedades_pasto_11_05_21_3.xlsx',engine='openpyxl', index_col=0) properties.head(4) properties.info() properties...
github_jupyter
Currently stacks using weighted average on predicted submissions files. To do: - Use folds in the initial layers and train a stacking a layer (boosted tree) ## Import data ``` import numpy as np import pandas as pd path = 'data/raw/train.csv' full_path = os.path.join(dir_path, path) df_train = pd.read_csv(full_path...
github_jupyter
# Customizing QuickPlot This notebook shows how to customize PyBaMM's `QuickPlot`, using matplotlib's [style sheets and rcParams](https://matplotlib.org/stable/tutorials/introductory/customizing.html) First we define and solve the models ``` %pip install pybamm -q import pybamm models = [pybamm.lithium_ion.SPM(), p...
github_jupyter
``` # Organizing Topic Modeling Results import pandas as pd # Loading topic modeling results reviews = pd.read_csv(".//LDA/if_mallet_41topics_representation.tsv", sep = '\t') reviews = reviews.drop("Keywords", axis = 1) reviews = reviews.drop("Unnamed: 0", axis = 1) reviews = reviews.drop("Topic_Perc_Contrib", axis = 1...
github_jupyter
``` ! pip install pyspark ! pip install findspark from pyspark.sql import SparkSession spark = SparkSession \ .builder \ .appName("Semi_Sructured_Data_Analysis") \ .config("spark.some.config.option", "some-value") \ .getOrCreate() ``` ### Reading CSV ``` ! wget 'https://covid.ourworldindata.org/data/o...
github_jupyter
``` """ Brian Sharber CSCI 4350/5350 Dr. Joshua Phillips Honors Contract: Fall 2019 Program Description: Uses toy data sets to illustrate the effectiveness of Hybrid Clustering methods, which utilize Spectral and Subspace clustering methods. Adjusting the values of gamma and sigma from subspace and spectral clustering...
github_jupyter
In this chapter we will create an ontology and populate it with labels ## Preparing - Entities setup ``` import dtlpy as dl if dl.token_expired(): dl.login() project = dl.projects.get(project_name='project_name') dataset = project.datasets.get(dataset_name='dataset_name') # Get recipe from list recipe = datas...
github_jupyter
``` # Imports import base64 import json import os import requests import azureml.core from azureml.core import Workspace from azureml.core.model import Model from azureml.core.model import InferenceConfig from azureml.core import Environment from azureml.core.webservice import AciWebservice, Webservice f...
github_jupyter
## Dependencies ``` import os import sys import cv2 import shutil import random import warnings import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from tensorflow import set_random_seed from sklearn.utils import class_weight from sklearn.model_selection import train_test_split...
github_jupyter
# Styling This document is written as a Jupyter Notebook, and can be viewed or downloaded [here](https://nbviewer.ipython.org/github/pandas-dev/pandas/blob/master/doc/source/user_guide/style.ipynb). You can apply **conditional formatting**, the visual styling of a DataFrame depending on the data within, by using the ...
github_jupyter
## TensorFlow 2 Complete Project Workflow in Amazon SageMaker ### Data Preprocessing -> Code Prototyping -> Automatic Model Tuning -> Deployment 1. [Introduction](#Introduction) 2. [SageMaker Processing for dataset transformation](#SageMakerProcessing) 3. [Local Mode training](#LocalModeTraining) 4. [Local Mode en...
github_jupyter
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. # Azure ML Hardware Accelerated Object Detection This tutorial will show you how to deploy an object detection service based on the SSD-VGG model in just a few minutes using the Azure Machine Learning Accelerated AI service. W...
github_jupyter
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-59152712-8"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-59152712-8'); </script> # Tutorial-IllinoisGRMHD: postpostinitial__set_symmetries__...
github_jupyter
# Dirichlet Process Mixture Models in Pyro ## What are Bayesian nonparametric models? Bayesian nonparametric models are models where the number of parameters grow freely with the amount of data provided; thus, instead of training several models that vary in complexity and comparing them, one is able to design a model...
github_jupyter
# Table of Contents <p><div class="lev1"><a href="#Relative-Probabilities-1"><span class="toc-item-num">1&nbsp;&nbsp;</span>Relative Probabilities 1</a></div><div class="lev1"><a href="#Relative-Probabilities-2"><span class="toc-item-num">2&nbsp;&nbsp;</span>Relative Probabilities 2</a></div><div class="lev1"><a href=...
github_jupyter
## DeepExplain - Tensorflow example ### MNIST with a 2-layers MLP ``` from __future__ import absolute_import from __future__ import division from __future__ import print_function import tempfile, sys, os sys.path.insert(0, os.path.abspath('..')) from tensorflow.examples.tutorials.mnist import input_data import tenso...
github_jupyter
# Optimal Transmission Switching (OTS) (OST) with PowerModels.jl This tutorial describes how to run the OST feature of PowerModels.jl together with pandapower. The OST allows to optimize the "switching state" of a (meshed) grid by taking lines out of service. This not exactly the same as optimizing the switching state ...
github_jupyter
# Third week notebook-part three This notebook get the Postcode, Borough and Neighbourhood from Toronto and adds the longitude and latitude. Finally we do clustering and visualization. First modules are imported *Warning: This document uses both neighbo**u**rhood and neighborhood. This should be avoided* ``` fro...
github_jupyter
``` %matplotlib inline # flake8: noqa ``` # Tune's Scikit Learn Adapters Scikit-Learn is one of the most widely used tools in the ML community for working with data, offering dozens of easy-to-use machine learning algorithms. However, to achieve high performance for these algorithms, you often need to perform **model...
github_jupyter
Copyright (c) 2015, 2016 [Sebastian Raschka](sebastianraschka.com) https://github.com/rasbt/python-machine-learning-book [MIT License](https://github.com/rasbt/python-machine-learning-book/blob/master/LICENSE.txt) # Python Machine Learning - Code Examples # Chapter 11 - Working with Unlabeled Data – Clustering Anal...
github_jupyter
``` import os from pathlib import Path import xarray as xr import numpy as np import pandas as pd from datetime import datetime import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import seaborn as sb ``` This notebook takes the raw/downloaded information and pre-processes it into a da...
github_jupyter
This notebook is based on Slawek Biel's notebook (https://www.kaggle.com/slawekbiel/positive-score-with-detectron-3-3-inference) #### Version history * V1 - test the model_best_5.pth * V2 - test the model_best_4.pth * V3 - test the model_final_6.pth * V4 - test the model_final_5.pth ## Inference and Submission After ...
github_jupyter
# PyHMx Demo of the alternative interface (non `f90wrap`). This is currently called `pyhmx`. ``` import numpy as np %matplotlib inline import matplotlib.pyplot as plt import matplotlib.colorbar import camb import pyhmx def colorbar(colormap, ax, vmin=None, vmax=None): cmap = plt.get_cmap(colormap) cb_ax = ...
github_jupyter
``` %matplotlib inline import numpy as np from hagelslag.processing import EnhancedWatershed, ObjectMatcher, centroid_distance, shifted_centroid_distance from hagelslag.processing.tracker import extract_storm_objects, track_storms import matplotlib.pyplot as plt from scipy.stats import multivariate_normal from scipy.nd...
github_jupyter
# Aries Basic Controller - Basic Message Example ``` %autoawait import time import asyncio from aries_basic_controller.aries_controller import AriesAgentController WEBHOOK_HOST = "0.0.0.0" WEBHOOK_PORT = 8022 WEBHOOK_BASE = "" ADMIN_URL = "http://alice-agent:8021" # Based on the aca-py agent you wish to control ...
github_jupyter
``` import sys sys.path.append('../scripts/') from ideal_robot import * from scipy.stats import expon, norm class Robot(IdealRobot): ###add_stuck### noise, biasメソッドは省略で def __init__(self, pose, agent=None, sensor=None, color="black", \ noise_per_meter=5, no...
github_jupyter
``` # !wget https://storage.googleapis.com/xlnet/released_models/cased_L-12_H-768_A-12.zip -O xlnet.zip # !unzip xlnet.zip import os os.environ['CUDA_VISIBLE_DEVICES'] = '' import sentencepiece as spm from prepro_utils import preprocess_text, encode_ids sp_model = spm.SentencePieceProcessor() sp_model.Load('xlnet_case...
github_jupyter
# The Credit Card Fraud Dataset - Synthesizing the Minority Class In this notebook a practical exercise is presented to showcase the usage of the YData Synthetic library along with GANs to synthesize tabular data. For the purpose of this exercise, dataset of credit card fraud from Kaggle is used, that can be found her...
github_jupyter
# Demo notebook for Kamodo Flythrough "FakeFlight" function The FakeFlight function flies a user-designed trajectory through the chosen model data. The sample trajectory is created using a few input parameters as described in the output of block 5. You may run the notebook as is if you have the sample data file, but yo...
github_jupyter
<a href="https://colab.research.google.com/github/shahd1995913/Tahalf-Mechine-Learning-DS3/blob/main/Exercise/ML1_S5_Exercise_.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # ML1-S3 (K Nearest Neighbor (`KNN`) Algorithm)👨🏻‍💻 --- ### Agenda - [...
github_jupyter
# Quantum Integer Programming (QuIP) 47-779. Fall 2020, CMU ## Quiz 2 ### Problem statement #### Integer linear program Solve the following problem $$ \min_{\mathbf{x}} 2𝑥_0+4𝑥_1+4𝑥_2+4𝑥_3+4𝑥_4+4𝑥_5+5𝑥_6+4𝑥_7+5𝑥_8+6𝑥_9+5𝑥_{10} \\ s.t. \begin{bmatrix} 1 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 1\\ 0 & 1 & 0 & 1...
github_jupyter
``` import os, sys sys.path.append(os.getcwd()) import numpy as np import tensorflow as tf import scipy.misc import imageio from imageio import imwrite from scipy.misc import imsave, imread import keras from keras.datasets import mnist, cifar10 (x_train, y_train), (x_test, y_test) = mnist.load_data() (x_traincifar,...
github_jupyter