text
stringlengths
2.5k
6.39M
kind
stringclasses
3 values
--- _You are currently looking at **version 1.0** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-machine-learning/resources/bANLa) course resource._ --- # Applied Machine ...
github_jupyter
# CME 193 - Lecture 5 - Pandas Before we get started, you may want to make sure that you have the following packages installed in whatever environment you're using: `pandas` ```bash conda install pandas ``` Pandas is a package for working with tabular data. We'll also cover dictionaries and lambda functions today...
github_jupyter
``` import spacy from spacy import displacy import nltk nltk.download('punkt') nltk.download('averaged_perceptron_tagger') from nltk.tokenize import word_tokenize from nltk.tag import pos_tag nltk.download('wordnet') from nltk.corpus import stopwords import re from nltk.stem import PorterStemmer nltk.download('stopword...
github_jupyter
<a href="https://colab.research.google.com/github/SLCFLAB/Data-Science-Python/blob/main/Day%202/2_1.%20numpy%26pandas.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Numpy & Pandas basic ### Reference https://numpy.org/doc/stable/reference/routin...
github_jupyter
REF_top-10-0-10943-stacking-mice-and-brutal-force ๅ‚่€ƒ: - https://www.kaggle.com/agehsbarg/top-10-0-10943-stacking-mice-and-brutal-force ## Import PKGs ``` import os import time import numpy as np import pandas as pd import datetime import random import matplotlib.pyplot as plt from sklearn.model_selection import G...
github_jupyter
Below is code with a link to a happy or sad dataset which contains 80 images, 40 happy and 40 sad. Create a convolutional neural network that trains to 100% accuracy on these images, which cancels training upon hitting training accuracy of >.999 Hint -- it will work best with 3 convolutional layers. ``` import tens...
github_jupyter
# Intuition for the Maximum Mean Discrepancy two-sample test _Thomas Viehmann_ This note sketches the intuition behind [A. Gretton et al.: A Kernel Two-Sample Test. JMLR 2012](http://www.gatsby.ucl.ac.uk/~gretton/mmd/mmd.htm). Given a (high-dimensional) space $\mathbb{R}^d$ and iid samples $X_i \in \mathbb{R}^d, i=1...
github_jupyter
# [Angle closure Glaucoma Evaluation Challenge](https://age.grand-challenge.org/Details/) ## Scleral spur localization Baseline ๏ผˆRCNN) - To keep model training stable, images with coordinate == -1, were removed. - For real inference, you MIGHT keep all images in val_file_path file. ## requirement install ``` !pip in...
github_jupyter
## 13) More NumPy Plus Linear Algebra Fundamentals Related references: - https://jakevdp.github.io/PythonDataScienceHandbook/02.04-computation-on-arrays-aggregates.html - https://jakevdp.github.io/PythonDataScienceHandbook/02.05-computation-on-arrays-broadcasting.html - [Feature Engineering for Machine Learning](http...
github_jupyter
# NNabla Models Finetuning Tutorial Here we demonstrate how to perform finetuning using nnabla's pre-trained models. ## Load the model Loading the model is very simple. All you need is just 2 lines. ``` from nnabla.models.imagenet import ResNet18 model = ResNet18() ``` You can choose other ResNet models such as `...
github_jupyter
<small><i>June 2016 - This notebook was created by [Oriol Pujol Vila](http://www.maia.ub.es/~oriol). Source and [license](./LICENSE.txt) info are in the folder.</i></small> # Backpropagation ``` #pip install tqdm ``` ## Basic scheme Consider the problem up to this point. Let us recall the three basic components of ...
github_jupyter
# Thompson Sampling for Linearly Constrained Bandits ## Plots for Regret and Violation ``` import numpy as np from matplotlib import pyplot as plt ``` # Load Data ``` results_dir = 'results/' filename = 'edX_eta0.50_T50000_N16' #filename = 'coupon_purchase_eta0.25_T10000_N16' file_ext = '.npy' #data = np....
github_jupyter
# [Titanic Data Set](https://www.kaggle.com/c/titanic/data) <img src="../images/titanic.jpeg"> ### Data Set Information: The titanic data frame describes the survival status of individual passengers on the Titanic. The titanic data frame does not contain information for the crew, but it does contain actual and estim...
github_jupyter
# Getting started with Azure ML Data Prep SDK Copyright (c) Microsoft Corporation. All rights reserved.<br> Licensed under the MIT License. Wonder how you can make the most of the Azure ML Data Prep SDK? In this "Getting Started" guide, we'll demonstrate how to do your normal data wrangling with this SDK and showcase...
github_jupyter
``` %matplotlib inline %config InlineBackend.figure_format = 'retina' import matplotlib.pyplot as plt import matplotlib as mpl from importlib import reload import IPython mpl.rcParams['lines.linewidth'] = 0.25 mpl.rcParams['axes.spines.top'] = False mpl.rcParams['axes.spines.right'] = False mpl.rcParams['axes.linewidt...
github_jupyter
``` %%html <style> div.output_stderr{ display:none } </style> <a id='top'></a> ``` # Operation of parmeter based functions * Documentation for *.yml and run_parameters funtions in ../src/mini_pipelines_toolbox.py. ### source code link: ##### (private) source repository: https://github.com/dlanier/minipipelines.g...
github_jupyter
#Convective Cell Identification & TRAcking (CITRA) using Doppler Weather Radar Images The cell below installs the Tesseract-OCR model and the Google Drive Mount sequence. **NOTE**: - When the below cell in run, it pops up a link to request access to your google drive. Open that link and grant acces. Then copy the acc...
github_jupyter
# Morphing basis animations Let's make something cool: ![morphing animation](morphing.gif) ``` import numpy as np import matplotlib from matplotlib import pyplot as plt from matplotlib.animation import FuncAnimation import numpy as np %matplotlib inline import sys try: from madminer.morphing import Morpher exce...
github_jupyter
``` import wave import struct import os from scipy import signal import numpy as np import tensorflow as tf # from tensorflow.python.ops import variable_scope as vs tf.reset_default_graph() path = r'C:\Users\xujiahao\Desktop\MIR-1K_for_MIREX\trainwav' #ๆ–‡ไปถๅคน็›ฎๅฝ• fname1 = 'left.wav' fname2 = 'right.wav' nframes = 9600...
github_jupyter
# Automated Machine Learning #### Forecasting away from training data ## Contents 1. [Introduction](#Introduction) 2. [Setup](#Setup) 3. [Data](#Data) 4. [Prepare remote compute and data.](#prepare_remote) 4. [Create the configuration and train a forecaster](#train) 5. [Forecasting from the trained model](#forecasti...
github_jupyter
``` import os import numpy as np import pandas as pd path = "../data/partial_files/" elements_list = ["players_info", "match_info", "players_lanes", "player_laning_stats", "player_flair_stats", "champion_bans", "champion_picks", "player_combat_stats", "player_objective_stats", "players...
github_jupyter
# Bouts of Sleep from a month-long recording of WT C57BL/6 mice ### First set up the working environment ``` import numpy as np # calculations import pandas as pd # dataframes and IO import matplotlib.pyplot as plt # plotting # show graphs/figures in notebooks %matplotlib inline import seaborn as sns # statistic...
github_jupyter
# Proof of concept of new "composable" ADMM formulation 3/30/21 This notebook is a proof of concept and understanding of the new ADMM formulation, based on grouping quadratic terms and linear constraints in with the global equality constraint. ``` %load_ext autoreload %autoreload 2 import numpy as np import matplotl...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_parent" href="https://github.com/giswqs/geemap/tree/master/tutorials/FeatureCollection/us_census_data.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target="_parent" h...
github_jupyter
# Pytorch Tutorial ### 4. Saving and Loading Models and Their States - Saving and loading model parameters - Using ```torchvision.models``` Setup torch and torchvision. ``` import torch, torchvision import torch.nn as nn import torch.optim as optim ``` ## Using ```torchvision.models``` Models provided by ```torch...
github_jupyter
# Get started with the Estimator primitive Learn how to set up and use the Estimator primitive program. ## Overview The Estimator primitive lets you efficiently calculate and interpret expectation values of quantum operators required for many algorithms. You can specify a list of circuits and observables, then eval...
github_jupyter
# Titanic Survival Prediction 1. [Import Libraries](#heading1)<br> 2. [Read Data](#heading2)<br> 3. [Data Cleaning & Feature Engineering](#heading3)<br> 4. [Exploratory Data Analysis](#heading4)<br> 5. [Model Building & Evaluation](#heading5)<br> 5.1 [Logistic Regression](#subheading1)<br> 5.2 [Gaussian Naive Baye...
github_jupyter
## 0.Import Packages ``` import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf import keras import os import glob import seaborn as sns ``` ## 1. Load Dataset ``` dir = 'refined_dataset' listdir = os.listdir(dir) print(listdir) print("The number of dataset :", len(listdir)) ...
github_jupyter
``` # !wget https://f000.backblazeb2.com/file/malay-dataset/knowledge-graph/kelm/train_X # !wget https://f000.backblazeb2.com/file/malay-dataset/knowledge-graph/kelm/train_Y import os os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'mesolitica-tpu.json' from tqdm import tqdm import re def cleaning(string): string ...
github_jupyter
# Experiment Collection #03 This notebook contains experiments regarding the use of a penalty term and enabling charging from the grid. These experiments are with the stochastic environment. ## 1. Basic Setup ``` # Jupyter setup %load_ext autoreload %autoreload 2 %config IPCompleter.greedy=True import ray ray.shutdo...
github_jupyter
# Neural Machine Translation Welcome to your first programming assignment for this week! * You will build a Neural Machine Translation (NMT) model to translate human-readable dates ("25th of June, 2009") into machine-readable dates ("2009-06-25"). * You will do this using an attention model, one of the most sophist...
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 os os.environ['CUDA_VISIBLE_DEVICES'] = '3' with open('../Malaya-Dataset/dependency/gsd-ud-train.conllu.txt') as fopen: corpus = fopen.read().split('\n') with open('../Malaya-Dataset/dependency/gsd-ud-test.conllu.txt') as fopen: corpus.extend(fopen.read().split('\n')) with open('../Malaya-D...
github_jupyter
![JohnSnowLabs](https://nlp.johnsnowlabs.com/assets/images/logo.png) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Public/5.1_Text_classification_examples_in_SparkML_S...
github_jupyter
<a href="https://colab.research.google.com/github/satyajitghana/TSAI-DeepNLP-END2.0/blob/main/05_NLP_Augment/SSTModel.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` ! nvidia-smi ! pip install pytorch-lightning --quiet ! pip install OmegaConf --...
github_jupyter
``` import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' import numpy as np import tensorflow as tf import json with open('dataset-bpe.json') as fopen: data = json.load(fopen) train_X = data['train_X'] train_Y = data['train_Y'] test_X = data['test_X'] test_Y = data['test_Y'] EOS = 2 GO = 1 vocab_size = 32000 train_Y ...
github_jupyter
``` import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader from torch.utils.data import sampler from tqdm import tnrange, tqdm_notebook, tqdm import skorch import torchvision.datasets as dset import torchvision.transforms as T import torch...
github_jupyter
KEGG ==== KEGG (<http://www.kegg.jp/>) is a database resource for understanding high-level functions and utilities of the biological system, such as the cell, the organism and the ecosystem, from molecular-level information, especially large-scale molecular datasets generated by genome sequencing and other high-throug...
github_jupyter
Copyright 2020 DeepMind Technologies Limited. 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](https://www.apache.org/licenses/LICENSE-2.0) Unless requ...
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
``` %pylab inline import numpy as np from scipy.integrate import odeint import itertools from Oracle_Training import * import json from SparseARD import* np.random.seed(0) retrain = False noise_percent = 0.1 n_trials = 10 n_sample = 2500 tol = 1e-8 # tolerance for ARD algorithm verbose = True # Translated into Pytho...
github_jupyter
# SYMPAIS Torus Demo [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ethanluoyc/sympais/blob/master/notebooks/torus_demo.ipynb) This notebook provides a visual illustration of the SYMPAIS algorithm. ## Setup ``` try: import google.colab IN_COL...
github_jupyter
**This notebook is an exercise in the [Intermediate Machine Learning](https://www.kaggle.com/learn/intermediate-machine-learning) course. You can reference the tutorial at [this link](https://www.kaggle.com/alexisbcook/introduction).** --- As a warm-up, you'll review some machine learning fundamentals and submit you...
github_jupyter
``` from sklearn.pipeline import Pipeline from sklearn.svm import SVC from sklearn.decomposition import PCA from sklearn.model_selection import StratifiedShuffleSplit from sklearn.metrics import roc_curve, auc import pandas as pd import time from scipy import interp from sklearn.preprocessing import FunctionTransfor...
github_jupyter
## Integraciรณn y procesamiento de los datos Primeramente importaremos todas las librerรญas que vamos a necesitar para el procesamiento de los datos, pandas para el manejo de data frames, matplotlib para generar las grรกficas, scipy para crear clusteres herarquicos y sklearn para hacer clusteres Luego importamos los dat...
github_jupyter
``` #loading libraries import pandas as pd import string import seaborn as sns import nltk from nltk import word_tokenize from nltk.corpus import stopwords from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer import xgboost as xgb from sklearn.ensemble import ...
github_jupyter
# Training Unet & Attention Unet ## Dependencies Install, load, and initialize all required dependencies for this experiment. ### Install Dependencies ``` import sys !{sys.executable} -m pip install -q -e ../../utils/ ``` ### Import Dependencies # System libraries ``` from __future__ import absolute_import, divis...
github_jupyter
# Quick Start Below is a simple demo of interaction with the environment of the VM scheduling scenario. ``` from maro.simulator import Env from maro.simulator.scenarios.vm_scheduling import AllocateAction, DecisionPayload env = Env(scenario="vm_scheduling", topology="azure.2019.10k", start_tick=0, durations=8638, sn...
github_jupyter
``` %load_ext autoreload %autoreload 2 import higlass import higlass.tilesets from higlass.client import Track, View ``` ## Synced heatmaps ``` from higlass.client import View, Track import higlass t1 = Track(track_type='top-axis', position='top') t2 = Track(track_type='heatmap', position='center', tileset...
github_jupyter
This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges). # Solution Notebook ## Problem: Find the single different char between two strings. * [Constraints](#Constraints) * [Test Cases](#Test-Ca...
github_jupyter
Similar to fiducial drift correction, 3D imaging based on astigmatism is implemented in B-Store in separate parts: 1. the `CalibrateAstigmatism` processor that is used to launch the interactive calibration, and 2. a `ComputeTrajectories` class that describes the algorithm for fitting smoothed curves to the beads' x- a...
github_jupyter
In this notebook, we'll learn how to use GANs to do semi-supervised learning. In supervised learning, we have a training set of inputs $x$ and class labels $y$. We train a model that takes $x$ as input and gives $y$ as output. In semi-supervised learning, our goal is still to train a model that takes $x$ as input and...
github_jupyter
``` project_id = 'elife-data-pipeline' source_dataset = 'de_dev' output_dataset = 'de_dev' output_table_prefix = 'data_science_' mv_prefix = 'mv_' max_workers = 10 max_editors = 100 email = 'd.ecer@elifesciences.org' import logging from datetime import datetime from functools import partial from concurrent.futures imp...
github_jupyter
``` %matplotlib inline ``` # Training a Classifier This is it. You have seen how to define neural networks, compute loss and make updates to the weights of the network. Now you might be thinking, ## What about data? Generally, when you have to deal with image, text, audio or video data, you can use standard pytho...
github_jupyter
# Known issues ## A float quantity is Iterable https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable This tests if the object has "__iter__" ``` import collections from physipy import m isinstance(m, collections.abc.Iterable) ``` ## Array repr with 0 value Pick best favunit take the smalle...
github_jupyter
``` from las import LASReader import numpy as np import pandas as pd from scipy import signal import matplotlib.pyplot as plt file = r'./data/7120_1_3.las' def loadLog(file): """ # Import sonic log into Numpy. """ log = LASReader(file, null_subs=np.nan) return log def npSonic(file): """ ...
github_jupyter
# Spark streaming basics project _____ ### Note on Streaming Streaming is something that is rapidly advancing and changing fast, there are multiple new libraries every year, new and different services always popping up, and what is in this notebook may or may not apply to you. Maybe your looking for something specifi...
github_jupyter
# Title: Alert Investigation (Windows Process Alerts) **Notebook Version:** 1.0<br> **Python Version:** Python 3.6 (including Python 3.6 - AzureML)<br> **Required Packages**: kqlmagic, msticpy, pandas, numpy, matplotlib, networkx, ipywidgets, ipython, scikit_learn<br> **Platforms Supported**:<br> - Azure Notebooks Fre...
github_jupyter
``` import numpy as np import matplotlib.pyplot as plt import laser.fresnel_propag as prop from laser.misc import gauss2D import laser.zernike as zern ``` # Example 1: Propagation through an optical setup with a hole ## Laser parameters ``` lam = 8e-7 # Wavelength (in m) k = 2*np.pi/lam # Wave vector fwhm = 0.07 # I...
github_jupyter
# T81-558: Applications of Deep Neural Networks **Module 4: Training a Neural Network** * Instructor: [Jeff Heaton](https://sites.wustl.edu/jeffheaton/), School of Engineering and Applied Science, [Washington University in St. Louis](https://engineering.wustl.edu/Programs/Pages/default.aspx) * For more information visi...
github_jupyter
# Logistic Regression with a Neural Network mindset Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone your intuitions about deep learning....
github_jupyter
``` # Copyright 2020 NVIDIA. All Rights Reserved. # # 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 a...
github_jupyter
``` %load_ext autoreload %autoreload 2 %env CUDA_VISIBLE_DEVICES=2 import numpy as np import pandas as pd import os from sklearn.decomposition import PCA import matplotlib.pyplot as plt import umap from firelight.visualizers.colorization import get_distinct_colors from matplotlib.colors import ListedColormap import pic...
github_jupyter
# CROP Arima model This notebook checks outputs of the Arima model ``` #!pip3 install psycopg2 #!pip3 install plotly import os from datetime import datetime, timedelta import psycopg2 import pandas as pd import plotly.express as px from plotly.subplots import make_subplots import plotly.graph_objects as go import matp...
github_jupyter
# The Egg data object This tutorial will go over the basics of the `Egg` data object, the essential quail data structure that contains all the data you need to run analyses and plot the results. An egg is made up of two primary pieces of data: 1. `pres` data - words/stimuli that were presented to a subject 2. `rec`...
github_jupyter
``` import pandas as pd import numpy as np import os import glob np.random.seed(42) # translate SNANA types types_names = {90:'Ia', 67: '91bg', 52:'Iax', 42:'II', 62:'Ibc', 95: 'SLSN', 15:'TDE', 64:'KN', 88:'AGN', 92:'RRL', 65:'M-dwarf', 16:'EB',53:'Mira', 6:'MicroL', 991:'MicroLB', 992:...
github_jupyter
# Graphillionใซ่งฆใ‚Œใฆใฟใ‚ˆใ† ใ„ใ‚ˆใ„ใ‚ˆGraphillionใฎ่งฃ่ชฌใซๅ…ฅใ‚Šใพใ™๏ผŽใพใšใฏใฏใ˜ใ‚ใซๆ•ฐใˆไธŠใ’ใŠๅง‰ใ•ใ‚“ๅ•้กŒใ‚’็ดนไป‹ใ—๏ผŒใใ‚Œใ‚’Graphillionใ‚’ไฝฟใฃใฆใฉใฎใ‚ˆใ†ใซ่งฃใใ‹ใ‚’ๅ…ทไฝ“็š„ใชใ‚ณใƒผใƒ‰ใ‚’ไบคใˆใฆ่งฃ่ชฌใ—ใพใ™๏ผŽGraphillionใฎๆฉŸ่ƒฝใฎ่ฉณ็ดฐใŠใ‚ˆใณๅ†…้ƒจใงใฉใฎใ‚ˆใ†ใชๅ‡ฆ็†ใŒ่ตฐใฃใฆใ„ใ‚‹ใฎใ‹ใซใคใ„ใฆใฏๆฌก็ซ ไปฅ้™ใง่งฃ่ชฌใ—ใพใ™๏ผŽ ## ๆ•ฐใˆไธŠใ’ใŠๅง‰ใ•ใ‚“ๅ•้กŒ ใพใšใฏไปฅไธ‹ใฎๅ‹•็”ปใ‚’ๅพก่ฆงใใ ใ•ใ„๏ผŽ ``` from IPython.display import YouTubeVideo YouTubeVideo("Q4gTV4r0zRs") ``` ใ“ใฎๅ‹•็”ปใงๅ–ใ‚ŠไธŠใ’ใฆใ„ใ‚‹ๅ•้กŒใ‚’**ๆ•ฐใˆไธŠใ’ใŠๅง‰ใ•ใ‚“ๅ•้กŒ**ใจใ‚ˆใถใ“ใจใซใ—ใพใ™๏ผŽๅ‹•...
github_jupyter
``` import matplotlib as mpl import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.font_manager from matplotlib.patches import Rectangle, PathPatch from matplotlib.textpath import TextPath import matplotlib.transforms as mtrans %matplotlib inline MPL_BLUE = '#11557c' ziti = mpl...
github_jupyter
# Example for computing a price serie's spectrogram ``` # Put these at the top of every notebook, to get automatic reloading and inline plotting %reload_ext autoreload %autoreload 2 %matplotlib inline from datetime import datetime import numpy as np import pandas as pd from pandas import Series, DataFrame pd.set_optio...
github_jupyter
# inference only demo We're done! We have a working pair of models which produce meaninful shared embeddings for text and images, which we can use to run image searches without relying on detailed metadata. The only thing to do now is ensure that the search process is fast enough to be practical, and lay out all of the...
github_jupyter
<span style="color:red; font-family:Helvetica Neue, Helvetica, Arial, sans-serif; font-size:2em;">An Exception was encountered at '<a href="#papermill-error-cell">In [8]</a>'.</span> ``` YEAR = "2020" BASE_DIR = "." # Parameters id = None YEAR = "2302" BASE_DIR = "/Users/cfe/Dev/jupyter-api/src" DATA_DIR = "/Users/cfe...
github_jupyter
# 20 Newsgroups text classification with pre-trained word embeddings In this notebook, we'll use pre-trained [GloVe word embeddings](http://nlp.stanford.edu/projects/glove/) for text classification using PyTorch. Tokenization and word-to-id mapping is done using [gensim](https://radimrehurek.com/gensim/index.html). Th...
github_jupyter
# Striplog expert functions This notebooks looks at the main `striplog` object. For the basic objects it depends on, see [Basic objects](./Basic_objects.ipynb). First, import anything we might need. ``` import matplotlib.pyplot as plt %matplotlib inline import numpy as np import striplog striplog.__version__ from ...
github_jupyter
# Human Protien Atlas Data Processing Here we are pulling data in and processing it. * [Here](http://www.sciencemag.org/content/347/6220/1260419.full) is the paper by Uhlen et al. on the dataset * The data was obtained from [proteinatlas.org](http://www.proteinatlas.org/) ``` %matplotlib inline import pandas as pd ...
github_jupyter
``` import numpy as np %matplotlib inline import matplotlib.pyplot as plt import pandas as pd ``` ## Exercise 1 - load the dataset: `../data/international-airline-passengers.csv` - inspect it using the `.info()` and `.head()` commands - use the function `pd.to_datetime()` to change the column type of 'Month' to a da...
github_jupyter
# Merge Combine data files into a CSV that's ready for analysis ``` import pandas as pd ``` Import data files ``` deaths_df = pd.read_csv( "../input/processed/death-records.csv", parse_dates=["date_of_death", "date_of_birth"], dtype={ "last_name": str, "first_name": str, "middle_...
github_jupyter
Copyright (c) Microsoft Corporation. Licensed under the MIT license. ## Model Training Script for Synapse-AI-Retail-Recommender Model Author (Data Scientist): Xiaoyong Zhu This script is an adapted script of the full Model Training script that can be found in `4. ML Model Building`. This is a slimmed down vers...
github_jupyter
<a href="https://colab.research.google.com/github/hatimnaitlho/ml-sklearn/blob/master/ExtraTreeClassifier_for_breast_cancer_diagnosis.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Extra Tree Classifier for Breast Cancer Diagnosis In this notebo...
github_jupyter
``` %pylab inline import phreeqpython import pandas as pd pp = phreeqpython.PhreeqPython(database='phreeqc.dat') ``` ## Oxygen ``` pressure_range = np.linspace(0.01, 100, 100) o2 = [] for p in pressure_range: sol = pp.add_solution({'temp':27}) gas = pp.add_gas({'O2(g)':p}, pressure=p, fixed_pressure=True) ...
github_jupyter
# Differences that modeling cause to the baseline model in i2b2 data for reference, command that was run within scripts/ was ```CUDA_VISIBLE_DEVICES=<device_no> python main.py --<cross_validate/use_test> --dataset=i2b2 --preprocessing_type=<entity_blinding/punct_digit/punct_stop_digit> --border_size=-1 --num_epoches=1...
github_jupyter
# ORF307 Precept 5 # Converting LPs Convert the following LP into 2 forms \begin{array}{ll} \mbox{min} & \|Ax - b\|_1 \\ \mbox{subject to} & \|x\|_{\infty} \leq k \\ \end{array} form (1) \begin{array}{ll} \mbox{min} & c^T x \\ \mbox{subject to} & Ax \leq b \\ & Cx = d \\ \end{array} form (2) \begin{array}{ll} \m...
github_jupyter
**Tools - pandas** *The `pandas` library provides high-performance, easy-to-use data structures and data analysis tools. The main data structure is the `DataFrame`, which you can think of as an in-memory 2D table (like a spreadsheet, with column names and row labels). Many features available in Excel are available pro...
github_jupyter
# Bayesian Temporal Matrix Factorization **Published**: October 8, 2019 **Author**: Xinyu Chen [[**GitHub homepage**](https://github.com/xinychen)] **Download**: This Jupyter notebook is at our GitHub repository. If you want to evaluate the code, please download the notebook from the repository of [**tensor-learning...
github_jupyter
<a href="https://colab.research.google.com/github/ziatdinovmax/gpax/blob/v0.0.3/examples/GP_sGP.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> ``` !pip install -q git+https://github.com/ziatdinovmax/gpax@v0.0.3 ``` Imports: ``` import gpax import...
github_jupyter
``` import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns train = pd.read_csv('E:/kaggle/Benz/data/train.csv/train.csv') ``` ## First, we have a glance of the our dataset ``` train.head() train.describe() train.info() train[train.isnull().values == True] ``` #### This is a regr...
github_jupyter
# Training and hosting SageMaker Models using the Apache MXNet Module API The **SageMaker Python SDK** makes it easy to train and deploy MXNet models. In this example, we train a simple neural network using the Apache MXNet [Module API](https://mxnet.apache.org/api/python/module/module.html) and the MNIST dataset. The...
github_jupyter
# Deep Q-learning ``` import gym import tensorflow from matplotlib import pyplot import dqn ``` ## Atari 2600 Breakout ``` env = gym.make('Breakout-v0') env.action_space, env.observation_space # env.observation_space.low, env.observation_space.high env.env.get_action_meanings() S = env.reset() for t in range(250): ...
github_jupyter
<!--NOTEBOOK_HEADER--> *This notebook contains material from [CBE40455-2020](https://jckantor.github.io/CBE40455-2020); content is available [on Github](https://github.com/jckantor/CBE40455-2020.git).* <!--NAVIGATION--> < [3.3 Agent Based Models](https://jckantor.github.io/CBE40455-2020/03.03-Agent-Based-Models.html) ...
github_jupyter
``` import sqlite3 from selenium import webdriver from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as ...
github_jupyter
##### Copyright 2018 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
# RUL estimation UNIBO Powertools Dataset ``` import numpy as np import pandas as pd import scipy.io import math import os import ntpath import sys import logging import time import sys import random from importlib import reload import plotly.graph_objects as go import tensorflow as tf from tensorflow import keras f...
github_jupyter
# Analyze Product Sentiment ``` import turicreate import os ``` # Read product review data ``` d = os.getcwd() #Gets the current working directory os.chdir("..") products = turicreate.SFrame('./data/amazon_baby.sframe/m_bfaa91c17752f745.frame_idx') ``` # Explore data ``` products products.groupby('name',operations...
github_jupyter
# Disease Outbreak Response Decision-making Under Uncertainty: A retrospective analysis of measles in Sao Paulo ``` %matplotlib inline import pandas as pd import numpy as np import numpy.ma as ma from datetime import datetime import matplotlib.pyplot as plt import seaborn as sb sb.set() import pdb np.random.seed(2009...
github_jupyter
# Keras tutorial - the Happy House Welcome to the first assignment of week 2. In this assignment, you will: 1. Learn to use Keras, a high-level neural networks API (programming framework), written in Python and capable of running on top of several lower-level frameworks including TensorFlow and CNTK. 2. See how you c...
github_jupyter
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Algorithms/landsat_surface_reflectance.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td> <td><a target...
github_jupyter
# Example: CanvasXpress violin Chart No. 1 This example page demonstrates how to, using the Python package, create a chart that matches the CanvasXpress online example located at: https://www.canvasxpress.org/examples/violin-1.html This example is generated using the reproducible JSON obtained from the above page an...
github_jupyter
<a href="https://colab.research.google.com/github/srimanthtenneti/Deep-Learning-NanoDegree/blob/main/Capsule_Networks.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # Capsule Networks ``` import torch import torch.nn as nn import torch.nn.function...
github_jupyter
``` import pickle import matplotlib.pyplot as plt from scipy.stats.mstats import gmean import seaborn as sns from statistics import stdev from math import log import numpy as np from scipy import stats from statistics import mean %matplotlib inline price_100_stan = pickle.load(open("C:\\Users\\ymamo\\Google Drive\\1. P...
github_jupyter
``` !git clone https://github.com/karpathy/minGPT.git !pip install snakeviz from fastai.text.all import * from minGPT.mingpt.model import GPT, GPTConfig, GPT1Config with open('/kaggle/input/lyrics-v2/lyrics.txt', encoding="utf8", errors='ignore') as f: raw_text=f.read() len(raw_text) class CharTransform(DisplayedTr...
github_jupyter
## Tutorial for building a feature vector distribution plot In this tutorial we will build an interactive widget using bqplot and ipywidgets. bqplot is a powerful interactive plotting library for jupyter. Its main power comes from how well integrated it is into the ipywidgets library. There are a few things you should...
github_jupyter